diff --git a/eng/lintingconfigs/revapi/track2/revapi.json b/eng/lintingconfigs/revapi/track2/revapi.json index b15d38971ec1..2afcc8332ac6 100644 --- a/eng/lintingconfigs/revapi/track2/revapi.json +++ b/eng/lintingconfigs/revapi/track2/revapi.json @@ -874,6 +874,68 @@ "match": "class com\\.azure\\.resourcemanager\\.containerregistry\\.models\\..*ListResult" }, "justification": "Pageable models moved to implementation package. Unlikely used by user." + }, + { + "code": "java.method.visibilityReduced", + "old" : { + "matcher": "regex", + "match": "method void com\\.azure\\.resourcemanager\\.cosmos\\.models\\..*\\:\\:\\\\(\\)" + }, + "justification": "Output-only immutable models' constructors are now private." + }, + { + "code": "java.method.visibilityReduced", + "old" : { + "matcher": "regex", + "match": "method .* com\\.azure\\.resourcemanager\\.cosmos\\.models\\..*\\:\\:with.*\\(.*\\).*" + }, + "justification": "Output-only immutable models' setters are now package-private if it's being used by child class." + }, + { + "code": "java.method.removed", + "old" : { + "matcher": "regex", + "match": "method .* com\\.azure\\.resourcemanager\\.cosmos\\.models\\..*\\:\\:with.*\\(.*\\).*" + }, + "justification": "Output-only immutable models' setters are removed if no explicit usage." + }, + { + "code": "java.class.removed", + "old" : { + "matcher": "regex", + "match": "class com\\.azure\\.resourcemanager\\.cosmos\\.models\\..*ListResult" + }, + "justification": "Pageable models moved to implementation package. Unlikely used by user." + }, + { + "code": "java.class.removed", + "old" : { + "matcher": "regex", + "match": "class com\\.azure\\.resourcemanager\\.cosmos\\.models\\.(ListClusters|ListDataCenters|PartitionUsagesResult|UsagesResult)" + }, + "justification": "Pageable/List models moved to implementation package. Unlikely used by user." + }, + { + "code": "java.class.removed", + "old" : { + "matcher": "regex", + "match": "class com\\.azure\\.resourcemanager\\.cosmos\\.models\\.(ExtendedResourceProperties|ManagedCassandraArmResourceProperties)" + }, + "justification": "Models removed as part of TypeSpec migration. Base types consolidated." + }, + { + "regex": true, + "code": "java\\.missing\\.(oldSuperType|newSuperType)", + "old" : "class com\\.azure\\.resourcemanager\\.cosmos\\.models\\..*", + "justification": "TypeSpec fix for base resource class." + }, + { + "code": "java.method.returnTypeChanged", + "old" : { + "matcher": "regex", + "match": "method .* com\\.azure\\.resourcemanager\\.cosmos\\.models\\..*\\:\\:with.*\\(.*\\).*" + }, + "justification": "Setter return type changed from GetPropertiesResource to Resource in TypeSpec migration." } ] } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/CHANGELOG.md b/sdk/cosmos/azure-resourcemanager-cosmos/CHANGELOG.md index fa8a5cb4ee5c..51ef96ef4f9e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/CHANGELOG.md +++ b/sdk/cosmos/azure-resourcemanager-cosmos/CHANGELOG.md @@ -2,12 +2,6 @@ ## 2.55.0-beta.1 (Unreleased) -### Features Added - -### Breaking Changes - -### Bugs Fixed - ### Other Changes ## 2.54.1 (2026-01-29) diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/README.md b/sdk/cosmos/azure-resourcemanager-cosmos/README.md index b870ef174dae..6c3748c00836 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/README.md +++ b/sdk/cosmos/azure-resourcemanager-cosmos/README.md @@ -18,7 +18,7 @@ For documentation on how to use this package, please see [Azure Management Libra com.azure.resourcemanager azure-resourcemanager-cosmos - 2.54.0 + 2.55.0-beta.1 ``` [//]: # ({x-version-update-end}) diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CassandraClustersClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CassandraClustersClient.java index 1d7c1e4cf6ee..38367ca9b500 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CassandraClustersClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CassandraClustersClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; @@ -13,9 +13,12 @@ import com.azure.core.util.Context; import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cosmos.fluent.models.BackupResourceInner; import com.azure.resourcemanager.cosmos.fluent.models.CassandraClusterPublicStatusInner; import com.azure.resourcemanager.cosmos.fluent.models.ClusterResourceInner; import com.azure.resourcemanager.cosmos.fluent.models.CommandOutputInner; +import com.azure.resourcemanager.cosmos.fluent.models.CommandPublicResourceInner; +import com.azure.resourcemanager.cosmos.models.CommandAsyncPostBody; import com.azure.resourcemanager.cosmos.models.CommandPostBody; import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; @@ -29,75 +32,6 @@ */ public interface CassandraClustersClient extends InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - /** - * List all managed Cassandra clusters in this subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of managed Cassandra clusters as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * List all managed Cassandra clusters in this subscription. - * - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of managed Cassandra clusters as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List all managed Cassandra clusters in this subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of managed Cassandra clusters as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * List all managed Cassandra clusters in this resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of managed Cassandra clusters as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * List all managed Cassandra clusters in this resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of managed Cassandra clusters as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * List all managed Cassandra clusters in this resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of managed Cassandra clusters as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - /** * Get the properties of a managed Cassandra cluster. * @@ -154,97 +88,6 @@ Response getByResourceGroupWithResponse(String resourceGro @ServiceMethod(returns = ReturnType.SINGLE) ClusterResourceInner getByResourceGroup(String resourceGroupName, String clusterName); - /** - * Deletes a managed Cassandra cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Managed Cassandra cluster name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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) - Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName); - - /** - * Deletes a managed Cassandra cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Managed Cassandra cluster name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName); - - /** - * Deletes a managed Cassandra cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Managed Cassandra cluster name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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) - SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName); - - /** - * Deletes a managed Cassandra cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Managed Cassandra cluster name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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) - SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, Context context); - - /** - * Deletes a managed Cassandra cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Managed Cassandra cluster name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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) - Mono deleteAsync(String resourceGroupName, String clusterName); - - /** - * Deletes a managed Cassandra cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Managed Cassandra cluster name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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) - void delete(String resourceGroupName, String clusterName); - - /** - * Deletes a managed Cassandra cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Managed Cassandra cluster name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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) - void delete(String resourceGroupName, String clusterName, Context context); - /** * Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update * only some properties, use PATCH. @@ -466,170 +309,682 @@ ClusterResourceInner update(String resourceGroupName, String clusterName, Cluste Context context); /** - * Invoke a command like nodetool for cassandra maintenance. + * Deletes a managed Cassandra cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body Specification which command to run where. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of /command api along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> invokeCommandWithResponseAsync(String resourceGroupName, String clusterName, - CommandPostBody body); + Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName); /** - * Invoke a command like nodetool for cassandra maintenance. + * Deletes a managed Cassandra cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body Specification which command to run where. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 response of /command api. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, CommandOutputInner> beginInvokeCommandAsync(String resourceGroupName, - String clusterName, CommandPostBody body); + PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName); /** - * Invoke a command like nodetool for cassandra maintenance. + * Deletes a managed Cassandra cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body Specification which command to run where. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 response of /command api. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CommandOutputInner> beginInvokeCommand(String resourceGroupName, - String clusterName, CommandPostBody body); + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName); /** - * Invoke a command like nodetool for cassandra maintenance. + * Deletes a managed Cassandra cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body Specification which command to run where. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 response of /command api. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CommandOutputInner> beginInvokeCommand(String resourceGroupName, - String clusterName, CommandPostBody body, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, Context context); /** - * Invoke a command like nodetool for cassandra maintenance. + * Deletes a managed Cassandra cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body Specification which command to run where. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of /command api on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono invokeCommandAsync(String resourceGroupName, String clusterName, CommandPostBody body); + Mono deleteAsync(String resourceGroupName, String clusterName); /** - * Invoke a command like nodetool for cassandra maintenance. + * Deletes a managed Cassandra cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body Specification which command to run where. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of /command api. */ @ServiceMethod(returns = ReturnType.SINGLE) - CommandOutputInner invokeCommand(String resourceGroupName, String clusterName, CommandPostBody body); + void delete(String resourceGroupName, String clusterName); /** - * Invoke a command like nodetool for cassandra maintenance. + * Deletes a managed Cassandra cluster. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body Specification which command to run where. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return response of /command api. */ @ServiceMethod(returns = ReturnType.SINGLE) - CommandOutputInner invokeCommand(String resourceGroupName, String clusterName, CommandPostBody body, - Context context); + void delete(String resourceGroupName, String clusterName, Context context); /** - * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host - * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated - * cluster. Use Start to restart the cluster. + * List all managed Cassandra clusters in this resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Managed Cassandra cluster name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return list of managed Cassandra clusters as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deallocateWithResponseAsync(String resourceGroupName, String clusterName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByResourceGroupAsync(String resourceGroupName); /** - * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host - * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated - * cluster. Use Start to restart the cluster. + * List all managed Cassandra clusters in this resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Managed Cassandra cluster name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return list of managed Cassandra clusters as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, Void> beginDeallocateAsync(String resourceGroupName, String clusterName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); /** - * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host - * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated - * cluster. Use Start to restart the cluster. + * List all managed Cassandra clusters in this resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Managed Cassandra cluster name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return list of managed Cassandra clusters as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeallocate(String resourceGroupName, String clusterName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); /** - * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host - * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated - * cluster. Use Start to restart the cluster. + * List all managed Cassandra clusters in this subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Managed Cassandra cluster name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return list of managed Cassandra clusters as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeallocate(String resourceGroupName, String clusterName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(); + + /** + * List all managed Cassandra clusters in this subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed Cassandra clusters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List all managed Cassandra clusters in this subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed Cassandra clusters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + + /** + * Invoke a command like nodetool for cassandra maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of /command api along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> invokeCommandWithResponseAsync(String resourceGroupName, String clusterName, + CommandPostBody body); + + /** + * Invoke a command like nodetool for cassandra maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 response of /command api. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, CommandOutputInner> beginInvokeCommandAsync(String resourceGroupName, + String clusterName, CommandPostBody body); + + /** + * Invoke a command like nodetool for cassandra maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 response of /command api. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CommandOutputInner> beginInvokeCommand(String resourceGroupName, + String clusterName, CommandPostBody body); + + /** + * Invoke a command like nodetool for cassandra maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 response of /command api. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CommandOutputInner> beginInvokeCommand(String resourceGroupName, + String clusterName, CommandPostBody body, Context context); + + /** + * Invoke a command like nodetool for cassandra maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of /command api on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono invokeCommandAsync(String resourceGroupName, String clusterName, CommandPostBody body); + + /** + * Invoke a command like nodetool for cassandra maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of /command api. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CommandOutputInner invokeCommand(String resourceGroupName, String clusterName, CommandPostBody body); + + /** + * Invoke a command like nodetool for cassandra maintenance. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return response of /command api. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CommandOutputInner invokeCommand(String resourceGroupName, String clusterName, CommandPostBody body, + Context context); + + /** + * Invoke a command like nodetool for cassandra maintenance asynchronously. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource representing a command along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> invokeCommandAsyncResourceWithResponseAsync(String resourceGroupName, + String clusterName, CommandAsyncPostBody body); + + /** + * Invoke a command like nodetool for cassandra maintenance asynchronously. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 resource representing a command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, CommandPublicResourceInner> + beginInvokeCommandAsyncResourceAsync(String resourceGroupName, String clusterName, CommandAsyncPostBody body); + + /** + * Invoke a command like nodetool for cassandra maintenance asynchronously. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 resource representing a command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CommandPublicResourceInner> + beginInvokeCommandAsyncResource(String resourceGroupName, String clusterName, CommandAsyncPostBody body); + + /** + * Invoke a command like nodetool for cassandra maintenance asynchronously. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 resource representing a command. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CommandPublicResourceInner> beginInvokeCommandAsyncResource( + String resourceGroupName, String clusterName, CommandAsyncPostBody body, Context context); + + /** + * Invoke a command like nodetool for cassandra maintenance asynchronously. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource representing a command on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono invokeCommandAsyncResourceAsync(String resourceGroupName, String clusterName, + CommandAsyncPostBody body); + + /** + * Invoke a command like nodetool for cassandra maintenance asynchronously. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource representing a command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CommandPublicResourceInner invokeCommandAsyncResource(String resourceGroupName, String clusterName, + CommandAsyncPostBody body); + + /** + * Invoke a command like nodetool for cassandra maintenance asynchronously. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return resource representing a command. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CommandPublicResourceInner invokeCommandAsyncResource(String resourceGroupName, String clusterName, + CommandAsyncPostBody body, Context context); + + /** + * List all commands currently running on ring info. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of commands for cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listCommandAsync(String resourceGroupName, String clusterName); + + /** + * List all commands currently running on ring info. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of commands for cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCommand(String resourceGroupName, String clusterName); + + /** + * List all commands currently running on ring info. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of commands for cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCommand(String resourceGroupName, String clusterName, + Context context); + + /** + * Get details about a specified command that was run asynchronously. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param commandId Managed Cassandra cluster command id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about a specified command that was run asynchronously along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getCommandAsyncResourceWithResponseAsync(String resourceGroupName, + String clusterName, String commandId); + + /** + * Get details about a specified command that was run asynchronously. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param commandId Managed Cassandra cluster command id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about a specified command that was run asynchronously on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getCommandAsyncResourceAsync(String resourceGroupName, String clusterName, + String commandId); + + /** + * Get details about a specified command that was run asynchronously. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param commandId Managed Cassandra cluster command id. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about a specified command that was run asynchronously along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getCommandAsyncResourceWithResponse(String resourceGroupName, + String clusterName, String commandId, Context context); + + /** + * Get details about a specified command that was run asynchronously. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param commandId Managed Cassandra cluster command id. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return details about a specified command that was run asynchronously. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CommandPublicResourceInner getCommandAsyncResource(String resourceGroupName, String clusterName, String commandId); + + /** + * List the backups of this cluster that are available to restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of restorable backups for a Cassandra cluster as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listBackupsAsync(String resourceGroupName, String clusterName); + + /** + * List the backups of this cluster that are available to restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of restorable backups for a Cassandra cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBackups(String resourceGroupName, String clusterName); + + /** + * List the backups of this cluster that are available to restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of restorable backups for a Cassandra cluster as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listBackups(String resourceGroupName, String clusterName, Context context); + + /** + * Get the properties of an individual backup of this cluster that is available to restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param backupId Id of a restorable backup of a Cassandra cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 properties of an individual backup of this cluster that is available to restore along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getBackupWithResponseAsync(String resourceGroupName, String clusterName, + String backupId); + + /** + * Get the properties of an individual backup of this cluster that is available to restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param backupId Id of a restorable backup of a Cassandra cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 properties of an individual backup of this cluster that is available to restore on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getBackupAsync(String resourceGroupName, String clusterName, String backupId); + + /** + * Get the properties of an individual backup of this cluster that is available to restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param backupId Id of a restorable backup of a Cassandra cluster. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 properties of an individual backup of this cluster that is available to restore along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getBackupWithResponse(String resourceGroupName, String clusterName, String backupId, + Context context); + + /** + * Get the properties of an individual backup of this cluster that is available to restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param backupId Id of a restorable backup of a Cassandra cluster. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 properties of an individual backup of this cluster that is available to restore. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackupResourceInner getBackup(String resourceGroupName, String clusterName, String backupId); + + /** + * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host + * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated + * cluster. Use Start to restart the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param forceDeallocate Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of + * Cluster Type Production might cause data loss. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono>> deallocateWithResponseAsync(String resourceGroupName, String clusterName, + String forceDeallocate); + + /** + * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host + * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated + * cluster. Use Start to restart the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param forceDeallocate Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of + * Cluster Type Production might cause data loss. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PollerFlux, Void> beginDeallocateAsync(String resourceGroupName, String clusterName, + String forceDeallocate); + + /** + * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host + * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated + * cluster. Use Start to restart the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PollerFlux, Void> beginDeallocateAsync(String resourceGroupName, String clusterName); + + /** + * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host + * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated + * cluster. Use Start to restart the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, Void> beginDeallocate(String resourceGroupName, String clusterName); + + /** + * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host + * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated + * cluster. Use Start to restart the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param forceDeallocate Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of + * Cluster Type Production might cause data loss. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, Void> beginDeallocate(String resourceGroupName, String clusterName, + String forceDeallocate, Context context); + + /** + * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host + * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated + * cluster. Use Start to restart the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param forceDeallocate Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of + * Cluster Type Production might cause data loss. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono deallocateAsync(String resourceGroupName, String clusterName, String forceDeallocate); /** * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host @@ -667,13 +1022,15 @@ CommandOutputInner invokeCommand(String resourceGroupName, String clusterName, C * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. + * @param forceDeallocate Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of + * Cluster Type Production might cause data loss. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) - void deallocate(String resourceGroupName, String clusterName, Context context); + void deallocate(String resourceGroupName, String clusterName, String forceDeallocate, Context context); /** * Start the Managed Cassandra Cluster and Associated Data Centers. Start will start the host virtual machine of diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CassandraDataCentersClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CassandraDataCentersClient.java index 30b3c8993f1f..85ea2169d898 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CassandraDataCentersClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CassandraDataCentersClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; @@ -22,48 +22,6 @@ * An instance of this class provides access to all the operations defined in CassandraDataCentersClient. */ public interface CassandraDataCentersClient { - /** - * List all data centers in a particular managed Cassandra cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Managed Cassandra cluster name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of managed Cassandra data centers and their properties as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String clusterName); - - /** - * List all data centers in a particular managed Cassandra cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Managed Cassandra cluster name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of managed Cassandra data centers and their properties as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String clusterName); - - /** - * List all data centers in a particular managed Cassandra cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Managed Cassandra cluster name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return list of managed Cassandra data centers and their properties as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String clusterName, Context context); - /** * Get the properties of a managed Cassandra data center. * @@ -125,165 +83,181 @@ Response getWithResponse(String resourceGroupName, Stri DataCenterResourceInner get(String resourceGroupName, String clusterName, String dataCenterName); /** - * Delete a managed Cassandra data center. + * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some + * properties, use PATCH. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. + * @param body Parameters specifying the managed Cassandra data center. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return a managed Cassandra data center along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, - String dataCenterName); + Mono>> createUpdateWithResponseAsync(String resourceGroupName, String clusterName, + String dataCenterName, DataCenterResourceInner body); /** - * Delete a managed Cassandra data center. + * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some + * properties, use PATCH. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. + * @param body Parameters specifying the managed Cassandra data center. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link PollerFlux} for polling of a managed Cassandra data center. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, - String dataCenterName); + PollerFlux, DataCenterResourceInner> beginCreateUpdateAsync( + String resourceGroupName, String clusterName, String dataCenterName, DataCenterResourceInner body); /** - * Delete a managed Cassandra data center. + * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some + * properties, use PATCH. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. + * @param body Parameters specifying the managed Cassandra data center. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of a managed Cassandra data center. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String dataCenterName); + SyncPoller, DataCenterResourceInner> beginCreateUpdate(String resourceGroupName, + String clusterName, String dataCenterName, DataCenterResourceInner body); /** - * Delete a managed Cassandra data center. + * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some + * properties, use PATCH. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. + * @param body Parameters specifying the managed Cassandra data center. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of a managed Cassandra data center. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String dataCenterName, - Context context); + SyncPoller, DataCenterResourceInner> beginCreateUpdate(String resourceGroupName, + String clusterName, String dataCenterName, DataCenterResourceInner body, Context context); /** - * Delete a managed Cassandra data center. + * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some + * properties, use PATCH. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. + * @param body Parameters specifying the managed Cassandra data center. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return a managed Cassandra data center on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String clusterName, String dataCenterName); + Mono createUpdateAsync(String resourceGroupName, String clusterName, String dataCenterName, + DataCenterResourceInner body); /** - * Delete a managed Cassandra data center. + * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some + * properties, use PATCH. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. + * @param body Parameters specifying the managed Cassandra data center. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 managed Cassandra data center. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String clusterName, String dataCenterName); + DataCenterResourceInner createUpdate(String resourceGroupName, String clusterName, String dataCenterName, + DataCenterResourceInner body); /** - * Delete a managed Cassandra data center. + * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some + * properties, use PATCH. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. + * @param body Parameters specifying the managed Cassandra data center. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 managed Cassandra data center. */ @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String clusterName, String dataCenterName, Context context); + DataCenterResourceInner createUpdate(String resourceGroupName, String clusterName, String dataCenterName, + DataCenterResourceInner body, Context context); /** - * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some - * properties, use PATCH. + * Update some of the properties of a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters specifying the managed Cassandra data center. + * @param body Parameters to provide for specifying the managed Cassandra data center. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 managed Cassandra data center along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createUpdateWithResponseAsync(String resourceGroupName, String clusterName, + Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, String dataCenterName, DataCenterResourceInner body); /** - * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some - * properties, use PATCH. + * Update some of the properties of a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters specifying the managed Cassandra data center. + * @param body Parameters to provide for specifying the managed Cassandra data center. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 a managed Cassandra data center. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, DataCenterResourceInner> beginCreateUpdateAsync( - String resourceGroupName, String clusterName, String dataCenterName, DataCenterResourceInner body); + PollerFlux, DataCenterResourceInner> beginUpdateAsync(String resourceGroupName, + String clusterName, String dataCenterName, DataCenterResourceInner body); /** - * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some - * properties, use PATCH. + * Update some of the properties of a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters specifying the managed Cassandra data center. + * @param body Parameters to provide for specifying the managed Cassandra data center. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 a managed Cassandra data center. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DataCenterResourceInner> beginCreateUpdate(String resourceGroupName, + SyncPoller, DataCenterResourceInner> beginUpdate(String resourceGroupName, String clusterName, String dataCenterName, DataCenterResourceInner body); /** - * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some - * properties, use PATCH. + * Update some of the properties of a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters specifying the managed Cassandra data center. + * @param body Parameters to provide for specifying the managed Cassandra data center. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -291,51 +265,48 @@ SyncPoller, DataCenterResourceInner> beginCr * @return the {@link SyncPoller} for polling of a managed Cassandra data center. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DataCenterResourceInner> beginCreateUpdate(String resourceGroupName, + SyncPoller, DataCenterResourceInner> beginUpdate(String resourceGroupName, String clusterName, String dataCenterName, DataCenterResourceInner body, Context context); /** - * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some - * properties, use PATCH. + * Update some of the properties of a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters specifying the managed Cassandra data center. + * @param body Parameters to provide for specifying the managed Cassandra data center. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 managed Cassandra data center on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createUpdateAsync(String resourceGroupName, String clusterName, String dataCenterName, + Mono updateAsync(String resourceGroupName, String clusterName, String dataCenterName, DataCenterResourceInner body); /** - * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some - * properties, use PATCH. + * Update some of the properties of a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters specifying the managed Cassandra data center. + * @param body Parameters to provide for specifying the managed Cassandra data center. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 managed Cassandra data center. */ @ServiceMethod(returns = ReturnType.SINGLE) - DataCenterResourceInner createUpdate(String resourceGroupName, String clusterName, String dataCenterName, + DataCenterResourceInner update(String resourceGroupName, String clusterName, String dataCenterName, DataCenterResourceInner body); /** - * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some - * properties, use PATCH. + * Update some of the properties of a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters specifying the managed Cassandra data center. + * @param body Parameters to provide for specifying the managed Cassandra data center. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -343,120 +314,149 @@ DataCenterResourceInner createUpdate(String resourceGroupName, String clusterNam * @return a managed Cassandra data center. */ @ServiceMethod(returns = ReturnType.SINGLE) - DataCenterResourceInner createUpdate(String resourceGroupName, String clusterName, String dataCenterName, + DataCenterResourceInner update(String resourceGroupName, String clusterName, String dataCenterName, DataCenterResourceInner body, Context context); /** - * Update some of the properties of a managed Cassandra data center. + * Delete a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters to provide for specifying the managed Cassandra data center. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 managed Cassandra data center along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, - String dataCenterName, DataCenterResourceInner body); + Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, + String dataCenterName); /** - * Update some of the properties of a managed Cassandra data center. + * Delete a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters to provide for specifying the managed Cassandra data center. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 a managed Cassandra data center. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, DataCenterResourceInner> beginUpdateAsync(String resourceGroupName, - String clusterName, String dataCenterName, DataCenterResourceInner body); + PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, + String dataCenterName); /** - * Update some of the properties of a managed Cassandra data center. + * Delete a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters to provide for specifying the managed Cassandra data center. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 a managed Cassandra data center. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DataCenterResourceInner> beginUpdate(String resourceGroupName, - String clusterName, String dataCenterName, DataCenterResourceInner body); + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String dataCenterName); /** - * Update some of the properties of a managed Cassandra data center. + * Delete a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters to provide for specifying the managed Cassandra data center. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 a managed Cassandra data center. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DataCenterResourceInner> beginUpdate(String resourceGroupName, - String clusterName, String dataCenterName, DataCenterResourceInner body, Context context); + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, String dataCenterName, + Context context); /** - * Update some of the properties of a managed Cassandra data center. + * Delete a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters to provide for specifying the managed Cassandra data center. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 managed Cassandra data center on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync(String resourceGroupName, String clusterName, String dataCenterName, - DataCenterResourceInner body); + Mono deleteAsync(String resourceGroupName, String clusterName, String dataCenterName); /** - * Update some of the properties of a managed Cassandra data center. + * Delete a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters to provide for specifying the managed Cassandra data center. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 managed Cassandra data center. */ @ServiceMethod(returns = ReturnType.SINGLE) - DataCenterResourceInner update(String resourceGroupName, String clusterName, String dataCenterName, - DataCenterResourceInner body); + void delete(String resourceGroupName, String clusterName, String dataCenterName); /** - * Update some of the properties of a managed Cassandra data center. + * Delete a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters to provide for specifying the managed Cassandra data center. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 managed Cassandra data center. */ @ServiceMethod(returns = ReturnType.SINGLE) - DataCenterResourceInner update(String resourceGroupName, String clusterName, String dataCenterName, - DataCenterResourceInner body, Context context); + void delete(String resourceGroupName, String clusterName, String dataCenterName, Context context); + + /** + * List all data centers in a particular managed Cassandra cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed Cassandra data centers and their properties as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String clusterName); + + /** + * List all data centers in a particular managed Cassandra cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed Cassandra data centers and their properties as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName); + + /** + * List all data centers in a particular managed Cassandra cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of managed Cassandra data centers and their properties as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String clusterName, Context context); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CassandraResourcesClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CassandraResourcesClient.java index ec95799db02f..7303d617c257 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CassandraResourcesClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CassandraResourcesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; @@ -14,10 +14,14 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.cosmos.fluent.models.CassandraKeyspaceGetResultsInner; +import com.azure.resourcemanager.cosmos.fluent.models.CassandraRoleAssignmentResourceInner; +import com.azure.resourcemanager.cosmos.fluent.models.CassandraRoleDefinitionResourceInner; import com.azure.resourcemanager.cosmos.fluent.models.CassandraTableGetResultsInner; +import com.azure.resourcemanager.cosmos.fluent.models.CassandraViewGetResultsInner; import com.azure.resourcemanager.cosmos.fluent.models.ThroughputSettingsGetResultsInner; import com.azure.resourcemanager.cosmos.models.CassandraKeyspaceCreateUpdateParameters; import com.azure.resourcemanager.cosmos.models.CassandraTableCreateUpdateParameters; +import com.azure.resourcemanager.cosmos.models.CassandraViewCreateUpdateParameters; import com.azure.resourcemanager.cosmos.models.ThroughputSettingsUpdateParameters; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -28,53 +32,8 @@ */ public interface CassandraResourcesClient { /** - * Lists the Cassandra keyspaces 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 com.azure.core.management.exception.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 Cassandra keyspaces and their properties as paginated - * response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listCassandraKeyspacesAsync(String resourceGroupName, - String accountName); - - /** - * Lists the Cassandra keyspaces 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 com.azure.core.management.exception.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 Cassandra keyspaces and their properties as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listCassandraKeyspaces(String resourceGroupName, - String accountName); - - /** - * Lists the Cassandra keyspaces 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 com.azure.core.management.exception.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 Cassandra keyspaces and their properties as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listCassandraKeyspaces(String resourceGroupName, String accountName, - Context context); - - /** - * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * Gets the RUs per second of the Cassandra Keyspace 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. @@ -82,15 +41,16 @@ PagedIterable listCassandraKeyspaces(String re * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name along - * with {@link Response} on successful completion of {@link Mono}. + * @return the RUs per second of the Cassandra Keyspace 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) - Mono> getCassandraKeyspaceWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName); + Mono> getCassandraKeyspaceThroughputWithResponseAsync( + String resourceGroupName, String accountName, String keyspaceName); /** - * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * Gets the RUs per second of the Cassandra Keyspace 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. @@ -98,15 +58,16 @@ Mono> getCassandraKeyspaceWithRespons * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name on - * successful completion of {@link Mono}. + * @return the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the + * provided name on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getCassandraKeyspaceAsync(String resourceGroupName, String accountName, - String keyspaceName); + Mono getCassandraKeyspaceThroughputAsync(String resourceGroupName, + String accountName, String keyspaceName); /** - * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * Gets the RUs per second of the Cassandra Keyspace 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. @@ -115,15 +76,16 @@ Mono getCassandraKeyspaceAsync(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name along - * with {@link Response}. + * @return the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the + * provided name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getCassandraKeyspaceWithResponse(String resourceGroupName, + Response getCassandraKeyspaceThroughputWithResponse(String resourceGroupName, String accountName, String keyspaceName, Context context); /** - * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * Gets the RUs per second of the Cassandra Keyspace 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. @@ -131,135 +93,140 @@ Response getCassandraKeyspaceWithResponse(Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * @return the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the + * provided name. */ @ServiceMethod(returns = ReturnType.SINGLE) - CassandraKeyspaceGetResultsInner getCassandraKeyspace(String resourceGroupName, String accountName, + ThroughputSettingsGetResultsInner getCassandraKeyspaceThroughput(String resourceGroupName, String accountName, String keyspaceName); /** - * Create or update an Azure Cosmos DB Cassandra keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra + * Keyspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra keyspace along with {@link Response} on successful completion of + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createUpdateCassandraKeyspaceWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName, - CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters); + Mono>> updateCassandraKeyspaceThroughputWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters); /** - * Create or update an Azure Cosmos DB Cassandra keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra + * Keyspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra keyspace. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, CassandraKeyspaceGetResultsInner> - beginCreateUpdateCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName, - CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters); + PollerFlux, ThroughputSettingsGetResultsInner> + beginUpdateCassandraKeyspaceThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, + ThroughputSettingsUpdateParameters updateThroughputParameters); /** - * Create or update an Azure Cosmos DB Cassandra keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra + * Keyspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra keyspace. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CassandraKeyspaceGetResultsInner> - beginCreateUpdateCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName, - CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters); + SyncPoller, ThroughputSettingsGetResultsInner> + beginUpdateCassandraKeyspaceThroughput(String resourceGroupName, String accountName, String keyspaceName, + ThroughputSettingsUpdateParameters updateThroughputParameters); /** - * Create or update an Azure Cosmos DB Cassandra keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra + * Keyspace. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra keyspace. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CassandraKeyspaceGetResultsInner> - beginCreateUpdateCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName, - CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, Context context); + SyncPoller, ThroughputSettingsGetResultsInner> + beginUpdateCassandraKeyspaceThroughput(String resourceGroupName, String accountName, String keyspaceName, + ThroughputSettingsUpdateParameters updateThroughputParameters, Context context); /** - * Create or update an Azure Cosmos DB Cassandra keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra + * Keyspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra keyspace on successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createUpdateCassandraKeyspaceAsync(String resourceGroupName, - String accountName, String keyspaceName, - CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters); + Mono updateCassandraKeyspaceThroughputAsync(String resourceGroupName, + String accountName, String keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters); /** - * Create or update an Azure Cosmos DB Cassandra keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra + * Keyspace. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra keyspace. + * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - CassandraKeyspaceGetResultsInner createUpdateCassandraKeyspace(String resourceGroupName, String accountName, - String keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters); + ThroughputSettingsGetResultsInner updateCassandraKeyspaceThroughput(String resourceGroupName, String accountName, + String keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters); /** - * Create or update an Azure Cosmos DB Cassandra keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra + * Keyspace. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra keyspace. + * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - CassandraKeyspaceGetResultsInner createUpdateCassandraKeyspace(String resourceGroupName, String accountName, - String keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, - Context context); + ThroughputSettingsGetResultsInner updateCassandraKeyspaceThroughput(String resourceGroupName, String accountName, + String keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context); /** - * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * Migrate an Azure Cosmos DB Cassandra Keyspace 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. @@ -267,14 +234,15 @@ CassandraKeyspaceGetResultsInner createUpdateCassandraKeyspace(String resourceGr * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteCassandraKeyspaceWithResponseAsync(String resourceGroupName, + Mono>> migrateCassandraKeyspaceToAutoscaleWithResponseAsync(String resourceGroupName, String accountName, String keyspaceName); /** - * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * Migrate an Azure Cosmos DB Cassandra Keyspace 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. @@ -282,14 +250,15 @@ Mono>> deleteCassandraKeyspaceWithResponseAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, Void> beginDeleteCassandraKeyspaceAsync(String resourceGroupName, String accountName, - String keyspaceName); + PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateCassandraKeyspaceToAutoscaleAsync(String resourceGroupName, String accountName, + String keyspaceName); /** - * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * Migrate an Azure Cosmos DB Cassandra Keyspace 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. @@ -297,14 +266,14 @@ PollerFlux, Void> beginDeleteCassandraKeyspaceAsync(String reso * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeleteCassandraKeyspace(String resourceGroupName, String accountName, - String keyspaceName); + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateCassandraKeyspaceToAutoscale(String resourceGroupName, String accountName, String keyspaceName); /** - * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * Migrate an Azure Cosmos DB Cassandra Keyspace 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. @@ -313,14 +282,15 @@ SyncPoller, Void> beginDeleteCassandraKeyspace(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeleteCassandraKeyspace(String resourceGroupName, String accountName, - String keyspaceName, Context context); + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateCassandraKeyspaceToAutoscale(String resourceGroupName, String accountName, String keyspaceName, + Context context); /** - * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * Migrate an Azure Cosmos DB Cassandra Keyspace 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. @@ -328,13 +298,14 @@ SyncPoller, Void> beginDeleteCassandraKeyspace(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName); + Mono migrateCassandraKeyspaceToAutoscaleAsync(String resourceGroupName, + String accountName, String keyspaceName); /** - * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * Migrate an Azure Cosmos DB Cassandra Keyspace 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. @@ -342,12 +313,14 @@ SyncPoller, Void> beginDeleteCassandraKeyspace(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) - void deleteCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName); + ThroughputSettingsGetResultsInner migrateCassandraKeyspaceToAutoscale(String resourceGroupName, String accountName, + String keyspaceName); /** - * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * Migrate an Azure Cosmos DB Cassandra Keyspace 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. @@ -356,13 +329,14 @@ SyncPoller, Void> beginDeleteCassandraKeyspace(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) - void deleteCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName, Context context); + ThroughputSettingsGetResultsInner migrateCassandraKeyspaceToAutoscale(String resourceGroupName, String accountName, + String keyspaceName, Context context); /** - * Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the - * provided name. + * Migrate an Azure Cosmos DB Cassandra Keyspace 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. @@ -370,16 +344,15 @@ SyncPoller, Void> beginDeleteCassandraKeyspace(String resourceG * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra Keyspace under an existing Azure Cosmos DB database account with the - * provided name along with {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getCassandraKeyspaceThroughputWithResponseAsync( + Mono>> migrateCassandraKeyspaceToManualThroughputWithResponseAsync( String resourceGroupName, String accountName, String keyspaceName); /** - * Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the - * provided name. + * Migrate an Azure Cosmos DB Cassandra Keyspace 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. @@ -387,56 +360,174 @@ Mono> getCassandraKeyspaceThroughput * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra Keyspace under an existing Azure Cosmos DB database account with the - * provided name on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getCassandraKeyspaceThroughputAsync(String resourceGroupName, - String accountName, String keyspaceName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateCassandraKeyspaceToManualThroughputAsync(String resourceGroupName, String accountName, + String keyspaceName); /** - * Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the - * provided name. + * Migrate an Azure Cosmos DB Cassandra Keyspace 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 keyspaceName Cosmos DB keyspace name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra Keyspace under an existing Azure Cosmos DB database account with the - * provided name along with {@link Response}. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getCassandraKeyspaceThroughputWithResponse(String resourceGroupName, - String accountName, String keyspaceName, Context context); - + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateCassandraKeyspaceToManualThroughput(String resourceGroupName, String accountName, + String keyspaceName); + /** - * Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the + * Migrate an Azure Cosmos DB Cassandra Keyspace 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 keyspaceName Cosmos DB keyspace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateCassandraKeyspaceToManualThroughput(String resourceGroupName, String accountName, + String keyspaceName, Context context); + + /** + * Migrate an Azure Cosmos DB Cassandra Keyspace 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 keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono migrateCassandraKeyspaceToManualThroughputAsync(String resourceGroupName, + String accountName, String keyspaceName); + + /** + * Migrate an Azure Cosmos DB Cassandra Keyspace 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 keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner migrateCassandraKeyspaceToManualThroughput(String resourceGroupName, + String accountName, String keyspaceName); + + /** + * Migrate an Azure Cosmos DB Cassandra Keyspace 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 keyspaceName Cosmos DB keyspace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner migrateCassandraKeyspaceToManualThroughput(String resourceGroupName, + String accountName, String keyspaceName, Context context); + + /** + * Gets the RUs per second of the Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra Keyspace under an existing Azure Cosmos DB database account with the + * @return the RUs per second of the Cassandra table 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) + Mono> getCassandraTableThroughputWithResponseAsync( + String resourceGroupName, String accountName, String keyspaceName, String tableName); + + /** + * Gets the RUs per second of the Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra table under an existing Azure Cosmos DB database account with the + * provided name on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner getCassandraKeyspaceThroughput(String resourceGroupName, String accountName, - String keyspaceName); + Mono getCassandraTableThroughputAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName); /** - * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. + * Gets the RUs per second of the Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra table under an existing Azure Cosmos DB database account with the + * provided name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getCassandraTableThroughputWithResponse(String resourceGroupName, + String accountName, String keyspaceName, String tableName, Context context); + + /** + * Gets the RUs per second of the Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra table under an existing Azure Cosmos DB database account with the + * provided name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputSettingsGetResultsInner getCassandraTableThroughput(String resourceGroupName, String accountName, + String keyspaceName, String tableName); + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * Keyspace. + * table. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -444,17 +535,19 @@ ThroughputSettingsGetResultsInner getCassandraKeyspaceThroughput(String resource * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateCassandraKeyspaceThroughputWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters); + Mono>> updateCassandraTableThroughputWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName, + ThroughputSettingsUpdateParameters updateThroughputParameters); /** - * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * Keyspace. + * table. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -462,17 +555,18 @@ Mono>> updateCassandraKeyspaceThroughputWithResponseAs */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) PollerFlux, ThroughputSettingsGetResultsInner> - beginUpdateCassandraKeyspaceThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, - ThroughputSettingsUpdateParameters updateThroughputParameters); + beginUpdateCassandraTableThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, + String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters); /** - * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * Keyspace. + * table. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. @@ -480,17 +574,18 @@ Mono>> updateCassandraKeyspaceThroughputWithResponseAs */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateCassandraKeyspaceThroughput(String resourceGroupName, String accountName, String keyspaceName, - ThroughputSettingsUpdateParameters updateThroughputParameters); + beginUpdateCassandraTableThroughput(String resourceGroupName, String accountName, String keyspaceName, + String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters); /** - * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * Keyspace. + * table. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -499,284 +594,1734 @@ Mono>> updateCassandraKeyspaceThroughputWithResponseAs */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateCassandraKeyspaceThroughput(String resourceGroupName, String accountName, String keyspaceName, - ThroughputSettingsUpdateParameters updateThroughputParameters, Context context); + beginUpdateCassandraTableThroughput(String resourceGroupName, String accountName, String keyspaceName, + String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context); /** - * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * Keyspace. + * table. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) - Mono updateCassandraKeyspaceThroughputAsync(String resourceGroupName, - String accountName, String keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters); + Mono updateCassandraTableThroughputAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName, + ThroughputSettingsUpdateParameters updateThroughputParameters); /** - * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra + * table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner updateCassandraTableThroughput(String resourceGroupName, String accountName, + String keyspaceName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra + * table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner updateCassandraTableThroughput(String resourceGroupName, String accountName, + String keyspaceName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, + Context context); + + /** + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono>> migrateCassandraTableToAutoscaleWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName); + + /** + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateCassandraTableToAutoscaleAsync(String resourceGroupName, String accountName, String keyspaceName, + String tableName); + + /** + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateCassandraTableToAutoscale(String resourceGroupName, String accountName, String keyspaceName, + String tableName); + + /** + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateCassandraTableToAutoscale(String resourceGroupName, String accountName, String keyspaceName, + String tableName, Context context); + + /** + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono migrateCassandraTableToAutoscaleAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName); + + /** + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner migrateCassandraTableToAutoscale(String resourceGroupName, String accountName, + String keyspaceName, String tableName); + + /** + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner migrateCassandraTableToAutoscale(String resourceGroupName, String accountName, + String keyspaceName, String tableName, Context context); + + /** + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono>> migrateCassandraTableToManualThroughputWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName); + + /** + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateCassandraTableToManualThroughputAsync(String resourceGroupName, String accountName, + String keyspaceName, String tableName); + + /** + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateCassandraTableToManualThroughput(String resourceGroupName, String accountName, String keyspaceName, + String tableName); + + /** + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateCassandraTableToManualThroughput(String resourceGroupName, String accountName, String keyspaceName, + String tableName, Context context); + + /** + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono migrateCassandraTableToManualThroughputAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName); + + /** + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner migrateCassandraTableToManualThroughput(String resourceGroupName, + String accountName, String keyspaceName, String tableName); + + /** + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner migrateCassandraTableToManualThroughput(String resourceGroupName, + String accountName, String keyspaceName, String tableName, Context context); + + /** + * Gets the RUs per second of the Cassandra view 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 keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra view 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) + Mono> getCassandraViewThroughputWithResponseAsync( + String resourceGroupName, String accountName, String keyspaceName, String viewName); + + /** + * Gets the RUs per second of the Cassandra view 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 keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra view under an existing Azure Cosmos DB database account with the + * provided name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getCassandraViewThroughputAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName); + + /** + * Gets the RUs per second of the Cassandra view 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 keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra view under an existing Azure Cosmos DB database account with the + * provided name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getCassandraViewThroughputWithResponse(String resourceGroupName, + String accountName, String keyspaceName, String viewName, Context context); + + /** + * Gets the RUs per second of the Cassandra view 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 keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra view under an existing Azure Cosmos DB database account with the + * provided name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputSettingsGetResultsInner getCassandraViewThroughput(String resourceGroupName, String accountName, + String keyspaceName, String viewName); + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono>> updateCassandraViewThroughputWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, + ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PollerFlux, ThroughputSettingsGetResultsInner> + beginUpdateCassandraViewThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, + String viewName, ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginUpdateCassandraViewThroughput(String resourceGroupName, String accountName, String keyspaceName, + String viewName, ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginUpdateCassandraViewThroughput(String resourceGroupName, String accountName, String keyspaceName, + String viewName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context); + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono updateCassandraViewThroughputAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, + ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner updateCassandraViewThroughput(String resourceGroupName, String accountName, + String keyspaceName, String viewName, ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner updateCassandraViewThroughput(String resourceGroupName, String accountName, + String keyspaceName, String viewName, ThroughputSettingsUpdateParameters updateThroughputParameters, + Context context); + + /** + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono>> migrateCassandraViewToAutoscaleWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName); + + /** + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateCassandraViewToAutoscaleAsync(String resourceGroupName, String accountName, String keyspaceName, + String viewName); + + /** + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateCassandraViewToAutoscale(String resourceGroupName, String accountName, String keyspaceName, + String viewName); + + /** + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateCassandraViewToAutoscale(String resourceGroupName, String accountName, String keyspaceName, + String viewName, Context context); + + /** + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono migrateCassandraViewToAutoscaleAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName); + + /** + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner migrateCassandraViewToAutoscale(String resourceGroupName, String accountName, + String keyspaceName, String viewName); + + /** + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner migrateCassandraViewToAutoscale(String resourceGroupName, String accountName, + String keyspaceName, String viewName, Context context); + + /** + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono>> migrateCassandraViewToManualThroughputWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName); + + /** + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateCassandraViewToManualThroughputAsync(String resourceGroupName, String accountName, + String keyspaceName, String viewName); + + /** + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateCassandraViewToManualThroughput(String resourceGroupName, String accountName, String keyspaceName, + String viewName); + + /** + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateCassandraViewToManualThroughput(String resourceGroupName, String accountName, String keyspaceName, + String viewName, Context context); + + /** + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono migrateCassandraViewToManualThroughputAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName); + + /** + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner migrateCassandraViewToManualThroughput(String resourceGroupName, + String accountName, String keyspaceName, String viewName); + + /** + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner migrateCassandraViewToManualThroughput(String resourceGroupName, + String accountName, String keyspaceName, String viewName, Context context); + + /** + * Gets the Cassandra keyspaces 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 keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra keyspaces 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) + Mono> getCassandraKeyspaceWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName); + + /** + * Gets the Cassandra keyspaces 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 keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getCassandraKeyspaceAsync(String resourceGroupName, String accountName, + String keyspaceName); + + /** + * Gets the Cassandra keyspaces 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 keyspaceName Cosmos DB keyspace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name along + * with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getCassandraKeyspaceWithResponse(String resourceGroupName, + String accountName, String keyspaceName, Context context); + + /** + * Gets the Cassandra keyspaces 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 keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CassandraKeyspaceGetResultsInner getCassandraKeyspace(String resourceGroupName, String accountName, + String keyspaceName); + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra keyspace along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> createUpdateCassandraKeyspaceWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, + CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters); + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra keyspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, CassandraKeyspaceGetResultsInner> + beginCreateUpdateCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName, + CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters); + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra keyspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CassandraKeyspaceGetResultsInner> + beginCreateUpdateCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName, + CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters); + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra keyspace. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CassandraKeyspaceGetResultsInner> + beginCreateUpdateCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName, + CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, Context context); + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra keyspace on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createUpdateCassandraKeyspaceAsync(String resourceGroupName, + String accountName, String keyspaceName, + CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters); + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra keyspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CassandraKeyspaceGetResultsInner createUpdateCassandraKeyspace(String resourceGroupName, String accountName, + String keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters); + + /** + * Create or update an Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra keyspace. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CassandraKeyspaceGetResultsInner createUpdateCassandraKeyspace(String resourceGroupName, String accountName, + String keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, + Context context); + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono>> deleteCassandraKeyspaceWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName); + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PollerFlux, Void> beginDeleteCassandraKeyspaceAsync(String resourceGroupName, String accountName, + String keyspaceName); + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, Void> beginDeleteCassandraKeyspace(String resourceGroupName, String accountName, + String keyspaceName); + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, Void> beginDeleteCassandraKeyspace(String resourceGroupName, String accountName, + String keyspaceName, Context context); + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono deleteCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName); + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + void deleteCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName); + + /** + * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + void deleteCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName, Context context); + + /** + * Lists the Cassandra keyspaces 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 com.azure.core.management.exception.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 Cassandra keyspaces and their properties as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listCassandraKeyspacesAsync(String resourceGroupName, + String accountName); + + /** + * Lists the Cassandra keyspaces 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 com.azure.core.management.exception.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 Cassandra keyspaces and their properties as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCassandraKeyspaces(String resourceGroupName, + String accountName); + + /** + * Lists the Cassandra keyspaces 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 com.azure.core.management.exception.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 Cassandra keyspaces and their properties as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCassandraKeyspaces(String resourceGroupName, String accountName, + Context context); + + /** + * Gets the Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra table under an existing Azure Cosmos DB database account along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getCassandraTableWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName); + + /** + * Gets the Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra table under an existing Azure Cosmos DB database account on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getCassandraTableAsync(String resourceGroupName, String accountName, + String keyspaceName, String tableName); + + /** + * Gets the Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra table under an existing Azure Cosmos DB database account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getCassandraTableWithResponse(String resourceGroupName, String accountName, + String keyspaceName, String tableName, Context context); + + /** + * Gets the Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra table under an existing Azure Cosmos DB database account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CassandraTableGetResultsInner getCassandraTable(String resourceGroupName, String accountName, String keyspaceName, + String tableName); + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra table along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> createUpdateCassandraTableWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName, + CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters); + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra table. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, CassandraTableGetResultsInner> + beginCreateUpdateCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, + String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters); + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra table. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CassandraTableGetResultsInner> + beginCreateUpdateCassandraTable(String resourceGroupName, String accountName, String keyspaceName, + String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters); + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra table. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, CassandraTableGetResultsInner> + beginCreateUpdateCassandraTable(String resourceGroupName, String accountName, String keyspaceName, + String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, + Context context); + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra table on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createUpdateCassandraTableAsync(String resourceGroupName, String accountName, + String keyspaceName, String tableName, + CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters); + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CassandraTableGetResultsInner createUpdateCassandraTable(String resourceGroupName, String accountName, + String keyspaceName, String tableName, + CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters); + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CassandraTableGetResultsInner createUpdateCassandraTable(String resourceGroupName, String accountName, + String keyspaceName, String tableName, + CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, Context context); + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono>> deleteCassandraTableWithResponseAsync(String resourceGroupName, String accountName, + String keyspaceName, String tableName); + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PollerFlux, Void> beginDeleteCassandraTableAsync(String resourceGroupName, String accountName, + String keyspaceName, String tableName); + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, Void> beginDeleteCassandraTable(String resourceGroupName, String accountName, + String keyspaceName, String tableName); + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, Void> beginDeleteCassandraTable(String resourceGroupName, String accountName, + String keyspaceName, String tableName, Context context); + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono deleteCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, + String tableName); + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + void deleteCassandraTable(String resourceGroupName, String accountName, String keyspaceName, String tableName); + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + void deleteCassandraTable(String resourceGroupName, String accountName, String keyspaceName, String tableName, + Context context); + + /** + * Lists the Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra tables and their properties as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listCassandraTablesAsync(String resourceGroupName, String accountName, + String keyspaceName); + + /** + * Lists the Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra tables and their properties as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCassandraTables(String resourceGroupName, String accountName, + String keyspaceName); + + /** + * Lists the Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra tables and their properties as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCassandraTables(String resourceGroupName, String accountName, + String keyspaceName, Context context); + + /** + * Gets the Cassandra view 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 keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra view under an existing Azure Cosmos DB database account along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getCassandraViewWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName); + + /** + * Gets the Cassandra view 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 keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cassandra view under an existing Azure Cosmos DB database account on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getCassandraViewAsync(String resourceGroupName, String accountName, + String keyspaceName, String viewName); + + /** + * Gets the Cassandra view 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 keyspaceName Cosmos DB keyspace name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * Keyspace. + * @param viewName Cosmos DB view name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the Cassandra view under an existing Azure Cosmos DB database account along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner updateCassandraKeyspaceThroughput(String resourceGroupName, String accountName, - String keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters); + Response getCassandraViewWithResponse(String resourceGroupName, String accountName, + String keyspaceName, String viewName, Context context); /** - * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. + * Gets the Cassandra view 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 keyspaceName Cosmos DB keyspace name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * Keyspace. - * @param context The context to associate with this operation. + * @param viewName Cosmos DB view name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the Cassandra view under an existing Azure Cosmos DB database account. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner updateCassandraKeyspaceThroughput(String resourceGroupName, String accountName, - String keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context); + CassandraViewGetResultsInner getCassandraView(String resourceGroupName, String accountName, String keyspaceName, + String viewName); /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. + * Create or update an Azure Cosmos DB Cassandra View. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return an Azure Cosmos DB Cassandra view along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> migrateCassandraKeyspaceToAutoscaleWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName); + Mono>> createUpdateCassandraViewWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, + CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters); /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. + * Create or update an Azure Cosmos DB Cassandra View. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB Cassandra view. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateCassandraKeyspaceToAutoscaleAsync(String resourceGroupName, String accountName, - String keyspaceName); + PollerFlux, CassandraViewGetResultsInner> + beginCreateUpdateCassandraViewAsync(String resourceGroupName, String accountName, String keyspaceName, + String viewName, CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters); /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. + * Create or update an Azure Cosmos DB Cassandra View. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB Cassandra view. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateCassandraKeyspaceToAutoscale(String resourceGroupName, String accountName, String keyspaceName); + SyncPoller, CassandraViewGetResultsInner> beginCreateUpdateCassandraView( + String resourceGroupName, String accountName, String keyspaceName, String viewName, + CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters); /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. + * Create or update an Azure Cosmos DB Cassandra View. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB Cassandra view. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateCassandraKeyspaceToAutoscale(String resourceGroupName, String accountName, String keyspaceName, - Context context); + SyncPoller, CassandraViewGetResultsInner> beginCreateUpdateCassandraView( + String resourceGroupName, String accountName, String keyspaceName, String viewName, + CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters, Context context); /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. + * Create or update an Azure Cosmos DB Cassandra View. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return an Azure Cosmos DB Cassandra view on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono migrateCassandraKeyspaceToAutoscaleAsync(String resourceGroupName, - String accountName, String keyspaceName); + Mono createUpdateCassandraViewAsync(String resourceGroupName, String accountName, + String keyspaceName, String viewName, CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters); /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. + * Create or update an Azure Cosmos DB Cassandra View. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return an Azure Cosmos DB Cassandra view. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner migrateCassandraKeyspaceToAutoscale(String resourceGroupName, String accountName, - String keyspaceName); + CassandraViewGetResultsInner createUpdateCassandraView(String resourceGroupName, String accountName, + String keyspaceName, String viewName, CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters); /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. + * Create or update an Azure Cosmos DB Cassandra View. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return an Azure Cosmos DB Cassandra view. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner migrateCassandraKeyspaceToAutoscale(String resourceGroupName, String accountName, - String keyspaceName, Context context); + CassandraViewGetResultsInner createUpdateCassandraView(String resourceGroupName, String accountName, + String keyspaceName, String viewName, CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters, + Context context); /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> migrateCassandraKeyspaceToManualThroughputWithResponseAsync( - String resourceGroupName, String accountName, String keyspaceName); + Mono>> deleteCassandraViewWithResponseAsync(String resourceGroupName, String accountName, + String keyspaceName, String viewName); /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateCassandraKeyspaceToManualThroughputAsync(String resourceGroupName, String accountName, - String keyspaceName); + PollerFlux, Void> beginDeleteCassandraViewAsync(String resourceGroupName, String accountName, + String keyspaceName, String viewName); /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateCassandraKeyspaceToManualThroughput(String resourceGroupName, String accountName, - String keyspaceName); + SyncPoller, Void> beginDeleteCassandraView(String resourceGroupName, String accountName, + String keyspaceName, String viewName); /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateCassandraKeyspaceToManualThroughput(String resourceGroupName, String accountName, - String keyspaceName, Context context); + SyncPoller, Void> beginDeleteCassandraView(String resourceGroupName, String accountName, + String keyspaceName, String viewName, Context context); /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono migrateCassandraKeyspaceToManualThroughputAsync(String resourceGroupName, - String accountName, String keyspaceName); + Mono deleteCassandraViewAsync(String resourceGroupName, String accountName, String keyspaceName, + String viewName); /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) - ThroughputSettingsGetResultsInner migrateCassandraKeyspaceToManualThroughput(String resourceGroupName, - String accountName, String keyspaceName); + void deleteCassandraView(String resourceGroupName, String accountName, String keyspaceName, String viewName); /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) - ThroughputSettingsGetResultsInner migrateCassandraKeyspaceToManualThroughput(String resourceGroupName, - String accountName, String keyspaceName, Context context); + void deleteCassandraView(String resourceGroupName, String accountName, String keyspaceName, String viewName, + Context context); /** - * Lists the Cassandra table under an existing Azure Cosmos DB database account. + * Lists the Cassandra materialized views 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. @@ -784,15 +2329,15 @@ ThroughputSettingsGetResultsInner migrateCassandraKeyspaceToManualThroughput(Str * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra tables and their properties as paginated - * response with {@link PagedFlux}. + * @return the List operation response, that contains the Cassandra views and their properties as paginated response + * with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listCassandraTablesAsync(String resourceGroupName, String accountName, + PagedFlux listCassandraViewsAsync(String resourceGroupName, String accountName, String keyspaceName); /** - * Lists the Cassandra table under an existing Azure Cosmos DB database account. + * Lists the Cassandra materialized views 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. @@ -800,15 +2345,15 @@ PagedFlux listCassandraTablesAsync(String resourc * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra tables and their properties as paginated - * response with {@link PagedIterable}. + * @return the List operation response, that contains the Cassandra views and their properties as paginated response + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listCassandraTables(String resourceGroupName, String accountName, + PagedIterable listCassandraViews(String resourceGroupName, String accountName, String keyspaceName); /** - * Lists the Cassandra table under an existing Azure Cosmos DB database account. + * Lists the Cassandra materialized views 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. @@ -817,761 +2362,704 @@ PagedIterable listCassandraTables(String resource * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra tables and their properties as paginated - * response with {@link PagedIterable}. + * @return the List operation response, that contains the Cassandra views and their properties as paginated response + * with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listCassandraTables(String resourceGroupName, String accountName, + PagedIterable listCassandraViews(String resourceGroupName, String accountName, String keyspaceName, Context context); /** - * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Definition with the given Id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param roleDefinitionId The GUID for the Role Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra table under an existing Azure Cosmos DB database account along with {@link Response} on - * successful completion of {@link Mono}. + * @return parameters to create and update an Azure Cosmos DB Cassandra Role Definition along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getCassandraTableWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName); + Mono> getCassandraRoleDefinitionWithResponseAsync( + String resourceGroupName, String accountName, String roleDefinitionId); /** - * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Definition with the given Id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param roleDefinitionId The GUID for the Role Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra table under an existing Azure Cosmos DB database account on successful completion of + * @return parameters to create and update an Azure Cosmos DB Cassandra Role Definition on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getCassandraTableAsync(String resourceGroupName, String accountName, - String keyspaceName, String tableName); + Mono getCassandraRoleDefinitionAsync(String resourceGroupName, + String accountName, String roleDefinitionId); /** - * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Definition with the given Id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param roleDefinitionId The GUID for the Role Definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra table under an existing Azure Cosmos DB database account along with {@link Response}. + * @return parameters to create and update an Azure Cosmos DB Cassandra Role Definition along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getCassandraTableWithResponse(String resourceGroupName, String accountName, - String keyspaceName, String tableName, Context context); + Response getCassandraRoleDefinitionWithResponse(String resourceGroupName, + String accountName, String roleDefinitionId, Context context); /** - * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Definition with the given Id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param roleDefinitionId The GUID for the Role Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra table under an existing Azure Cosmos DB database account. + * @return parameters to create and update an Azure Cosmos DB Cassandra Role Definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - CassandraTableGetResultsInner getCassandraTable(String resourceGroupName, String accountName, String keyspaceName, - String tableName); + CassandraRoleDefinitionResourceInner getCassandraRoleDefinition(String resourceGroupName, String accountName, + String roleDefinitionId); /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Creates or updates an Azure Cosmos DB Cassandra Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateCassandraRoleDefinitionParameters The properties required to create or update a Role + * Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra table along with {@link Response} on successful completion of {@link Mono}. + * @return parameters to create and update an Azure Cosmos DB Cassandra Role Definition along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createUpdateCassandraTableWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName, - CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters); + Mono>> createUpdateCassandraRoleDefinitionWithResponseAsync(String resourceGroupName, + String accountName, String roleDefinitionId, + CassandraRoleDefinitionResourceInner createUpdateCassandraRoleDefinitionParameters); /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Creates or updates an Azure Cosmos DB Cassandra Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateCassandraRoleDefinitionParameters The properties required to create or update a Role + * Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra table. + * @return the {@link PollerFlux} for polling of parameters to create and update an Azure Cosmos DB Cassandra Role + * Definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, CassandraTableGetResultsInner> - beginCreateUpdateCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, - String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters); + PollerFlux, CassandraRoleDefinitionResourceInner> + beginCreateUpdateCassandraRoleDefinitionAsync(String resourceGroupName, String accountName, + String roleDefinitionId, + CassandraRoleDefinitionResourceInner createUpdateCassandraRoleDefinitionParameters); /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Creates or updates an Azure Cosmos DB Cassandra Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateCassandraRoleDefinitionParameters The properties required to create or update a Role + * Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra table. + * @return the {@link SyncPoller} for polling of parameters to create and update an Azure Cosmos DB Cassandra Role + * Definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CassandraTableGetResultsInner> - beginCreateUpdateCassandraTable(String resourceGroupName, String accountName, String keyspaceName, - String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters); + SyncPoller, CassandraRoleDefinitionResourceInner> + beginCreateUpdateCassandraRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId, + CassandraRoleDefinitionResourceInner createUpdateCassandraRoleDefinitionParameters); /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Creates or updates an Azure Cosmos DB Cassandra Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateCassandraRoleDefinitionParameters The properties required to create or update a Role + * Definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra table. + * @return the {@link SyncPoller} for polling of parameters to create and update an Azure Cosmos DB Cassandra Role + * Definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, CassandraTableGetResultsInner> - beginCreateUpdateCassandraTable(String resourceGroupName, String accountName, String keyspaceName, - String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, - Context context); + SyncPoller, CassandraRoleDefinitionResourceInner> + beginCreateUpdateCassandraRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId, + CassandraRoleDefinitionResourceInner createUpdateCassandraRoleDefinitionParameters, Context context); /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Creates or updates an Azure Cosmos DB Cassandra Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateCassandraRoleDefinitionParameters The properties required to create or update a Role + * Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra table on successful completion of {@link Mono}. + * @return parameters to create and update an Azure Cosmos DB Cassandra Role Definition on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createUpdateCassandraTableAsync(String resourceGroupName, String accountName, - String keyspaceName, String tableName, - CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters); + Mono createUpdateCassandraRoleDefinitionAsync(String resourceGroupName, + String accountName, String roleDefinitionId, + CassandraRoleDefinitionResourceInner createUpdateCassandraRoleDefinitionParameters); /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Creates or updates an Azure Cosmos DB Cassandra Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateCassandraRoleDefinitionParameters The properties required to create or update a Role + * Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra table. + * @return parameters to create and update an Azure Cosmos DB Cassandra Role Definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - CassandraTableGetResultsInner createUpdateCassandraTable(String resourceGroupName, String accountName, - String keyspaceName, String tableName, - CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters); + CassandraRoleDefinitionResourceInner createUpdateCassandraRoleDefinition(String resourceGroupName, + String accountName, String roleDefinitionId, + CassandraRoleDefinitionResourceInner createUpdateCassandraRoleDefinitionParameters); /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Creates or updates an Azure Cosmos DB Cassandra Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateCassandraRoleDefinitionParameters The properties required to create or update a Role + * Definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra table. + * @return parameters to create and update an Azure Cosmos DB Cassandra Role Definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - CassandraTableGetResultsInner createUpdateCassandraTable(String resourceGroupName, String accountName, - String keyspaceName, String tableName, - CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, Context context); + CassandraRoleDefinitionResourceInner createUpdateCassandraRoleDefinition(String resourceGroupName, + String accountName, String roleDefinitionId, + CassandraRoleDefinitionResourceInner createUpdateCassandraRoleDefinitionParameters, Context context); /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Deletes an existing Azure Cosmos DB Cassandra Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param roleDefinitionId The GUID for the Role Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) - Mono>> deleteCassandraTableWithResponseAsync(String resourceGroupName, String accountName, - String keyspaceName, String tableName); + Mono>> deleteCassandraRoleDefinitionWithResponseAsync(String resourceGroupName, + String accountName, String roleDefinitionId); /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Deletes an existing Azure Cosmos DB Cassandra Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param roleDefinitionId The GUID for the Role Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) - PollerFlux, Void> beginDeleteCassandraTableAsync(String resourceGroupName, String accountName, - String keyspaceName, String tableName); - - /** - * Deletes an existing Azure Cosmos DB Cassandra table. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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) - SyncPoller, Void> beginDeleteCassandraTable(String resourceGroupName, String accountName, - String keyspaceName, String tableName); - - /** - * Deletes an existing Azure Cosmos DB Cassandra table. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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) - SyncPoller, Void> beginDeleteCassandraTable(String resourceGroupName, String accountName, - String keyspaceName, String tableName, Context context); - - /** - * Deletes an existing Azure Cosmos DB Cassandra table. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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) - Mono deleteCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, - String tableName); - - /** - * Deletes an existing Azure Cosmos DB Cassandra table. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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) - void deleteCassandraTable(String resourceGroupName, String accountName, String keyspaceName, String tableName); + PollerFlux, Void> beginDeleteCassandraRoleDefinitionAsync(String resourceGroupName, + String accountName, String roleDefinitionId); /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Deletes an existing Azure Cosmos DB Cassandra Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param context The context to associate with this operation. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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.SINGLE) - void deleteCassandraTable(String resourceGroupName, String accountName, String keyspaceName, String tableName, - Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteCassandraRoleDefinition(String resourceGroupName, String accountName, + String roleDefinitionId); /** - * Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the - * provided name. + * Deletes an existing Azure Cosmos DB Cassandra Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra table under an existing Azure Cosmos DB database account with the - * provided name along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getCassandraTableThroughputWithResponseAsync( - String resourceGroupName, String accountName, String keyspaceName, String tableName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteCassandraRoleDefinition(String resourceGroupName, String accountName, + String roleDefinitionId, Context context); /** - * Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the - * provided name. + * Deletes an existing Azure Cosmos DB Cassandra Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param roleDefinitionId The GUID for the Role Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra table under an existing Azure Cosmos DB database account with the - * provided name on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getCassandraTableThroughputAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName); + Mono deleteCassandraRoleDefinitionAsync(String resourceGroupName, String accountName, + String roleDefinitionId); /** - * Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the - * provided name. + * Deletes an existing Azure Cosmos DB Cassandra Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param context The context to associate with this operation. + * @param roleDefinitionId The GUID for the Role Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra table under an existing Azure Cosmos DB database account with the - * provided name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getCassandraTableThroughputWithResponse(String resourceGroupName, - String accountName, String keyspaceName, String tableName, Context context); + void deleteCassandraRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId); /** - * Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the - * provided name. + * Deletes an existing Azure Cosmos DB Cassandra Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Cassandra table under an existing Azure Cosmos DB database account with the - * provided name. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner getCassandraTableThroughput(String resourceGroupName, String accountName, - String keyspaceName, String tableName); + void deleteCassandraRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId, + Context context); /** - * Update RUs per second of an Azure Cosmos DB Cassandra table. + * Retrieves the list of all Azure Cosmos DB Cassandra Role Definitions. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * table. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return the response of a CassandraRoleDefinitionResource list operation as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateCassandraTableThroughputWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName, - ThroughputSettingsUpdateParameters updateThroughputParameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listCassandraRoleDefinitionsAsync(String resourceGroupName, + String accountName); /** - * Update RUs per second of an Azure Cosmos DB Cassandra table. + * Retrieves the list of all Azure Cosmos DB Cassandra Role Definitions. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * table. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the response of a CassandraRoleDefinitionResource list operation as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, ThroughputSettingsGetResultsInner> - beginUpdateCassandraTableThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, - String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCassandraRoleDefinitions(String resourceGroupName, + String accountName); /** - * Update RUs per second of an Azure Cosmos DB Cassandra table. + * Retrieves the list of all Azure Cosmos DB Cassandra Role Definitions. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * table. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the response of a CassandraRoleDefinitionResource list operation as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateCassandraTableThroughput(String resourceGroupName, String accountName, String keyspaceName, - String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCassandraRoleDefinitions(String resourceGroupName, + String accountName, Context context); /** - * Update RUs per second of an Azure Cosmos DB Cassandra table. + * Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Assignment with the given Id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * table. - * @param context The context to associate with this operation. + * @param roleAssignmentId The GUID for the Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return parameters to create and update an Azure Cosmos DB Cassandra Role Assignment along with {@link Response} + * on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateCassandraTableThroughput(String resourceGroupName, String accountName, String keyspaceName, - String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getCassandraRoleAssignmentWithResponseAsync( + String resourceGroupName, String accountName, String roleAssignmentId); /** - * Update RUs per second of an Azure Cosmos DB Cassandra table. + * Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Assignment with the given Id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * table. + * @param roleAssignmentId The GUID for the Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return parameters to create and update an Azure Cosmos DB Cassandra Role Assignment on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateCassandraTableThroughputAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName, - ThroughputSettingsUpdateParameters updateThroughputParameters); + Mono getCassandraRoleAssignmentAsync(String resourceGroupName, + String accountName, String roleAssignmentId); /** - * Update RUs per second of an Azure Cosmos DB Cassandra table. + * Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Assignment with the given Id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * table. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return parameters to create and update an Azure Cosmos DB Cassandra Role Assignment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner updateCassandraTableThroughput(String resourceGroupName, String accountName, - String keyspaceName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters); + Response getCassandraRoleAssignmentWithResponse(String resourceGroupName, + String accountName, String roleAssignmentId, Context context); /** - * Update RUs per second of an Azure Cosmos DB Cassandra table. + * Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Assignment with the given Id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * table. - * @param context The context to associate with this operation. + * @param roleAssignmentId The GUID for the Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return parameters to create and update an Azure Cosmos DB Cassandra Role Assignment. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner updateCassandraTableThroughput(String resourceGroupName, String accountName, - String keyspaceName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, - Context context); + CassandraRoleAssignmentResourceInner getCassandraRoleAssignment(String resourceGroupName, String accountName, + String roleAssignmentId); /** - * Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. + * Creates or updates an Azure Cosmos DB Cassandra Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateCassandraRoleAssignmentParameters The properties required to create or update a Role + * Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return parameters to create and update an Azure Cosmos DB Cassandra Role Assignment along with {@link Response} + * on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> migrateCassandraTableToAutoscaleWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName); + Mono>> createUpdateCassandraRoleAssignmentWithResponseAsync(String resourceGroupName, + String accountName, String roleAssignmentId, + CassandraRoleAssignmentResourceInner createUpdateCassandraRoleAssignmentParameters); /** - * Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. + * Creates or updates an Azure Cosmos DB Cassandra Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateCassandraRoleAssignmentParameters The properties required to create or update a Role + * Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link PollerFlux} for polling of parameters to create and update an Azure Cosmos DB Cassandra Role + * Assignment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateCassandraTableToAutoscaleAsync(String resourceGroupName, String accountName, String keyspaceName, - String tableName); + PollerFlux, CassandraRoleAssignmentResourceInner> + beginCreateUpdateCassandraRoleAssignmentAsync(String resourceGroupName, String accountName, + String roleAssignmentId, + CassandraRoleAssignmentResourceInner createUpdateCassandraRoleAssignmentParameters); /** - * Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. + * Creates or updates an Azure Cosmos DB Cassandra Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateCassandraRoleAssignmentParameters The properties required to create or update a Role + * Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of parameters to create and update an Azure Cosmos DB Cassandra Role + * Assignment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateCassandraTableToAutoscale(String resourceGroupName, String accountName, String keyspaceName, - String tableName); + SyncPoller, CassandraRoleAssignmentResourceInner> + beginCreateUpdateCassandraRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId, + CassandraRoleAssignmentResourceInner createUpdateCassandraRoleAssignmentParameters); /** - * Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. + * Creates or updates an Azure Cosmos DB Cassandra Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateCassandraRoleAssignmentParameters The properties required to create or update a Role + * Assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of parameters to create and update an Azure Cosmos DB Cassandra Role + * Assignment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateCassandraTableToAutoscale(String resourceGroupName, String accountName, String keyspaceName, - String tableName, Context context); + SyncPoller, CassandraRoleAssignmentResourceInner> + beginCreateUpdateCassandraRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId, + CassandraRoleAssignmentResourceInner createUpdateCassandraRoleAssignmentParameters, Context context); /** - * Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. + * Creates or updates an Azure Cosmos DB Cassandra Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateCassandraRoleAssignmentParameters The properties required to create or update a Role + * Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return parameters to create and update an Azure Cosmos DB Cassandra Role Assignment on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono migrateCassandraTableToAutoscaleAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName); + Mono createUpdateCassandraRoleAssignmentAsync(String resourceGroupName, + String accountName, String roleAssignmentId, + CassandraRoleAssignmentResourceInner createUpdateCassandraRoleAssignmentParameters); /** - * Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. + * Creates or updates an Azure Cosmos DB Cassandra Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateCassandraRoleAssignmentParameters The properties required to create or update a Role + * Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return parameters to create and update an Azure Cosmos DB Cassandra Role Assignment. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner migrateCassandraTableToAutoscale(String resourceGroupName, String accountName, - String keyspaceName, String tableName); + CassandraRoleAssignmentResourceInner createUpdateCassandraRoleAssignment(String resourceGroupName, + String accountName, String roleAssignmentId, + CassandraRoleAssignmentResourceInner createUpdateCassandraRoleAssignmentParameters); /** - * Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. + * Creates or updates an Azure Cosmos DB Cassandra Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateCassandraRoleAssignmentParameters The properties required to create or update a Role + * Assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return parameters to create and update an Azure Cosmos DB Cassandra Role Assignment. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner migrateCassandraTableToAutoscale(String resourceGroupName, String accountName, - String keyspaceName, String tableName, Context context); + CassandraRoleAssignmentResourceInner createUpdateCassandraRoleAssignment(String resourceGroupName, + String accountName, String roleAssignmentId, + CassandraRoleAssignmentResourceInner createUpdateCassandraRoleAssignmentParameters, Context context); /** - * Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Cassandra Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> migrateCassandraTableToManualThroughputWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName); + Mono>> deleteCassandraRoleAssignmentWithResponseAsync(String resourceGroupName, + String accountName, String roleAssignmentId); /** - * Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Cassandra Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateCassandraTableToManualThroughputAsync(String resourceGroupName, String accountName, - String keyspaceName, String tableName); + PollerFlux, Void> beginDeleteCassandraRoleAssignmentAsync(String resourceGroupName, + String accountName, String roleAssignmentId); /** - * Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Cassandra Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateCassandraTableToManualThroughput(String resourceGroupName, String accountName, String keyspaceName, - String tableName); + SyncPoller, Void> beginDeleteCassandraRoleAssignment(String resourceGroupName, String accountName, + String roleAssignmentId); /** - * Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Cassandra Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateCassandraTableToManualThroughput(String resourceGroupName, String accountName, String keyspaceName, - String tableName, Context context); + SyncPoller, Void> beginDeleteCassandraRoleAssignment(String resourceGroupName, String accountName, + String roleAssignmentId, Context context); /** - * Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Cassandra Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono migrateCassandraTableToManualThroughputAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName); + Mono deleteCassandraRoleAssignmentAsync(String resourceGroupName, String accountName, + String roleAssignmentId); /** - * Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Cassandra Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) - ThroughputSettingsGetResultsInner migrateCassandraTableToManualThroughput(String resourceGroupName, - String accountName, String keyspaceName, String tableName); + void deleteCassandraRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId); /** - * Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Cassandra Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) - ThroughputSettingsGetResultsInner migrateCassandraTableToManualThroughput(String resourceGroupName, - String accountName, String keyspaceName, String tableName, Context context); + void deleteCassandraRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId, + Context context); + + /** + * Retrieves the list of all Azure Cosmos DB Cassandra Role Assignments. + * + * @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 com.azure.core.management.exception.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 response of a CassandraRoleAssignmentResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listCassandraRoleAssignmentsAsync(String resourceGroupName, + String accountName); + + /** + * Retrieves the list of all Azure Cosmos DB Cassandra Role Assignments. + * + * @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 com.azure.core.management.exception.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 response of a CassandraRoleAssignmentResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCassandraRoleAssignments(String resourceGroupName, + String accountName); + + /** + * Retrieves the list of all Azure Cosmos DB Cassandra Role Assignments. + * + * @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 com.azure.core.management.exception.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 response of a CassandraRoleAssignmentResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listCassandraRoleAssignments(String resourceGroupName, + String accountName, Context context); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ChaosFaultsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ChaosFaultsClient.java new file mode 100644 index 000000000000..288f7a907862 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ChaosFaultsClient.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cosmos.fluent.models.ChaosFaultResourceInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ChaosFaultsClient. + */ +public interface ChaosFaultsClient { + /** + * Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return chaos Fault for a CosmosdB account for a particular Chaos Fault along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String chaosFault); + + /** + * Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return chaos Fault for a CosmosdB account for a particular Chaos Fault on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String accountName, String chaosFault); + + /** + * Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return chaos Fault for a CosmosdB account for a particular Chaos Fault along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, String chaosFault, + Context context); + + /** + * Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return chaos Fault for a CosmosdB account for a particular Chaos Fault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ChaosFaultResourceInner get(String resourceGroupName, String accountName, String chaosFault); + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 request object to enable/disable the chaos fault along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> enableDisableWithResponseAsync(String resourceGroupName, String accountName, + String chaosFault, ChaosFaultResourceInner chaosFaultRequest); + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 a request object to enable/disable the chaos fault. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, ChaosFaultResourceInner> beginEnableDisableAsync( + String resourceGroupName, String accountName, String chaosFault, ChaosFaultResourceInner chaosFaultRequest); + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 a request object to enable/disable the chaos fault. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ChaosFaultResourceInner> beginEnableDisable( + String resourceGroupName, String accountName, String chaosFault, ChaosFaultResourceInner chaosFaultRequest); + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 a request object to enable/disable the chaos fault. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ChaosFaultResourceInner> beginEnableDisable( + String resourceGroupName, String accountName, String chaosFault, ChaosFaultResourceInner chaosFaultRequest, + Context context); + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 request object to enable/disable the chaos fault on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono enableDisableAsync(String resourceGroupName, String accountName, String chaosFault, + ChaosFaultResourceInner chaosFaultRequest); + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 request object to enable/disable the chaos fault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ChaosFaultResourceInner enableDisable(String resourceGroupName, String accountName, String chaosFault, + ChaosFaultResourceInner chaosFaultRequest); + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 request object to enable/disable the chaos fault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ChaosFaultResourceInner enableDisable(String resourceGroupName, String accountName, String chaosFault, + ChaosFaultResourceInner chaosFaultRequest, Context context); + + /** + * List Chaos Faults for CosmosDB 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return chaos Fault List Response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String accountName); + + /** + * List Chaos Faults for CosmosDB 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return chaos Fault List Response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * List Chaos Faults for CosmosDB 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return chaos Fault List Response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CollectionPartitionRegionsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CollectionPartitionRegionsClient.java index 208a678eba6f..cc13d96bfb8e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CollectionPartitionRegionsClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CollectionPartitionRegionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CollectionPartitionsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CollectionPartitionsClient.java index 1aa51f08b567..56100aa15269 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CollectionPartitionsClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CollectionPartitionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CollectionRegionsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CollectionRegionsClient.java index 0519e70ecb20..f1f441e84b88 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CollectionRegionsClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CollectionRegionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CollectionsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CollectionsClient.java index 13ba8aa90129..c74359d3e3c7 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CollectionsClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CollectionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CopyJobsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CopyJobsClient.java new file mode 100644 index 000000000000..c75156bd1ddf --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CopyJobsClient.java @@ -0,0 +1,420 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cosmos.fluent.models.CopyJobGetResultsInner; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in CopyJobsClient. + */ +public interface CopyJobsClient { + /** + * Get a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String jobName); + + /** + * Get a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Copy Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String accountName, String jobName); + + /** + * Get a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Copy Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, String jobName, + Context context); + + /** + * Get a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Copy Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CopyJobGetResultsInner get(String resourceGroupName, String accountName, String jobName); + + /** + * Creates a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> createWithResponseAsync(String resourceGroupName, String accountName, + String jobName, CopyJobGetResultsInner jobCreateParameters); + + /** + * Creates a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Copy Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createAsync(String resourceGroupName, String accountName, String jobName, + CopyJobGetResultsInner jobCreateParameters); + + /** + * Creates a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Copy Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse(String resourceGroupName, String accountName, String jobName, + CopyJobGetResultsInner jobCreateParameters, Context context); + + /** + * Creates a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Copy Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CopyJobGetResultsInner create(String resourceGroupName, String accountName, String jobName, + CopyJobGetResultsInner jobCreateParameters); + + /** + * Get a list of Copy jobs. + * + * @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 com.azure.core.management.exception.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 list of Copy jobs as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByDatabaseAccountAsync(String resourceGroupName, String accountName); + + /** + * Get a list of Copy jobs. + * + * @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 com.azure.core.management.exception.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 list of Copy jobs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName); + + /** + * Get a list of Copy jobs. + * + * @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 com.azure.core.management.exception.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 list of Copy jobs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName, + Context context); + + /** + * Pause a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> pauseWithResponseAsync(String resourceGroupName, String accountName, + String jobName); + + /** + * Pause a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Copy Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono pauseAsync(String resourceGroupName, String accountName, String jobName); + + /** + * Pause a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Copy Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response pauseWithResponse(String resourceGroupName, String accountName, String jobName, + Context context); + + /** + * Pause a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Copy Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CopyJobGetResultsInner pause(String resourceGroupName, String accountName, String jobName); + + /** + * Resumes a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> resumeWithResponseAsync(String resourceGroupName, String accountName, + String jobName); + + /** + * Resumes a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Copy Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono resumeAsync(String resourceGroupName, String accountName, String jobName); + + /** + * Resumes a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Copy Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response resumeWithResponse(String resourceGroupName, String accountName, String jobName, + Context context); + + /** + * Resumes a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Copy Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CopyJobGetResultsInner resume(String resourceGroupName, String accountName, String jobName); + + /** + * Cancels a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> cancelWithResponseAsync(String resourceGroupName, String accountName, + String jobName); + + /** + * Cancels a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Copy Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono cancelAsync(String resourceGroupName, String accountName, String jobName); + + /** + * Cancels a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Copy Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response cancelWithResponse(String resourceGroupName, String accountName, String jobName, + Context context); + + /** + * Cancels a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Copy Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CopyJobGetResultsInner cancel(String resourceGroupName, String accountName, String jobName); + + /** + * Completes an Online Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> completeWithResponseAsync(String resourceGroupName, String accountName, + String jobName); + + /** + * Completes an Online Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Copy Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono completeAsync(String resourceGroupName, String accountName, String jobName); + + /** + * Completes an Online Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Copy Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response completeWithResponse(String resourceGroupName, String accountName, String jobName, + Context context); + + /** + * Completes an Online Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Copy Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + CopyJobGetResultsInner complete(String resourceGroupName, String accountName, String jobName); +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CosmosDBManagementClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CosmosDBManagementClient.java index 91b7433183b2..1497e9e24d32 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CosmosDBManagementClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/CosmosDBManagementClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; @@ -12,26 +12,26 @@ */ public interface CosmosDBManagementClient { /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - String getSubscriptionId(); - - /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ String getEndpoint(); /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ String getApiVersion(); + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + String getSubscriptionId(); + /** * Gets The HTTP pipeline to send requests through. * @@ -46,6 +46,13 @@ public interface CosmosDBManagementClient { */ Duration getDefaultPollInterval(); + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + OperationsClient getOperations(); + /** * Gets the DatabaseAccountsClient object to access its operations. * @@ -54,11 +61,102 @@ public interface CosmosDBManagementClient { DatabaseAccountsClient getDatabaseAccounts(); /** - * Gets the OperationsClient object to access its operations. + * Gets the CopyJobsClient object to access its operations. * - * @return the OperationsClient object. + * @return the CopyJobsClient object. */ - OperationsClient getOperations(); + CopyJobsClient getCopyJobs(); + + /** + * Gets the GraphResourcesClient object to access its operations. + * + * @return the GraphResourcesClient object. + */ + GraphResourcesClient getGraphResources(); + + /** + * Gets the SqlResourcesClient object to access its operations. + * + * @return the SqlResourcesClient object. + */ + SqlResourcesClient getSqlResources(); + + /** + * Gets the MongoDBResourcesClient object to access its operations. + * + * @return the MongoDBResourcesClient object. + */ + MongoDBResourcesClient getMongoDBResources(); + + /** + * Gets the TableResourcesClient object to access its operations. + * + * @return the TableResourcesClient object. + */ + TableResourcesClient getTableResources(); + + /** + * Gets the CassandraResourcesClient object to access its operations. + * + * @return the CassandraResourcesClient object. + */ + CassandraResourcesClient getCassandraResources(); + + /** + * Gets the GremlinResourcesClient object to access its operations. + * + * @return the GremlinResourcesClient object. + */ + GremlinResourcesClient getGremlinResources(); + + /** + * Gets the DataTransferJobsClient object to access its operations. + * + * @return the DataTransferJobsClient object. + */ + DataTransferJobsClient getDataTransferJobs(); + + /** + * Gets the GarnetClustersClient object to access its operations. + * + * @return the GarnetClustersClient object. + */ + GarnetClustersClient getGarnetClusters(); + + /** + * Gets the NetworkSecurityPerimeterConfigurationsClient object to access its operations. + * + * @return the NetworkSecurityPerimeterConfigurationsClient object. + */ + NetworkSecurityPerimeterConfigurationsClient getNetworkSecurityPerimeterConfigurations(); + + /** + * Gets the NotebookWorkspacesClient object to access its operations. + * + * @return the NotebookWorkspacesClient object. + */ + NotebookWorkspacesClient getNotebookWorkspaces(); + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + PrivateEndpointConnectionsClient getPrivateEndpointConnections(); + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + PrivateLinkResourcesClient getPrivateLinkResources(); + + /** + * Gets the ChaosFaultsClient object to access its operations. + * + * @return the ChaosFaultsClient object. + */ + ChaosFaultsClient getChaosFaults(); /** * Gets the DatabasesClient object to access its operations. @@ -137,41 +235,6 @@ public interface CosmosDBManagementClient { */ PartitionKeyRangeIdRegionsClient getPartitionKeyRangeIdRegions(); - /** - * Gets the SqlResourcesClient object to access its operations. - * - * @return the SqlResourcesClient object. - */ - SqlResourcesClient getSqlResources(); - - /** - * Gets the MongoDBResourcesClient object to access its operations. - * - * @return the MongoDBResourcesClient object. - */ - MongoDBResourcesClient getMongoDBResources(); - - /** - * Gets the TableResourcesClient object to access its operations. - * - * @return the TableResourcesClient object. - */ - TableResourcesClient getTableResources(); - - /** - * Gets the CassandraResourcesClient object to access its operations. - * - * @return the CassandraResourcesClient object. - */ - CassandraResourcesClient getCassandraResources(); - - /** - * Gets the GremlinResourcesClient object to access its operations. - * - * @return the GremlinResourcesClient object. - */ - GremlinResourcesClient getGremlinResources(); - /** * Gets the LocationsClient object to access its operations. * @@ -193,27 +256,6 @@ public interface CosmosDBManagementClient { */ CassandraDataCentersClient getCassandraDataCenters(); - /** - * Gets the NotebookWorkspacesClient object to access its operations. - * - * @return the NotebookWorkspacesClient object. - */ - NotebookWorkspacesClient getNotebookWorkspaces(); - - /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. - * - * @return the PrivateEndpointConnectionsClient object. - */ - PrivateEndpointConnectionsClient getPrivateEndpointConnections(); - - /** - * Gets the PrivateLinkResourcesClient object to access its operations. - * - * @return the PrivateLinkResourcesClient object. - */ - PrivateLinkResourcesClient getPrivateLinkResources(); - /** * Gets the RestorableDatabaseAccountsClient object to access its operations. * @@ -305,6 +347,41 @@ public interface CosmosDBManagementClient { */ ServicesClient getServices(); + /** + * Gets the ThroughputPoolsClient object to access its operations. + * + * @return the ThroughputPoolsClient object. + */ + ThroughputPoolsClient getThroughputPools(); + + /** + * Gets the ThroughputPoolsOperationsClient object to access its operations. + * + * @return the ThroughputPoolsOperationsClient object. + */ + ThroughputPoolsOperationsClient getThroughputPoolsOperations(); + + /** + * Gets the ThroughputPoolAccountsClient object to access its operations. + * + * @return the ThroughputPoolAccountsClient object. + */ + ThroughputPoolAccountsClient getThroughputPoolAccounts(); + + /** + * Gets the ThroughputPoolAccountsOperationsClient object to access its operations. + * + * @return the ThroughputPoolAccountsOperationsClient object. + */ + ThroughputPoolAccountsOperationsClient getThroughputPoolAccountsOperations(); + + /** + * Gets the MongoMIResourcesClient object to access its operations. + * + * @return the MongoMIResourcesClient object. + */ + MongoMIResourcesClient getMongoMIResources(); + /** * Gets the FleetsClient object to access its operations. * @@ -312,6 +389,13 @@ public interface CosmosDBManagementClient { */ FleetsClient getFleets(); + /** + * Gets the FleetAnalyticsClient object to access its operations. + * + * @return the FleetAnalyticsClient object. + */ + FleetAnalyticsClient getFleetAnalytics(); + /** * Gets the FleetspacesClient object to access its operations. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/DataTransferJobsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/DataTransferJobsClient.java new file mode 100644 index 000000000000..611d044b6ef6 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/DataTransferJobsClient.java @@ -0,0 +1,421 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cosmos.fluent.models.DataTransferJobGetResultsInner; +import com.azure.resourcemanager.cosmos.models.CreateJobRequest; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in DataTransferJobsClient. + */ +public interface DataTransferJobsClient { + /** + * Get a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String jobName); + + /** + * Get a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Data Transfer Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String accountName, String jobName); + + /** + * Get a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Data Transfer Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, + String jobName, Context context); + + /** + * Get a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Data Transfer Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataTransferJobGetResultsInner get(String resourceGroupName, String accountName, String jobName); + + /** + * Creates a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> createWithResponseAsync(String resourceGroupName, String accountName, + String jobName, CreateJobRequest jobCreateParameters); + + /** + * Creates a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Data Transfer Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createAsync(String resourceGroupName, String accountName, String jobName, + CreateJobRequest jobCreateParameters); + + /** + * Creates a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Data Transfer Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse(String resourceGroupName, String accountName, + String jobName, CreateJobRequest jobCreateParameters, Context context); + + /** + * Creates a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Data Transfer Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataTransferJobGetResultsInner create(String resourceGroupName, String accountName, String jobName, + CreateJobRequest jobCreateParameters); + + /** + * Get a list of Data Transfer jobs. + * + * @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 com.azure.core.management.exception.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 list of Data Transfer jobs as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByDatabaseAccountAsync(String resourceGroupName, String accountName); + + /** + * Get a list of Data Transfer jobs. + * + * @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 com.azure.core.management.exception.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 list of Data Transfer jobs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName); + + /** + * Get a list of Data Transfer jobs. + * + * @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 com.azure.core.management.exception.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 list of Data Transfer jobs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName, + Context context); + + /** + * Pause a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> pauseWithResponseAsync(String resourceGroupName, String accountName, + String jobName); + + /** + * Pause a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Data Transfer Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono pauseAsync(String resourceGroupName, String accountName, String jobName); + + /** + * Pause a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Data Transfer Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response pauseWithResponse(String resourceGroupName, String accountName, + String jobName, Context context); + + /** + * Pause a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Data Transfer Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataTransferJobGetResultsInner pause(String resourceGroupName, String accountName, String jobName); + + /** + * Resumes a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> resumeWithResponseAsync(String resourceGroupName, String accountName, + String jobName); + + /** + * Resumes a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Data Transfer Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono resumeAsync(String resourceGroupName, String accountName, String jobName); + + /** + * Resumes a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Data Transfer Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response resumeWithResponse(String resourceGroupName, String accountName, + String jobName, Context context); + + /** + * Resumes a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Data Transfer Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataTransferJobGetResultsInner resume(String resourceGroupName, String accountName, String jobName); + + /** + * Cancels a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> cancelWithResponseAsync(String resourceGroupName, String accountName, + String jobName); + + /** + * Cancels a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Data Transfer Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono cancelAsync(String resourceGroupName, String accountName, String jobName); + + /** + * Cancels a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Data Transfer Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response cancelWithResponse(String resourceGroupName, String accountName, + String jobName, Context context); + + /** + * Cancels a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Data Transfer Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataTransferJobGetResultsInner cancel(String resourceGroupName, String accountName, String jobName); + + /** + * Completes a Data Transfer Online Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> completeWithResponseAsync(String resourceGroupName, + String accountName, String jobName); + + /** + * Completes a Data Transfer Online Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Data Transfer Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono completeAsync(String resourceGroupName, String accountName, String jobName); + + /** + * Completes a Data Transfer Online Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Data Transfer Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response completeWithResponse(String resourceGroupName, String accountName, + String jobName, Context context); + + /** + * Completes a Data Transfer Online Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB Data Transfer Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + DataTransferJobGetResultsInner complete(String resourceGroupName, String accountName, String jobName); +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/DatabaseAccountRegionsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/DatabaseAccountRegionsClient.java index 500590d7451a..06fb2f96c90f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/DatabaseAccountRegionsClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/DatabaseAccountRegionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/DatabaseAccountsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/DatabaseAccountsClient.java index a44c4af5442a..75b8178156dd 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/DatabaseAccountsClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/DatabaseAccountsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; @@ -93,56 +93,60 @@ Response getByResourceGroupWithResponse(String r DatabaseAccountGetResultsInner getByResourceGroup(String resourceGroupName, String accountName); /** - * Updates the properties of an existing Azure Cosmos DB database account. + * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates + * on an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param updateParameters The parameters to provide for the current database account. + * @param createUpdateParameters The parameters to provide for the current database account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 database account along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateWithResponseAsync(String resourceGroupName, String accountName, - DatabaseAccountUpdateParameters updateParameters); + Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String accountName, + DatabaseAccountCreateUpdateParameters createUpdateParameters); /** - * Updates the properties of an existing Azure Cosmos DB database account. + * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates + * on an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param updateParameters The parameters to provide for the current database account. + * @param createUpdateParameters The parameters to provide for the current database account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 database account. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, DatabaseAccountGetResultsInner> beginUpdateAsync( - String resourceGroupName, String accountName, DatabaseAccountUpdateParameters updateParameters); + PollerFlux, DatabaseAccountGetResultsInner> beginCreateOrUpdateAsync( + String resourceGroupName, String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters); /** - * Updates the properties of an existing Azure Cosmos DB database account. + * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates + * on an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param updateParameters The parameters to provide for the current database account. + * @param createUpdateParameters The parameters to provide for the current database account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 database account. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DatabaseAccountGetResultsInner> - beginUpdate(String resourceGroupName, String accountName, DatabaseAccountUpdateParameters updateParameters); + SyncPoller, DatabaseAccountGetResultsInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters); /** - * Updates the properties of an existing Azure Cosmos DB database account. + * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates + * on an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param updateParameters The parameters to provide for the current database account. + * @param createUpdateParameters The parameters to provide for the current database account. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -150,46 +154,49 @@ PollerFlux, DatabaseAccountGetResults * @return the {@link SyncPoller} for polling of an Azure Cosmos DB database account. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DatabaseAccountGetResultsInner> beginUpdate( - String resourceGroupName, String accountName, DatabaseAccountUpdateParameters updateParameters, + SyncPoller, DatabaseAccountGetResultsInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters, Context context); /** - * Updates the properties of an existing Azure Cosmos DB database account. + * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates + * on an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param updateParameters The parameters to provide for the current database account. + * @param createUpdateParameters The parameters to provide for the current database account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 database account on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateAsync(String resourceGroupName, String accountName, - DatabaseAccountUpdateParameters updateParameters); + Mono createOrUpdateAsync(String resourceGroupName, String accountName, + DatabaseAccountCreateUpdateParameters createUpdateParameters); /** - * Updates the properties of an existing Azure Cosmos DB database account. + * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates + * on an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param updateParameters The parameters to provide for the current database account. + * @param createUpdateParameters The parameters to provide for the current database account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 database account. */ @ServiceMethod(returns = ReturnType.SINGLE) - DatabaseAccountGetResultsInner update(String resourceGroupName, String accountName, - DatabaseAccountUpdateParameters updateParameters); + DatabaseAccountGetResultsInner createOrUpdate(String resourceGroupName, String accountName, + DatabaseAccountCreateUpdateParameters createUpdateParameters); /** - * Updates the properties of an existing Azure Cosmos DB database account. + * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates + * on an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param updateParameters The parameters to provide for the current database account. + * @param createUpdateParameters The parameters to provide for the current database account. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -197,64 +204,60 @@ DatabaseAccountGetResultsInner update(String resourceGroupName, String accountNa * @return an Azure Cosmos DB database account. */ @ServiceMethod(returns = ReturnType.SINGLE) - DatabaseAccountGetResultsInner update(String resourceGroupName, String accountName, - DatabaseAccountUpdateParameters updateParameters, Context context); + DatabaseAccountGetResultsInner createOrUpdate(String resourceGroupName, String accountName, + DatabaseAccountCreateUpdateParameters createUpdateParameters, Context context); /** - * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates - * on an account. + * Updates the properties of 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 createUpdateParameters The parameters to provide for the current database account. + * @param updateParameters The parameters to provide for the current database account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 database account along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, String accountName, - DatabaseAccountCreateUpdateParameters createUpdateParameters); + Mono>> updateWithResponseAsync(String resourceGroupName, String accountName, + DatabaseAccountUpdateParameters updateParameters); /** - * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates - * on an account. + * Updates the properties of 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 createUpdateParameters The parameters to provide for the current database account. + * @param updateParameters The parameters to provide for the current database account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 database account. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, DatabaseAccountGetResultsInner> beginCreateOrUpdateAsync( - String resourceGroupName, String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters); + PollerFlux, DatabaseAccountGetResultsInner> beginUpdateAsync( + String resourceGroupName, String accountName, DatabaseAccountUpdateParameters updateParameters); /** - * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates - * on an account. + * Updates the properties of 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 createUpdateParameters The parameters to provide for the current database account. + * @param updateParameters The parameters to provide for the current database account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 database account. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DatabaseAccountGetResultsInner> beginCreateOrUpdate( - String resourceGroupName, String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters); + SyncPoller, DatabaseAccountGetResultsInner> + beginUpdate(String resourceGroupName, String accountName, DatabaseAccountUpdateParameters updateParameters); /** - * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates - * on an account. + * Updates the properties of 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 createUpdateParameters The parameters to provide for the current database account. + * @param updateParameters The parameters to provide for the current database account. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -262,49 +265,46 @@ SyncPoller, DatabaseAccountGetResults * @return the {@link SyncPoller} for polling of an Azure Cosmos DB database account. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, DatabaseAccountGetResultsInner> beginCreateOrUpdate( - String resourceGroupName, String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters, + SyncPoller, DatabaseAccountGetResultsInner> beginUpdate( + String resourceGroupName, String accountName, DatabaseAccountUpdateParameters updateParameters, Context context); /** - * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates - * on an account. + * Updates the properties of 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 createUpdateParameters The parameters to provide for the current database account. + * @param updateParameters The parameters to provide for the current database account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 database account on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createOrUpdateAsync(String resourceGroupName, String accountName, - DatabaseAccountCreateUpdateParameters createUpdateParameters); + Mono updateAsync(String resourceGroupName, String accountName, + DatabaseAccountUpdateParameters updateParameters); /** - * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates - * on an account. + * Updates the properties of 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 createUpdateParameters The parameters to provide for the current database account. + * @param updateParameters The parameters to provide for the current database account. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 database account. */ @ServiceMethod(returns = ReturnType.SINGLE) - DatabaseAccountGetResultsInner createOrUpdate(String resourceGroupName, String accountName, - DatabaseAccountCreateUpdateParameters createUpdateParameters); + DatabaseAccountGetResultsInner update(String resourceGroupName, String accountName, + DatabaseAccountUpdateParameters updateParameters); /** - * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates - * on an account. + * Updates the properties of 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 createUpdateParameters The parameters to provide for the current database account. + * @param updateParameters The parameters to provide for the current database account. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. @@ -312,8 +312,8 @@ DatabaseAccountGetResultsInner createOrUpdate(String resourceGroupName, String a * @return an Azure Cosmos DB database account. */ @ServiceMethod(returns = ReturnType.SINGLE) - DatabaseAccountGetResultsInner createOrUpdate(String resourceGroupName, String accountName, - DatabaseAccountCreateUpdateParameters createUpdateParameters, Context context); + DatabaseAccountGetResultsInner update(String resourceGroupName, String accountName, + DatabaseAccountUpdateParameters updateParameters, Context context); /** * Deletes an existing Azure Cosmos DB database account. @@ -406,6 +406,81 @@ DatabaseAccountGetResultsInner createOrUpdate(String resourceGroupName, String a @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String accountName, Context context); + /** + * Lists all the Azure Cosmos DB database accounts available under the given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 database accounts and their properties as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByResourceGroupAsync(String resourceGroupName); + + /** + * Lists all the Azure Cosmos DB database accounts available under the given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 database accounts and their properties as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the Azure Cosmos DB database accounts available under the given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 database accounts and their properties as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the Azure Cosmos DB database accounts available under the subscription. + * + * @throws com.azure.core.management.exception.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 database accounts and their properties as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(); + + /** + * Lists all the Azure Cosmos DB database accounts available under the subscription. + * + * @throws com.azure.core.management.exception.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 database accounts and their properties as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the Azure Cosmos DB database accounts available under the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 database accounts and their properties as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); + /** * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a * write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values @@ -524,81 +599,6 @@ Mono failoverPriorityChangeAsync(String resourceGroupName, String accountN void failoverPriorityChange(String resourceGroupName, String accountName, FailoverPolicies failoverParameters, Context context); - /** - * Lists all the Azure Cosmos DB database accounts available under the subscription. - * - * @throws com.azure.core.management.exception.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 database accounts and their properties as paginated - * response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Lists all the Azure Cosmos DB database accounts available under the subscription. - * - * @throws com.azure.core.management.exception.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 database accounts and their properties as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all the Azure Cosmos DB database accounts available under the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 database accounts and their properties as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Lists all the Azure Cosmos DB database accounts available under the given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 database accounts and their properties as paginated - * response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Lists all the Azure Cosmos DB database accounts available under the given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 database accounts and their properties as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all the Azure Cosmos DB database accounts available under the given resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 database accounts and their properties as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - /** * Lists the access keys for the specified Azure Cosmos DB database account. * @@ -1138,59 +1138,6 @@ void regenerateKey(String resourceGroupName, String accountName, void regenerateKey(String resourceGroupName, String accountName, DatabaseAccountRegenerateKeyParameters keyToRegenerate, Context context); - /** - * Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase - * letters, numbers, and the '-' character, and must be between 3 and 50 characters. - * - * @param accountName Cosmos DB database account name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> checkNameExistsWithResponseAsync(String accountName); - - /** - * Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase - * letters, numbers, and the '-' character, and must be between 3 and 50 characters. - * - * @param accountName Cosmos DB database account name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono checkNameExistsAsync(String accountName); - - /** - * Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase - * letters, numbers, and the '-' character, and must be between 3 and 50 characters. - * - * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response checkNameExistsWithResponse(String accountName, Context context); - - /** - * Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase - * letters, numbers, and the '-' character, and must be between 3 and 50 characters. - * - * @param accountName Cosmos DB database account name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - boolean checkNameExists(String accountName); - /** * Retrieves the metrics determined by the given filter for the given database account. * @@ -1338,4 +1285,57 @@ PagedIterable listMetrics(String resourceGroupName, String accountN @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listMetricDefinitions(String resourceGroupName, String accountName, Context context); + + /** + * Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase + * letters, numbers, and the '-' character, and must be between 3 and 50 characters. + * + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> checkNameExistsWithResponseAsync(String accountName); + + /** + * Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase + * letters, numbers, and the '-' character, and must be between 3 and 50 characters. + * + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono checkNameExistsAsync(String accountName); + + /** + * Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase + * letters, numbers, and the '-' character, and must be between 3 and 50 characters. + * + * @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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response checkNameExistsWithResponse(String accountName, Context context); + + /** + * Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase + * letters, numbers, and the '-' character, and must be between 3 and 50 characters. + * + * @param accountName Cosmos DB database account name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + boolean checkNameExists(String accountName); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/DatabasesClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/DatabasesClient.java index 1ededb9e5c9e..a582becb8a9d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/DatabasesClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/DatabasesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/FleetAnalyticsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/FleetAnalyticsClient.java new file mode 100644 index 000000000000..04788f625d0d --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/FleetAnalyticsClient.java @@ -0,0 +1,290 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cosmos.fluent.models.FleetAnalyticsResourceInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in FleetAnalyticsClient. + */ +public interface FleetAnalyticsClient { + /** + * Retrieves the properties of an existing Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 FleetAnalytics along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String fleetName, + String fleetAnalyticsName); + + /** + * Retrieves the properties of an existing Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 FleetAnalytics on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String fleetName, String fleetAnalyticsName); + + /** + * Retrieves the properties of an existing Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 FleetAnalytics along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String fleetName, + String fleetAnalyticsName, Context context); + + /** + * Retrieves the properties of an existing Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 FleetAnalytics. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FleetAnalyticsResourceInner get(String resourceGroupName, String fleetName, String fleetAnalyticsName); + + /** + * Creates an Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @param body The parameters to provide for the current FleetAnalytics. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 FleetAnalytics along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> createWithResponseAsync(String resourceGroupName, String fleetName, + String fleetAnalyticsName, FleetAnalyticsResourceInner body); + + /** + * Creates an Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @param body The parameters to provide for the current FleetAnalytics. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 FleetAnalytics on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createAsync(String resourceGroupName, String fleetName, String fleetAnalyticsName, + FleetAnalyticsResourceInner body); + + /** + * Creates an Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @param body The parameters to provide for the current FleetAnalytics. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 FleetAnalytics along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response createWithResponse(String resourceGroupName, String fleetName, + String fleetAnalyticsName, FleetAnalyticsResourceInner body, Context context); + + /** + * Creates an Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @param body The parameters to provide for the current FleetAnalytics. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 FleetAnalytics. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + FleetAnalyticsResourceInner create(String resourceGroupName, String fleetName, String fleetAnalyticsName, + FleetAnalyticsResourceInner body); + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono>> deleteWithResponseAsync(String resourceGroupName, String fleetName, + String fleetAnalyticsName); + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String fleetName, + String fleetAnalyticsName); + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, Void> beginDelete(String resourceGroupName, String fleetName, + String fleetAnalyticsName); + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, Void> beginDelete(String resourceGroupName, String fleetName, + String fleetAnalyticsName, Context context); + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono deleteAsync(String resourceGroupName, String fleetName, String fleetAnalyticsName); + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + void delete(String resourceGroupName, String fleetName, String fleetAnalyticsName); + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + void delete(String resourceGroupName, String fleetName, String fleetAnalyticsName, Context context); + + /** + * Lists all the FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 response of a FleetAnalyticsResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String fleetName); + + /** + * Lists all the FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 response of a FleetAnalyticsResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String fleetName); + + /** + * Lists all the FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 response of a FleetAnalyticsResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String fleetName, Context context); +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/FleetsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/FleetsClient.java index 0ac9ad525d3d..18a5294c7be6 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/FleetsClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/FleetsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; @@ -27,81 +27,6 @@ */ public interface FleetsClient extends InnerSupportsGet, InnerSupportsListing, InnerSupportsDelete { - /** - * Lists all the fleets under the subscription. - * - * @throws com.azure.core.management.exception.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 response of the List operation that contains the fleets and their properties as paginated response - * with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * Lists all the fleets under the subscription. - * - * @throws com.azure.core.management.exception.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 response of the List operation that contains the fleets and their properties as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * Lists all the fleets under the subscription. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 response of the List operation that contains the fleets and their properties as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - - /** - * Lists all the fleets under the specified subscription and resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 response of the List operation that contains the fleets and their properties as paginated response - * with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByResourceGroupAsync(String resourceGroupName); - - /** - * Lists all the fleets under the specified subscription and resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 response of the List operation that contains the fleets and their properties as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName); - - /** - * Lists all the fleets under the specified subscription and resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 response of the List operation that contains the fleets and their properties as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByResourceGroup(String resourceGroupName, Context context); - /** * Retrieves the properties of an existing Azure Cosmos DB fleet under a subscription. * @@ -362,4 +287,73 @@ Response updateWithResponse(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String fleetName, Context context); + + /** + * Lists all the fleets under the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 response of a FleetResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByResourceGroupAsync(String resourceGroupName); + + /** + * Lists all the fleets under the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 response of a FleetResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * Lists all the fleets under the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 response of a FleetResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the fleets under the subscription. + * + * @throws com.azure.core.management.exception.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 response of a FleetResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(); + + /** + * Lists all the fleets under the subscription. + * + * @throws com.azure.core.management.exception.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 response of a FleetResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the fleets under the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 response of a FleetResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/FleetspaceAccountsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/FleetspaceAccountsClient.java index e95bd1c9b307..ac9ffcf1f38b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/FleetspaceAccountsClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/FleetspaceAccountsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; @@ -22,55 +22,6 @@ * An instance of this class provides access to all the operations defined in FleetspaceAccountsClient. */ public interface FleetspaceAccountsClient { - /** - * Lists all the fleetspaces accounts under a fleetspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. - * @param fleetspaceName Cosmos DB fleetspace name. Needs to be unique under a fleet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 global database accounts and their properties as paginated - * response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String fleetName, - String fleetspaceName); - - /** - * Lists all the fleetspaces accounts under a fleetspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. - * @param fleetspaceName Cosmos DB fleetspace name. Needs to be unique under a fleet. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 global database accounts and their properties as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String fleetName, - String fleetspaceName); - - /** - * Lists all the fleetspaces accounts under a fleetspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. - * @param fleetspaceName Cosmos DB fleetspace name. Needs to be unique under a fleet. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 global database accounts and their properties as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String fleetName, - String fleetspaceName, Context context); - /** * Retrieves the properties of an existing Azure Cosmos DB fleetspace account under a fleetspace. * @@ -372,4 +323,52 @@ Mono deleteAsync(String resourceGroupName, String fleetName, String fleets @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String fleetName, String fleetspaceName, String fleetspaceAccountName, Context context); + + /** + * Lists all the fleetspaces accounts under a fleetspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetspaceName Cosmos DB fleetspace name. Needs to be unique under a fleet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 response of a FleetspaceAccountResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String fleetName, + String fleetspaceName); + + /** + * Lists all the fleetspaces accounts under a fleetspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetspaceName Cosmos DB fleetspace name. Needs to be unique under a fleet. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 response of a FleetspaceAccountResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String fleetName, + String fleetspaceName); + + /** + * Lists all the fleetspaces accounts under a fleetspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetspaceName Cosmos DB fleetspace name. Needs to be unique under a fleet. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 response of a FleetspaceAccountResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String fleetName, + String fleetspaceName, Context context); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/FleetspacesClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/FleetspacesClient.java index 365f7ad43dad..6709b8b8ea8a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/FleetspacesClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/FleetspacesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; @@ -23,49 +23,6 @@ * An instance of this class provides access to all the operations defined in FleetspacesClient. */ public interface FleetspacesClient { - /** - * Lists all the fleetspaces under a fleet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 response of the List operation that contains the fleetspaces and their properties as paginated - * response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String fleetName); - - /** - * Lists all the fleetspaces under a fleet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 response of the List operation that contains the fleetspaces and their properties as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String fleetName); - - /** - * Lists all the fleetspaces under a fleet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 response of the List operation that contains the fleetspaces and their properties as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String fleetName, Context context); - /** * Retrieves the properties of an existing Azure Cosmos DB fleetspace under a fleet. * @@ -479,4 +436,44 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String fleetName, String fleetspaceName, Context context); + + /** + * Lists all the fleetspaces under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 response of a FleetspaceResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String fleetName); + + /** + * Lists all the fleetspaces under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 response of a FleetspaceResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String fleetName); + + /** + * Lists all the fleetspaces under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 response of a FleetspaceResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String fleetName, Context context); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/GarnetClustersClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/GarnetClustersClient.java new file mode 100644 index 000000000000..dc7dda1d54d3 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/GarnetClustersClient.java @@ -0,0 +1,460 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cosmos.fluent.models.GarnetClusterResourceInner; +import com.azure.resourcemanager.cosmos.models.GarnetClusterResourcePatch; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in GarnetClustersClient. + */ +public interface GarnetClustersClient extends InnerSupportsGet, + InnerSupportsListing, InnerSupportsDelete { + /** + * Get the properties of a Garnet cache cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 properties of a Garnet cache cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String clusterName); + + /** + * Get the properties of a Garnet cache cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 properties of a Garnet cache cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getByResourceGroupAsync(String resourceGroupName, String clusterName); + + /** + * Get the properties of a Garnet cache cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 properties of a Garnet cache cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, + Context context); + + /** + * Get the properties of a Garnet cache cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 properties of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GarnetClusterResourceInner getByResourceGroup(String resourceGroupName, String clusterName); + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return representation of a Garnet cache cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> createUpdateWithResponseAsync(String resourceGroupName, String clusterName, + GarnetClusterResourceInner body); + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, GarnetClusterResourceInner> + beginCreateUpdateAsync(String resourceGroupName, String clusterName, GarnetClusterResourceInner body); + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GarnetClusterResourceInner> + beginCreateUpdate(String resourceGroupName, String clusterName, GarnetClusterResourceInner body); + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GarnetClusterResourceInner> beginCreateUpdate( + String resourceGroupName, String clusterName, GarnetClusterResourceInner body, Context context); + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return representation of a Garnet cache cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createUpdateAsync(String resourceGroupName, String clusterName, + GarnetClusterResourceInner body); + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GarnetClusterResourceInner createUpdate(String resourceGroupName, String clusterName, + GarnetClusterResourceInner body); + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GarnetClusterResourceInner createUpdate(String resourceGroupName, String clusterName, + GarnetClusterResourceInner body, Context context); + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return representation of a Garnet cache cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, + GarnetClusterResourcePatch body); + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, GarnetClusterResourceInner> + beginUpdateAsync(String resourceGroupName, String clusterName, GarnetClusterResourcePatch body); + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GarnetClusterResourceInner> beginUpdate(String resourceGroupName, + String clusterName, GarnetClusterResourcePatch body); + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GarnetClusterResourceInner> beginUpdate(String resourceGroupName, + String clusterName, GarnetClusterResourcePatch body, Context context); + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return representation of a Garnet cache cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateAsync(String resourceGroupName, String clusterName, + GarnetClusterResourcePatch body); + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GarnetClusterResourceInner update(String resourceGroupName, String clusterName, GarnetClusterResourcePatch body); + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GarnetClusterResourceInner update(String resourceGroupName, String clusterName, GarnetClusterResourcePatch body, + Context context); + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName); + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName); + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName); + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, Context context); + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono deleteAsync(String resourceGroupName, String clusterName); + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + void delete(String resourceGroupName, String clusterName); + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + void delete(String resourceGroupName, String clusterName, Context context); + + /** + * List all Garnet clusters in this resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Garnet clusters as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByResourceGroupAsync(String resourceGroupName); + + /** + * List all Garnet clusters in this resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Garnet clusters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List all Garnet clusters in this resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Garnet clusters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * List all Garnet clusters in this subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Garnet clusters as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(); + + /** + * List all Garnet clusters in this subscription. + * + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Garnet clusters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List all Garnet clusters in this subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of Garnet clusters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/GraphResourcesClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/GraphResourcesClient.java new file mode 100644 index 000000000000..c603299fa374 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/GraphResourcesClient.java @@ -0,0 +1,350 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cosmos.fluent.models.GraphResourceGetResultsInner; +import com.azure.resourcemanager.cosmos.models.GraphResourceCreateUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in GraphResourcesClient. + */ +public interface GraphResourcesClient { + /** + * Gets the Graph resource 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 graphName Cosmos DB graph resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Graph resource 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) + Mono> getGraphWithResponseAsync(String resourceGroupName, String accountName, + String graphName); + + /** + * Gets the Graph resource 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 graphName Cosmos DB graph resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Graph resource under an existing Azure Cosmos DB database account with the provided name on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getGraphAsync(String resourceGroupName, String accountName, String graphName); + + /** + * Gets the Graph resource 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 graphName Cosmos DB graph resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Graph resource under an existing Azure Cosmos DB database account with the provided name along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getGraphWithResponse(String resourceGroupName, String accountName, + String graphName, Context context); + + /** + * Gets the Graph resource 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 graphName Cosmos DB graph resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Graph resource under an existing Azure Cosmos DB database account with the provided name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GraphResourceGetResultsInner getGraph(String resourceGroupName, String accountName, String graphName); + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Graph resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> createUpdateGraphWithResponseAsync(String resourceGroupName, String accountName, + String graphName, GraphResourceCreateUpdateParameters createUpdateGraphParameters); + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Graph resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, GraphResourceGetResultsInner> beginCreateUpdateGraphAsync( + String resourceGroupName, String accountName, String graphName, + GraphResourceCreateUpdateParameters createUpdateGraphParameters); + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Graph resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GraphResourceGetResultsInner> beginCreateUpdateGraph( + String resourceGroupName, String accountName, String graphName, + GraphResourceCreateUpdateParameters createUpdateGraphParameters); + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Graph resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GraphResourceGetResultsInner> beginCreateUpdateGraph( + String resourceGroupName, String accountName, String graphName, + GraphResourceCreateUpdateParameters createUpdateGraphParameters, Context context); + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Graph resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createUpdateGraphAsync(String resourceGroupName, String accountName, + String graphName, GraphResourceCreateUpdateParameters createUpdateGraphParameters); + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Graph resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GraphResourceGetResultsInner createUpdateGraph(String resourceGroupName, String accountName, String graphName, + GraphResourceCreateUpdateParameters createUpdateGraphParameters); + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Graph resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + GraphResourceGetResultsInner createUpdateGraph(String resourceGroupName, String accountName, String graphName, + GraphResourceCreateUpdateParameters createUpdateGraphParameters, Context context); + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono>> deleteGraphResourceWithResponseAsync(String resourceGroupName, String accountName, + String graphName); + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PollerFlux, Void> beginDeleteGraphResourceAsync(String resourceGroupName, String accountName, + String graphName); + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, Void> beginDeleteGraphResource(String resourceGroupName, String accountName, + String graphName); + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, Void> beginDeleteGraphResource(String resourceGroupName, String accountName, + String graphName, Context context); + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono deleteGraphResourceAsync(String resourceGroupName, String accountName, String graphName); + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + void deleteGraphResource(String resourceGroupName, String accountName, String graphName); + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + void deleteGraphResource(String resourceGroupName, String accountName, String graphName, Context context); + + /** + * Lists the graphs 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 com.azure.core.management.exception.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 Graph resource and their properties as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listGraphsAsync(String resourceGroupName, String accountName); + + /** + * Lists the graphs 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 com.azure.core.management.exception.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 Graph resource and their properties as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listGraphs(String resourceGroupName, String accountName); + + /** + * Lists the graphs 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 com.azure.core.management.exception.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 Graph resource and their properties as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listGraphs(String resourceGroupName, String accountName, + Context context); +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/GremlinResourcesClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/GremlinResourcesClient.java index 5afe20cb5a9f..db97b92c06ff 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/GremlinResourcesClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/GremlinResourcesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; @@ -16,6 +16,8 @@ import com.azure.resourcemanager.cosmos.fluent.models.BackupInformationInner; import com.azure.resourcemanager.cosmos.fluent.models.GremlinDatabaseGetResultsInner; import com.azure.resourcemanager.cosmos.fluent.models.GremlinGraphGetResultsInner; +import com.azure.resourcemanager.cosmos.fluent.models.GremlinRoleAssignmentResourceInner; +import com.azure.resourcemanager.cosmos.fluent.models.GremlinRoleDefinitionResourceInner; import com.azure.resourcemanager.cosmos.fluent.models.ThroughputSettingsGetResultsInner; import com.azure.resourcemanager.cosmos.models.ContinuousBackupRestoreLocation; import com.azure.resourcemanager.cosmos.models.GremlinDatabaseCreateUpdateParameters; @@ -30,48 +32,850 @@ */ public interface GremlinResourcesClient { /** - * Lists the Gremlin databases under an existing Azure Cosmos DB database account. + * Gets the RUs per second of the Gremlin 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 com.azure.core.management.exception.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 Gremlin 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) + Mono> getGremlinDatabaseThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName); + + /** + * Gets the RUs per second of the Gremlin 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 com.azure.core.management.exception.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 Gremlin database under an existing Azure Cosmos DB database account with the + * provided name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getGremlinDatabaseThroughputAsync(String resourceGroupName, + String accountName, String databaseName); + + /** + * Gets the RUs per second of the Gremlin 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 com.azure.core.management.exception.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 Gremlin database under an existing Azure Cosmos DB database account with the + * provided name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getGremlinDatabaseThroughputWithResponse(String resourceGroupName, + String accountName, String databaseName, Context context); + + /** + * Gets the RUs per second of the Gremlin 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 com.azure.core.management.exception.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 Gremlin database under an existing Azure Cosmos DB database account with the + * provided name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputSettingsGetResultsInner getGremlinDatabaseThroughput(String resourceGroupName, String accountName, + String databaseName); + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin 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 RUs per second of the parameters to provide for the current Gremlin + * database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono>> updateGremlinDatabaseThroughputWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin 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 RUs per second of the parameters to provide for the current Gremlin + * database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PollerFlux, ThroughputSettingsGetResultsInner> + beginUpdateGremlinDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, + ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin 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 RUs per second of the parameters to provide for the current Gremlin + * database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginUpdateGremlinDatabaseThroughput(String resourceGroupName, String accountName, String databaseName, + ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin 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 RUs per second of the parameters to provide for the current Gremlin + * database. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginUpdateGremlinDatabaseThroughput(String resourceGroupName, String accountName, String databaseName, + ThroughputSettingsUpdateParameters updateThroughputParameters, Context context); + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin 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 RUs per second of the parameters to provide for the current Gremlin + * database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono updateGremlinDatabaseThroughputAsync(String resourceGroupName, + String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin 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 RUs per second of the parameters to provide for the current Gremlin + * database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner updateGremlinDatabaseThroughput(String resourceGroupName, String accountName, + String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin 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 RUs per second of the parameters to provide for the current Gremlin + * database. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner updateGremlinDatabaseThroughput(String resourceGroupName, String accountName, + String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context); + + /** + * Migrate an Azure Cosmos DB Gremlin 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 com.azure.core.management.exception.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) + Mono>> migrateGremlinDatabaseToAutoscaleWithResponseAsync(String resourceGroupName, + String accountName, String databaseName); + + /** + * Migrate an Azure Cosmos DB Gremlin 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 com.azure.core.management.exception.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) + PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateGremlinDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName); + + /** + * Migrate an Azure Cosmos DB Gremlin 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 com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateGremlinDatabaseToAutoscale(String resourceGroupName, String accountName, String databaseName); + + /** + * Migrate an Azure Cosmos DB Gremlin 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 com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateGremlinDatabaseToAutoscale(String resourceGroupName, String accountName, String databaseName, + Context context); + + /** + * Migrate an Azure Cosmos DB Gremlin 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 com.azure.core.management.exception.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) + Mono migrateGremlinDatabaseToAutoscaleAsync(String resourceGroupName, + String accountName, String databaseName); + + /** + * Migrate an Azure Cosmos DB Gremlin 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 com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner migrateGremlinDatabaseToAutoscale(String resourceGroupName, String accountName, + String databaseName); + + /** + * Migrate an Azure Cosmos DB Gremlin 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 com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner migrateGremlinDatabaseToAutoscale(String resourceGroupName, String accountName, + String databaseName, Context context); + + /** + * Migrate an Azure Cosmos DB Gremlin 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 com.azure.core.management.exception.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) + Mono>> migrateGremlinDatabaseToManualThroughputWithResponseAsync(String resourceGroupName, + String accountName, String databaseName); + + /** + * Migrate an Azure Cosmos DB Gremlin 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 com.azure.core.management.exception.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) + PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateGremlinDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, + String databaseName); + + /** + * Migrate an Azure Cosmos DB Gremlin 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 com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateGremlinDatabaseToManualThroughput(String resourceGroupName, String accountName, + String databaseName); + + /** + * Migrate an Azure Cosmos DB Gremlin 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 com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateGremlinDatabaseToManualThroughput(String resourceGroupName, String accountName, String databaseName, + Context context); + + /** + * Migrate an Azure Cosmos DB Gremlin 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 com.azure.core.management.exception.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) + Mono migrateGremlinDatabaseToManualThroughputAsync(String resourceGroupName, + String accountName, String databaseName); + + /** + * Migrate an Azure Cosmos DB Gremlin 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 com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner migrateGremlinDatabaseToManualThroughput(String resourceGroupName, + String accountName, String databaseName); + + /** + * Migrate an Azure Cosmos DB Gremlin 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 com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner migrateGremlinDatabaseToManualThroughput(String resourceGroupName, + String accountName, String databaseName, Context context); + + /** + * Gets the Gremlin graph throughput 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 graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Gremlin graph throughput 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) + Mono> getGremlinGraphThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String graphName); + + /** + * Gets the Gremlin graph throughput 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 graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getGremlinGraphThroughputAsync(String resourceGroupName, String accountName, + String databaseName, String graphName); + + /** + * Gets the Gremlin graph throughput 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 graphName Cosmos DB graph name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getGremlinGraphThroughputWithResponse(String resourceGroupName, + String accountName, String databaseName, String graphName, Context context); + + /** + * Gets the Gremlin graph throughput 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 graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputSettingsGetResultsInner getGremlinGraphThroughput(String resourceGroupName, String accountName, + String databaseName, String graphName); + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * + * @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 graphName Cosmos DB graph name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono>> updateGremlinGraphThroughputWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String graphName, + ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * + * @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 graphName Cosmos DB graph name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PollerFlux, ThroughputSettingsGetResultsInner> + beginUpdateGremlinGraphThroughputAsync(String resourceGroupName, String accountName, String databaseName, + String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * + * @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 graphName Cosmos DB graph name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginUpdateGremlinGraphThroughput(String resourceGroupName, String accountName, String databaseName, + String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * + * @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 graphName Cosmos DB graph name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginUpdateGremlinGraphThroughput(String resourceGroupName, String accountName, String databaseName, + String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context); + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * + * @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 graphName Cosmos DB graph name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono updateGremlinGraphThroughputAsync(String resourceGroupName, + String accountName, String databaseName, String graphName, + ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * + * @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 graphName Cosmos DB graph name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner updateGremlinGraphThroughput(String resourceGroupName, String accountName, + String databaseName, String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * + * @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 graphName Cosmos DB graph name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner updateGremlinGraphThroughput(String resourceGroupName, String accountName, + String databaseName, String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters, + Context context); + + /** + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono>> migrateGremlinGraphToAutoscaleWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String graphName); + + /** + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateGremlinGraphToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, + String graphName); + + /** + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Gremlin databases and their properties as paginated - * response with {@link PagedFlux}. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listGremlinDatabasesAsync(String resourceGroupName, String accountName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateGremlinGraphToAutoscale(String resourceGroupName, String accountName, String databaseName, + String graphName); /** - * Lists the Gremlin databases under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Gremlin databases and their properties as paginated - * response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listGremlinDatabases(String resourceGroupName, String accountName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateGremlinGraphToAutoscale(String resourceGroupName, String accountName, String databaseName, + String graphName, Context context); /** - * Lists the Gremlin databases under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono migrateGremlinGraphToAutoscaleAsync(String resourceGroupName, + String accountName, String databaseName, String graphName); + + /** + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner migrateGremlinGraphToAutoscale(String resourceGroupName, String accountName, + String databaseName, String graphName); + + /** + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Gremlin databases and their properties as paginated - * response with {@link PagedIterable}. + * @return an Azure Cosmos DB resource throughput. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listGremlinDatabases(String resourceGroupName, String accountName, - Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputSettingsGetResultsInner migrateGremlinGraphToAutoscale(String resourceGroupName, String accountName, + String databaseName, String graphName, Context context); + + /** + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono>> migrateGremlinGraphToManualThroughputWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String graphName); + + /** + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateGremlinGraphToManualThroughputAsync(String resourceGroupName, String accountName, + String databaseName, String graphName); + + /** + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateGremlinGraphToManualThroughput(String resourceGroupName, String accountName, String databaseName, + String graphName); + + /** + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateGremlinGraphToManualThroughput(String resourceGroupName, String accountName, String databaseName, + String graphName, Context context); + + /** + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono migrateGremlinGraphToManualThroughputAsync(String resourceGroupName, + String accountName, String databaseName, String graphName); + + /** + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner migrateGremlinGraphToManualThroughput(String resourceGroupName, + String accountName, String databaseName, String graphName); + + /** + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner migrateGremlinGraphToManualThroughput(String resourceGroupName, + String accountName, String databaseName, String graphName, Context context); /** * Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. @@ -284,65 +1088,7 @@ Mono>> deleteGremlinDatabaseWithResponseAsync(String r */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) PollerFlux, Void> beginDeleteGremlinDatabaseAsync(String resourceGroupName, String accountName, - String databaseName); - - /** - * Deletes an existing Azure Cosmos DB Gremlin 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 com.azure.core.management.exception.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) - SyncPoller, Void> beginDeleteGremlinDatabase(String resourceGroupName, String accountName, - String databaseName); - - /** - * Deletes an existing Azure Cosmos DB Gremlin 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 com.azure.core.management.exception.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) - SyncPoller, Void> beginDeleteGremlinDatabase(String resourceGroupName, String accountName, - String databaseName, Context context); - - /** - * Deletes an existing Azure Cosmos DB Gremlin 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 com.azure.core.management.exception.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) - Mono deleteGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName); - - /** - * Deletes an existing Azure Cosmos DB Gremlin 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 com.azure.core.management.exception.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) - void deleteGremlinDatabase(String resourceGroupName, String accountName, String databaseName); + String databaseName); /** * Deletes an existing Azure Cosmos DB Gremlin database. @@ -350,34 +1096,33 @@ SyncPoller, Void> beginDeleteGremlinDatabase(String resourceGro * @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 com.azure.core.management.exception.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.SINGLE) - void deleteGremlinDatabase(String resourceGroupName, String accountName, String databaseName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteGremlinDatabase(String resourceGroupName, String accountName, + String databaseName); /** - * Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the - * provided name. + * Deletes an existing Azure Cosmos DB Gremlin 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 com.azure.core.management.exception.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 Gremlin database under an existing Azure Cosmos DB database account with the - * provided name along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getGremlinDatabaseThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDeleteGremlinDatabase(String resourceGroupName, String accountName, + String databaseName, Context context); /** - * Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the - * provided name. + * Deletes an existing Azure Cosmos DB Gremlin database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -385,392 +1130,385 @@ Mono> getGremlinDatabaseThroughputWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Gremlin database under an existing Azure Cosmos DB database account with the - * provided name on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getGremlinDatabaseThroughputAsync(String resourceGroupName, - String accountName, String databaseName); + Mono deleteGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName); /** - * Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the - * provided name. + * Deletes an existing Azure Cosmos DB Gremlin 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 com.azure.core.management.exception.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 Gremlin database under an existing Azure Cosmos DB database account with the - * provided name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getGremlinDatabaseThroughputWithResponse(String resourceGroupName, - String accountName, String databaseName, Context context); + void deleteGremlinDatabase(String resourceGroupName, String accountName, String databaseName); /** - * Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the - * provided name. + * Deletes an existing Azure Cosmos DB Gremlin 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 com.azure.core.management.exception.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 Gremlin database under an existing Azure Cosmos DB database account with the - * provided name. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner getGremlinDatabaseThroughput(String resourceGroupName, String accountName, - String databaseName); + void deleteGremlinDatabase(String resourceGroupName, String accountName, String databaseName, Context context); /** - * Update RUs per second of an Azure Cosmos DB Gremlin database. + * Lists the Gremlin 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 databaseName Cosmos DB database name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin - * database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return the List operation response, that contains the Gremlin databases and their properties as paginated + * response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateGremlinDatabaseThroughputWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listGremlinDatabasesAsync(String resourceGroupName, String accountName); /** - * Update RUs per second of an Azure Cosmos DB Gremlin database. + * Lists the Gremlin 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 databaseName Cosmos DB database name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin - * database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the List operation response, that contains the Gremlin databases and their properties as paginated + * response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, ThroughputSettingsGetResultsInner> - beginUpdateGremlinDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, - ThroughputSettingsUpdateParameters updateThroughputParameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listGremlinDatabases(String resourceGroupName, String accountName); /** - * Update RUs per second of an Azure Cosmos DB Gremlin database. + * Lists the Gremlin 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 databaseName Cosmos DB database name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin - * database. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the List operation response, that contains the Gremlin databases and their properties as paginated + * response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateGremlinDatabaseThroughput(String resourceGroupName, String accountName, String databaseName, - ThroughputSettingsUpdateParameters updateThroughputParameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listGremlinDatabases(String resourceGroupName, String accountName, + Context context); /** - * Update RUs per second of an Azure Cosmos DB Gremlin database. + * Gets the Gremlin graph 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 updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin - * database. - * @param context The context to associate with this operation. + * @param graphName Cosmos DB graph name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the Gremlin graph under an existing Azure Cosmos DB database account along with {@link Response} on + * successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateGremlinDatabaseThroughput(String resourceGroupName, String accountName, String databaseName, - ThroughputSettingsUpdateParameters updateThroughputParameters, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getGremlinGraphWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String graphName); /** - * Update RUs per second of an Azure Cosmos DB Gremlin database. + * Gets the Gremlin graph 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 updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin - * database. + * @param graphName Cosmos DB graph name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return the Gremlin graph under an existing Azure Cosmos DB database account on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateGremlinDatabaseThroughputAsync(String resourceGroupName, - String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters); + Mono getGremlinGraphAsync(String resourceGroupName, String accountName, + String databaseName, String graphName); /** - * Update RUs per second of an Azure Cosmos DB Gremlin database. + * Gets the Gremlin graph 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 updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin - * database. + * @param graphName Cosmos DB graph name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the Gremlin graph under an existing Azure Cosmos DB database account along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner updateGremlinDatabaseThroughput(String resourceGroupName, String accountName, - String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters); + Response getGremlinGraphWithResponse(String resourceGroupName, String accountName, + String databaseName, String graphName, Context context); /** - * Update RUs per second of an Azure Cosmos DB Gremlin database. + * Gets the Gremlin graph 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 updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin - * database. - * @param context The context to associate with this operation. + * @param graphName Cosmos DB graph name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the Gremlin graph under an existing Azure Cosmos DB database account. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner updateGremlinDatabaseThroughput(String resourceGroupName, String accountName, - String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context); + GremlinGraphGetResultsInner getGremlinGraph(String resourceGroupName, String accountName, String databaseName, + String graphName); /** - * Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. + * Create or update an Azure Cosmos DB Gremlin graph. * * @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 graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return an Azure Cosmos DB Gremlin graph along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> migrateGremlinDatabaseToAutoscaleWithResponseAsync(String resourceGroupName, - String accountName, String databaseName); + Mono>> createUpdateGremlinGraphWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String graphName, + GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters); /** - * Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. + * Create or update an Azure Cosmos DB Gremlin graph. * * @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 graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB Gremlin graph. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateGremlinDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName); + PollerFlux, GremlinGraphGetResultsInner> beginCreateUpdateGremlinGraphAsync( + String resourceGroupName, String accountName, String databaseName, String graphName, + GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters); /** - * Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. + * Create or update an Azure Cosmos DB Gremlin graph. * * @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 graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB Gremlin graph. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateGremlinDatabaseToAutoscale(String resourceGroupName, String accountName, String databaseName); + SyncPoller, GremlinGraphGetResultsInner> beginCreateUpdateGremlinGraph( + String resourceGroupName, String accountName, String databaseName, String graphName, + GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters); /** - * Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. + * Create or update an Azure Cosmos DB Gremlin graph. * * @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 graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB Gremlin graph. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateGremlinDatabaseToAutoscale(String resourceGroupName, String accountName, String databaseName, - Context context); + SyncPoller, GremlinGraphGetResultsInner> beginCreateUpdateGremlinGraph( + String resourceGroupName, String accountName, String databaseName, String graphName, + GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, Context context); /** - * Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. + * Create or update an Azure Cosmos DB Gremlin graph. * * @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 graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return an Azure Cosmos DB Gremlin graph on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono migrateGremlinDatabaseToAutoscaleAsync(String resourceGroupName, - String accountName, String databaseName); + Mono createUpdateGremlinGraphAsync(String resourceGroupName, String accountName, + String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters); /** - * Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. + * Create or update an Azure Cosmos DB Gremlin graph. * * @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 graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return an Azure Cosmos DB Gremlin graph. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner migrateGremlinDatabaseToAutoscale(String resourceGroupName, String accountName, - String databaseName); + GremlinGraphGetResultsInner createUpdateGremlinGraph(String resourceGroupName, String accountName, + String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters); /** - * Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. + * Create or update an Azure Cosmos DB Gremlin graph. * * @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 graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return an Azure Cosmos DB Gremlin graph. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner migrateGremlinDatabaseToAutoscale(String resourceGroupName, String accountName, - String databaseName, Context context); + GremlinGraphGetResultsInner createUpdateGremlinGraph(String resourceGroupName, String accountName, + String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, + Context context); /** - * Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Gremlin graph. * * @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 graphName Cosmos DB graph name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> migrateGremlinDatabaseToManualThroughputWithResponseAsync(String resourceGroupName, - String accountName, String databaseName); + Mono>> deleteGremlinGraphWithResponseAsync(String resourceGroupName, String accountName, + String databaseName, String graphName); /** - * Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Gremlin graph. * * @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 graphName Cosmos DB graph name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateGremlinDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, - String databaseName); + PollerFlux, Void> beginDeleteGremlinGraphAsync(String resourceGroupName, String accountName, + String databaseName, String graphName); /** - * Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Gremlin graph. * * @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 graphName Cosmos DB graph name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateGremlinDatabaseToManualThroughput(String resourceGroupName, String accountName, - String databaseName); + SyncPoller, Void> beginDeleteGremlinGraph(String resourceGroupName, String accountName, + String databaseName, String graphName); /** - * Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Gremlin graph. * * @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 graphName Cosmos DB graph name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateGremlinDatabaseToManualThroughput(String resourceGroupName, String accountName, String databaseName, - Context context); + SyncPoller, Void> beginDeleteGremlinGraph(String resourceGroupName, String accountName, + String databaseName, String graphName, Context context); /** - * Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Gremlin graph. * * @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 graphName Cosmos DB graph name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono migrateGremlinDatabaseToManualThroughputAsync(String resourceGroupName, - String accountName, String databaseName); + Mono deleteGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, + String graphName); /** - * Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Gremlin graph. * * @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 graphName Cosmos DB graph name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) - ThroughputSettingsGetResultsInner migrateGremlinDatabaseToManualThroughput(String resourceGroupName, - String accountName, String databaseName); + void deleteGremlinGraph(String resourceGroupName, String accountName, String databaseName, String graphName); /** - * Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Gremlin graph. * * @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 graphName Cosmos DB graph name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) - ThroughputSettingsGetResultsInner migrateGremlinDatabaseToManualThroughput(String resourceGroupName, - String accountName, String databaseName, Context context); + void deleteGremlinGraph(String resourceGroupName, String accountName, String databaseName, String graphName, + Context context); /** * Lists the Gremlin graph under an existing Azure Cosmos DB database account. @@ -822,862 +1560,800 @@ PagedIterable listGremlinGraphs(String resourceGrou String databaseName, Context context); /** - * Gets the Gremlin graph 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 graphName Cosmos DB graph name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 Gremlin graph under an existing Azure Cosmos DB database account along with {@link Response} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getGremlinGraphWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String graphName); - - /** - * Gets the Gremlin graph 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 graphName Cosmos DB graph name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 Gremlin graph under an existing Azure Cosmos DB database account on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getGremlinGraphAsync(String resourceGroupName, String accountName, - String databaseName, String graphName); - - /** - * Gets the Gremlin graph 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 graphName Cosmos DB graph name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 Gremlin graph under an existing Azure Cosmos DB database account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getGremlinGraphWithResponse(String resourceGroupName, String accountName, - String databaseName, String graphName, Context context); - - /** - * Gets the Gremlin graph 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 graphName Cosmos DB graph name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 Gremlin graph under an existing Azure Cosmos DB database account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - GremlinGraphGetResultsInner getGremlinGraph(String resourceGroupName, String accountName, String databaseName, - String graphName); - - /** - * Create or update an Azure Cosmos DB Gremlin graph. + * Retrieves continuous backup information for a gremlin graph. * * @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 graphName Cosmos DB graph name. - * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. + * @param location The name of the continuous backup restore location. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Gremlin graph along with {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createUpdateGremlinGraphWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String graphName, - GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters); + Mono>> retrieveContinuousBackupInformationWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String graphName, ContinuousBackupRestoreLocation location); /** - * Create or update an Azure Cosmos DB Gremlin graph. + * Retrieves continuous backup information for a gremlin graph. * * @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 graphName Cosmos DB graph name. - * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. + * @param location The name of the continuous backup restore location. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Gremlin graph. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, GremlinGraphGetResultsInner> beginCreateUpdateGremlinGraphAsync( - String resourceGroupName, String accountName, String databaseName, String graphName, - GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters); + PollerFlux, BackupInformationInner> + beginRetrieveContinuousBackupInformationAsync(String resourceGroupName, String accountName, String databaseName, + String graphName, ContinuousBackupRestoreLocation location); /** - * Create or update an Azure Cosmos DB Gremlin graph. + * Retrieves continuous backup information for a gremlin graph. * * @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 graphName Cosmos DB graph name. - * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. + * @param location The name of the continuous backup restore location. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Gremlin graph. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GremlinGraphGetResultsInner> beginCreateUpdateGremlinGraph( + SyncPoller, BackupInformationInner> beginRetrieveContinuousBackupInformation( String resourceGroupName, String accountName, String databaseName, String graphName, - GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters); + ContinuousBackupRestoreLocation location); /** - * Create or update an Azure Cosmos DB Gremlin graph. + * Retrieves continuous backup information for a gremlin graph. * * @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 graphName Cosmos DB graph name. - * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. + * @param location The name of the continuous backup restore location. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Gremlin graph. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, GremlinGraphGetResultsInner> beginCreateUpdateGremlinGraph( + SyncPoller, BackupInformationInner> beginRetrieveContinuousBackupInformation( String resourceGroupName, String accountName, String databaseName, String graphName, - GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, Context context); + ContinuousBackupRestoreLocation location, Context context); /** - * Create or update an Azure Cosmos DB Gremlin graph. + * Retrieves continuous backup information for a gremlin graph. * * @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 graphName Cosmos DB graph name. - * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. + * @param location The name of the continuous backup restore location. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Gremlin graph on successful completion of {@link Mono}. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createUpdateGremlinGraphAsync(String resourceGroupName, String accountName, - String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters); + Mono retrieveContinuousBackupInformationAsync(String resourceGroupName, String accountName, + String databaseName, String graphName, ContinuousBackupRestoreLocation location); /** - * Create or update an Azure Cosmos DB Gremlin graph. + * Retrieves continuous backup information for a gremlin graph. * * @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 graphName Cosmos DB graph name. - * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. + * @param location The name of the continuous backup restore location. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Gremlin graph. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - GremlinGraphGetResultsInner createUpdateGremlinGraph(String resourceGroupName, String accountName, - String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters); + BackupInformationInner retrieveContinuousBackupInformation(String resourceGroupName, String accountName, + String databaseName, String graphName, ContinuousBackupRestoreLocation location); /** - * Create or update an Azure Cosmos DB Gremlin graph. + * Retrieves continuous backup information for a gremlin graph. * * @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 graphName Cosmos DB graph name. - * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. + * @param location The name of the continuous backup restore location. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Gremlin graph. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - GremlinGraphGetResultsInner createUpdateGremlinGraph(String resourceGroupName, String accountName, - String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, - Context context); + BackupInformationInner retrieveContinuousBackupInformation(String resourceGroupName, String accountName, + String databaseName, String graphName, ContinuousBackupRestoreLocation location, Context context); /** - * Deletes an existing Azure Cosmos DB Gremlin graph. + * Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Definition with the given Id. * * @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 graphName Cosmos DB graph name. + * @param roleDefinitionId The GUID for the Role Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return parameters to create and update an Azure Cosmos DB Gremlin Role Definition along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteGremlinGraphWithResponseAsync(String resourceGroupName, String accountName, - String databaseName, String graphName); + Mono> getGremlinRoleDefinitionWithResponseAsync( + String resourceGroupName, String accountName, String roleDefinitionId); /** - * Deletes an existing Azure Cosmos DB Gremlin graph. + * Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Definition with the given Id. * * @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 graphName Cosmos DB graph name. + * @param roleDefinitionId The GUID for the Role Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return parameters to create and update an Azure Cosmos DB Gremlin Role Definition on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, Void> beginDeleteGremlinGraphAsync(String resourceGroupName, String accountName, - String databaseName, String graphName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getGremlinRoleDefinitionAsync(String resourceGroupName, String accountName, + String roleDefinitionId); /** - * Deletes an existing Azure Cosmos DB Gremlin graph. + * Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Definition with the given Id. * * @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 graphName Cosmos DB graph name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return parameters to create and update an Azure Cosmos DB Gremlin Role Definition along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeleteGremlinGraph(String resourceGroupName, String accountName, - String databaseName, String graphName); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getGremlinRoleDefinitionWithResponse(String resourceGroupName, + String accountName, String roleDefinitionId, Context context); /** - * Deletes an existing Azure Cosmos DB Gremlin graph. + * Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Definition with the given Id. * * @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 graphName Cosmos DB graph name. - * @param context The context to associate with this operation. + * @param roleDefinitionId The GUID for the Role Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return parameters to create and update an Azure Cosmos DB Gremlin Role Definition. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeleteGremlinGraph(String resourceGroupName, String accountName, - String databaseName, String graphName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + GremlinRoleDefinitionResourceInner getGremlinRoleDefinition(String resourceGroupName, String accountName, + String roleDefinitionId); /** - * Deletes an existing Azure Cosmos DB Gremlin graph. + * Creates or updates an Azure Cosmos DB Gremlin Role Definition. * * @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 graphName Cosmos DB graph name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateGremlinRoleDefinitionParameters The properties required to create or update a Role Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return parameters to create and update an Azure Cosmos DB Gremlin Role Definition along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, - String graphName); + Mono>> createUpdateGremlinRoleDefinitionWithResponseAsync(String resourceGroupName, + String accountName, String roleDefinitionId, + GremlinRoleDefinitionResourceInner createUpdateGremlinRoleDefinitionParameters); /** - * Deletes an existing Azure Cosmos DB Gremlin graph. + * Creates or updates an Azure Cosmos DB Gremlin Role Definition. * * @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 graphName Cosmos DB graph name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateGremlinRoleDefinitionParameters The properties required to create or update a Role Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 parameters to create and update an Azure Cosmos DB Gremlin Role + * Definition. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteGremlinGraph(String resourceGroupName, String accountName, String databaseName, String graphName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, GremlinRoleDefinitionResourceInner> + beginCreateUpdateGremlinRoleDefinitionAsync(String resourceGroupName, String accountName, + String roleDefinitionId, GremlinRoleDefinitionResourceInner createUpdateGremlinRoleDefinitionParameters); /** - * Deletes an existing Azure Cosmos DB Gremlin graph. + * Creates or updates an Azure Cosmos DB Gremlin Role Definition. * * @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 graphName Cosmos DB graph name. - * @param context The context to associate with this operation. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateGremlinRoleDefinitionParameters The properties required to create or update a Role Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 parameters to create and update an Azure Cosmos DB Gremlin Role + * Definition. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteGremlinGraph(String resourceGroupName, String accountName, String databaseName, String graphName, - Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GremlinRoleDefinitionResourceInner> + beginCreateUpdateGremlinRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId, + GremlinRoleDefinitionResourceInner createUpdateGremlinRoleDefinitionParameters); /** - * Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. + * Creates or updates an Azure Cosmos DB Gremlin Role Definition. * * @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 graphName Cosmos DB graph name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateGremlinRoleDefinitionParameters The properties required to create or update a Role Definition. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name - * along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of parameters to create and update an Azure Cosmos DB Gremlin Role + * Definition. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getGremlinGraphThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, String graphName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, GremlinRoleDefinitionResourceInner> + beginCreateUpdateGremlinRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId, + GremlinRoleDefinitionResourceInner createUpdateGremlinRoleDefinitionParameters, Context context); /** - * Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. + * Creates or updates an Azure Cosmos DB Gremlin Role Definition. * * @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 graphName Cosmos DB graph name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateGremlinRoleDefinitionParameters The properties required to create or update a Role Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name on - * successful completion of {@link Mono}. + * @return parameters to create and update an Azure Cosmos DB Gremlin Role Definition on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getGremlinGraphThroughputAsync(String resourceGroupName, String accountName, - String databaseName, String graphName); + Mono createUpdateGremlinRoleDefinitionAsync(String resourceGroupName, + String accountName, String roleDefinitionId, + GremlinRoleDefinitionResourceInner createUpdateGremlinRoleDefinitionParameters); /** - * Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. + * Creates or updates an Azure Cosmos DB Gremlin Role Definition. * * @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 graphName Cosmos DB graph name. - * @param context The context to associate with this operation. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateGremlinRoleDefinitionParameters The properties required to create or update a Role Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name - * along with {@link Response}. + * @return parameters to create and update an Azure Cosmos DB Gremlin Role Definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getGremlinGraphThroughputWithResponse(String resourceGroupName, - String accountName, String databaseName, String graphName, Context context); + GremlinRoleDefinitionResourceInner createUpdateGremlinRoleDefinition(String resourceGroupName, String accountName, + String roleDefinitionId, GremlinRoleDefinitionResourceInner createUpdateGremlinRoleDefinitionParameters); /** - * Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. + * Creates or updates an Azure Cosmos DB Gremlin Role Definition. * * @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 graphName Cosmos DB graph name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateGremlinRoleDefinitionParameters The properties required to create or update a Role Definition. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. + * @return parameters to create and update an Azure Cosmos DB Gremlin Role Definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner getGremlinGraphThroughput(String resourceGroupName, String accountName, - String databaseName, String graphName); + GremlinRoleDefinitionResourceInner createUpdateGremlinRoleDefinition(String resourceGroupName, String accountName, + String roleDefinitionId, GremlinRoleDefinitionResourceInner createUpdateGremlinRoleDefinitionParameters, + Context context); /** - * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin Role Definition. * * @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 graphName Cosmos DB graph name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. + * @param roleDefinitionId The GUID for the Role Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateGremlinGraphThroughputWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String graphName, - ThroughputSettingsUpdateParameters updateThroughputParameters); + Mono>> deleteGremlinRoleDefinitionWithResponseAsync(String resourceGroupName, + String accountName, String roleDefinitionId); /** - * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin Role Definition. * * @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 graphName Cosmos DB graph name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. + * @param roleDefinitionId The GUID for the Role Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, ThroughputSettingsGetResultsInner> - beginUpdateGremlinGraphThroughputAsync(String resourceGroupName, String accountName, String databaseName, - String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters); + PollerFlux, Void> beginDeleteGremlinRoleDefinitionAsync(String resourceGroupName, + String accountName, String roleDefinitionId); /** - * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin Role Definition. * * @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 graphName Cosmos DB graph name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. + * @param roleDefinitionId The GUID for the Role Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateGremlinGraphThroughput(String resourceGroupName, String accountName, String databaseName, - String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters); + SyncPoller, Void> beginDeleteGremlinRoleDefinition(String resourceGroupName, String accountName, + String roleDefinitionId); /** - * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin Role Definition. * * @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 graphName Cosmos DB graph name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. + * @param roleDefinitionId The GUID for the Role Definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateGremlinGraphThroughput(String resourceGroupName, String accountName, String databaseName, - String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context); + SyncPoller, Void> beginDeleteGremlinRoleDefinition(String resourceGroupName, String accountName, + String roleDefinitionId, Context context); /** - * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin Role Definition. * * @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 graphName Cosmos DB graph name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. + * @param roleDefinitionId The GUID for the Role Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateGremlinGraphThroughputAsync(String resourceGroupName, - String accountName, String databaseName, String graphName, - ThroughputSettingsUpdateParameters updateThroughputParameters); + Mono deleteGremlinRoleDefinitionAsync(String resourceGroupName, String accountName, String roleDefinitionId); /** - * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin Role Definition. * * @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 graphName Cosmos DB graph name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. + * @param roleDefinitionId The GUID for the Role Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) - ThroughputSettingsGetResultsInner updateGremlinGraphThroughput(String resourceGroupName, String accountName, - String databaseName, String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters); + void deleteGremlinRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId); /** - * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin Role Definition. * * @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 graphName Cosmos DB graph name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. + * @param roleDefinitionId The GUID for the Role Definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) - ThroughputSettingsGetResultsInner updateGremlinGraphThroughput(String resourceGroupName, String accountName, - String databaseName, String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters, + void deleteGremlinRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId, Context context); /** - * Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale. + * Retrieves the list of all Azure Cosmos DB Gremlin Role Definitions. * * @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 graphName Cosmos DB graph name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return the response of a GremlinRoleDefinitionResource list operation as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> migrateGremlinGraphToAutoscaleWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String graphName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listGremlinRoleDefinitionsAsync(String resourceGroupName, + String accountName); /** - * Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale. + * Retrieves the list of all Azure Cosmos DB Gremlin Role Definitions. * * @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 graphName Cosmos DB graph name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the response of a GremlinRoleDefinitionResource list operation as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateGremlinGraphToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, - String graphName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listGremlinRoleDefinitions(String resourceGroupName, + String accountName); /** - * Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale. + * Retrieves the list of all Azure Cosmos DB Gremlin Role Definitions. * * @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 graphName Cosmos DB graph name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the response of a GremlinRoleDefinitionResource list operation as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateGremlinGraphToAutoscale(String resourceGroupName, String accountName, String databaseName, - String graphName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listGremlinRoleDefinitions(String resourceGroupName, + String accountName, Context context); /** - * Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale. + * Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Assignment with the given Id. * * @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 graphName Cosmos DB graph name. - * @param context The context to associate with this operation. + * @param roleAssignmentId The GUID for the Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return parameters to create and update an Azure Cosmos DB Gremlin Role Assignment along with {@link Response} on + * successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateGremlinGraphToAutoscale(String resourceGroupName, String accountName, String databaseName, - String graphName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getGremlinRoleAssignmentWithResponseAsync( + String resourceGroupName, String accountName, String roleAssignmentId); /** - * Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale. + * Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Assignment with the given Id. * * @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 graphName Cosmos DB graph name. + * @param roleAssignmentId The GUID for the Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return parameters to create and update an Azure Cosmos DB Gremlin Role Assignment on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono migrateGremlinGraphToAutoscaleAsync(String resourceGroupName, - String accountName, String databaseName, String graphName); + Mono getGremlinRoleAssignmentAsync(String resourceGroupName, String accountName, + String roleAssignmentId); /** - * Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale. + * Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Assignment with the given Id. * * @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 graphName Cosmos DB graph name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return parameters to create and update an Azure Cosmos DB Gremlin Role Assignment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner migrateGremlinGraphToAutoscale(String resourceGroupName, String accountName, - String databaseName, String graphName); + Response getGremlinRoleAssignmentWithResponse(String resourceGroupName, + String accountName, String roleAssignmentId, Context context); /** - * Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale. + * Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Assignment with the given Id. * * @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 graphName Cosmos DB graph name. - * @param context The context to associate with this operation. + * @param roleAssignmentId The GUID for the Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return parameters to create and update an Azure Cosmos DB Gremlin Role Assignment. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner migrateGremlinGraphToAutoscale(String resourceGroupName, String accountName, - String databaseName, String graphName, Context context); + GremlinRoleAssignmentResourceInner getGremlinRoleAssignment(String resourceGroupName, String accountName, + String roleAssignmentId); /** - * Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput. + * Creates or updates an Azure Cosmos DB Gremlin Role Assignment. * * @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 graphName Cosmos DB graph name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateGremlinRoleAssignmentParameters The properties required to create or update a Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return parameters to create and update an Azure Cosmos DB Gremlin Role Assignment along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> migrateGremlinGraphToManualThroughputWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String graphName); + Mono>> createUpdateGremlinRoleAssignmentWithResponseAsync(String resourceGroupName, + String accountName, String roleAssignmentId, + GremlinRoleAssignmentResourceInner createUpdateGremlinRoleAssignmentParameters); /** - * Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput. + * Creates or updates an Azure Cosmos DB Gremlin Role Assignment. * * @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 graphName Cosmos DB graph name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateGremlinRoleAssignmentParameters The properties required to create or update a Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link PollerFlux} for polling of parameters to create and update an Azure Cosmos DB Gremlin Role + * Assignment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateGremlinGraphToManualThroughputAsync(String resourceGroupName, String accountName, - String databaseName, String graphName); + PollerFlux, GremlinRoleAssignmentResourceInner> + beginCreateUpdateGremlinRoleAssignmentAsync(String resourceGroupName, String accountName, + String roleAssignmentId, GremlinRoleAssignmentResourceInner createUpdateGremlinRoleAssignmentParameters); /** - * Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput. + * Creates or updates an Azure Cosmos DB Gremlin Role Assignment. * * @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 graphName Cosmos DB graph name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateGremlinRoleAssignmentParameters The properties required to create or update a Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of parameters to create and update an Azure Cosmos DB Gremlin Role + * Assignment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateGremlinGraphToManualThroughput(String resourceGroupName, String accountName, String databaseName, - String graphName); + SyncPoller, GremlinRoleAssignmentResourceInner> + beginCreateUpdateGremlinRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId, + GremlinRoleAssignmentResourceInner createUpdateGremlinRoleAssignmentParameters); /** - * Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput. + * Creates or updates an Azure Cosmos DB Gremlin Role Assignment. * * @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 graphName Cosmos DB graph name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateGremlinRoleAssignmentParameters The properties required to create or update a Role Assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of parameters to create and update an Azure Cosmos DB Gremlin Role + * Assignment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateGremlinGraphToManualThroughput(String resourceGroupName, String accountName, String databaseName, - String graphName, Context context); + SyncPoller, GremlinRoleAssignmentResourceInner> + beginCreateUpdateGremlinRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId, + GremlinRoleAssignmentResourceInner createUpdateGremlinRoleAssignmentParameters, Context context); /** - * Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput. + * Creates or updates an Azure Cosmos DB Gremlin Role Assignment. * * @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 graphName Cosmos DB graph name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateGremlinRoleAssignmentParameters The properties required to create or update a Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return parameters to create and update an Azure Cosmos DB Gremlin Role Assignment on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono migrateGremlinGraphToManualThroughputAsync(String resourceGroupName, - String accountName, String databaseName, String graphName); + Mono createUpdateGremlinRoleAssignmentAsync(String resourceGroupName, + String accountName, String roleAssignmentId, + GremlinRoleAssignmentResourceInner createUpdateGremlinRoleAssignmentParameters); /** - * Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput. + * Creates or updates an Azure Cosmos DB Gremlin Role Assignment. * * @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 graphName Cosmos DB graph name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateGremlinRoleAssignmentParameters The properties required to create or update a Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return parameters to create and update an Azure Cosmos DB Gremlin Role Assignment. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner migrateGremlinGraphToManualThroughput(String resourceGroupName, - String accountName, String databaseName, String graphName); + GremlinRoleAssignmentResourceInner createUpdateGremlinRoleAssignment(String resourceGroupName, String accountName, + String roleAssignmentId, GremlinRoleAssignmentResourceInner createUpdateGremlinRoleAssignmentParameters); /** - * Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput. + * Creates or updates an Azure Cosmos DB Gremlin Role Assignment. * * @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 graphName Cosmos DB graph name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateGremlinRoleAssignmentParameters The properties required to create or update a Role Assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return parameters to create and update an Azure Cosmos DB Gremlin Role Assignment. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner migrateGremlinGraphToManualThroughput(String resourceGroupName, - String accountName, String databaseName, String graphName, Context context); + GremlinRoleAssignmentResourceInner createUpdateGremlinRoleAssignment(String resourceGroupName, String accountName, + String roleAssignmentId, GremlinRoleAssignmentResourceInner createUpdateGremlinRoleAssignmentParameters, + Context context); /** - * Retrieves continuous backup information for a gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin Role Assignment. * * @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 graphName Cosmos DB graph name. - * @param location The name of the continuous backup restore location. + * @param roleAssignmentId The GUID for the Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup information of a resource along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> retrieveContinuousBackupInformationWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String graphName, ContinuousBackupRestoreLocation location); + Mono>> deleteGremlinRoleAssignmentWithResponseAsync(String resourceGroupName, + String accountName, String roleAssignmentId); /** - * Retrieves continuous backup information for a gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin Role Assignment. * * @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 graphName Cosmos DB graph name. - * @param location The name of the continuous backup restore location. + * @param roleAssignmentId The GUID for the Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 backup information of a resource. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, BackupInformationInner> - beginRetrieveContinuousBackupInformationAsync(String resourceGroupName, String accountName, String databaseName, - String graphName, ContinuousBackupRestoreLocation location); + PollerFlux, Void> beginDeleteGremlinRoleAssignmentAsync(String resourceGroupName, + String accountName, String roleAssignmentId); /** - * Retrieves continuous backup information for a gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin Role Assignment. * * @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 graphName Cosmos DB graph name. - * @param location The name of the continuous backup restore location. + * @param roleAssignmentId The GUID for the Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 backup information of a resource. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BackupInformationInner> beginRetrieveContinuousBackupInformation( - String resourceGroupName, String accountName, String databaseName, String graphName, - ContinuousBackupRestoreLocation location); + SyncPoller, Void> beginDeleteGremlinRoleAssignment(String resourceGroupName, String accountName, + String roleAssignmentId); /** - * Retrieves continuous backup information for a gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin Role Assignment. * * @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 graphName Cosmos DB graph name. - * @param location The name of the continuous backup restore location. + * @param roleAssignmentId The GUID for the Role Assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 backup information of a resource. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BackupInformationInner> beginRetrieveContinuousBackupInformation( - String resourceGroupName, String accountName, String databaseName, String graphName, - ContinuousBackupRestoreLocation location, Context context); + SyncPoller, Void> beginDeleteGremlinRoleAssignment(String resourceGroupName, String accountName, + String roleAssignmentId, Context context); /** - * Retrieves continuous backup information for a gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin Role Assignment. * * @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 graphName Cosmos DB graph name. - * @param location The name of the continuous backup restore location. + * @param roleAssignmentId The GUID for the Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup information of a resource on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono retrieveContinuousBackupInformationAsync(String resourceGroupName, String accountName, - String databaseName, String graphName, ContinuousBackupRestoreLocation location); + Mono deleteGremlinRoleAssignmentAsync(String resourceGroupName, String accountName, String roleAssignmentId); /** - * Retrieves continuous backup information for a gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin Role Assignment. * * @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 graphName Cosmos DB graph name. - * @param location The name of the continuous backup restore location. + * @param roleAssignmentId The GUID for the Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup information of a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - BackupInformationInner retrieveContinuousBackupInformation(String resourceGroupName, String accountName, - String databaseName, String graphName, ContinuousBackupRestoreLocation location); + void deleteGremlinRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId); /** - * Retrieves continuous backup information for a gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin Role Assignment. * * @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 graphName Cosmos DB graph name. - * @param location The name of the continuous backup restore location. + * @param roleAssignmentId The GUID for the Role Assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup information of a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - BackupInformationInner retrieveContinuousBackupInformation(String resourceGroupName, String accountName, - String databaseName, String graphName, ContinuousBackupRestoreLocation location, Context context); + void deleteGremlinRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId, + Context context); + + /** + * Retrieves the list of all Azure Cosmos DB Gremlin Role Assignments. + * + * @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 com.azure.core.management.exception.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 response of a GremlinRoleAssignmentResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listGremlinRoleAssignmentsAsync(String resourceGroupName, + String accountName); + + /** + * Retrieves the list of all Azure Cosmos DB Gremlin Role Assignments. + * + * @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 com.azure.core.management.exception.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 response of a GremlinRoleAssignmentResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listGremlinRoleAssignments(String resourceGroupName, + String accountName); + + /** + * Retrieves the list of all Azure Cosmos DB Gremlin Role Assignments. + * + * @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 com.azure.core.management.exception.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 response of a GremlinRoleAssignmentResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listGremlinRoleAssignments(String resourceGroupName, + String accountName, Context context); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/LocationsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/LocationsClient.java index 0c8104eb506c..3b4343f67a17 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/LocationsClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/LocationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; @@ -17,41 +17,6 @@ * An instance of this class provides access to all the operations defined in LocationsClient. */ public interface LocationsClient { - /** - * List Cosmos DB locations and their properties. - * - * @throws com.azure.core.management.exception.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 Cosmos DB locations and their properties as paginated response - * with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(); - - /** - * List Cosmos DB locations and their properties. - * - * @throws com.azure.core.management.exception.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 Cosmos DB locations and their properties as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(); - - /** - * List Cosmos DB locations and their properties. - * - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 Cosmos DB locations and their properties as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(Context context); - /** * Get the properties of an existing Cosmos DB location. * @@ -101,4 +66,39 @@ public interface LocationsClient { */ @ServiceMethod(returns = ReturnType.SINGLE) LocationGetResultInner get(String location); + + /** + * List Cosmos DB locations and their properties. + * + * @throws com.azure.core.management.exception.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 Cosmos DB locations and their properties as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(); + + /** + * List Cosmos DB locations and their properties. + * + * @throws com.azure.core.management.exception.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 Cosmos DB locations and their properties as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * List Cosmos DB locations and their properties. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Cosmos DB locations and their properties as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/MongoDBResourcesClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/MongoDBResourcesClient.java index 114b858fc24f..a348d59abcae 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/MongoDBResourcesClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/MongoDBResourcesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; @@ -18,12 +18,17 @@ import com.azure.resourcemanager.cosmos.fluent.models.MongoDBDatabaseGetResultsInner; import com.azure.resourcemanager.cosmos.fluent.models.MongoRoleDefinitionGetResultsInner; import com.azure.resourcemanager.cosmos.fluent.models.MongoUserDefinitionGetResultsInner; +import com.azure.resourcemanager.cosmos.fluent.models.PhysicalPartitionStorageInfoCollectionInner; +import com.azure.resourcemanager.cosmos.fluent.models.PhysicalPartitionThroughputInfoResultInner; import com.azure.resourcemanager.cosmos.fluent.models.ThroughputSettingsGetResultsInner; import com.azure.resourcemanager.cosmos.models.ContinuousBackupRestoreLocation; +import com.azure.resourcemanager.cosmos.models.MergeParameters; import com.azure.resourcemanager.cosmos.models.MongoDBCollectionCreateUpdateParameters; import com.azure.resourcemanager.cosmos.models.MongoDBDatabaseCreateUpdateParameters; import com.azure.resourcemanager.cosmos.models.MongoRoleDefinitionCreateUpdateParameters; import com.azure.resourcemanager.cosmos.models.MongoUserDefinitionCreateUpdateParameters; +import com.azure.resourcemanager.cosmos.models.RedistributeThroughputParameters; +import com.azure.resourcemanager.cosmos.models.RetrieveThroughputParameters; import com.azure.resourcemanager.cosmos.models.ThroughputSettingsUpdateParameters; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -34,337 +39,1394 @@ */ public interface MongoDBResourcesClient { /** - * Lists the MongoDB databases under an existing Azure Cosmos DB database account. + * Gets the RUs per second of the MongoDB 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 com.azure.core.management.exception.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 MongoDB 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) + Mono> getMongoDBDatabaseThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName); + + /** + * Gets the RUs per second of the MongoDB 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 com.azure.core.management.exception.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 MongoDB database under an existing Azure Cosmos DB database account with the + * provided name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getMongoDBDatabaseThroughputAsync(String resourceGroupName, + String accountName, String databaseName); + + /** + * Gets the RUs per second of the MongoDB 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 com.azure.core.management.exception.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 MongoDB database under an existing Azure Cosmos DB database account with the + * provided name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getMongoDBDatabaseThroughputWithResponse(String resourceGroupName, + String accountName, String databaseName, Context context); + + /** + * Gets the RUs per second of the MongoDB 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 com.azure.core.management.exception.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 MongoDB database under an existing Azure Cosmos DB database account with the + * provided name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputSettingsGetResultsInner getMongoDBDatabaseThroughput(String resourceGroupName, String accountName, + String databaseName); + + /** + * Update RUs per second of the an Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB + * database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono>> updateMongoDBDatabaseThroughputWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of the an Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB + * database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PollerFlux, ThroughputSettingsGetResultsInner> + beginUpdateMongoDBDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, + ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of the an Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB + * database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginUpdateMongoDBDatabaseThroughput(String resourceGroupName, String accountName, String databaseName, + ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of the an Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB + * database. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginUpdateMongoDBDatabaseThroughput(String resourceGroupName, String accountName, String databaseName, + ThroughputSettingsUpdateParameters updateThroughputParameters, Context context); + + /** + * Update RUs per second of the an Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB + * database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono updateMongoDBDatabaseThroughputAsync(String resourceGroupName, + String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of the an Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB + * database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner updateMongoDBDatabaseThroughput(String resourceGroupName, String accountName, + String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of the an Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB + * database. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner updateMongoDBDatabaseThroughput(String resourceGroupName, String accountName, + String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context); + + /** + * Migrate an Azure Cosmos DB MongoDB 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 com.azure.core.management.exception.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) + Mono>> migrateMongoDBDatabaseToAutoscaleWithResponseAsync(String resourceGroupName, + String accountName, String databaseName); + + /** + * Migrate an Azure Cosmos DB MongoDB 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 com.azure.core.management.exception.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) + PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateMongoDBDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName); + + /** + * Migrate an Azure Cosmos DB MongoDB 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 com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateMongoDBDatabaseToAutoscale(String resourceGroupName, String accountName, String databaseName); + + /** + * Migrate an Azure Cosmos DB MongoDB 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 com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateMongoDBDatabaseToAutoscale(String resourceGroupName, String accountName, String databaseName, + Context context); + + /** + * Migrate an Azure Cosmos DB MongoDB 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 com.azure.core.management.exception.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) + Mono migrateMongoDBDatabaseToAutoscaleAsync(String resourceGroupName, + String accountName, String databaseName); + + /** + * Migrate an Azure Cosmos DB MongoDB 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 com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner migrateMongoDBDatabaseToAutoscale(String resourceGroupName, String accountName, + String databaseName); + + /** + * Migrate an Azure Cosmos DB MongoDB 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 com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner migrateMongoDBDatabaseToAutoscale(String resourceGroupName, String accountName, + String databaseName, Context context); + + /** + * Migrate an Azure Cosmos DB MongoDB 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 com.azure.core.management.exception.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) + Mono>> migrateMongoDBDatabaseToManualThroughputWithResponseAsync(String resourceGroupName, + String accountName, String databaseName); + + /** + * Migrate an Azure Cosmos DB MongoDB 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 com.azure.core.management.exception.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) + PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateMongoDBDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, + String databaseName); + + /** + * Migrate an Azure Cosmos DB MongoDB 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 com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateMongoDBDatabaseToManualThroughput(String resourceGroupName, String accountName, + String databaseName); + + /** + * Migrate an Azure Cosmos DB MongoDB 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 com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateMongoDBDatabaseToManualThroughput(String resourceGroupName, String accountName, String databaseName, + Context context); + + /** + * Migrate an Azure Cosmos DB MongoDB 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 com.azure.core.management.exception.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) + Mono migrateMongoDBDatabaseToManualThroughputAsync(String resourceGroupName, + String accountName, String databaseName); + + /** + * Migrate an Azure Cosmos DB MongoDB 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 com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner migrateMongoDBDatabaseToManualThroughput(String resourceGroupName, + String accountName, String databaseName); + + /** + * Migrate an Azure Cosmos DB MongoDB 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 com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner migrateMongoDBDatabaseToManualThroughput(String resourceGroupName, + String accountName, String databaseName, Context context); + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> mongoDBDatabaseRetrieveThroughputDistributionWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters); + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBDatabaseRetrieveThroughputDistributionAsync(String resourceGroupName, String accountName, + String databaseName, RetrieveThroughputParameters retrieveThroughputParameters); + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBDatabaseRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, RetrieveThroughputParameters retrieveThroughputParameters); + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB database. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBDatabaseRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, RetrieveThroughputParameters retrieveThroughputParameters, Context context); + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono mongoDBDatabaseRetrieveThroughputDistributionAsync( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters); + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionThroughputInfoResultInner mongoDBDatabaseRetrieveThroughputDistribution(String resourceGroupName, + String accountName, String databaseName, RetrieveThroughputParameters retrieveThroughputParameters); + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB database. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionThroughputInfoResultInner mongoDBDatabaseRetrieveThroughputDistribution(String resourceGroupName, + String accountName, String databaseName, RetrieveThroughputParameters retrieveThroughputParameters, + Context context); + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> mongoDBDatabaseRedistributeThroughputWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, RedistributeThroughputParameters redistributeThroughputParameters); + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBDatabaseRedistributeThroughputAsync(String resourceGroupName, String accountName, + String databaseName, RedistributeThroughputParameters redistributeThroughputParameters); + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBDatabaseRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters); + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB database. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBDatabaseRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context); + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono mongoDBDatabaseRedistributeThroughputAsync( + String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters); + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB database. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionThroughputInfoResultInner mongoDBDatabaseRedistributeThroughput(String resourceGroupName, + String accountName, String databaseName, RedistributeThroughputParameters redistributeThroughputParameters); + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB database. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionThroughputInfoResultInner mongoDBDatabaseRedistributeThroughput(String resourceGroupName, + String accountName, String databaseName, RedistributeThroughputParameters redistributeThroughputParameters, + Context context); + + /** + * Gets the RUs per second of the MongoDB collection 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 collectionName Cosmos DB collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 MongoDB collection 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) + Mono> getMongoDBCollectionThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName); + + /** + * Gets the RUs per second of the MongoDB collection 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 collectionName Cosmos DB collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 MongoDB collection under an existing Azure Cosmos DB database account with the + * provided name on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getMongoDBCollectionThroughputAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName); + + /** + * Gets the RUs per second of the MongoDB collection 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 collectionName Cosmos DB collection name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 MongoDB collection under an existing Azure Cosmos DB database account with the + * provided name along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getMongoDBCollectionThroughputWithResponse(String resourceGroupName, + String accountName, String databaseName, String collectionName, Context context); + + /** + * Gets the RUs per second of the MongoDB collection 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 collectionName Cosmos DB collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 MongoDB collection under an existing Azure Cosmos DB database account with the + * provided name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputSettingsGetResultsInner getMongoDBCollectionThroughput(String resourceGroupName, String accountName, + String databaseName, String collectionName); + + /** + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * + * @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 collectionName Cosmos DB collection name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB + * collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono>> updateMongoDBCollectionThroughputWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName, + ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * + * @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 collectionName Cosmos DB collection name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB + * collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PollerFlux, ThroughputSettingsGetResultsInner> + beginUpdateMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, + String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * + * @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 collectionName Cosmos DB collection name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB + * collection. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginUpdateMongoDBCollectionThroughput(String resourceGroupName, String accountName, String databaseName, + String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * + * @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 collectionName Cosmos DB collection name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB + * collection. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginUpdateMongoDBCollectionThroughput(String resourceGroupName, String accountName, String databaseName, + String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context); + + /** + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. * * @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 collectionName Cosmos DB collection name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB + * collection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 MongoDB databases and their properties as paginated - * response with {@link PagedFlux}. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listMongoDBDatabasesAsync(String resourceGroupName, String accountName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateMongoDBCollectionThroughputAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName, + ThroughputSettingsUpdateParameters updateThroughputParameters); /** - * Lists the MongoDB databases under an existing Azure Cosmos DB database account. + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. * * @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 collectionName Cosmos DB collection name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB + * collection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 MongoDB databases and their properties as paginated - * response with {@link PagedIterable}. + * @return an Azure Cosmos DB resource throughput. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMongoDBDatabases(String resourceGroupName, String accountName); + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputSettingsGetResultsInner updateMongoDBCollectionThroughput(String resourceGroupName, String accountName, + String databaseName, String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters); /** - * Lists the MongoDB databases under an existing Azure Cosmos DB database account. + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. * * @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 collectionName Cosmos DB collection name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB + * collection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 MongoDB databases and their properties as paginated - * response with {@link PagedIterable}. + * @return an Azure Cosmos DB resource throughput. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMongoDBDatabases(String resourceGroupName, String accountName, + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputSettingsGetResultsInner updateMongoDBCollectionThroughput(String resourceGroupName, String accountName, + String databaseName, String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context); /** - * Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 MongoDB databases under an existing Azure Cosmos DB database account with the provided name along - * with {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getMongoDBDatabaseWithResponseAsync(String resourceGroupName, - String accountName, String databaseName); + Mono>> mongoDBContainerRetrieveThroughputDistributionWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + RetrieveThroughputParameters retrieveThroughputParameters); /** - * Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 MongoDB databases under an existing Azure Cosmos DB database account with the provided name on - * successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBContainerRetrieveThroughputDistributionAsync(String resourceGroupName, String accountName, + String databaseName, String collectionName, RetrieveThroughputParameters retrieveThroughputParameters); + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBContainerRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, String collectionName, RetrieveThroughputParameters retrieveThroughputParameters); + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBContainerRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, String collectionName, RetrieveThroughputParameters retrieveThroughputParameters, + Context context); + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getMongoDBDatabaseAsync(String resourceGroupName, String accountName, - String databaseName); + Mono mongoDBContainerRetrieveThroughputDistributionAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + RetrieveThroughputParameters retrieveThroughputParameters); /** - * Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionThroughputInfoResultInner mongoDBContainerRetrieveThroughputDistribution(String resourceGroupName, + String accountName, String databaseName, String collectionName, + RetrieveThroughputParameters retrieveThroughputParameters); + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB container. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 MongoDB databases under an existing Azure Cosmos DB database account with the provided name along - * with {@link Response}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getMongoDBDatabaseWithResponse(String resourceGroupName, - String accountName, String databaseName, Context context); + PhysicalPartitionThroughputInfoResultInner mongoDBContainerRetrieveThroughputDistribution(String resourceGroupName, + String accountName, String databaseName, String collectionName, + RetrieveThroughputParameters retrieveThroughputParameters, Context context); /** - * Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 MongoDB databases under an existing Azure Cosmos DB database account with the provided name. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - MongoDBDatabaseGetResultsInner getMongoDBDatabase(String resourceGroupName, String accountName, - String databaseName); + Mono>> mongoDBContainerRedistributeThroughputWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName, + RedistributeThroughputParameters redistributeThroughputParameters); /** - * Create or updates Azure Cosmos DB MongoDB database. + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. + * @param collectionName Cosmos DB collection name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 MongoDB database along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBContainerRedistributeThroughputAsync(String resourceGroupName, String accountName, + String databaseName, String collectionName, + RedistributeThroughputParameters redistributeThroughputParameters); + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBContainerRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + String collectionName, RedistributeThroughputParameters redistributeThroughputParameters); + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBContainerRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + String collectionName, RedistributeThroughputParameters redistributeThroughputParameters, Context context); + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB container. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createUpdateMongoDBDatabaseWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, - MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters); + Mono mongoDBContainerRedistributeThroughputAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + RedistributeThroughputParameters redistributeThroughputParameters); /** - * Create or updates Azure Cosmos DB MongoDB database. + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. + * @param collectionName Cosmos DB collection name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 MongoDB database. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionThroughputInfoResultInner mongoDBContainerRedistributeThroughput(String resourceGroupName, + String accountName, String databaseName, String collectionName, + RedistributeThroughputParameters redistributeThroughputParameters); + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB container. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionThroughputInfoResultInner mongoDBContainerRedistributeThroughput(String resourceGroupName, + String accountName, String databaseName, String collectionName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context); + + /** + * Migrate an Azure Cosmos DB MongoDB collection 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 collectionName Cosmos DB collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono>> migrateMongoDBCollectionToAutoscaleWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName); + + /** + * Migrate an Azure Cosmos DB MongoDB collection 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 collectionName Cosmos DB collection name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) - PollerFlux, MongoDBDatabaseGetResultsInner> - beginCreateUpdateMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, - MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters); + PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateMongoDBCollectionToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, + String collectionName); /** - * Create or updates Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB collection 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 createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. + * @param collectionName Cosmos DB collection name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 MongoDB database. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, MongoDBDatabaseGetResultsInner> - beginCreateUpdateMongoDBDatabase(String resourceGroupName, String accountName, String databaseName, - MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters); + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateMongoDBCollectionToAutoscale(String resourceGroupName, String accountName, String databaseName, + String collectionName); /** - * Create or updates Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB collection 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 createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. + * @param collectionName Cosmos DB collection name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 MongoDB database. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, MongoDBDatabaseGetResultsInner> - beginCreateUpdateMongoDBDatabase(String resourceGroupName, String accountName, String databaseName, - MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters, Context context); + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateMongoDBCollectionToAutoscale(String resourceGroupName, String accountName, String databaseName, + String collectionName, Context context); /** - * Create or updates Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB collection 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 createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. + * @param collectionName Cosmos DB collection name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 MongoDB database on successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createUpdateMongoDBDatabaseAsync(String resourceGroupName, String accountName, - String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters); + Mono migrateMongoDBCollectionToAutoscaleAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName); /** - * Create or updates Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB collection 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 createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. + * @param collectionName Cosmos DB collection name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 MongoDB database. + * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - MongoDBDatabaseGetResultsInner createUpdateMongoDBDatabase(String resourceGroupName, String accountName, - String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters); + ThroughputSettingsGetResultsInner migrateMongoDBCollectionToAutoscale(String resourceGroupName, String accountName, + String databaseName, String collectionName); /** - * Create or updates Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB collection 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 createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. + * @param collectionName Cosmos DB collection name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 MongoDB database. + * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - MongoDBDatabaseGetResultsInner createUpdateMongoDBDatabase(String resourceGroupName, String accountName, - String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters, - Context context); + ThroughputSettingsGetResultsInner migrateMongoDBCollectionToAutoscale(String resourceGroupName, String accountName, + String databaseName, String collectionName, Context context); /** - * Deletes an existing Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB collection 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 collectionName Cosmos DB collection name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteMongoDBDatabaseWithResponseAsync(String resourceGroupName, - String accountName, String databaseName); + Mono>> migrateMongoDBCollectionToManualThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName); /** - * Deletes an existing Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB collection 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 collectionName Cosmos DB collection name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, Void> beginDeleteMongoDBDatabaseAsync(String resourceGroupName, String accountName, - String databaseName); + PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateMongoDBCollectionToManualThroughputAsync(String resourceGroupName, String accountName, + String databaseName, String collectionName); /** - * Deletes an existing Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB collection 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 collectionName Cosmos DB collection name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeleteMongoDBDatabase(String resourceGroupName, String accountName, - String databaseName); + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateMongoDBCollectionToManualThroughput(String resourceGroupName, String accountName, + String databaseName, String collectionName); /** - * Deletes an existing Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB collection 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 collectionName Cosmos DB collection name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, Void> beginDeleteMongoDBDatabase(String resourceGroupName, String accountName, - String databaseName, Context context); + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateMongoDBCollectionToManualThroughput(String resourceGroupName, String accountName, + String databaseName, String collectionName, Context context); /** - * Deletes an existing Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB collection 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 collectionName Cosmos DB collection name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName); + Mono migrateMongoDBCollectionToManualThroughputAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName); /** - * Deletes an existing Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB collection 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 collectionName Cosmos DB collection name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) - void deleteMongoDBDatabase(String resourceGroupName, String accountName, String databaseName); + ThroughputSettingsGetResultsInner migrateMongoDBCollectionToManualThroughput(String resourceGroupName, + String accountName, String databaseName, String collectionName); /** - * Deletes an existing Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB collection 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 collectionName Cosmos DB collection name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) - void deleteMongoDBDatabase(String resourceGroupName, String accountName, String databaseName, Context context); + ThroughputSettingsGetResultsInner migrateMongoDBCollectionToManualThroughput(String resourceGroupName, + String accountName, String databaseName, String collectionName, Context context); /** - * Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the - * provided name. + * Gets the MongoDB databases 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. @@ -372,16 +1434,15 @@ SyncPoller, Void> beginDeleteMongoDBDatabase(String resourceGro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 MongoDB database under an existing Azure Cosmos DB database account with the - * provided name along with {@link Response} on successful completion of {@link Mono}. + * @return the MongoDB databases 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) - Mono> getMongoDBDatabaseThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName); + Mono> getMongoDBDatabaseWithResponseAsync(String resourceGroupName, + String accountName, String databaseName); /** - * Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the - * provided name. + * Gets the MongoDB databases 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. @@ -389,16 +1450,15 @@ Mono> getMongoDBDatabaseThroughputWi * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 MongoDB database under an existing Azure Cosmos DB database account with the - * provided name on successful completion of {@link Mono}. + * @return the MongoDB databases under an existing Azure Cosmos DB database account with the provided name on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getMongoDBDatabaseThroughputAsync(String resourceGroupName, - String accountName, String databaseName); + Mono getMongoDBDatabaseAsync(String resourceGroupName, String accountName, + String databaseName); /** - * Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the - * provided name. + * Gets the MongoDB databases 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. @@ -407,16 +1467,15 @@ Mono getMongoDBDatabaseThroughputAsync(String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 MongoDB database under an existing Azure Cosmos DB database account with the - * provided name along with {@link Response}. + * @return the MongoDB databases under an existing Azure Cosmos DB database account with the provided name along + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getMongoDBDatabaseThroughputWithResponse(String resourceGroupName, + Response getMongoDBDatabaseWithResponse(String resourceGroupName, String accountName, String databaseName, Context context); /** - * Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the - * provided name. + * Gets the MongoDB databases 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. @@ -424,140 +1483,133 @@ Response getMongoDBDatabaseThroughputWithResp * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 MongoDB database under an existing Azure Cosmos DB database account with the - * provided name. + * @return the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner getMongoDBDatabaseThroughput(String resourceGroupName, String accountName, + MongoDBDatabaseGetResultsInner getMongoDBDatabase(String resourceGroupName, String accountName, String databaseName); /** - * Update RUs per second of the an Azure Cosmos DB MongoDB database. + * Create or updates Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB - * database. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return an Azure Cosmos DB MongoDB database along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateMongoDBDatabaseThroughputWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters); + Mono>> createUpdateMongoDBDatabaseWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, + MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters); /** - * Update RUs per second of the an Azure Cosmos DB MongoDB database. + * Create or updates Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB - * database. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB MongoDB database. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, ThroughputSettingsGetResultsInner> - beginUpdateMongoDBDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, - ThroughputSettingsUpdateParameters updateThroughputParameters); + PollerFlux, MongoDBDatabaseGetResultsInner> + beginCreateUpdateMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, + MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters); /** - * Update RUs per second of the an Azure Cosmos DB MongoDB database. + * Create or updates Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB - * database. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB MongoDB database. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateMongoDBDatabaseThroughput(String resourceGroupName, String accountName, String databaseName, - ThroughputSettingsUpdateParameters updateThroughputParameters); + SyncPoller, MongoDBDatabaseGetResultsInner> + beginCreateUpdateMongoDBDatabase(String resourceGroupName, String accountName, String databaseName, + MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters); /** - * Update RUs per second of the an Azure Cosmos DB MongoDB database. + * Create or updates Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB - * database. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB MongoDB database. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateMongoDBDatabaseThroughput(String resourceGroupName, String accountName, String databaseName, - ThroughputSettingsUpdateParameters updateThroughputParameters, Context context); + SyncPoller, MongoDBDatabaseGetResultsInner> + beginCreateUpdateMongoDBDatabase(String resourceGroupName, String accountName, String databaseName, + MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters, Context context); /** - * Update RUs per second of the an Azure Cosmos DB MongoDB database. + * Create or updates Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB - * database. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return an Azure Cosmos DB MongoDB database on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateMongoDBDatabaseThroughputAsync(String resourceGroupName, - String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters); + Mono createUpdateMongoDBDatabaseAsync(String resourceGroupName, String accountName, + String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters); /** - * Update RUs per second of the an Azure Cosmos DB MongoDB database. + * Create or updates Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB - * database. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return an Azure Cosmos DB MongoDB database. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner updateMongoDBDatabaseThroughput(String resourceGroupName, String accountName, - String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters); + MongoDBDatabaseGetResultsInner createUpdateMongoDBDatabase(String resourceGroupName, String accountName, + String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters); /** - * Update RUs per second of the an Azure Cosmos DB MongoDB database. + * Create or updates Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB - * database. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return an Azure Cosmos DB MongoDB database. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner updateMongoDBDatabaseThroughput(String resourceGroupName, String accountName, - String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context); + MongoDBDatabaseGetResultsInner createUpdateMongoDBDatabase(String resourceGroupName, String accountName, + String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters, + Context context); /** - * Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale. + * Deletes an existing Azure Cosmos DB MongoDB database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -565,15 +1617,14 @@ ThroughputSettingsGetResultsInner updateMongoDBDatabaseThroughput(String resourc * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> migrateMongoDBDatabaseToAutoscaleWithResponseAsync(String resourceGroupName, + Mono>> deleteMongoDBDatabaseWithResponseAsync(String resourceGroupName, String accountName, String databaseName); /** - * Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale. + * Deletes an existing Azure Cosmos DB MongoDB database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -581,14 +1632,14 @@ Mono>> migrateMongoDBDatabaseToAutoscaleWithResponseAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateMongoDBDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName); + PollerFlux, Void> beginDeleteMongoDBDatabaseAsync(String resourceGroupName, String accountName, + String databaseName); /** - * Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale. + * Deletes an existing Azure Cosmos DB MongoDB database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -596,14 +1647,14 @@ Mono>> migrateMongoDBDatabaseToAutoscaleWithResponseAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateMongoDBDatabaseToAutoscale(String resourceGroupName, String accountName, String databaseName); + SyncPoller, Void> beginDeleteMongoDBDatabase(String resourceGroupName, String accountName, + String databaseName); /** - * Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale. + * Deletes an existing Azure Cosmos DB MongoDB database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -612,15 +1663,14 @@ Mono>> migrateMongoDBDatabaseToAutoscaleWithResponseAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateMongoDBDatabaseToAutoscale(String resourceGroupName, String accountName, String databaseName, - Context context); + SyncPoller, Void> beginDeleteMongoDBDatabase(String resourceGroupName, String accountName, + String databaseName, Context context); /** - * Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale. + * Deletes an existing Azure Cosmos DB MongoDB database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -628,14 +1678,13 @@ Mono>> migrateMongoDBDatabaseToAutoscaleWithResponseAs * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono migrateMongoDBDatabaseToAutoscaleAsync(String resourceGroupName, - String accountName, String databaseName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName); /** - * Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale. + * Deletes an existing Azure Cosmos DB MongoDB database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -643,14 +1692,12 @@ Mono migrateMongoDBDatabaseToAutoscaleAsync(S * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) - ThroughputSettingsGetResultsInner migrateMongoDBDatabaseToAutoscale(String resourceGroupName, String accountName, - String databaseName); + void deleteMongoDBDatabase(String resourceGroupName, String accountName, String databaseName); /** - * Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale. + * Deletes an existing Azure Cosmos DB MongoDB database. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -659,171 +1706,175 @@ ThroughputSettingsGetResultsInner migrateMongoDBDatabaseToAutoscale(String resou * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) - ThroughputSettingsGetResultsInner migrateMongoDBDatabaseToAutoscale(String resourceGroupName, String accountName, - String databaseName, Context context); + void deleteMongoDBDatabase(String resourceGroupName, String accountName, String databaseName, Context context); /** - * Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. + * Lists the MongoDB 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 databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return the List operation response, that contains the MongoDB databases and their properties as paginated + * response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> migrateMongoDBDatabaseToManualThroughputWithResponseAsync(String resourceGroupName, - String accountName, String databaseName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listMongoDBDatabasesAsync(String resourceGroupName, String accountName); /** - * Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. + * Lists the MongoDB 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 databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the List operation response, that contains the MongoDB databases and their properties as paginated + * response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateMongoDBDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, - String databaseName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listMongoDBDatabases(String resourceGroupName, String accountName); /** - * Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. + * Lists the MongoDB 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 databaseName Cosmos DB database name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the List operation response, that contains the MongoDB databases and their properties as paginated + * response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateMongoDBDatabaseToManualThroughput(String resourceGroupName, String accountName, - String databaseName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listMongoDBDatabases(String resourceGroupName, String accountName, + Context context); /** - * Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. + * Merges the partitions of a MongoDB 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. + * @param mergeParameters The parameters for the merge operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return list of physical partitions and their properties returned by a merge operation along with + * {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateMongoDBDatabaseToManualThroughput(String resourceGroupName, String accountName, String databaseName, - Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> mongoDBDatabasePartitionMergeWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters); /** - * Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. + * Merges the partitions of a MongoDB 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 mergeParameters The parameters for the merge operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return the {@link PollerFlux} for polling of list of physical partitions and their properties returned by a + * merge operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono migrateMongoDBDatabaseToManualThroughputAsync(String resourceGroupName, - String accountName, String databaseName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, PhysicalPartitionStorageInfoCollectionInner> + beginMongoDBDatabasePartitionMergeAsync(String resourceGroupName, String accountName, String databaseName, + MergeParameters mergeParameters); /** - * Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. + * Merges the partitions of a MongoDB 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 mergeParameters The parameters for the merge operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of list of physical partitions and their properties returned by a + * merge operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner migrateMongoDBDatabaseToManualThroughput(String resourceGroupName, - String accountName, String databaseName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginMongoDBDatabasePartitionMerge(String resourceGroupName, String accountName, String databaseName, + MergeParameters mergeParameters); /** - * Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. + * Merges the partitions of a MongoDB 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 mergeParameters The parameters for the merge operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of list of physical partitions and their properties returned by a + * merge operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner migrateMongoDBDatabaseToManualThroughput(String resourceGroupName, - String accountName, String databaseName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginMongoDBDatabasePartitionMerge(String resourceGroupName, String accountName, String databaseName, + MergeParameters mergeParameters, Context context); /** - * Lists the MongoDB collection under an existing Azure Cosmos DB database account. + * Merges the partitions of a MongoDB 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 mergeParameters The parameters for the merge operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 MongoDB collections and their properties as paginated - * response with {@link PagedFlux}. + * @return list of physical partitions and their properties returned by a merge operation on successful completion + * of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listMongoDBCollectionsAsync(String resourceGroupName, - String accountName, String databaseName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono mongoDBDatabasePartitionMergeAsync(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters); /** - * Lists the MongoDB collection under an existing Azure Cosmos DB database account. + * Merges the partitions of a MongoDB 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 mergeParameters The parameters for the merge operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 MongoDB collections and their properties as paginated - * response with {@link PagedIterable}. + * @return list of physical partitions and their properties returned by a merge operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMongoDBCollections(String resourceGroupName, String accountName, - String databaseName); + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionStorageInfoCollectionInner mongoDBDatabasePartitionMerge(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters); /** - * Lists the MongoDB collection under an existing Azure Cosmos DB database account. + * Merges the partitions of a MongoDB 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 mergeParameters The parameters for the merge operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 MongoDB collections and their properties as paginated - * response with {@link PagedIterable}. + * @return list of physical partitions and their properties returned by a merge operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listMongoDBCollections(String resourceGroupName, String accountName, - String databaseName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionStorageInfoCollectionInner mongoDBDatabasePartitionMerge(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters, Context context); /** * Gets the MongoDB collection under an existing Azure Cosmos DB database account. @@ -1135,448 +2186,307 @@ void deleteMongoDBCollection(String resourceGroupName, String accountName, Strin String collectionName, Context context); /** - * Gets the RUs per second of the MongoDB collection 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 collectionName Cosmos DB collection name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 MongoDB collection 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) - Mono> getMongoDBCollectionThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, String collectionName); - - /** - * Gets the RUs per second of the MongoDB collection 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 collectionName Cosmos DB collection name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 MongoDB collection under an existing Azure Cosmos DB database account with the - * provided name on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getMongoDBCollectionThroughputAsync(String resourceGroupName, - String accountName, String databaseName, String collectionName); - - /** - * Gets the RUs per second of the MongoDB collection 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 collectionName Cosmos DB collection name. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 MongoDB collection under an existing Azure Cosmos DB database account with the - * provided name along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getMongoDBCollectionThroughputWithResponse(String resourceGroupName, - String accountName, String databaseName, String collectionName, Context context); - - /** - * Gets the RUs per second of the MongoDB collection 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 collectionName Cosmos DB collection name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 MongoDB collection under an existing Azure Cosmos DB database account with the - * provided name. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner getMongoDBCollectionThroughput(String resourceGroupName, String accountName, - String databaseName, String collectionName); - - /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. - * - * @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 collectionName Cosmos DB collection name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB - * collection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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) - Mono>> updateMongoDBCollectionThroughputWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String collectionName, - ThroughputSettingsUpdateParameters updateThroughputParameters); - - /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. - * - * @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 collectionName Cosmos DB collection name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB - * collection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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) - PollerFlux, ThroughputSettingsGetResultsInner> - beginUpdateMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, - String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters); - - /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. - * - * @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 collectionName Cosmos DB collection name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB - * collection. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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) - SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateMongoDBCollectionThroughput(String resourceGroupName, String accountName, String databaseName, - String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters); - - /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. - * - * @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 collectionName Cosmos DB collection name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB - * collection. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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) - SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateMongoDBCollectionThroughput(String resourceGroupName, String accountName, String databaseName, - String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context); - - /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * Lists the MongoDB collection 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 collectionName Cosmos DB collection name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB - * collection. + * @param databaseName Cosmos DB database name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return the List operation response, that contains the MongoDB collections and their properties as paginated + * response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateMongoDBCollectionThroughputAsync(String resourceGroupName, - String accountName, String databaseName, String collectionName, - ThroughputSettingsUpdateParameters updateThroughputParameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listMongoDBCollectionsAsync(String resourceGroupName, + String accountName, String databaseName); /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * Lists the MongoDB collection 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 collectionName Cosmos DB collection name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB - * collection. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the List operation response, that contains the MongoDB collections and their properties as paginated + * response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner updateMongoDBCollectionThroughput(String resourceGroupName, String accountName, - String databaseName, String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listMongoDBCollections(String resourceGroupName, String accountName, + String databaseName); /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * Lists the MongoDB collection 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 collectionName Cosmos DB collection name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB - * collection. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the List operation response, that contains the MongoDB collections and their properties as paginated + * response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner updateMongoDBCollectionThroughput(String resourceGroupName, String accountName, - String databaseName, String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, - Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listMongoDBCollections(String resourceGroupName, String accountName, + String databaseName, Context context); /** - * Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale. + * Merges the partitions of a MongoDB Collection. * * @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 collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return list of physical partitions and their properties returned by a merge operation along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> migrateMongoDBCollectionToAutoscaleWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String collectionName); + Mono>> listMongoDBCollectionPartitionMergeWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName, MergeParameters mergeParameters); /** - * Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale. + * Merges the partitions of a MongoDB Collection. * * @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 collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link PollerFlux} for polling of list of physical partitions and their properties returned by a + * merge operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateMongoDBCollectionToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, - String collectionName); + PollerFlux, PhysicalPartitionStorageInfoCollectionInner> + beginListMongoDBCollectionPartitionMergeAsync(String resourceGroupName, String accountName, String databaseName, + String collectionName, MergeParameters mergeParameters); /** - * Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale. + * Merges the partitions of a MongoDB Collection. * * @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 collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of list of physical partitions and their properties returned by a + * merge operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateMongoDBCollectionToAutoscale(String resourceGroupName, String accountName, String databaseName, - String collectionName); + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginListMongoDBCollectionPartitionMerge(String resourceGroupName, String accountName, String databaseName, + String collectionName, MergeParameters mergeParameters); /** - * Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale. + * Merges the partitions of a MongoDB Collection. * * @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 collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of list of physical partitions and their properties returned by a + * merge operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateMongoDBCollectionToAutoscale(String resourceGroupName, String accountName, String databaseName, - String collectionName, Context context); + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginListMongoDBCollectionPartitionMerge(String resourceGroupName, String accountName, String databaseName, + String collectionName, MergeParameters mergeParameters, Context context); /** - * Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale. + * Merges the partitions of a MongoDB Collection. * * @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 collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return list of physical partitions and their properties returned by a merge operation on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono migrateMongoDBCollectionToAutoscaleAsync(String resourceGroupName, - String accountName, String databaseName, String collectionName); + Mono listMongoDBCollectionPartitionMergeAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName, MergeParameters mergeParameters); /** - * Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale. + * Merges the partitions of a MongoDB Collection. * * @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 collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return list of physical partitions and their properties returned by a merge operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner migrateMongoDBCollectionToAutoscale(String resourceGroupName, String accountName, - String databaseName, String collectionName); + PhysicalPartitionStorageInfoCollectionInner listMongoDBCollectionPartitionMerge(String resourceGroupName, + String accountName, String databaseName, String collectionName, MergeParameters mergeParameters); /** - * Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale. + * Merges the partitions of a MongoDB Collection. * * @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 collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge operation. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return list of physical partitions and their properties returned by a merge operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner migrateMongoDBCollectionToAutoscale(String resourceGroupName, String accountName, - String databaseName, String collectionName, Context context); + PhysicalPartitionStorageInfoCollectionInner listMongoDBCollectionPartitionMerge(String resourceGroupName, + String accountName, String databaseName, String collectionName, MergeParameters mergeParameters, + Context context); /** - * Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput. + * Retrieves continuous backup information for a Mongodb collection. * * @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 collectionName Cosmos DB collection name. + * @param location The name of the continuous backup restore location. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> migrateMongoDBCollectionToManualThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, String collectionName); + Mono>> retrieveContinuousBackupInformationWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName, ContinuousBackupRestoreLocation location); /** - * Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput. + * Retrieves continuous backup information for a Mongodb collection. * * @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 collectionName Cosmos DB collection name. + * @param location The name of the continuous backup restore location. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateMongoDBCollectionToManualThroughputAsync(String resourceGroupName, String accountName, - String databaseName, String collectionName); + PollerFlux, BackupInformationInner> + beginRetrieveContinuousBackupInformationAsync(String resourceGroupName, String accountName, String databaseName, + String collectionName, ContinuousBackupRestoreLocation location); /** - * Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput. + * Retrieves continuous backup information for a Mongodb collection. * * @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 collectionName Cosmos DB collection name. + * @param location The name of the continuous backup restore location. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateMongoDBCollectionToManualThroughput(String resourceGroupName, String accountName, - String databaseName, String collectionName); + SyncPoller, BackupInformationInner> beginRetrieveContinuousBackupInformation( + String resourceGroupName, String accountName, String databaseName, String collectionName, + ContinuousBackupRestoreLocation location); /** - * Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput. + * Retrieves continuous backup information for a Mongodb collection. * * @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 collectionName Cosmos DB collection name. + * @param location The name of the continuous backup restore location. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateMongoDBCollectionToManualThroughput(String resourceGroupName, String accountName, - String databaseName, String collectionName, Context context); + SyncPoller, BackupInformationInner> beginRetrieveContinuousBackupInformation( + String resourceGroupName, String accountName, String databaseName, String collectionName, + ContinuousBackupRestoreLocation location, Context context); /** - * Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput. + * Retrieves continuous backup information for a Mongodb collection. * * @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 collectionName Cosmos DB collection name. + * @param location The name of the continuous backup restore location. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono migrateMongoDBCollectionToManualThroughputAsync(String resourceGroupName, - String accountName, String databaseName, String collectionName); + Mono retrieveContinuousBackupInformationAsync(String resourceGroupName, String accountName, + String databaseName, String collectionName, ContinuousBackupRestoreLocation location); /** - * Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput. + * Retrieves continuous backup information for a Mongodb collection. * * @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 collectionName Cosmos DB collection name. + * @param location The name of the continuous backup restore location. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner migrateMongoDBCollectionToManualThroughput(String resourceGroupName, - String accountName, String databaseName, String collectionName); + BackupInformationInner retrieveContinuousBackupInformation(String resourceGroupName, String accountName, + String databaseName, String collectionName, ContinuousBackupRestoreLocation location); /** - * Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput. + * Retrieves continuous backup information for a Mongodb collection. * * @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 collectionName Cosmos DB collection name. + * @param location The name of the continuous backup restore location. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner migrateMongoDBCollectionToManualThroughput(String resourceGroupName, - String accountName, String databaseName, String collectionName, Context context); + BackupInformationInner retrieveContinuousBackupInformation(String resourceGroupName, String accountName, + String databaseName, String collectionName, ContinuousBackupRestoreLocation location, Context context); /** * Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. @@ -2237,128 +3147,4 @@ PagedIterable listMongoUserDefinitions(Strin @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listMongoUserDefinitions(String resourceGroupName, String accountName, Context context); - - /** - * Retrieves continuous backup information for a Mongodb collection. - * - * @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 collectionName Cosmos DB collection name. - * @param location The name of the continuous backup restore location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup information of a resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> retrieveContinuousBackupInformationWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String collectionName, ContinuousBackupRestoreLocation location); - - /** - * Retrieves continuous backup information for a Mongodb collection. - * - * @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 collectionName Cosmos DB collection name. - * @param location The name of the continuous backup restore location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 backup information of a resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, BackupInformationInner> - beginRetrieveContinuousBackupInformationAsync(String resourceGroupName, String accountName, String databaseName, - String collectionName, ContinuousBackupRestoreLocation location); - - /** - * Retrieves continuous backup information for a Mongodb collection. - * - * @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 collectionName Cosmos DB collection name. - * @param location The name of the continuous backup restore location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 backup information of a resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BackupInformationInner> beginRetrieveContinuousBackupInformation( - String resourceGroupName, String accountName, String databaseName, String collectionName, - ContinuousBackupRestoreLocation location); - - /** - * Retrieves continuous backup information for a Mongodb collection. - * - * @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 collectionName Cosmos DB collection name. - * @param location The name of the continuous backup restore location. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 backup information of a resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BackupInformationInner> beginRetrieveContinuousBackupInformation( - String resourceGroupName, String accountName, String databaseName, String collectionName, - ContinuousBackupRestoreLocation location, Context context); - - /** - * Retrieves continuous backup information for a Mongodb collection. - * - * @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 collectionName Cosmos DB collection name. - * @param location The name of the continuous backup restore location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup information of a resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono retrieveContinuousBackupInformationAsync(String resourceGroupName, String accountName, - String databaseName, String collectionName, ContinuousBackupRestoreLocation location); - - /** - * Retrieves continuous backup information for a Mongodb collection. - * - * @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 collectionName Cosmos DB collection name. - * @param location The name of the continuous backup restore location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup information of a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupInformationInner retrieveContinuousBackupInformation(String resourceGroupName, String accountName, - String databaseName, String collectionName, ContinuousBackupRestoreLocation location); - - /** - * Retrieves continuous backup information for a Mongodb collection. - * - * @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 collectionName Cosmos DB collection name. - * @param location The name of the continuous backup restore location. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup information of a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupInformationInner retrieveContinuousBackupInformation(String resourceGroupName, String accountName, - String databaseName, String collectionName, ContinuousBackupRestoreLocation location, Context context); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/MongoMIResourcesClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/MongoMIResourcesClient.java new file mode 100644 index 000000000000..c95efa3d71b4 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/MongoMIResourcesClient.java @@ -0,0 +1,699 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cosmos.fluent.models.MongoMIRoleAssignmentResourceInner; +import com.azure.resourcemanager.cosmos.fluent.models.MongoMIRoleDefinitionResourceInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in MongoMIResourcesClient. + */ +public interface MongoMIResourcesClient { + /** + * Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Definition with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return parameters to create and update an Azure Cosmos DB MongoMI Role Definition along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getMongoMIRoleDefinitionWithResponseAsync( + String resourceGroupName, String accountName, String roleDefinitionId); + + /** + * Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Definition with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return parameters to create and update an Azure Cosmos DB MongoMI Role Definition on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getMongoMIRoleDefinitionAsync(String resourceGroupName, String accountName, + String roleDefinitionId); + + /** + * Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Definition with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return parameters to create and update an Azure Cosmos DB MongoMI Role Definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getMongoMIRoleDefinitionWithResponse(String resourceGroupName, + String accountName, String roleDefinitionId, Context context); + + /** + * Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Definition with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return parameters to create and update an Azure Cosmos DB MongoMI Role Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MongoMIRoleDefinitionResourceInner getMongoMIRoleDefinition(String resourceGroupName, String accountName, + String roleDefinitionId); + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateMongoMIRoleDefinitionParameters The properties required to create or update a Role Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return parameters to create and update an Azure Cosmos DB MongoMI Role Definition along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> createUpdateMongoMIRoleDefinitionWithResponseAsync(String resourceGroupName, + String accountName, String roleDefinitionId, + MongoMIRoleDefinitionResourceInner createUpdateMongoMIRoleDefinitionParameters); + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateMongoMIRoleDefinitionParameters The properties required to create or update a Role Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 parameters to create and update an Azure Cosmos DB MongoMI Role + * Definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, MongoMIRoleDefinitionResourceInner> + beginCreateUpdateMongoMIRoleDefinitionAsync(String resourceGroupName, String accountName, + String roleDefinitionId, MongoMIRoleDefinitionResourceInner createUpdateMongoMIRoleDefinitionParameters); + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateMongoMIRoleDefinitionParameters The properties required to create or update a Role Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 parameters to create and update an Azure Cosmos DB MongoMI Role + * Definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MongoMIRoleDefinitionResourceInner> + beginCreateUpdateMongoMIRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId, + MongoMIRoleDefinitionResourceInner createUpdateMongoMIRoleDefinitionParameters); + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateMongoMIRoleDefinitionParameters The properties required to create or update a Role Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 parameters to create and update an Azure Cosmos DB MongoMI Role + * Definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MongoMIRoleDefinitionResourceInner> + beginCreateUpdateMongoMIRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId, + MongoMIRoleDefinitionResourceInner createUpdateMongoMIRoleDefinitionParameters, Context context); + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateMongoMIRoleDefinitionParameters The properties required to create or update a Role Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return parameters to create and update an Azure Cosmos DB MongoMI Role Definition on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createUpdateMongoMIRoleDefinitionAsync(String resourceGroupName, + String accountName, String roleDefinitionId, + MongoMIRoleDefinitionResourceInner createUpdateMongoMIRoleDefinitionParameters); + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateMongoMIRoleDefinitionParameters The properties required to create or update a Role Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return parameters to create and update an Azure Cosmos DB MongoMI Role Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MongoMIRoleDefinitionResourceInner createUpdateMongoMIRoleDefinition(String resourceGroupName, String accountName, + String roleDefinitionId, MongoMIRoleDefinitionResourceInner createUpdateMongoMIRoleDefinitionParameters); + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateMongoMIRoleDefinitionParameters The properties required to create or update a Role Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return parameters to create and update an Azure Cosmos DB MongoMI Role Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MongoMIRoleDefinitionResourceInner createUpdateMongoMIRoleDefinition(String resourceGroupName, String accountName, + String roleDefinitionId, MongoMIRoleDefinitionResourceInner createUpdateMongoMIRoleDefinitionParameters, + Context context); + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono>> deleteMongoMIRoleDefinitionWithResponseAsync(String resourceGroupName, + String accountName, String roleDefinitionId); + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PollerFlux, Void> beginDeleteMongoMIRoleDefinitionAsync(String resourceGroupName, + String accountName, String roleDefinitionId); + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, Void> beginDeleteMongoMIRoleDefinition(String resourceGroupName, String accountName, + String roleDefinitionId); + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, Void> beginDeleteMongoMIRoleDefinition(String resourceGroupName, String accountName, + String roleDefinitionId, Context context); + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono deleteMongoMIRoleDefinitionAsync(String resourceGroupName, String accountName, String roleDefinitionId); + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + void deleteMongoMIRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId); + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + void deleteMongoMIRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId, + Context context); + + /** + * Retrieves the list of all Azure Cosmos DB MongoMI Role Definitions. + * + * @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 com.azure.core.management.exception.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 response of a MongoMIRoleDefinitionResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listMongoMIRoleDefinitionsAsync(String resourceGroupName, + String accountName); + + /** + * Retrieves the list of all Azure Cosmos DB MongoMI Role Definitions. + * + * @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 com.azure.core.management.exception.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 response of a MongoMIRoleDefinitionResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listMongoMIRoleDefinitions(String resourceGroupName, + String accountName); + + /** + * Retrieves the list of all Azure Cosmos DB MongoMI Role Definitions. + * + * @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 com.azure.core.management.exception.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 response of a MongoMIRoleDefinitionResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listMongoMIRoleDefinitions(String resourceGroupName, + String accountName, Context context); + + /** + * Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Assignment with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return parameters to create and update an Azure Cosmos DB MongoMI Role Assignment along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getMongoMIRoleAssignmentWithResponseAsync( + String resourceGroupName, String accountName, String roleAssignmentId); + + /** + * Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Assignment with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return parameters to create and update an Azure Cosmos DB MongoMI Role Assignment on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getMongoMIRoleAssignmentAsync(String resourceGroupName, String accountName, + String roleAssignmentId); + + /** + * Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Assignment with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return parameters to create and update an Azure Cosmos DB MongoMI Role Assignment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getMongoMIRoleAssignmentWithResponse(String resourceGroupName, + String accountName, String roleAssignmentId, Context context); + + /** + * Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Assignment with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return parameters to create and update an Azure Cosmos DB MongoMI Role Assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MongoMIRoleAssignmentResourceInner getMongoMIRoleAssignment(String resourceGroupName, String accountName, + String roleAssignmentId); + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateMongoMIRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return parameters to create and update an Azure Cosmos DB MongoMI Role Assignment along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> createUpdateMongoMIRoleAssignmentWithResponseAsync(String resourceGroupName, + String accountName, String roleAssignmentId, + MongoMIRoleAssignmentResourceInner createUpdateMongoMIRoleAssignmentParameters); + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateMongoMIRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 parameters to create and update an Azure Cosmos DB MongoMI Role + * Assignment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, MongoMIRoleAssignmentResourceInner> + beginCreateUpdateMongoMIRoleAssignmentAsync(String resourceGroupName, String accountName, + String roleAssignmentId, MongoMIRoleAssignmentResourceInner createUpdateMongoMIRoleAssignmentParameters); + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateMongoMIRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 parameters to create and update an Azure Cosmos DB MongoMI Role + * Assignment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MongoMIRoleAssignmentResourceInner> + beginCreateUpdateMongoMIRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId, + MongoMIRoleAssignmentResourceInner createUpdateMongoMIRoleAssignmentParameters); + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateMongoMIRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 parameters to create and update an Azure Cosmos DB MongoMI Role + * Assignment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, MongoMIRoleAssignmentResourceInner> + beginCreateUpdateMongoMIRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId, + MongoMIRoleAssignmentResourceInner createUpdateMongoMIRoleAssignmentParameters, Context context); + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateMongoMIRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return parameters to create and update an Azure Cosmos DB MongoMI Role Assignment on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createUpdateMongoMIRoleAssignmentAsync(String resourceGroupName, + String accountName, String roleAssignmentId, + MongoMIRoleAssignmentResourceInner createUpdateMongoMIRoleAssignmentParameters); + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateMongoMIRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return parameters to create and update an Azure Cosmos DB MongoMI Role Assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MongoMIRoleAssignmentResourceInner createUpdateMongoMIRoleAssignment(String resourceGroupName, String accountName, + String roleAssignmentId, MongoMIRoleAssignmentResourceInner createUpdateMongoMIRoleAssignmentParameters); + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateMongoMIRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return parameters to create and update an Azure Cosmos DB MongoMI Role Assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + MongoMIRoleAssignmentResourceInner createUpdateMongoMIRoleAssignment(String resourceGroupName, String accountName, + String roleAssignmentId, MongoMIRoleAssignmentResourceInner createUpdateMongoMIRoleAssignmentParameters, + Context context); + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono>> deleteMongoMIRoleAssignmentWithResponseAsync(String resourceGroupName, + String accountName, String roleAssignmentId); + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PollerFlux, Void> beginDeleteMongoMIRoleAssignmentAsync(String resourceGroupName, + String accountName, String roleAssignmentId); + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, Void> beginDeleteMongoMIRoleAssignment(String resourceGroupName, String accountName, + String roleAssignmentId); + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, Void> beginDeleteMongoMIRoleAssignment(String resourceGroupName, String accountName, + String roleAssignmentId, Context context); + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono deleteMongoMIRoleAssignmentAsync(String resourceGroupName, String accountName, String roleAssignmentId); + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + void deleteMongoMIRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId); + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + void deleteMongoMIRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId, + Context context); + + /** + * Retrieves the list of all Azure Cosmos DB MongoMI Role Assignments. + * + * @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 com.azure.core.management.exception.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 response of a MongoMIRoleAssignmentResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listMongoMIRoleAssignmentsAsync(String resourceGroupName, + String accountName); + + /** + * Retrieves the list of all Azure Cosmos DB MongoMI Role Assignments. + * + * @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 com.azure.core.management.exception.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 response of a MongoMIRoleAssignmentResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listMongoMIRoleAssignments(String resourceGroupName, + String accountName); + + /** + * Retrieves the list of all Azure Cosmos DB MongoMI Role Assignments. + * + * @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 com.azure.core.management.exception.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 response of a MongoMIRoleAssignmentResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listMongoMIRoleAssignments(String resourceGroupName, + String accountName, Context context); +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/NetworkSecurityPerimeterConfigurationsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/NetworkSecurityPerimeterConfigurationsClient.java new file mode 100644 index 000000000000..75aa08a90abe --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/NetworkSecurityPerimeterConfigurationsClient.java @@ -0,0 +1,236 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cosmos.fluent.models.NetworkSecurityPerimeterConfigurationInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * NetworkSecurityPerimeterConfigurationsClient. + */ +public interface NetworkSecurityPerimeterConfigurationsClient { + /** + * Gets effective Network Security Perimeter Configuration for association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return effective Network Security Perimeter Configuration for association along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, + String accountName, String networkSecurityPerimeterConfigurationName); + + /** + * Gets effective Network Security Perimeter Configuration for association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return effective Network Security Perimeter Configuration for association on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName); + + /** + * Gets effective Network Security Perimeter Configuration for association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return effective Network Security Perimeter Configuration for association along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName, Context context); + + /** + * Gets effective Network Security Perimeter Configuration for association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return effective Network Security Perimeter Configuration for association. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + NetworkSecurityPerimeterConfigurationInner get(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName); + + /** + * Gets list of effective Network Security Perimeter Configuration for cosmos db 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of effective Network Security Perimeter Configuration for cosmos db account as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String accountName); + + /** + * Gets list of effective Network Security Perimeter Configuration for cosmos db 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of effective Network Security Perimeter Configuration for cosmos db account as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); + + /** + * Gets list of effective Network Security Perimeter Configuration for cosmos db 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 com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of effective Network Security Perimeter Configuration for cosmos db account as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, + Context context); + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono>> reconcileWithResponseAsync(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName); + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PollerFlux, Void> beginReconcileAsync(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName); + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, Void> beginReconcile(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName); + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, Void> beginReconcile(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName, Context context); + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono reconcileAsync(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName); + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + void reconcile(String resourceGroupName, String accountName, String networkSecurityPerimeterConfigurationName); + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + void reconcile(String resourceGroupName, String accountName, String networkSecurityPerimeterConfigurationName, + Context context); +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/NotebookWorkspacesClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/NotebookWorkspacesClient.java index aec1a131bcd7..2c57a40d9085 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/NotebookWorkspacesClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/NotebookWorkspacesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; @@ -25,50 +25,6 @@ * An instance of this class provides access to all the operations defined in NotebookWorkspacesClient. */ public interface NotebookWorkspacesClient { - /** - * Gets the notebook workspace resources of an existing Cosmos DB 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 com.azure.core.management.exception.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 notebook workspace resources of an existing Cosmos DB account as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByDatabaseAccountAsync(String resourceGroupName, String accountName); - - /** - * Gets the notebook workspace resources of an existing Cosmos DB 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 com.azure.core.management.exception.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 notebook workspace resources of an existing Cosmos DB account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName); - - /** - * Gets the notebook workspace resources of an existing Cosmos DB 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 com.azure.core.management.exception.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 notebook workspace resources of an existing Cosmos DB account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName, - Context context); - /** * Gets the notebook workspace for a Cosmos DB account. * @@ -355,6 +311,50 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String void delete(String resourceGroupName, String accountName, NotebookWorkspaceName notebookWorkspaceName, Context context); + /** + * Gets the notebook workspace resources of an existing Cosmos DB 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 com.azure.core.management.exception.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 notebook workspace resources of an existing Cosmos DB account as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByDatabaseAccountAsync(String resourceGroupName, String accountName); + + /** + * Gets the notebook workspace resources of an existing Cosmos DB 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 com.azure.core.management.exception.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 notebook workspace resources of an existing Cosmos DB account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName); + + /** + * Gets the notebook workspace resources of an existing Cosmos DB 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 com.azure.core.management.exception.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 notebook workspace resources of an existing Cosmos DB account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName, + Context context); + /** * Retrieves the connection info for the notebook workspace. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/OperationsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/OperationsClient.java index 72c2ffad4dde..9ae5284d6dd5 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/OperationsClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/OperationsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/PartitionKeyRangeIdRegionsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/PartitionKeyRangeIdRegionsClient.java index d05d38bd0281..d4b1e246d08e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/PartitionKeyRangeIdRegionsClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/PartitionKeyRangeIdRegionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/PartitionKeyRangeIdsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/PartitionKeyRangeIdsClient.java index e202fc071f92..e816a9171430 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/PartitionKeyRangeIdsClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/PartitionKeyRangeIdsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/PercentileSourceTargetsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/PercentileSourceTargetsClient.java index 03c2b2cbd3c4..eb7d231fe6ca 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/PercentileSourceTargetsClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/PercentileSourceTargetsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/PercentileTargetsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/PercentileTargetsClient.java index e472ba6c25aa..153b1c1ac4ff 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/PercentileTargetsClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/PercentileTargetsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/PercentilesClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/PercentilesClient.java index ad402987839a..090924f4a1bf 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/PercentilesClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/PercentilesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/PrivateEndpointConnectionsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/PrivateEndpointConnectionsClient.java index 4ca675967b12..1cce1386ecce 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/PrivateEndpointConnectionsClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/PrivateEndpointConnectionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; @@ -22,47 +22,6 @@ * An instance of this class provides access to all the operations defined in PrivateEndpointConnectionsClient. */ public interface PrivateEndpointConnectionsClient { - /** - * List all private endpoint connections on a Cosmos DB 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 com.azure.core.management.exception.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 list of private endpoint connections as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByDatabaseAccountAsync(String resourceGroupName, String accountName); - - /** - * List all private endpoint connections on a Cosmos DB 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 com.azure.core.management.exception.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 list of private endpoint connections as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName); - - /** - * List all private endpoint connections on a Cosmos DB 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 com.azure.core.management.exception.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 list of private endpoint connections as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName, - Context context); - /** * Gets a private endpoint connection. * @@ -342,4 +301,45 @@ SyncPoller, Void> beginDelete(String resourceGroupName, String */ @ServiceMethod(returns = ReturnType.SINGLE) void delete(String resourceGroupName, String accountName, String privateEndpointConnectionName, Context context); + + /** + * List all private endpoint connections on a Cosmos DB 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 com.azure.core.management.exception.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 list of private endpoint connections as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByDatabaseAccountAsync(String resourceGroupName, String accountName); + + /** + * List all private endpoint connections on a Cosmos DB 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 com.azure.core.management.exception.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 list of private endpoint connections as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName); + + /** + * List all private endpoint connections on a Cosmos DB 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 com.azure.core.management.exception.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 list of private endpoint connections as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName, + Context context); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/PrivateLinkResourcesClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/PrivateLinkResourcesClient.java index 1380cd304602..7bec0f35a305 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/PrivateLinkResourcesClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/PrivateLinkResourcesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; @@ -22,43 +22,46 @@ public interface PrivateLinkResourcesClient { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. + * @param groupName The name of the private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 private link resources that need to be created for a Cosmos DB account as paginated response with - * {@link PagedFlux}. + * @return the private link resources that need to be created for a Cosmos DB account along with {@link Response} on + * successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listByDatabaseAccountAsync(String resourceGroupName, String accountName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String groupName); /** * Gets the private link resources that need to be created for a Cosmos DB account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. + * @param groupName The name of the private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 private link resources that need to be created for a Cosmos DB account as paginated response with - * {@link PagedIterable}. + * @return the private link resources that need to be created for a Cosmos DB account on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String accountName, String groupName); /** * Gets the private link resources that need to be created for a Cosmos DB account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. + * @param groupName The name of the private link resource. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 private link resources that need to be created for a Cosmos DB account as paginated response with - * {@link PagedIterable}. + * @return the private link resources that need to be created for a Cosmos DB account along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName, + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, String groupName, Context context); /** @@ -70,55 +73,52 @@ PagedIterable listByDatabaseAccount(String resourceGro * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 private link resources that need to be created for a Cosmos DB account along with {@link Response} on - * successful completion of {@link Mono}. + * @return the private link resources that need to be created for a Cosmos DB account. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String resourceGroupName, String accountName, - String groupName); + PrivateLinkResourceInner get(String resourceGroupName, String accountName, String groupName); /** * Gets the private link resources that need to be created for a Cosmos DB account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param groupName The name of the private link resource. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 private link resources that need to be created for a Cosmos DB account on successful completion of - * {@link Mono}. + * @return the private link resources that need to be created for a Cosmos DB account as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String accountName, String groupName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByDatabaseAccountAsync(String resourceGroupName, String accountName); /** * Gets the private link resources that need to be created for a Cosmos DB account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param groupName The name of the private link resource. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 private link resources that need to be created for a Cosmos DB account along with {@link Response}. + * @return the private link resources that need to be created for a Cosmos DB account as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String accountName, String groupName, - Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName); /** * Gets the private link resources that need to be created for a Cosmos DB account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param groupName The name of the private link resource. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 private link resources that need to be created for a Cosmos DB account. + * @return the private link resources that need to be created for a Cosmos DB account as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - PrivateLinkResourceInner get(String resourceGroupName, String accountName, String groupName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName, + Context context); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableDatabaseAccountsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableDatabaseAccountsClient.java index 914c13e6d03a..a80a5fe6e298 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableDatabaseAccountsClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableDatabaseAccountsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; @@ -17,6 +17,66 @@ * An instance of this class provides access to all the operations defined in RestorableDatabaseAccountsClient. */ public interface RestorableDatabaseAccountsClient { + /** + * Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires + * 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. + * + * @param location Cosmos DB region, with spaces between words and each word capitalized. + * @param instanceId The instanceId GUID of a restorable database account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Azure Cosmos DB restorable database account along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getByLocationWithResponseAsync(String location, + String instanceId); + + /** + * Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires + * 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. + * + * @param location Cosmos DB region, with spaces between words and each word capitalized. + * @param instanceId The instanceId GUID of a restorable database account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Azure Cosmos DB restorable database account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getByLocationAsync(String location, String instanceId); + + /** + * Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires + * 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. + * + * @param location Cosmos DB region, with spaces between words and each word capitalized. + * @param instanceId The instanceId GUID of a restorable database account. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Azure Cosmos DB restorable database account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByLocationWithResponse(String location, String instanceId, + Context context); + + /** + * Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires + * 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. + * + * @param location Cosmos DB region, with spaces between words and each word capitalized. + * @param instanceId The instanceId GUID of a restorable database account. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Azure Cosmos DB restorable database account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + RestorableDatabaseAccountGetResultInner getByLocation(String location, String instanceId); + /** * Lists all the restorable Azure Cosmos DB database accounts available under the subscription and in a region. This * call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. @@ -97,64 +157,4 @@ public interface RestorableDatabaseAccountsClient { */ @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable list(Context context); - - /** - * Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires - * 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. - * - * @param location Cosmos DB region, with spaces between words and each word capitalized. - * @param instanceId The instanceId GUID of a restorable database account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 Azure Cosmos DB restorable database account along with {@link Response} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getByLocationWithResponseAsync(String location, - String instanceId); - - /** - * Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires - * 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. - * - * @param location Cosmos DB region, with spaces between words and each word capitalized. - * @param instanceId The instanceId GUID of a restorable database account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 Azure Cosmos DB restorable database account on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getByLocationAsync(String location, String instanceId); - - /** - * Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires - * 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. - * - * @param location Cosmos DB region, with spaces between words and each word capitalized. - * @param instanceId The instanceId GUID of a restorable database account. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 Azure Cosmos DB restorable database account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getByLocationWithResponse(String location, String instanceId, - Context context); - - /** - * Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires - * 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. - * - * @param location Cosmos DB region, with spaces between words and each word capitalized. - * @param instanceId The instanceId GUID of a restorable database account. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 Azure Cosmos DB restorable database account. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - RestorableDatabaseAccountGetResultInner getByLocation(String location, String instanceId); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableGremlinDatabasesClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableGremlinDatabasesClient.java index 51a7cd894b5f..9d3a4db3b5ad 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableGremlinDatabasesClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableGremlinDatabasesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableGremlinGraphsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableGremlinGraphsClient.java index 9ee4efb2bd00..9696c736c773 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableGremlinGraphsClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableGremlinGraphsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableGremlinResourcesClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableGremlinResourcesClient.java index 08f60ef2ba48..cd940025e3b6 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableGremlinResourcesClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableGremlinResourcesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableMongodbCollectionsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableMongodbCollectionsClient.java index b390c821228c..c10d035decda 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableMongodbCollectionsClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableMongodbCollectionsClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableMongodbDatabasesClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableMongodbDatabasesClient.java index d0bcc4bd738e..a806315f6077 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableMongodbDatabasesClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableMongodbDatabasesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableMongodbResourcesClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableMongodbResourcesClient.java index a320e270c1bd..fed717906458 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableMongodbResourcesClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableMongodbResourcesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableSqlContainersClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableSqlContainersClient.java index b1ca360cbdf3..2533dc1a4314 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableSqlContainersClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableSqlContainersClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableSqlDatabasesClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableSqlDatabasesClient.java index 94ab55e98bc5..d29a598799ee 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableSqlDatabasesClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableSqlDatabasesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableSqlResourcesClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableSqlResourcesClient.java index bf5788eecb84..8672d673f97a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableSqlResourcesClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableSqlResourcesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableTableResourcesClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableTableResourcesClient.java index 721f2e125669..3d4a3b8f5854 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableTableResourcesClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableTableResourcesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableTablesClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableTablesClient.java index 3ca2af141238..5d55d02a69a8 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableTablesClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableTablesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ServicesClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ServicesClient.java index 530e2427234c..8712f02b0827 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ServicesClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ServicesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; @@ -28,40 +28,59 @@ public interface ServicesClient { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. + * @param serviceName Cosmos DB service name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 status of service as paginated response with {@link PagedFlux}. + * @return the status of service along with {@link Response} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listAsync(String resourceGroupName, String accountName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String serviceName); /** * Gets the status of service. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. + * @param serviceName Cosmos DB service name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 status of service as paginated response with {@link PagedIterable}. + * @return the status of service on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String accountName, String serviceName); /** * Gets the status of service. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. + * @param serviceName Cosmos DB service name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 status of service as paginated response with {@link PagedIterable}. + * @return the status of service along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable list(String resourceGroupName, String accountName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String accountName, String serviceName, + Context context); + + /** + * Gets the status of service. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param serviceName Cosmos DB service name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 status of service. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ServiceResourceInner get(String resourceGroupName, String accountName, String serviceName); /** * Creates a service. @@ -179,7 +198,7 @@ ServiceResourceInner create(String resourceGroupName, String accountName, String ServiceResourceCreateUpdateParameters createUpdateParameters, Context context); /** - * Gets the status of service. + * Deletes service with the given serviceName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -187,44 +206,29 @@ ServiceResourceInner create(String resourceGroupName, String accountName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 status of service along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getWithResponseAsync(String resourceGroupName, String accountName, + Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, String serviceName); /** - * Gets the status of service. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName Cosmos DB database account name. - * @param serviceName Cosmos DB service name. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 status of service on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono getAsync(String resourceGroupName, String accountName, String serviceName); - - /** - * Gets the status of service. + * Deletes service with the given serviceName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param serviceName Cosmos DB service name. - * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 status of service along with {@link Response}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Response getWithResponse(String resourceGroupName, String accountName, String serviceName, - Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String accountName, + String serviceName); /** - * Gets the status of service. + * Deletes service with the given serviceName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -232,10 +236,10 @@ Response getWithResponse(String resourceGroupName, String * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 status of service. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - ServiceResourceInner get(String resourceGroupName, String accountName, String serviceName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, String serviceName); /** * Deletes service with the given serviceName. @@ -243,14 +247,15 @@ Response getWithResponse(String resourceGroupName, String * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param serviceName Cosmos DB service name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, - String serviceName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, String serviceName, + Context context); /** * Deletes service with the given serviceName. @@ -261,11 +266,10 @@ Mono>> deleteWithResponseAsync(String resourceGroupNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return A {@link Mono} that completes when a successful response is received. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String accountName, - String serviceName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono deleteAsync(String resourceGroupName, String accountName, String serviceName); /** * Deletes service with the given serviceName. @@ -276,10 +280,9 @@ PollerFlux, Void> beginDeleteAsync(String resourceGroupName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) - SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, String serviceName); + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String serviceName); /** * Deletes service with the given serviceName. @@ -291,50 +294,47 @@ PollerFlux, Void> beginDeleteAsync(String resourceGroupName, St * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) - SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, String serviceName, - Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + void delete(String resourceGroupName, String accountName, String serviceName, Context context); /** - * Deletes service with the given serviceName. + * Gets the status of service. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param serviceName Cosmos DB service name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the status of service as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono deleteAsync(String resourceGroupName, String accountName, String serviceName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String accountName); /** - * Deletes service with the given serviceName. + * Gets the status of service. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param serviceName Cosmos DB service name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 status of service as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String accountName, String serviceName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName); /** - * Deletes service with the given serviceName. + * Gets the status of service. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param serviceName Cosmos DB service name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 status of service as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void delete(String resourceGroupName, String accountName, String serviceName, Context context); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String accountName, Context context); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/SqlResourcesClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/SqlResourcesClient.java index c3fdbb894115..c8cca07dc3c2 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/SqlResourcesClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/SqlResourcesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; @@ -15,6 +15,8 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.cosmos.fluent.models.BackupInformationInner; import com.azure.resourcemanager.cosmos.fluent.models.ClientEncryptionKeyGetResultsInner; +import com.azure.resourcemanager.cosmos.fluent.models.PhysicalPartitionStorageInfoCollectionInner; +import com.azure.resourcemanager.cosmos.fluent.models.PhysicalPartitionThroughputInfoResultInner; import com.azure.resourcemanager.cosmos.fluent.models.SqlContainerGetResultsInner; import com.azure.resourcemanager.cosmos.fluent.models.SqlDatabaseGetResultsInner; import com.azure.resourcemanager.cosmos.fluent.models.SqlRoleAssignmentGetResultsInner; @@ -25,6 +27,9 @@ import com.azure.resourcemanager.cosmos.fluent.models.ThroughputSettingsGetResultsInner; import com.azure.resourcemanager.cosmos.models.ClientEncryptionKeyCreateUpdateParameters; import com.azure.resourcemanager.cosmos.models.ContinuousBackupRestoreLocation; +import com.azure.resourcemanager.cosmos.models.MergeParameters; +import com.azure.resourcemanager.cosmos.models.RedistributeThroughputParameters; +import com.azure.resourcemanager.cosmos.models.RetrieveThroughputParameters; import com.azure.resourcemanager.cosmos.models.SqlContainerCreateUpdateParameters; import com.azure.resourcemanager.cosmos.models.SqlDatabaseCreateUpdateParameters; import com.azure.resourcemanager.cosmos.models.SqlRoleAssignmentCreateUpdateParameters; @@ -41,50 +46,6 @@ * An instance of this class provides access to all the operations defined in SqlResourcesClient. */ public interface SqlResourcesClient { - /** - * 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 com.azure.core.management.exception.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) - PagedFlux listSqlDatabasesAsync(String resourceGroupName, String 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. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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) - PagedIterable listSqlDatabases(String resourceGroupName, String 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 com.azure.core.management.exception.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) - PagedIterable listSqlDatabases(String resourceGroupName, String accountName, - Context context); - /** * Gets the SQL database under an existing Azure Cosmos DB database account with the provided name. * @@ -367,6 +328,172 @@ SyncPoller, Void> beginDeleteSqlDatabase(String resourceGroupNa @ServiceMethod(returns = ReturnType.SINGLE) void deleteSqlDatabase(String resourceGroupName, String accountName, String databaseName, 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 com.azure.core.management.exception.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) + PagedFlux listSqlDatabasesAsync(String resourceGroupName, String 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PagedIterable listSqlDatabases(String resourceGroupName, String 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 com.azure.core.management.exception.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) + PagedIterable listSqlDatabases(String resourceGroupName, String accountName, + Context context); + + /** + * Merges the partitions of a 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 mergeParameters The parameters for the merge operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of physical partitions and their properties returned by a merge operation along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> sqlDatabasePartitionMergeWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters); + + /** + * Merges the partitions of a 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 mergeParameters The parameters for the merge operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, PhysicalPartitionStorageInfoCollectionInner> + beginSqlDatabasePartitionMergeAsync(String resourceGroupName, String accountName, String databaseName, + MergeParameters mergeParameters); + + /** + * Merges the partitions of a 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 mergeParameters The parameters for the merge operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginSqlDatabasePartitionMerge(String resourceGroupName, String accountName, String databaseName, + MergeParameters mergeParameters); + + /** + * Merges the partitions of a 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 mergeParameters The parameters for the merge operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginSqlDatabasePartitionMerge(String resourceGroupName, String accountName, String databaseName, + MergeParameters mergeParameters, Context context); + + /** + * Merges the partitions of a 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 mergeParameters The parameters for the merge operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of physical partitions and their properties returned by a merge operation on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono sqlDatabasePartitionMergeAsync(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters); + + /** + * Merges the partitions of a 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 mergeParameters The parameters for the merge operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of physical partitions and their properties returned by a merge operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionStorageInfoCollectionInner sqlDatabasePartitionMerge(String resourceGroupName, String accountName, + String databaseName, MergeParameters mergeParameters); + + /** + * Merges the partitions of a 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 mergeParameters The parameters for the merge operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of physical partitions and their properties returned by a merge operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionStorageInfoCollectionInner sqlDatabasePartitionMerge(String resourceGroupName, String accountName, + String databaseName, MergeParameters mergeParameters, Context context); + /** * Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided * name. @@ -774,358 +901,257 @@ ThroughputSettingsGetResultsInner migrateSqlDatabaseToManualThroughput(String re String databaseName, Context context); /** - * Lists the SQL container under an existing Azure Cosmos DB database account. + * Retrieve throughput distribution for 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 retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listSqlContainersAsync(String resourceGroupName, String accountName, - String databaseName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> sqlDatabaseRetrieveThroughputDistributionWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters); /** - * Lists the SQL container under an existing Azure Cosmos DB database account. + * Retrieve throughput distribution for 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 retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSqlContainers(String resourceGroupName, String accountName, - String databaseName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginSqlDatabaseRetrieveThroughputDistributionAsync(String resourceGroupName, String accountName, + String databaseName, RetrieveThroughputParameters retrieveThroughputParameters); /** - * Lists the SQL container under an existing Azure Cosmos DB database account. + * Retrieve throughput distribution for 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 context The context to associate with this operation. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSqlContainers(String resourceGroupName, String accountName, - String databaseName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlDatabaseRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, RetrieveThroughputParameters retrieveThroughputParameters); /** - * Gets the SQL container under an existing Azure Cosmos DB database account. + * Retrieve throughput distribution for 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 containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL database. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getSqlContainerWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String containerName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlDatabaseRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, RetrieveThroughputParameters retrieveThroughputParameters, Context context); /** - * Gets the SQL container under an existing Azure Cosmos DB database account. + * Retrieve throughput distribution for 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 containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getSqlContainerAsync(String resourceGroupName, String accountName, - String databaseName, String containerName); + Mono sqlDatabaseRetrieveThroughputDistributionAsync( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters); /** - * Gets the SQL container under an existing Azure Cosmos DB database account. + * Retrieve throughput distribution for 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 containerName Cosmos DB container name. - * @param context The context to associate with this operation. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getSqlContainerWithResponse(String resourceGroupName, String accountName, - String databaseName, String containerName, Context context); + PhysicalPartitionThroughputInfoResultInner sqlDatabaseRetrieveThroughputDistribution(String resourceGroupName, + String accountName, String databaseName, RetrieveThroughputParameters retrieveThroughputParameters); /** - * Gets the SQL container under an existing Azure Cosmos DB database account. + * Retrieve throughput distribution for 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 containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL database. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - SqlContainerGetResultsInner getSqlContainer(String resourceGroupName, String accountName, String databaseName, - String containerName); + PhysicalPartitionThroughputInfoResultInner sqlDatabaseRetrieveThroughputDistribution(String resourceGroupName, + String accountName, String databaseName, RetrieveThroughputParameters retrieveThroughputParameters, + Context context); /** - * Create or update an Azure Cosmos DB SQL container. + * Redistribute throughput for 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 containerName Cosmos DB container name. - * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createUpdateSqlContainerWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String containerName, - SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters); + Mono>> sqlDatabaseRedistributeThroughputWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, RedistributeThroughputParameters redistributeThroughputParameters); /** - * Create or update an Azure Cosmos DB SQL container. + * Redistribute throughput for 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 containerName Cosmos DB container name. - * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, SqlContainerGetResultsInner> beginCreateUpdateSqlContainerAsync( - String resourceGroupName, String accountName, String databaseName, String containerName, - SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters); + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginSqlDatabaseRedistributeThroughputAsync(String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters); /** - * Create or update an Azure Cosmos DB SQL container. + * Redistribute throughput for 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 containerName Cosmos DB container name. - * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, SqlContainerGetResultsInner> beginCreateUpdateSqlContainer( - String resourceGroupName, String accountName, String databaseName, String containerName, - SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters); + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlDatabaseRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters); /** - * Create or update an Azure Cosmos DB SQL container. + * Redistribute throughput for 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 containerName Cosmos DB container name. - * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL database. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, SqlContainerGetResultsInner> beginCreateUpdateSqlContainer( - String resourceGroupName, String accountName, String databaseName, String containerName, - SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters, Context context); + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlDatabaseRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context); /** - * Create or update an Azure Cosmos DB SQL container. + * Redistribute throughput for 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 containerName Cosmos DB container name. - * @param createUpdateSqlContainerParameters The parameters to provide for the current SQL container. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createUpdateSqlContainerAsync(String resourceGroupName, String accountName, - String databaseName, String containerName, - SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters); - - /** - * 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 com.azure.core.management.exception.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) - SqlContainerGetResultsInner createUpdateSqlContainer(String resourceGroupName, String accountName, - String databaseName, String containerName, - SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters); - - /** - * 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 com.azure.core.management.exception.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) - SqlContainerGetResultsInner createUpdateSqlContainer(String resourceGroupName, String accountName, - String databaseName, String containerName, - SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters, Context 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 com.azure.core.management.exception.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) - Mono>> deleteSqlContainerWithResponseAsync(String resourceGroupName, String accountName, - String databaseName, String containerName); - - /** - * 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 com.azure.core.management.exception.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) - PollerFlux, Void> beginDeleteSqlContainerAsync(String resourceGroupName, String accountName, - String databaseName, String containerName); - - /** - * 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 com.azure.core.management.exception.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) - SyncPoller, Void> beginDeleteSqlContainer(String resourceGroupName, String accountName, - String databaseName, String containerName); - - /** - * 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 com.azure.core.management.exception.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) - SyncPoller, Void> beginDeleteSqlContainer(String resourceGroupName, String accountName, - String databaseName, String containerName, Context 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 com.azure.core.management.exception.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) - Mono deleteSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, - String containerName); + Mono sqlDatabaseRedistributeThroughputAsync(String resourceGroupName, + String accountName, String databaseName, RedistributeThroughputParameters redistributeThroughputParameters); /** - * Deletes an existing Azure Cosmos DB SQL container. + * Redistribute throughput for 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 containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL database. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - void deleteSqlContainer(String resourceGroupName, String accountName, String databaseName, String containerName); + PhysicalPartitionThroughputInfoResultInner sqlDatabaseRedistributeThroughput(String resourceGroupName, + String accountName, String databaseName, RedistributeThroughputParameters redistributeThroughputParameters); /** - * Deletes an existing Azure Cosmos DB SQL container. + * Redistribute throughput for 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 containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL database. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - void deleteSqlContainer(String resourceGroupName, String accountName, String databaseName, String containerName, + PhysicalPartitionThroughputInfoResultInner sqlDatabaseRedistributeThroughput(String resourceGroupName, + String accountName, String databaseName, RedistributeThroughputParameters redistributeThroughputParameters, Context context); /** @@ -1561,310 +1587,1140 @@ ThroughputSettingsGetResultsInner migrateSqlContainerToManualThroughput(String r String accountName, String databaseName, String containerName, Context context); /** - * Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. + * Retrieve throughput distribution for 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 retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listClientEncryptionKeysAsync(String resourceGroupName, - String accountName, String databaseName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> sqlContainerRetrieveThroughputDistributionWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String containerName, + RetrieveThroughputParameters retrieveThroughputParameters); /** - * Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. + * Retrieve throughput distribution for 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 retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listClientEncryptionKeys(String resourceGroupName, - String accountName, String databaseName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginSqlContainerRetrieveThroughputDistributionAsync(String resourceGroupName, String accountName, + String databaseName, String containerName, RetrieveThroughputParameters retrieveThroughputParameters); /** - * Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. + * Retrieve throughput distribution for 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 context The context to associate with this operation. + * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listClientEncryptionKeys(String resourceGroupName, - String accountName, String databaseName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlContainerRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, String containerName, RetrieveThroughputParameters retrieveThroughputParameters); /** - * Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + * Retrieve throughput distribution for 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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. + * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL container. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getClientEncryptionKeyWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String clientEncryptionKeyName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlContainerRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, String containerName, RetrieveThroughputParameters retrieveThroughputParameters, + Context context); /** - * Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + * Retrieve throughput distribution for 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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. + * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getClientEncryptionKeyAsync(String resourceGroupName, String accountName, - String databaseName, String clientEncryptionKeyName); + Mono sqlContainerRetrieveThroughputDistributionAsync( + String resourceGroupName, String accountName, String databaseName, String containerName, + RetrieveThroughputParameters retrieveThroughputParameters); /** - * Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + * Retrieve throughput distribution for 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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. - * @param context The context to associate with this operation. + * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getClientEncryptionKeyWithResponse(String resourceGroupName, - String accountName, String databaseName, String clientEncryptionKeyName, Context context); + PhysicalPartitionThroughputInfoResultInner sqlContainerRetrieveThroughputDistribution(String resourceGroupName, + String accountName, String databaseName, String containerName, + RetrieveThroughputParameters retrieveThroughputParameters); /** - * Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + * Retrieve throughput distribution for 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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. + * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current SQL container. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - ClientEncryptionKeyGetResultsInner getClientEncryptionKey(String resourceGroupName, String accountName, - String databaseName, String clientEncryptionKeyName); + PhysicalPartitionThroughputInfoResultInner sqlContainerRetrieveThroughputDistribution(String resourceGroupName, + String accountName, String databaseName, String containerName, + RetrieveThroughputParameters retrieveThroughputParameters, Context context); /** - * Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell - * (instead of directly). + * Redistribute throughput for 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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. - * @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption key. + * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> createUpdateClientEncryptionKeyWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String clientEncryptionKeyName, - ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters); + Mono>> sqlContainerRedistributeThroughputWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String containerName, + RedistributeThroughputParameters redistributeThroughputParameters); /** - * Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell - * (instead of directly). + * Redistribute throughput for 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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. - * @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption key. + * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, ClientEncryptionKeyGetResultsInner> - beginCreateUpdateClientEncryptionKeyAsync(String resourceGroupName, String accountName, String databaseName, - String clientEncryptionKeyName, - ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters); + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginSqlContainerRedistributeThroughputAsync(String resourceGroupName, String accountName, String databaseName, + String containerName, RedistributeThroughputParameters redistributeThroughputParameters); /** - * Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell - * (instead of directly). + * Redistribute throughput for 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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. - * @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption key. + * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ClientEncryptionKeyGetResultsInner> - beginCreateUpdateClientEncryptionKey(String resourceGroupName, String accountName, String databaseName, - String clientEncryptionKeyName, - ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters); + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlContainerRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + String containerName, RedistributeThroughputParameters redistributeThroughputParameters); /** - * Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell - * (instead of directly). + * Redistribute throughput for 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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. - * @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption key. + * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL container. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ClientEncryptionKeyGetResultsInner> - beginCreateUpdateClientEncryptionKey(String resourceGroupName, String accountName, String databaseName, - String clientEncryptionKeyName, - ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters, Context context); + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlContainerRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + String containerName, RedistributeThroughputParameters redistributeThroughputParameters, Context context); /** - * Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell - * (instead of directly). + * Redistribute throughput for 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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. - * @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption key. + * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono createUpdateClientEncryptionKeyAsync(String resourceGroupName, - String accountName, String databaseName, String clientEncryptionKeyName, - ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters); + Mono sqlContainerRedistributeThroughputAsync(String resourceGroupName, + String accountName, String databaseName, String containerName, + RedistributeThroughputParameters redistributeThroughputParameters); /** - * Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell - * (instead of directly). + * Redistribute throughput for 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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. - * @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption key. + * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL container. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - ClientEncryptionKeyGetResultsInner createUpdateClientEncryptionKey(String resourceGroupName, String accountName, - String databaseName, String clientEncryptionKeyName, - ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters); + PhysicalPartitionThroughputInfoResultInner sqlContainerRedistributeThroughput(String resourceGroupName, + String accountName, String databaseName, String containerName, + RedistributeThroughputParameters redistributeThroughputParameters); /** - * Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell - * (instead of directly). + * Redistribute throughput for 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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. - * @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption key. + * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * SQL container. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - ClientEncryptionKeyGetResultsInner createUpdateClientEncryptionKey(String resourceGroupName, String accountName, + PhysicalPartitionThroughputInfoResultInner sqlContainerRedistributeThroughput(String resourceGroupName, + String accountName, String databaseName, String containerName, + RedistributeThroughputParameters redistributeThroughputParameters, Context 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 com.azure.core.management.exception.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) + Mono> getClientEncryptionKeyWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String clientEncryptionKeyName); + + /** + * 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 com.azure.core.management.exception.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) + Mono getClientEncryptionKeyAsync(String resourceGroupName, String accountName, + String databaseName, String clientEncryptionKeyName); + + /** + * 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 com.azure.core.management.exception.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) + Response getClientEncryptionKeyWithResponse(String resourceGroupName, + String accountName, String databaseName, String clientEncryptionKeyName, Context 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 com.azure.core.management.exception.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) + ClientEncryptionKeyGetResultsInner getClientEncryptionKey(String resourceGroupName, String accountName, + String databaseName, String clientEncryptionKeyName); + + /** + * 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 com.azure.core.management.exception.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) + Mono>> createUpdateClientEncryptionKeyWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String clientEncryptionKeyName, + ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters); + + /** + * 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 com.azure.core.management.exception.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) + PollerFlux, ClientEncryptionKeyGetResultsInner> + beginCreateUpdateClientEncryptionKeyAsync(String resourceGroupName, String accountName, String databaseName, + String clientEncryptionKeyName, + ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters); + + /** + * 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 com.azure.core.management.exception.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) + SyncPoller, ClientEncryptionKeyGetResultsInner> + beginCreateUpdateClientEncryptionKey(String resourceGroupName, String accountName, String databaseName, + String clientEncryptionKeyName, + ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters); + + /** + * 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 com.azure.core.management.exception.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) + SyncPoller, ClientEncryptionKeyGetResultsInner> + beginCreateUpdateClientEncryptionKey(String resourceGroupName, String accountName, String databaseName, + String clientEncryptionKeyName, + ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters, Context 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 com.azure.core.management.exception.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) + Mono createUpdateClientEncryptionKeyAsync(String resourceGroupName, + String accountName, String databaseName, String clientEncryptionKeyName, + ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters); + + /** + * 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 com.azure.core.management.exception.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) + ClientEncryptionKeyGetResultsInner createUpdateClientEncryptionKey(String resourceGroupName, String accountName, + String databaseName, String clientEncryptionKeyName, + ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters); + + /** + * 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 com.azure.core.management.exception.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) + ClientEncryptionKeyGetResultsInner createUpdateClientEncryptionKey(String resourceGroupName, String accountName, String databaseName, String clientEncryptionKeyName, ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters, Context context); /** - * Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. + * 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 com.azure.core.management.exception.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) + PagedFlux listClientEncryptionKeysAsync(String resourceGroupName, + String accountName, String 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PagedIterable listClientEncryptionKeys(String resourceGroupName, + String accountName, String 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 com.azure.core.management.exception.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) + PagedIterable listClientEncryptionKeys(String resourceGroupName, + String accountName, String databaseName, Context 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 com.azure.core.management.exception.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) + Mono> getSqlContainerWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String containerName); + + /** + * 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 com.azure.core.management.exception.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) + Mono getSqlContainerAsync(String resourceGroupName, String accountName, + String databaseName, String containerName); + + /** + * 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 com.azure.core.management.exception.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) + Response getSqlContainerWithResponse(String resourceGroupName, String accountName, + String databaseName, String containerName, Context 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 com.azure.core.management.exception.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) + SqlContainerGetResultsInner getSqlContainer(String resourceGroupName, String accountName, String databaseName, + String containerName); + + /** + * 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 com.azure.core.management.exception.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) + Mono>> createUpdateSqlContainerWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String containerName, + SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters); + + /** + * 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 com.azure.core.management.exception.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) + PollerFlux, SqlContainerGetResultsInner> beginCreateUpdateSqlContainerAsync( + String resourceGroupName, String accountName, String databaseName, String containerName, + SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters); + + /** + * 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 com.azure.core.management.exception.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) + SyncPoller, SqlContainerGetResultsInner> beginCreateUpdateSqlContainer( + String resourceGroupName, String accountName, String databaseName, String containerName, + SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters); + + /** + * 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 com.azure.core.management.exception.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) + SyncPoller, SqlContainerGetResultsInner> beginCreateUpdateSqlContainer( + String resourceGroupName, String accountName, String databaseName, String containerName, + SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters, Context 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 com.azure.core.management.exception.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) + Mono createUpdateSqlContainerAsync(String resourceGroupName, String accountName, + String databaseName, String containerName, + SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters); + + /** + * 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 com.azure.core.management.exception.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) + SqlContainerGetResultsInner createUpdateSqlContainer(String resourceGroupName, String accountName, + String databaseName, String containerName, + SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters); + + /** + * 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 com.azure.core.management.exception.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) + SqlContainerGetResultsInner createUpdateSqlContainer(String resourceGroupName, String accountName, + String databaseName, String containerName, + SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters, Context 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 com.azure.core.management.exception.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) + Mono>> deleteSqlContainerWithResponseAsync(String resourceGroupName, String accountName, + String databaseName, String containerName); + + /** + * 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 com.azure.core.management.exception.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) + PollerFlux, Void> beginDeleteSqlContainerAsync(String resourceGroupName, String accountName, + String databaseName, String containerName); + + /** + * 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 com.azure.core.management.exception.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) + SyncPoller, Void> beginDeleteSqlContainer(String resourceGroupName, String accountName, + String databaseName, String containerName); + + /** + * 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 com.azure.core.management.exception.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) + SyncPoller, Void> beginDeleteSqlContainer(String resourceGroupName, String accountName, + String databaseName, String containerName, Context 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 com.azure.core.management.exception.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) + Mono deleteSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, + String containerName); + + /** + * 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 com.azure.core.management.exception.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) + void deleteSqlContainer(String resourceGroupName, String accountName, String databaseName, String containerName); + + /** + * 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 com.azure.core.management.exception.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) + void deleteSqlContainer(String resourceGroupName, String accountName, String databaseName, String containerName, + Context 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 com.azure.core.management.exception.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) + PagedFlux listSqlContainersAsync(String resourceGroupName, String accountName, + String 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. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PagedIterable listSqlContainers(String resourceGroupName, String accountName, + String 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 com.azure.core.management.exception.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) + PagedIterable listSqlContainers(String resourceGroupName, String accountName, + String databaseName, Context context); + + /** + * Merges the partitions of a 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 mergeParameters The parameters for the merge operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of physical partitions and their properties returned by a merge operation along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> listSqlContainerPartitionMergeWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String containerName, MergeParameters mergeParameters); + + /** + * Merges the partitions of a 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 mergeParameters The parameters for the merge operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, PhysicalPartitionStorageInfoCollectionInner> + beginListSqlContainerPartitionMergeAsync(String resourceGroupName, String accountName, String databaseName, + String containerName, MergeParameters mergeParameters); + + /** + * Merges the partitions of a 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 mergeParameters The parameters for the merge operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginListSqlContainerPartitionMerge(String resourceGroupName, String accountName, String databaseName, + String containerName, MergeParameters mergeParameters); + + /** + * Merges the partitions of a 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 mergeParameters The parameters for the merge operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginListSqlContainerPartitionMerge(String resourceGroupName, String accountName, String databaseName, + String containerName, MergeParameters mergeParameters, Context context); + + /** + * Merges the partitions of a 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 mergeParameters The parameters for the merge operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of physical partitions and their properties returned by a merge operation on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono listSqlContainerPartitionMergeAsync(String resourceGroupName, + String accountName, String databaseName, String containerName, MergeParameters mergeParameters); + + /** + * Merges the partitions of a 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 mergeParameters The parameters for the merge operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of physical partitions and their properties returned by a merge operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionStorageInfoCollectionInner listSqlContainerPartitionMerge(String resourceGroupName, + String accountName, String databaseName, String containerName, MergeParameters mergeParameters); + + /** + * Merges the partitions of a 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 mergeParameters The parameters for the merge operation. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return list of physical partitions and their properties returned by a merge operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + PhysicalPartitionStorageInfoCollectionInner listSqlContainerPartitionMerge(String resourceGroupName, + String accountName, String databaseName, String containerName, MergeParameters mergeParameters, + Context context); + + /** + * Retrieves continuous backup information for a container resource. + * + * @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 location The name of the continuous backup restore location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> retrieveContinuousBackupInformationWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String containerName, ContinuousBackupRestoreLocation location); + + /** + * Retrieves continuous backup information for a container resource. + * + * @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 location The name of the continuous backup restore location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PollerFlux, BackupInformationInner> + beginRetrieveContinuousBackupInformationAsync(String resourceGroupName, String accountName, String databaseName, + String containerName, ContinuousBackupRestoreLocation location); + + /** + * Retrieves continuous backup information for a container resource. + * + * @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 location The name of the continuous backup restore location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, BackupInformationInner> beginRetrieveContinuousBackupInformation( + String resourceGroupName, String accountName, String databaseName, String containerName, + ContinuousBackupRestoreLocation location); + + /** + * Retrieves continuous backup information for a container resource. + * + * @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 location The name of the continuous backup restore location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, BackupInformationInner> beginRetrieveContinuousBackupInformation( + String resourceGroupName, String accountName, String databaseName, String containerName, + ContinuousBackupRestoreLocation location, Context context); + + /** + * Retrieves continuous backup information for a container resource. * * @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 location The name of the continuous backup restore location. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return the response body on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listSqlStoredProceduresAsync(String resourceGroupName, - String accountName, String databaseName, String containerName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono retrieveContinuousBackupInformationAsync(String resourceGroupName, String accountName, + String databaseName, String containerName, ContinuousBackupRestoreLocation location); /** - * Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. + * Retrieves continuous backup information for a container resource. * * @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 location The name of the continuous backup restore location. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return the response. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSqlStoredProcedures(String resourceGroupName, - String accountName, String databaseName, String containerName); + @ServiceMethod(returns = ReturnType.SINGLE) + BackupInformationInner retrieveContinuousBackupInformation(String resourceGroupName, String accountName, + String databaseName, String containerName, ContinuousBackupRestoreLocation location); /** - * Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. + * Retrieves continuous backup information for a container resource. * * @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 location The name of the continuous backup restore location. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return the response. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSqlStoredProcedures(String resourceGroupName, - String accountName, String databaseName, String containerName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + BackupInformationInner retrieveContinuousBackupInformation(String resourceGroupName, String accountName, + String databaseName, String containerName, ContinuousBackupRestoreLocation location, Context context); /** * Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. @@ -2195,7 +3051,7 @@ void deleteSqlStoredProcedure(String resourceGroupName, String accountName, Stri String containerName, String storedProcedureName, Context context); /** - * Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. + * 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. @@ -2204,15 +3060,15 @@ void deleteSqlStoredProcedure(String resourceGroupName, String accountName, Stri * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 as paginated + * @return the List operation response, that contains the storedProcedures and their properties as paginated * response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listSqlUserDefinedFunctionsAsync(String resourceGroupName, + PagedFlux listSqlStoredProceduresAsync(String resourceGroupName, String accountName, String databaseName, String containerName); /** - * Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. + * 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. @@ -2221,15 +3077,15 @@ PagedFlux listSqlUserDefinedFunctionsAsyn * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 as paginated + * @return the List operation response, that contains the storedProcedures and their properties as paginated * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSqlUserDefinedFunctions(String resourceGroupName, + PagedIterable listSqlStoredProcedures(String resourceGroupName, String accountName, String databaseName, String containerName); /** - * Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. + * 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. @@ -2239,11 +3095,11 @@ PagedIterable listSqlUserDefinedFunctions * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 as paginated + * @return the List operation response, that contains the storedProcedures and their properties as paginated * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSqlUserDefinedFunctions(String resourceGroupName, + PagedIterable listSqlStoredProcedures(String resourceGroupName, String accountName, String databaseName, String containerName, Context context); /** @@ -2585,7 +3441,7 @@ void deleteSqlUserDefinedFunction(String resourceGroupName, String accountName, String containerName, String userDefinedFunctionName, Context context); /** - * Lists the SQL trigger under an existing Azure Cosmos DB database account. + * 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. @@ -2594,15 +3450,15 @@ void deleteSqlUserDefinedFunction(String resourceGroupName, String accountName, * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 triggers and their properties as paginated response with - * {@link PagedFlux}. + * @return the List operation response, that contains the userDefinedFunctions and their properties as paginated + * response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedFlux listSqlTriggersAsync(String resourceGroupName, String accountName, - String databaseName, String containerName); + PagedFlux listSqlUserDefinedFunctionsAsync(String resourceGroupName, + String accountName, String databaseName, String containerName); /** - * Lists the SQL trigger under an existing Azure Cosmos DB database account. + * 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. @@ -2611,15 +3467,15 @@ PagedFlux listSqlTriggersAsync(String resourceGroupNa * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 triggers and their properties as paginated response with - * {@link PagedIterable}. + * @return the List operation response, that contains the userDefinedFunctions and their properties as paginated + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSqlTriggers(String resourceGroupName, String accountName, - String databaseName, String containerName); + PagedIterable listSqlUserDefinedFunctions(String resourceGroupName, + String accountName, String databaseName, String containerName); /** - * Lists the SQL trigger under an existing Azure Cosmos DB database account. + * 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. @@ -2629,12 +3485,12 @@ PagedIterable listSqlTriggers(String resourceGroupNam * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 triggers and their properties as paginated response with - * {@link PagedIterable}. + * @return the List operation response, that contains the userDefinedFunctions and their properties as paginated + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listSqlTriggers(String resourceGroupName, String accountName, - String databaseName, String containerName, Context context); + PagedIterable listSqlUserDefinedFunctions(String resourceGroupName, + String accountName, String databaseName, String containerName, Context context); /** * Gets the SQL trigger under an existing Azure Cosmos DB database account. @@ -2960,6 +3816,58 @@ void deleteSqlTrigger(String resourceGroupName, String accountName, String datab void deleteSqlTrigger(String resourceGroupName, String accountName, String databaseName, String containerName, String triggerName, Context context); + /** + * Lists the SQL trigger 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 com.azure.core.management.exception.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 triggers and their properties as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listSqlTriggersAsync(String resourceGroupName, String accountName, + String databaseName, String containerName); + + /** + * Lists the SQL trigger 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 com.azure.core.management.exception.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 triggers and their properties as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listSqlTriggers(String resourceGroupName, String accountName, + String databaseName, String containerName); + + /** + * Lists the SQL trigger 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 com.azure.core.management.exception.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 triggers and their properties as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listSqlTriggers(String resourceGroupName, String accountName, + String databaseName, String containerName, Context context); + /** * Retrieves the properties of an existing Azure Cosmos DB SQL Role Definition with the given Id. * @@ -3615,128 +4523,4 @@ PagedIterable listSqlRoleAssignments(String re @ServiceMethod(returns = ReturnType.COLLECTION) PagedIterable listSqlRoleAssignments(String resourceGroupName, String accountName, Context context); - - /** - * Retrieves continuous backup information for a container resource. - * - * @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 location The name of the continuous backup restore location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup information of a resource along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> retrieveContinuousBackupInformationWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String containerName, ContinuousBackupRestoreLocation location); - - /** - * Retrieves continuous backup information for a container resource. - * - * @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 location The name of the continuous backup restore location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 backup information of a resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, BackupInformationInner> - beginRetrieveContinuousBackupInformationAsync(String resourceGroupName, String accountName, String databaseName, - String containerName, ContinuousBackupRestoreLocation location); - - /** - * Retrieves continuous backup information for a container resource. - * - * @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 location The name of the continuous backup restore location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 backup information of a resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BackupInformationInner> beginRetrieveContinuousBackupInformation( - String resourceGroupName, String accountName, String databaseName, String containerName, - ContinuousBackupRestoreLocation location); - - /** - * Retrieves continuous backup information for a container resource. - * - * @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 location The name of the continuous backup restore location. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.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 backup information of a resource. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BackupInformationInner> beginRetrieveContinuousBackupInformation( - String resourceGroupName, String accountName, String databaseName, String containerName, - ContinuousBackupRestoreLocation location, Context context); - - /** - * Retrieves continuous backup information for a container resource. - * - * @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 location The name of the continuous backup restore location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup information of a resource on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono retrieveContinuousBackupInformationAsync(String resourceGroupName, String accountName, - String databaseName, String containerName, ContinuousBackupRestoreLocation location); - - /** - * Retrieves continuous backup information for a container resource. - * - * @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 location The name of the continuous backup restore location. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup information of a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupInformationInner retrieveContinuousBackupInformation(String resourceGroupName, String accountName, - String databaseName, String containerName, ContinuousBackupRestoreLocation location); - - /** - * Retrieves continuous backup information for a container resource. - * - * @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 location The name of the continuous backup restore location. - * @param context The context to associate with this operation. - * @throws IllegalArgumentException thrown if parameters fail the validation. - * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. - * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup information of a resource. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - BackupInformationInner retrieveContinuousBackupInformation(String resourceGroupName, String accountName, - String databaseName, String containerName, ContinuousBackupRestoreLocation location, Context context); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/TableResourcesClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/TableResourcesClient.java index e1cdada77c06..7393293a2bfe 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/TableResourcesClient.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/TableResourcesClient.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent; @@ -15,6 +15,8 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.cosmos.fluent.models.BackupInformationInner; import com.azure.resourcemanager.cosmos.fluent.models.TableGetResultsInner; +import com.azure.resourcemanager.cosmos.fluent.models.TableRoleAssignmentResourceInner; +import com.azure.resourcemanager.cosmos.fluent.models.TableRoleDefinitionResourceInner; import com.azure.resourcemanager.cosmos.fluent.models.ThroughputSettingsGetResultsInner; import com.azure.resourcemanager.cosmos.models.ContinuousBackupRestoreLocation; import com.azure.resourcemanager.cosmos.models.TableCreateUpdateParameters; @@ -28,47 +30,404 @@ */ public interface TableResourcesClient { /** - * Lists the Tables under an existing Azure Cosmos DB database account. + * Gets the RUs per second of the Table 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 tableName Cosmos DB table name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Table and their properties as paginated response with - * {@link PagedFlux}. + * @return the RUs per second of the Table 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.COLLECTION) - PagedFlux listTablesAsync(String resourceGroupName, String accountName); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getTableThroughputWithResponseAsync(String resourceGroupName, + String accountName, String tableName); + + /** + * Gets the RUs per second of the Table 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 tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Table under an existing Azure Cosmos DB database account with the provided name + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getTableThroughputAsync(String resourceGroupName, String accountName, + String tableName); + + /** + * Gets the RUs per second of the Table 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 tableName Cosmos DB table name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Table under an existing Azure Cosmos DB database account with the provided name + * along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getTableThroughputWithResponse(String resourceGroupName, + String accountName, String tableName, Context context); + + /** + * Gets the RUs per second of the Table 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 tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Table under an existing Azure Cosmos DB database account with the provided + * name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputSettingsGetResultsInner getTableThroughput(String resourceGroupName, String accountName, + String tableName); + + /** + * Update RUs per second of an Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono>> updateTableThroughputWithResponseAsync(String resourceGroupName, + String accountName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PollerFlux, ThroughputSettingsGetResultsInner> + beginUpdateTableThroughputAsync(String resourceGroupName, String accountName, String tableName, + ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginUpdateTableThroughput(String resourceGroupName, String accountName, String tableName, + ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginUpdateTableThroughput(String resourceGroupName, String accountName, String tableName, + ThroughputSettingsUpdateParameters updateThroughputParameters, Context context); + + /** + * Update RUs per second of an Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono updateTableThroughputAsync(String resourceGroupName, String accountName, + String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner updateTableThroughput(String resourceGroupName, String accountName, + String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters); + + /** + * Update RUs per second of an Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner updateTableThroughput(String resourceGroupName, String accountName, + String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context); + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono>> migrateTableToAutoscaleWithResponseAsync(String resourceGroupName, + String accountName, String tableName); + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateTableToAutoscaleAsync(String resourceGroupName, String accountName, String tableName); + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateTableToAutoscale(String resourceGroupName, String accountName, String tableName); + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateTableToAutoscale(String resourceGroupName, String accountName, String tableName, Context context); + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono migrateTableToAutoscaleAsync(String resourceGroupName, String accountName, + String tableName); + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner migrateTableToAutoscale(String resourceGroupName, String accountName, + String tableName); + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + ThroughputSettingsGetResultsInner migrateTableToAutoscale(String resourceGroupName, String accountName, + String tableName, Context context); + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono>> migrateTableToManualThroughputWithResponseAsync(String resourceGroupName, + String accountName, String tableName); + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateTableToManualThroughputAsync(String resourceGroupName, String accountName, String tableName); + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateTableToManualThroughput(String resourceGroupName, String accountName, String tableName); + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateTableToManualThroughput(String resourceGroupName, String accountName, String tableName, + Context context); + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono migrateTableToManualThroughputAsync(String resourceGroupName, + String accountName, String tableName); /** - * Lists the Tables under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Table and their properties as paginated response with - * {@link PagedIterable}. + * @return an Azure Cosmos DB resource throughput. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listTables(String resourceGroupName, String accountName); + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputSettingsGetResultsInner migrateTableToManualThroughput(String resourceGroupName, String accountName, + String tableName); /** - * Lists the Tables under an existing Azure Cosmos DB database account. + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Table and their properties as paginated response with - * {@link PagedIterable}. + * @return an Azure Cosmos DB resource throughput. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - PagedIterable listTables(String resourceGroupName, String accountName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputSettingsGetResultsInner migrateTableToManualThroughput(String resourceGroupName, String accountName, + String tableName, Context context); /** * Gets the Tables under an existing Azure Cosmos DB database account with the provided name. @@ -339,528 +698,845 @@ SyncPoller, Void> beginDeleteTable(String resourceGroupName, St * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param context The context to associate with this operation. + * @param tableName Cosmos DB table name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + void deleteTable(String resourceGroupName, String accountName, String tableName, Context context); + + /** + * Lists the Tables 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 com.azure.core.management.exception.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 Table and their properties as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listTablesAsync(String resourceGroupName, String accountName); + + /** + * Lists the Tables 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 com.azure.core.management.exception.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 Table and their properties as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listTables(String resourceGroupName, String accountName); + + /** + * Lists the Tables 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 com.azure.core.management.exception.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 Table and their properties as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listTables(String resourceGroupName, String accountName, Context context); + + /** + * Retrieves continuous backup information for a table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param location The name of the continuous backup restore location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> retrieveContinuousBackupInformationWithResponseAsync(String resourceGroupName, + String accountName, String tableName, ContinuousBackupRestoreLocation location); + + /** + * Retrieves continuous backup information for a table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param location The name of the continuous backup restore location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PollerFlux, BackupInformationInner> + beginRetrieveContinuousBackupInformationAsync(String resourceGroupName, String accountName, String tableName, + ContinuousBackupRestoreLocation location); + + /** + * Retrieves continuous backup information for a table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param location The name of the continuous backup restore location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, BackupInformationInner> beginRetrieveContinuousBackupInformation( + String resourceGroupName, String accountName, String tableName, ContinuousBackupRestoreLocation location); + + /** + * Retrieves continuous backup information for a table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param location The name of the continuous backup restore location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, BackupInformationInner> beginRetrieveContinuousBackupInformation( + String resourceGroupName, String accountName, String tableName, ContinuousBackupRestoreLocation location, + Context context); + + /** + * Retrieves continuous backup information for a table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param location The name of the continuous backup restore location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono retrieveContinuousBackupInformationAsync(String resourceGroupName, String accountName, + String tableName, ContinuousBackupRestoreLocation location); + + /** + * Retrieves continuous backup information for a table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param location The name of the continuous backup restore location. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackupInformationInner retrieveContinuousBackupInformation(String resourceGroupName, String accountName, + String tableName, ContinuousBackupRestoreLocation location); + + /** + * Retrieves continuous backup information for a table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param location The name of the continuous backup restore location. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + BackupInformationInner retrieveContinuousBackupInformation(String resourceGroupName, String accountName, + String tableName, ContinuousBackupRestoreLocation location, Context context); + + /** + * Retrieves the properties of an existing Azure Cosmos DB Table Role Definition with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return parameters to create and update an Azure Cosmos DB Table Role Definition along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getTableRoleDefinitionWithResponseAsync(String resourceGroupName, + String accountName, String roleDefinitionId); + + /** + * Retrieves the properties of an existing Azure Cosmos DB Table Role Definition with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return parameters to create and update an Azure Cosmos DB Table Role Definition on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getTableRoleDefinitionAsync(String resourceGroupName, String accountName, + String roleDefinitionId); + + /** + * Retrieves the properties of an existing Azure Cosmos DB Table Role Definition with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return parameters to create and update an Azure Cosmos DB Table Role Definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getTableRoleDefinitionWithResponse(String resourceGroupName, + String accountName, String roleDefinitionId, Context context); + + /** + * Retrieves the properties of an existing Azure Cosmos DB Table Role Definition with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return parameters to create and update an Azure Cosmos DB Table Role Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + TableRoleDefinitionResourceInner getTableRoleDefinition(String resourceGroupName, String accountName, + String roleDefinitionId); + + /** + * Creates or updates an Azure Cosmos DB Table Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateTableRoleDefinitionParameters The properties required to create or update a Role Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. + * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. + * @return parameters to create and update an Azure Cosmos DB Table Role Definition along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> createUpdateTableRoleDefinitionWithResponseAsync(String resourceGroupName, + String accountName, String roleDefinitionId, + TableRoleDefinitionResourceInner createUpdateTableRoleDefinitionParameters); + + /** + * Creates or updates an Azure Cosmos DB Table Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateTableRoleDefinitionParameters The properties required to create or update a Role Definition. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 parameters to create and update an Azure Cosmos DB Table Role + * Definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, TableRoleDefinitionResourceInner> + beginCreateUpdateTableRoleDefinitionAsync(String resourceGroupName, String accountName, String roleDefinitionId, + TableRoleDefinitionResourceInner createUpdateTableRoleDefinitionParameters); + + /** + * Creates or updates an Azure Cosmos DB Table Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateTableRoleDefinitionParameters The properties required to create or update a Role Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 parameters to create and update an Azure Cosmos DB Table Role + * Definition. */ - @ServiceMethod(returns = ReturnType.SINGLE) - void deleteTable(String resourceGroupName, String accountName, String tableName, Context context); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TableRoleDefinitionResourceInner> + beginCreateUpdateTableRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId, + TableRoleDefinitionResourceInner createUpdateTableRoleDefinitionParameters); /** - * Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. + * Creates or updates an Azure Cosmos DB Table Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateTableRoleDefinitionParameters The properties required to create or update a Role Definition. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Table under an existing Azure Cosmos DB database account with the provided name - * along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link SyncPoller} for polling of parameters to create and update an Azure Cosmos DB Table Role + * Definition. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono> getTableThroughputWithResponseAsync(String resourceGroupName, - String accountName, String tableName); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, TableRoleDefinitionResourceInner> + beginCreateUpdateTableRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId, + TableRoleDefinitionResourceInner createUpdateTableRoleDefinitionParameters, Context context); /** - * Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. + * Creates or updates an Azure Cosmos DB Table Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateTableRoleDefinitionParameters The properties required to create or update a Role Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Table under an existing Azure Cosmos DB database account with the provided name - * on successful completion of {@link Mono}. + * @return parameters to create and update an Azure Cosmos DB Table Role Definition on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono getTableThroughputAsync(String resourceGroupName, String accountName, - String tableName); + Mono createUpdateTableRoleDefinitionAsync(String resourceGroupName, + String accountName, String roleDefinitionId, + TableRoleDefinitionResourceInner createUpdateTableRoleDefinitionParameters); /** - * Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. + * Creates or updates an Azure Cosmos DB Table Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param context The context to associate with this operation. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateTableRoleDefinitionParameters The properties required to create or update a Role Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Table under an existing Azure Cosmos DB database account with the provided name - * along with {@link Response}. + * @return parameters to create and update an Azure Cosmos DB Table Role Definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - Response getTableThroughputWithResponse(String resourceGroupName, - String accountName, String tableName, Context context); + TableRoleDefinitionResourceInner createUpdateTableRoleDefinition(String resourceGroupName, String accountName, + String roleDefinitionId, TableRoleDefinitionResourceInner createUpdateTableRoleDefinitionParameters); /** - * Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. + * Creates or updates an Azure Cosmos DB Table Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateTableRoleDefinitionParameters The properties required to create or update a Role Definition. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 Table under an existing Azure Cosmos DB database account with the provided - * name. + * @return parameters to create and update an Azure Cosmos DB Table Role Definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner getTableThroughput(String resourceGroupName, String accountName, - String tableName); + TableRoleDefinitionResourceInner createUpdateTableRoleDefinition(String resourceGroupName, String accountName, + String roleDefinitionId, TableRoleDefinitionResourceInner createUpdateTableRoleDefinitionParameters, + Context context); /** - * Update RUs per second of an Azure Cosmos DB Table. + * Deletes an existing Azure Cosmos DB Table Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. + * @param roleDefinitionId The GUID for the Role Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> updateTableThroughputWithResponseAsync(String resourceGroupName, - String accountName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters); + Mono>> deleteTableRoleDefinitionWithResponseAsync(String resourceGroupName, + String accountName, String roleDefinitionId); /** - * Update RUs per second of an Azure Cosmos DB Table. + * Deletes an existing Azure Cosmos DB Table Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. + * @param roleDefinitionId The GUID for the Role Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, ThroughputSettingsGetResultsInner> - beginUpdateTableThroughputAsync(String resourceGroupName, String accountName, String tableName, - ThroughputSettingsUpdateParameters updateThroughputParameters); + PollerFlux, Void> beginDeleteTableRoleDefinitionAsync(String resourceGroupName, String accountName, + String roleDefinitionId); /** - * Update RUs per second of an Azure Cosmos DB Table. + * Deletes an existing Azure Cosmos DB Table Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. + * @param roleDefinitionId The GUID for the Role Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateTableThroughput(String resourceGroupName, String accountName, String tableName, - ThroughputSettingsUpdateParameters updateThroughputParameters); + SyncPoller, Void> beginDeleteTableRoleDefinition(String resourceGroupName, String accountName, + String roleDefinitionId); /** - * Update RUs per second of an Azure Cosmos DB Table. + * Deletes an existing Azure Cosmos DB Table Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. + * @param roleDefinitionId The GUID for the Role Definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateTableThroughput(String resourceGroupName, String accountName, String tableName, - ThroughputSettingsUpdateParameters updateThroughputParameters, Context context); + SyncPoller, Void> beginDeleteTableRoleDefinition(String resourceGroupName, String accountName, + String roleDefinitionId, Context context); /** - * Update RUs per second of an Azure Cosmos DB Table. + * Deletes an existing Azure Cosmos DB Table Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. + * @param roleDefinitionId The GUID for the Role Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono updateTableThroughputAsync(String resourceGroupName, String accountName, - String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters); + Mono deleteTableRoleDefinitionAsync(String resourceGroupName, String accountName, String roleDefinitionId); /** - * Update RUs per second of an Azure Cosmos DB Table. + * Deletes an existing Azure Cosmos DB Table Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. + * @param roleDefinitionId The GUID for the Role Definition. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) - ThroughputSettingsGetResultsInner updateTableThroughput(String resourceGroupName, String accountName, - String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters); + void deleteTableRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId); /** - * Update RUs per second of an Azure Cosmos DB Table. + * Deletes an existing Azure Cosmos DB Table Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. + * @param roleDefinitionId The GUID for the Role Definition. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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) - ThroughputSettingsGetResultsInner updateTableThroughput(String resourceGroupName, String accountName, - String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context); + void deleteTableRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId, + Context context); /** - * Migrate an Azure Cosmos DB Table from manual throughput to autoscale. + * Retrieves the list of all Azure Cosmos DB Table Role Definitions. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return the response of a TableRoleDefinitionResource list operation as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> migrateTableToAutoscaleWithResponseAsync(String resourceGroupName, - String accountName, String tableName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listTableRoleDefinitionsAsync(String resourceGroupName, + String accountName); /** - * Migrate an Azure Cosmos DB Table from manual throughput to autoscale. + * Retrieves the list of all Azure Cosmos DB Table Role Definitions. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the response of a TableRoleDefinitionResource list operation as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateTableToAutoscaleAsync(String resourceGroupName, String accountName, String tableName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listTableRoleDefinitions(String resourceGroupName, + String accountName); /** - * Migrate an Azure Cosmos DB Table from manual throughput to autoscale. + * Retrieves the list of all Azure Cosmos DB Table Role Definitions. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the response of a TableRoleDefinitionResource list operation as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateTableToAutoscale(String resourceGroupName, String accountName, String tableName); + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listTableRoleDefinitions(String resourceGroupName, + String accountName, Context context); /** - * Migrate an Azure Cosmos DB Table from manual throughput to autoscale. + * Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given Id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param context The context to associate with this operation. + * @param roleAssignmentId The GUID for the Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return parameters to create and update an Azure Cosmos DB Table Role Assignment along with {@link Response} on + * successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateTableToAutoscale(String resourceGroupName, String accountName, String tableName, Context context); + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getTableRoleAssignmentWithResponseAsync(String resourceGroupName, + String accountName, String roleAssignmentId); /** - * Migrate an Azure Cosmos DB Table from manual throughput to autoscale. + * Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given Id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return parameters to create and update an Azure Cosmos DB Table Role Assignment on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono migrateTableToAutoscaleAsync(String resourceGroupName, String accountName, - String tableName); + Mono getTableRoleAssignmentAsync(String resourceGroupName, String accountName, + String roleAssignmentId); /** - * Migrate an Azure Cosmos DB Table from manual throughput to autoscale. + * Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given Id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return parameters to create and update an Azure Cosmos DB Table Role Assignment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner migrateTableToAutoscale(String resourceGroupName, String accountName, - String tableName); + Response getTableRoleAssignmentWithResponse(String resourceGroupName, + String accountName, String roleAssignmentId, Context context); /** - * Migrate an Azure Cosmos DB Table from manual throughput to autoscale. + * Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given Id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param context The context to associate with this operation. + * @param roleAssignmentId The GUID for the Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return parameters to create and update an Azure Cosmos DB Table Role Assignment. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner migrateTableToAutoscale(String resourceGroupName, String accountName, - String tableName, Context context); + TableRoleAssignmentResourceInner getTableRoleAssignment(String resourceGroupName, String accountName, + String roleAssignmentId); /** - * Migrate an Azure Cosmos DB Table from autoscale to manual throughput. + * Creates or updates an Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateTableRoleAssignmentParameters The properties required to create or update a Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return parameters to create and update an Azure Cosmos DB Table Role Assignment along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> migrateTableToManualThroughputWithResponseAsync(String resourceGroupName, - String accountName, String tableName); + Mono>> createUpdateTableRoleAssignmentWithResponseAsync(String resourceGroupName, + String accountName, String roleAssignmentId, + TableRoleAssignmentResourceInner createUpdateTableRoleAssignmentParameters); /** - * Migrate an Azure Cosmos DB Table from autoscale to manual throughput. + * Creates or updates an Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateTableRoleAssignmentParameters The properties required to create or update a Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link PollerFlux} for polling of parameters to create and update an Azure Cosmos DB Table Role + * Assignment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateTableToManualThroughputAsync(String resourceGroupName, String accountName, String tableName); + PollerFlux, TableRoleAssignmentResourceInner> + beginCreateUpdateTableRoleAssignmentAsync(String resourceGroupName, String accountName, String roleAssignmentId, + TableRoleAssignmentResourceInner createUpdateTableRoleAssignmentParameters); /** - * Migrate an Azure Cosmos DB Table from autoscale to manual throughput. + * Creates or updates an Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateTableRoleAssignmentParameters The properties required to create or update a Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of parameters to create and update an Azure Cosmos DB Table Role + * Assignment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateTableToManualThroughput(String resourceGroupName, String accountName, String tableName); + SyncPoller, TableRoleAssignmentResourceInner> + beginCreateUpdateTableRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId, + TableRoleAssignmentResourceInner createUpdateTableRoleAssignmentParameters); /** - * Migrate an Azure Cosmos DB Table from autoscale to manual throughput. + * Creates or updates an Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateTableRoleAssignmentParameters The properties required to create or update a Role Assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return the {@link SyncPoller} for polling of parameters to create and update an Azure Cosmos DB Table Role + * Assignment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateTableToManualThroughput(String resourceGroupName, String accountName, String tableName, - Context context); + SyncPoller, TableRoleAssignmentResourceInner> + beginCreateUpdateTableRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId, + TableRoleAssignmentResourceInner createUpdateTableRoleAssignmentParameters, Context context); /** - * Migrate an Azure Cosmos DB Table from autoscale to manual throughput. + * Creates or updates an Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateTableRoleAssignmentParameters The properties required to create or update a Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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}. + * @return parameters to create and update an Azure Cosmos DB Table Role Assignment on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono migrateTableToManualThroughputAsync(String resourceGroupName, - String accountName, String tableName); + Mono createUpdateTableRoleAssignmentAsync(String resourceGroupName, + String accountName, String roleAssignmentId, + TableRoleAssignmentResourceInner createUpdateTableRoleAssignmentParameters); /** - * Migrate an Azure Cosmos DB Table from autoscale to manual throughput. + * Creates or updates an Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateTableRoleAssignmentParameters The properties required to create or update a Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return parameters to create and update an Azure Cosmos DB Table Role Assignment. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner migrateTableToManualThroughput(String resourceGroupName, String accountName, - String tableName); + TableRoleAssignmentResourceInner createUpdateTableRoleAssignment(String resourceGroupName, String accountName, + String roleAssignmentId, TableRoleAssignmentResourceInner createUpdateTableRoleAssignmentParameters); /** - * Migrate an Azure Cosmos DB Table from autoscale to manual throughput. + * Creates or updates an Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateTableRoleAssignmentParameters The properties required to create or update a Role Assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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. + * @return parameters to create and update an Azure Cosmos DB Table Role Assignment. */ @ServiceMethod(returns = ReturnType.SINGLE) - ThroughputSettingsGetResultsInner migrateTableToManualThroughput(String resourceGroupName, String accountName, - String tableName, Context context); + TableRoleAssignmentResourceInner createUpdateTableRoleAssignment(String resourceGroupName, String accountName, + String roleAssignmentId, TableRoleAssignmentResourceInner createUpdateTableRoleAssignmentParameters, + Context context); /** - * Retrieves continuous backup information for a table. + * Deletes an existing Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param location The name of the continuous backup restore location. + * @param roleAssignmentId The GUID for the Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup information of a resource along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono>> retrieveContinuousBackupInformationWithResponseAsync(String resourceGroupName, - String accountName, String tableName, ContinuousBackupRestoreLocation location); + Mono>> deleteTableRoleAssignmentWithResponseAsync(String resourceGroupName, + String accountName, String roleAssignmentId); /** - * Retrieves continuous backup information for a table. + * Deletes an existing Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param location The name of the continuous backup restore location. + * @param roleAssignmentId The GUID for the Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 backup information of a resource. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - PollerFlux, BackupInformationInner> - beginRetrieveContinuousBackupInformationAsync(String resourceGroupName, String accountName, String tableName, - ContinuousBackupRestoreLocation location); + PollerFlux, Void> beginDeleteTableRoleAssignmentAsync(String resourceGroupName, String accountName, + String roleAssignmentId); /** - * Retrieves continuous backup information for a table. + * Deletes an existing Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param location The name of the continuous backup restore location. + * @param roleAssignmentId The GUID for the Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 backup information of a resource. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BackupInformationInner> beginRetrieveContinuousBackupInformation( - String resourceGroupName, String accountName, String tableName, ContinuousBackupRestoreLocation location); + SyncPoller, Void> beginDeleteTableRoleAssignment(String resourceGroupName, String accountName, + String roleAssignmentId); /** - * Retrieves continuous backup information for a table. + * Deletes an existing Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param location The name of the continuous backup restore location. + * @param roleAssignmentId The GUID for the Role Assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.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 backup information of a resource. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - SyncPoller, BackupInformationInner> beginRetrieveContinuousBackupInformation( - String resourceGroupName, String accountName, String tableName, ContinuousBackupRestoreLocation location, - Context context); + SyncPoller, Void> beginDeleteTableRoleAssignment(String resourceGroupName, String accountName, + String roleAssignmentId, Context context); /** - * Retrieves continuous backup information for a table. + * Deletes an existing Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param location The name of the continuous backup restore location. + * @param roleAssignmentId The GUID for the Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup information of a resource on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - Mono retrieveContinuousBackupInformationAsync(String resourceGroupName, String accountName, - String tableName, ContinuousBackupRestoreLocation location); + Mono deleteTableRoleAssignmentAsync(String resourceGroupName, String accountName, String roleAssignmentId); /** - * Retrieves continuous backup information for a table. + * Deletes an existing Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param location The name of the continuous backup restore location. + * @param roleAssignmentId The GUID for the Role Assignment. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup information of a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - BackupInformationInner retrieveContinuousBackupInformation(String resourceGroupName, String accountName, - String tableName, ContinuousBackupRestoreLocation location); + void deleteTableRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId); /** - * Retrieves continuous backup information for a table. + * Deletes an existing Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param location The name of the continuous backup restore location. + * @param roleAssignmentId The GUID for the Role Assignment. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. - * @return backup information of a resource. */ @ServiceMethod(returns = ReturnType.SINGLE) - BackupInformationInner retrieveContinuousBackupInformation(String resourceGroupName, String accountName, - String tableName, ContinuousBackupRestoreLocation location, Context context); + void deleteTableRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId, + Context context); + + /** + * Retrieves the list of all Azure Cosmos DB Table Role Assignments. + * + * @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 com.azure.core.management.exception.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 response of a TableRoleAssignmentResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listTableRoleAssignmentsAsync(String resourceGroupName, + String accountName); + + /** + * Retrieves the list of all Azure Cosmos DB Table Role Assignments. + * + * @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 com.azure.core.management.exception.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 response of a TableRoleAssignmentResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listTableRoleAssignments(String resourceGroupName, + String accountName); + + /** + * Retrieves the list of all Azure Cosmos DB Table Role Assignments. + * + * @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 com.azure.core.management.exception.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 response of a TableRoleAssignmentResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listTableRoleAssignments(String resourceGroupName, + String accountName, Context context); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolAccountsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolAccountsClient.java new file mode 100644 index 000000000000..993c1993d89b --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolAccountsClient.java @@ -0,0 +1,311 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cosmos.fluent.models.ThroughputPoolAccountResourceInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ThroughputPoolAccountsClient. + */ +public interface ThroughputPoolAccountsClient { + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool Account along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getWithResponseAsync(String resourceGroupName, + String throughputPoolName, String throughputPoolAccountName); + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool Account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getAsync(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName); + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool Account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getWithResponse(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName, Context context); + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputPoolAccountResourceInner get(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName); + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool Account along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> createWithResponseAsync(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName, ThroughputPoolAccountResourceInner body); + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool Account. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, ThroughputPoolAccountResourceInner> beginCreateAsync( + String resourceGroupName, String throughputPoolName, String throughputPoolAccountName, + ThroughputPoolAccountResourceInner body); + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool Account. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ThroughputPoolAccountResourceInner> beginCreate( + String resourceGroupName, String throughputPoolName, String throughputPoolAccountName, + ThroughputPoolAccountResourceInner body); + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool Account. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ThroughputPoolAccountResourceInner> beginCreate( + String resourceGroupName, String throughputPoolName, String throughputPoolAccountName, + ThroughputPoolAccountResourceInner body, Context context); + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool Account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createAsync(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName, ThroughputPoolAccountResourceInner body); + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputPoolAccountResourceInner create(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName, ThroughputPoolAccountResourceInner body); + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputPoolAccountResourceInner create(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName, ThroughputPoolAccountResourceInner body, Context context); + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono>> deleteWithResponseAsync(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName); + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName); + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, Void> beginDelete(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName); + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, Void> beginDelete(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName, Context context); + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono deleteAsync(String resourceGroupName, String throughputPoolName, String throughputPoolAccountName); + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + void delete(String resourceGroupName, String throughputPoolName, String throughputPoolAccountName); + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + void delete(String resourceGroupName, String throughputPoolName, String throughputPoolAccountName, Context context); +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolAccountsOperationsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolAccountsOperationsClient.java new file mode 100644 index 000000000000..d4c007e372b1 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolAccountsOperationsClient.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cosmos.fluent.models.ThroughputPoolAccountResourceInner; + +/** + * An instance of this class provides access to all the operations defined in ThroughputPoolAccountsOperationsClient. + */ +public interface ThroughputPoolAccountsOperationsClient { + /** + * Lists all the Azure Cosmos DB accounts available under the subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 response of a ThroughputPoolAccountResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(String resourceGroupName, String throughputPoolName); + + /** + * Lists all the Azure Cosmos DB accounts available under the subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 response of a ThroughputPoolAccountResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String throughputPoolName); + + /** + * Lists all the Azure Cosmos DB accounts available under the subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 response of a ThroughputPoolAccountResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(String resourceGroupName, String throughputPoolName, + Context context); +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolsClient.java new file mode 100644 index 000000000000..c5a632c582cb --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolsClient.java @@ -0,0 +1,418 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.Response; +import com.azure.core.management.polling.PollResult; +import com.azure.core.util.Context; +import com.azure.core.util.polling.PollerFlux; +import com.azure.core.util.polling.SyncPoller; +import com.azure.resourcemanager.cosmos.fluent.models.ThroughputPoolResourceInner; +import com.azure.resourcemanager.cosmos.models.ThroughputPoolUpdate; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ThroughputPoolsClient. + */ +public interface ThroughputPoolsClient + extends InnerSupportsGet, InnerSupportsDelete { + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String throughputPoolName); + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono getByResourceGroupAsync(String resourceGroupName, String throughputPoolName); + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Response getByResourceGroupWithResponse(String resourceGroupName, + String throughputPoolName, Context context); + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputPoolResourceInner getByResourceGroup(String resourceGroupName, String throughputPoolName); + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String throughputPoolName, ThroughputPoolResourceInner body); + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, ThroughputPoolResourceInner> + beginCreateOrUpdateAsync(String resourceGroupName, String throughputPoolName, ThroughputPoolResourceInner body); + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ThroughputPoolResourceInner> + beginCreateOrUpdate(String resourceGroupName, String throughputPoolName, ThroughputPoolResourceInner body); + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ThroughputPoolResourceInner> beginCreateOrUpdate( + String resourceGroupName, String throughputPoolName, ThroughputPoolResourceInner body, Context context); + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono createOrUpdateAsync(String resourceGroupName, String throughputPoolName, + ThroughputPoolResourceInner body); + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputPoolResourceInner createOrUpdate(String resourceGroupName, String throughputPoolName, + ThroughputPoolResourceInner body); + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputPoolResourceInner createOrUpdate(String resourceGroupName, String throughputPoolName, + ThroughputPoolResourceInner body, Context context); + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current Throughput Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono>> updateWithResponseAsync(String resourceGroupName, String throughputPoolName, + ThroughputPoolUpdate body); + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current Throughput Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, ThroughputPoolResourceInner> + beginUpdateAsync(String resourceGroupName, String throughputPoolName, ThroughputPoolUpdate body); + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + PollerFlux, ThroughputPoolResourceInner> + beginUpdateAsync(String resourceGroupName, String throughputPoolName); + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ThroughputPoolResourceInner> + beginUpdate(String resourceGroupName, String throughputPoolName); + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current Throughput Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + SyncPoller, ThroughputPoolResourceInner> + beginUpdate(String resourceGroupName, String throughputPoolName, ThroughputPoolUpdate body, Context context); + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current Throughput Pool. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateAsync(String resourceGroupName, String throughputPoolName, + ThroughputPoolUpdate body); + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + Mono updateAsync(String resourceGroupName, String throughputPoolName); + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputPoolResourceInner update(String resourceGroupName, String throughputPoolName); + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current Throughput Pool. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 Throughputpool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + ThroughputPoolResourceInner update(String resourceGroupName, String throughputPoolName, ThroughputPoolUpdate body, + Context context); + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono>> deleteWithResponseAsync(String resourceGroupName, String throughputPoolName); + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String throughputPoolName); + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, Void> beginDelete(String resourceGroupName, String throughputPoolName); + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + SyncPoller, Void> beginDelete(String resourceGroupName, String throughputPoolName, + Context context); + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + Mono deleteAsync(String resourceGroupName, String throughputPoolName); + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + void delete(String resourceGroupName, String throughputPoolName); + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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) + void delete(String resourceGroupName, String throughputPoolName, Context context); +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolsOperationsClient.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolsOperationsClient.java new file mode 100644 index 000000000000..e54bd7e98a63 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolsOperationsClient.java @@ -0,0 +1,87 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent; + +import com.azure.core.annotation.ReturnType; +import com.azure.core.annotation.ServiceMethod; +import com.azure.core.http.rest.PagedFlux; +import com.azure.core.http.rest.PagedIterable; +import com.azure.core.util.Context; +import com.azure.resourcemanager.cosmos.fluent.models.ThroughputPoolResourceInner; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; + +/** + * An instance of this class provides access to all the operations defined in ThroughputPoolsOperationsClient. + */ +public interface ThroughputPoolsOperationsClient extends InnerSupportsListing { + /** + * List all the ThroughputPools in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 response of a ThroughputPoolResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listByResourceGroupAsync(String resourceGroupName); + + /** + * List all the ThroughputPools in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 response of a ThroughputPoolResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName); + + /** + * List all the ThroughputPools in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 response of a ThroughputPoolResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable listByResourceGroup(String resourceGroupName, Context context); + + /** + * Lists all the Azure Cosmos DB Throughput Pools available under the subscription. + * + * @throws com.azure.core.management.exception.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 response of a ThroughputPoolResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedFlux listAsync(); + + /** + * Lists all the Azure Cosmos DB Throughput Pools available under the subscription. + * + * @throws com.azure.core.management.exception.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 response of a ThroughputPoolResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(); + + /** + * Lists all the Azure Cosmos DB Throughput Pools available under the subscription. + * + * @param context The context to associate with this operation. + * @throws IllegalArgumentException thrown if parameters fail the validation. + * @throws com.azure.core.management.exception.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 response of a ThroughputPoolResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + PagedIterable list(Context context); +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/BackupInformationInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/BackupInformationInner.java index fa1c057eac89..f5e89f38cac8 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/BackupInformationInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/BackupInformationInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; @@ -25,7 +25,7 @@ public final class BackupInformationInner implements JsonSerializable { + /* + * The unique identifier of backup. + */ + private String backupId; + + /* + * The current state of the backup. + */ + private BackupState backupState; + + /* + * The time at which the backup process begins. + */ + private OffsetDateTime backupStartTimestamp; + + /* + * The time at which the backup process ends. + */ + private OffsetDateTime backupStopTimestamp; + + /* + * The time at which the backup will expire. + */ + private OffsetDateTime backupExpiryTimestamp; + + /** + * Creates an instance of BackupResourceInner class. + */ + private BackupResourceInner() { + } + + /** + * Get the backupId property: The unique identifier of backup. + * + * @return the backupId value. + */ + public String backupId() { + return this.backupId; + } + + /** + * Get the backupState property: The current state of the backup. + * + * @return the backupState value. + */ + public BackupState backupState() { + return this.backupState; + } + + /** + * Get the backupStartTimestamp property: The time at which the backup process begins. + * + * @return the backupStartTimestamp value. + */ + public OffsetDateTime backupStartTimestamp() { + return this.backupStartTimestamp; + } + + /** + * Get the backupStopTimestamp property: The time at which the backup process ends. + * + * @return the backupStopTimestamp value. + */ + public OffsetDateTime backupStopTimestamp() { + return this.backupStopTimestamp; + } + + /** + * Get the backupExpiryTimestamp property: The time at which the backup will expire. + * + * @return the backupExpiryTimestamp value. + */ + public OffsetDateTime backupExpiryTimestamp() { + return this.backupExpiryTimestamp; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("backupId", this.backupId); + jsonWriter.writeStringField("backupState", this.backupState == null ? null : this.backupState.toString()); + jsonWriter.writeStringField("backupStartTimestamp", + this.backupStartTimestamp == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.backupStartTimestamp)); + jsonWriter.writeStringField("backupStopTimestamp", + this.backupStopTimestamp == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.backupStopTimestamp)); + jsonWriter.writeStringField("backupExpiryTimestamp", + this.backupExpiryTimestamp == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.backupExpiryTimestamp)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BackupResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BackupResourceInner if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BackupResourceInner. + */ + public static BackupResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BackupResourceInner deserializedBackupResourceInner = new BackupResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("backupId".equals(fieldName)) { + deserializedBackupResourceInner.backupId = reader.getString(); + } else if ("backupState".equals(fieldName)) { + deserializedBackupResourceInner.backupState = BackupState.fromString(reader.getString()); + } else if ("backupStartTimestamp".equals(fieldName)) { + deserializedBackupResourceInner.backupStartTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("backupStopTimestamp".equals(fieldName)) { + deserializedBackupResourceInner.backupStopTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("backupExpiryTimestamp".equals(fieldName)) { + deserializedBackupResourceInner.backupExpiryTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedBackupResourceInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraClusterPublicStatusInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraClusterPublicStatusInner.java index d98c3a6aaaf2..05b1d5f582bc 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraClusterPublicStatusInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraClusterPublicStatusInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -19,7 +19,7 @@ /** * Properties of a managed Cassandra cluster public status. */ -@Fluent +@Immutable public final class CassandraClusterPublicStatusInner implements JsonSerializable { /* * The eTag property. @@ -49,7 +49,7 @@ public final class CassandraClusterPublicStatusInner implements JsonSerializable /** * Creates an instance of CassandraClusterPublicStatusInner class. */ - public CassandraClusterPublicStatusInner() { + private CassandraClusterPublicStatusInner() { } /** @@ -61,17 +61,6 @@ public String etag() { return this.etag; } - /** - * Set the etag property: The eTag property. - * - * @param etag the etag value to set. - * @return the CassandraClusterPublicStatusInner object itself. - */ - public CassandraClusterPublicStatusInner withEtag(String etag) { - this.etag = etag; - return this; - } - /** * Get the reaperStatus property: The reaperStatus property. * @@ -81,17 +70,6 @@ public ManagedCassandraReaperStatus reaperStatus() { return this.reaperStatus; } - /** - * Set the reaperStatus property: The reaperStatus property. - * - * @param reaperStatus the reaperStatus value to set. - * @return the CassandraClusterPublicStatusInner object itself. - */ - public CassandraClusterPublicStatusInner withReaperStatus(ManagedCassandraReaperStatus reaperStatus) { - this.reaperStatus = reaperStatus; - return this; - } - /** * Get the connectionErrors property: List relevant information about any connection errors to the Datacenters. * @@ -101,17 +79,6 @@ public List connectionErrors() { return this.connectionErrors; } - /** - * Set the connectionErrors property: List relevant information about any connection errors to the Datacenters. - * - * @param connectionErrors the connectionErrors value to set. - * @return the CassandraClusterPublicStatusInner object itself. - */ - public CassandraClusterPublicStatusInner withConnectionErrors(List connectionErrors) { - this.connectionErrors = connectionErrors; - return this; - } - /** * Get the errors property: List relevant information about any errors about cluster, data center and connection * error. @@ -122,18 +89,6 @@ public List errors() { return this.errors; } - /** - * Set the errors property: List relevant information about any errors about cluster, data center and connection - * error. - * - * @param errors the errors value to set. - * @return the CassandraClusterPublicStatusInner object itself. - */ - public CassandraClusterPublicStatusInner withErrors(List errors) { - this.errors = errors; - return this; - } - /** * Get the dataCenters property: List of the status of each datacenter in this cluster. * @@ -143,18 +98,6 @@ public List dataCenters() { return this.dataCenters; } - /** - * Set the dataCenters property: List of the status of each datacenter in this cluster. - * - * @param dataCenters the dataCenters value to set. - * @return the CassandraClusterPublicStatusInner object itself. - */ - public CassandraClusterPublicStatusInner - withDataCenters(List dataCenters) { - this.dataCenters = dataCenters; - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraKeyspaceCreateUpdateProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraKeyspaceCreateUpdateProperties.java index 048ff9b6d8db..eebce3d1dada 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraKeyspaceCreateUpdateProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraKeyspaceCreateUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraKeyspaceGetProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraKeyspaceGetProperties.java index 72186cfdce03..3df7247c4a10 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraKeyspaceGetProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraKeyspaceGetProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The properties of an Azure Cosmos DB Cassandra keyspace. */ -@Fluent +@Immutable public final class CassandraKeyspaceGetProperties implements JsonSerializable { /* * The resource property. @@ -31,7 +31,7 @@ public final class CassandraKeyspaceGetProperties implements JsonSerializable tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Identity for the resource. + */ + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -42,7 +64,7 @@ public final class CassandraKeyspaceGetResultsInner extends ArmResourcePropertie /** * Creates an instance of CassandraKeyspaceGetResultsInner class. */ - public CassandraKeyspaceGetResultsInner() { + private CassandraKeyspaceGetResultsInner() { } /** @@ -54,6 +76,42 @@ private CassandraKeyspaceGetProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -84,24 +142,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public CassandraKeyspaceGetResultsInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CassandraKeyspaceGetResultsInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the resource property: The resource property. * @@ -111,20 +151,6 @@ public CassandraKeyspaceGetPropertiesResource resource() { return this.innerProperties() == null ? null : this.innerProperties().resource(); } - /** - * Set the resource property: The resource property. - * - * @param resource the resource value to set. - * @return the CassandraKeyspaceGetResultsInner object itself. - */ - public CassandraKeyspaceGetResultsInner withResource(CassandraKeyspaceGetPropertiesResource resource) { - if (this.innerProperties() == null) { - this.innerProperties = new CassandraKeyspaceGetProperties(); - } - this.innerProperties().withResource(resource); - return this; - } - /** * Get the options property: The options property. * @@ -134,30 +160,18 @@ public CassandraKeyspaceGetPropertiesOptions options() { return this.innerProperties() == null ? null : this.innerProperties().options(); } - /** - * Set the options property: The options property. - * - * @param options the options value to set. - * @return the CassandraKeyspaceGetResultsInner object itself. - */ - public CassandraKeyspaceGetResultsInner withOptions(CassandraKeyspaceGetPropertiesOptions options) { - if (this.innerProperties() == null) { - this.innerProperties = new CassandraKeyspaceGetProperties(); - } - this.innerProperties().withOptions(options); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() != null) { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } /** @@ -166,9 +180,10 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -195,14 +210,18 @@ public static CassandraKeyspaceGetResultsInner fromJson(JsonReader jsonReader) t deserializedCassandraKeyspaceGetResultsInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedCassandraKeyspaceGetResultsInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedCassandraKeyspaceGetResultsInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedCassandraKeyspaceGetResultsInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedCassandraKeyspaceGetResultsInner.innerProperties = CassandraKeyspaceGetProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCassandraKeyspaceGetResultsInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedCassandraKeyspaceGetResultsInner.location = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedCassandraKeyspaceGetResultsInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCassandraKeyspaceGetResultsInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraRoleAssignmentResourceInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraRoleAssignmentResourceInner.java new file mode 100644 index 000000000000..e4365ad3a5c0 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraRoleAssignmentResourceInner.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters to create and update an Azure Cosmos DB Cassandra Role Assignment. + */ +@Fluent +public final class CassandraRoleAssignmentResourceInner extends ProxyResource { + /* + * Properties to create and update an Azure Cosmos DB Cassandra Role Assignment. + */ + private CassandraRoleAssignmentResourceProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of CassandraRoleAssignmentResourceInner class. + */ + public CassandraRoleAssignmentResourceInner() { + } + + /** + * Get the innerProperties property: Properties to create and update an Azure Cosmos DB Cassandra Role Assignment. + * + * @return the innerProperties value. + */ + private CassandraRoleAssignmentResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the roleDefinitionId property: The unique identifier for the associated Role Definition. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.innerProperties() == null ? null : this.innerProperties().roleDefinitionId(); + } + + /** + * Set the roleDefinitionId property: The unique identifier for the associated Role Definition. + * + * @param roleDefinitionId the roleDefinitionId value to set. + * @return the CassandraRoleAssignmentResourceInner object itself. + */ + public CassandraRoleAssignmentResourceInner withRoleDefinitionId(String roleDefinitionId) { + if (this.innerProperties() == null) { + this.innerProperties = new CassandraRoleAssignmentResourceProperties(); + } + this.innerProperties().withRoleDefinitionId(roleDefinitionId); + return this; + } + + /** + * Get the scope property: The data plane resource path for which access is being granted through this Cassandra + * Role Assignment. + * + * @return the scope value. + */ + public String scope() { + return this.innerProperties() == null ? null : this.innerProperties().scope(); + } + + /** + * Set the scope property: The data plane resource path for which access is being granted through this Cassandra + * Role Assignment. + * + * @param scope the scope value to set. + * @return the CassandraRoleAssignmentResourceInner object itself. + */ + public CassandraRoleAssignmentResourceInner withScope(String scope) { + if (this.innerProperties() == null) { + this.innerProperties = new CassandraRoleAssignmentResourceProperties(); + } + this.innerProperties().withScope(scope); + return this; + } + + /** + * Get the principalId property: The unique identifier for the associated AAD principal in the AAD graph to which + * access is being granted through this Cassandra Role Assignment. Tenant ID for the principal is inferred using the + * tenant associated with the subscription. + * + * @return the principalId value. + */ + public String principalId() { + return this.innerProperties() == null ? null : this.innerProperties().principalId(); + } + + /** + * Set the principalId property: The unique identifier for the associated AAD principal in the AAD graph to which + * access is being granted through this Cassandra Role Assignment. Tenant ID for the principal is inferred using the + * tenant associated with the subscription. + * + * @param principalId the principalId value to set. + * @return the CassandraRoleAssignmentResourceInner object itself. + */ + public CassandraRoleAssignmentResourceInner withPrincipalId(String principalId) { + if (this.innerProperties() == null) { + this.innerProperties = new CassandraRoleAssignmentResourceProperties(); + } + this.innerProperties().withPrincipalId(principalId); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CassandraRoleAssignmentResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CassandraRoleAssignmentResourceInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CassandraRoleAssignmentResourceInner. + */ + public static CassandraRoleAssignmentResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CassandraRoleAssignmentResourceInner deserializedCassandraRoleAssignmentResourceInner + = new CassandraRoleAssignmentResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCassandraRoleAssignmentResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCassandraRoleAssignmentResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCassandraRoleAssignmentResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedCassandraRoleAssignmentResourceInner.innerProperties + = CassandraRoleAssignmentResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCassandraRoleAssignmentResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCassandraRoleAssignmentResourceInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraRoleAssignmentResourceProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraRoleAssignmentResourceProperties.java new file mode 100644 index 000000000000..3a49b47c1a66 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraRoleAssignmentResourceProperties.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Azure Cosmos DB Cassandra Role Assignment resource object. + */ +@Fluent +public final class CassandraRoleAssignmentResourceProperties + implements JsonSerializable { + /* + * The unique identifier for the associated Role Definition. + */ + private String roleDefinitionId; + + /* + * The data plane resource path for which access is being granted through this Cassandra Role Assignment. + */ + private String scope; + + /* + * The unique identifier for the associated AAD principal in the AAD graph to which access is being granted through + * this Cassandra Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the + * subscription. + */ + private String principalId; + + /* + * Provisioning state of the resource. + */ + private String provisioningState; + + /** + * Creates an instance of CassandraRoleAssignmentResourceProperties class. + */ + public CassandraRoleAssignmentResourceProperties() { + } + + /** + * Get the roleDefinitionId property: The unique identifier for the associated Role Definition. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.roleDefinitionId; + } + + /** + * Set the roleDefinitionId property: The unique identifier for the associated Role Definition. + * + * @param roleDefinitionId the roleDefinitionId value to set. + * @return the CassandraRoleAssignmentResourceProperties object itself. + */ + public CassandraRoleAssignmentResourceProperties withRoleDefinitionId(String roleDefinitionId) { + this.roleDefinitionId = roleDefinitionId; + return this; + } + + /** + * Get the scope property: The data plane resource path for which access is being granted through this Cassandra + * Role Assignment. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: The data plane resource path for which access is being granted through this Cassandra + * Role Assignment. + * + * @param scope the scope value to set. + * @return the CassandraRoleAssignmentResourceProperties object itself. + */ + public CassandraRoleAssignmentResourceProperties withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the principalId property: The unique identifier for the associated AAD principal in the AAD graph to which + * access is being granted through this Cassandra Role Assignment. Tenant ID for the principal is inferred using the + * tenant associated with the subscription. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The unique identifier for the associated AAD principal in the AAD graph to which + * access is being granted through this Cassandra Role Assignment. Tenant ID for the principal is inferred using the + * tenant associated with the subscription. + * + * @param principalId the principalId value to set. + * @return the CassandraRoleAssignmentResourceProperties object itself. + */ + public CassandraRoleAssignmentResourceProperties withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("roleDefinitionId", this.roleDefinitionId); + jsonWriter.writeStringField("scope", this.scope); + jsonWriter.writeStringField("principalId", this.principalId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CassandraRoleAssignmentResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CassandraRoleAssignmentResourceProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CassandraRoleAssignmentResourceProperties. + */ + public static CassandraRoleAssignmentResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CassandraRoleAssignmentResourceProperties deserializedCassandraRoleAssignmentResourceProperties + = new CassandraRoleAssignmentResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("roleDefinitionId".equals(fieldName)) { + deserializedCassandraRoleAssignmentResourceProperties.roleDefinitionId = reader.getString(); + } else if ("scope".equals(fieldName)) { + deserializedCassandraRoleAssignmentResourceProperties.scope = reader.getString(); + } else if ("principalId".equals(fieldName)) { + deserializedCassandraRoleAssignmentResourceProperties.principalId = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedCassandraRoleAssignmentResourceProperties.provisioningState = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCassandraRoleAssignmentResourceProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraRoleDefinitionResourceInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraRoleDefinitionResourceInner.java new file mode 100644 index 000000000000..2da6358dc8b6 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraRoleDefinitionResourceInner.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.Permission; +import com.azure.resourcemanager.cosmos.models.RoleDefinitionType; +import java.io.IOException; +import java.util.List; + +/** + * Parameters to create and update an Azure Cosmos DB Cassandra Role Definition. + */ +@Fluent +public final class CassandraRoleDefinitionResourceInner extends ProxyResource { + /* + * Properties to create and update an Azure Cosmos DB Cassandra Role Definition. + */ + private CassandraRoleDefinitionResourceProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of CassandraRoleDefinitionResourceInner class. + */ + public CassandraRoleDefinitionResourceInner() { + } + + /** + * Get the innerProperties property: Properties to create and update an Azure Cosmos DB Cassandra Role Definition. + * + * @return the innerProperties value. + */ + private CassandraRoleDefinitionResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the id property: The path id for the Role Definition. + * + * @return the id value. + */ + public String idPropertiesId() { + return this.innerProperties() == null ? null : this.innerProperties().id(); + } + + /** + * Set the id property: The path id for the Role Definition. + * + * @param id the id value to set. + * @return the CassandraRoleDefinitionResourceInner object itself. + */ + public CassandraRoleDefinitionResourceInner withIdPropertiesId(String id) { + if (this.innerProperties() == null) { + this.innerProperties = new CassandraRoleDefinitionResourceProperties(); + } + this.innerProperties().withId(id); + return this; + } + + /** + * Get the roleName property: A user-friendly name for the Role Definition. Must be unique for the database account. + * + * @return the roleName value. + */ + public String roleName() { + return this.innerProperties() == null ? null : this.innerProperties().roleName(); + } + + /** + * Set the roleName property: A user-friendly name for the Role Definition. Must be unique for the database account. + * + * @param roleName the roleName value to set. + * @return the CassandraRoleDefinitionResourceInner object itself. + */ + public CassandraRoleDefinitionResourceInner withRoleName(String roleName) { + if (this.innerProperties() == null) { + this.innerProperties = new CassandraRoleDefinitionResourceProperties(); + } + this.innerProperties().withRoleName(roleName); + return this; + } + + /** + * Get the type property: Indicates whether the Role Definition was built-in or user created. + * + * @return the type value. + */ + public RoleDefinitionType typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: Indicates whether the Role Definition was built-in or user created. + * + * @param type the type value to set. + * @return the CassandraRoleDefinitionResourceInner object itself. + */ + public CassandraRoleDefinitionResourceInner withTypePropertiesType(RoleDefinitionType type) { + if (this.innerProperties() == null) { + this.innerProperties = new CassandraRoleDefinitionResourceProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the assignableScopes property: A set of fully qualified Scopes at or below which Cassandra Role Assignments + * may be created using this Role Definition. This will allow application of this Role Definition on the entire + * database account or any underlying Database / Collection. Must have at least one element. Scopes higher than + * Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes + * need not exist. + * + * @return the assignableScopes value. + */ + public List assignableScopes() { + return this.innerProperties() == null ? null : this.innerProperties().assignableScopes(); + } + + /** + * Set the assignableScopes property: A set of fully qualified Scopes at or below which Cassandra Role Assignments + * may be created using this Role Definition. This will allow application of this Role Definition on the entire + * database account or any underlying Database / Collection. Must have at least one element. Scopes higher than + * Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes + * need not exist. + * + * @param assignableScopes the assignableScopes value to set. + * @return the CassandraRoleDefinitionResourceInner object itself. + */ + public CassandraRoleDefinitionResourceInner withAssignableScopes(List assignableScopes) { + if (this.innerProperties() == null) { + this.innerProperties = new CassandraRoleDefinitionResourceProperties(); + } + this.innerProperties().withAssignableScopes(assignableScopes); + return this; + } + + /** + * Get the permissions property: The set of operations allowed through this Role Definition. + * + * @return the permissions value. + */ + public List permissions() { + return this.innerProperties() == null ? null : this.innerProperties().permissions(); + } + + /** + * Set the permissions property: The set of operations allowed through this Role Definition. + * + * @param permissions the permissions value to set. + * @return the CassandraRoleDefinitionResourceInner object itself. + */ + public CassandraRoleDefinitionResourceInner withPermissions(List permissions) { + if (this.innerProperties() == null) { + this.innerProperties = new CassandraRoleDefinitionResourceProperties(); + } + this.innerProperties().withPermissions(permissions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CassandraRoleDefinitionResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CassandraRoleDefinitionResourceInner if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CassandraRoleDefinitionResourceInner. + */ + public static CassandraRoleDefinitionResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CassandraRoleDefinitionResourceInner deserializedCassandraRoleDefinitionResourceInner + = new CassandraRoleDefinitionResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCassandraRoleDefinitionResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCassandraRoleDefinitionResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCassandraRoleDefinitionResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedCassandraRoleDefinitionResourceInner.innerProperties + = CassandraRoleDefinitionResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCassandraRoleDefinitionResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCassandraRoleDefinitionResourceInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraRoleDefinitionResourceProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraRoleDefinitionResourceProperties.java new file mode 100644 index 000000000000..7b014b5742db --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraRoleDefinitionResourceProperties.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.Permission; +import com.azure.resourcemanager.cosmos.models.RoleDefinitionType; +import java.io.IOException; +import java.util.List; + +/** + * Azure Cosmos DB Cassandra Role Definition resource object. + */ +@Fluent +public final class CassandraRoleDefinitionResourceProperties + implements JsonSerializable { + /* + * The path id for the Role Definition. + */ + private String id; + + /* + * A user-friendly name for the Role Definition. Must be unique for the database account. + */ + private String roleName; + + /* + * Indicates whether the Role Definition was built-in or user created. + */ + private RoleDefinitionType type; + + /* + * A set of fully qualified Scopes at or below which Cassandra Role Assignments may be created using this Role + * Definition. This will allow application of this Role Definition on the entire database account or any underlying + * Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as + * assignable Scopes. Note that resources referenced in assignable Scopes need not exist. + */ + private List assignableScopes; + + /* + * The set of operations allowed through this Role Definition. + */ + private List permissions; + + /** + * Creates an instance of CassandraRoleDefinitionResourceProperties class. + */ + public CassandraRoleDefinitionResourceProperties() { + } + + /** + * Get the id property: The path id for the Role Definition. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The path id for the Role Definition. + * + * @param id the id value to set. + * @return the CassandraRoleDefinitionResourceProperties object itself. + */ + public CassandraRoleDefinitionResourceProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the roleName property: A user-friendly name for the Role Definition. Must be unique for the database account. + * + * @return the roleName value. + */ + public String roleName() { + return this.roleName; + } + + /** + * Set the roleName property: A user-friendly name for the Role Definition. Must be unique for the database account. + * + * @param roleName the roleName value to set. + * @return the CassandraRoleDefinitionResourceProperties object itself. + */ + public CassandraRoleDefinitionResourceProperties withRoleName(String roleName) { + this.roleName = roleName; + return this; + } + + /** + * Get the type property: Indicates whether the Role Definition was built-in or user created. + * + * @return the type value. + */ + public RoleDefinitionType type() { + return this.type; + } + + /** + * Set the type property: Indicates whether the Role Definition was built-in or user created. + * + * @param type the type value to set. + * @return the CassandraRoleDefinitionResourceProperties object itself. + */ + public CassandraRoleDefinitionResourceProperties withType(RoleDefinitionType type) { + this.type = type; + return this; + } + + /** + * Get the assignableScopes property: A set of fully qualified Scopes at or below which Cassandra Role Assignments + * may be created using this Role Definition. This will allow application of this Role Definition on the entire + * database account or any underlying Database / Collection. Must have at least one element. Scopes higher than + * Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes + * need not exist. + * + * @return the assignableScopes value. + */ + public List assignableScopes() { + return this.assignableScopes; + } + + /** + * Set the assignableScopes property: A set of fully qualified Scopes at or below which Cassandra Role Assignments + * may be created using this Role Definition. This will allow application of this Role Definition on the entire + * database account or any underlying Database / Collection. Must have at least one element. Scopes higher than + * Database account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes + * need not exist. + * + * @param assignableScopes the assignableScopes value to set. + * @return the CassandraRoleDefinitionResourceProperties object itself. + */ + public CassandraRoleDefinitionResourceProperties withAssignableScopes(List assignableScopes) { + this.assignableScopes = assignableScopes; + return this; + } + + /** + * Get the permissions property: The set of operations allowed through this Role Definition. + * + * @return the permissions value. + */ + public List permissions() { + return this.permissions; + } + + /** + * Set the permissions property: The set of operations allowed through this Role Definition. + * + * @param permissions the permissions value to set. + * @return the CassandraRoleDefinitionResourceProperties object itself. + */ + public CassandraRoleDefinitionResourceProperties withPermissions(List permissions) { + this.permissions = permissions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (permissions() != null) { + permissions().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("roleName", this.roleName); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeArrayField("assignableScopes", this.assignableScopes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("permissions", this.permissions, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CassandraRoleDefinitionResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CassandraRoleDefinitionResourceProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CassandraRoleDefinitionResourceProperties. + */ + public static CassandraRoleDefinitionResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CassandraRoleDefinitionResourceProperties deserializedCassandraRoleDefinitionResourceProperties + = new CassandraRoleDefinitionResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCassandraRoleDefinitionResourceProperties.id = reader.getString(); + } else if ("roleName".equals(fieldName)) { + deserializedCassandraRoleDefinitionResourceProperties.roleName = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCassandraRoleDefinitionResourceProperties.type + = RoleDefinitionType.fromString(reader.getString()); + } else if ("assignableScopes".equals(fieldName)) { + List assignableScopes = reader.readArray(reader1 -> reader1.getString()); + deserializedCassandraRoleDefinitionResourceProperties.assignableScopes = assignableScopes; + } else if ("permissions".equals(fieldName)) { + List permissions = reader.readArray(reader1 -> Permission.fromJson(reader1)); + deserializedCassandraRoleDefinitionResourceProperties.permissions = permissions; + } else { + reader.skipChildren(); + } + } + + return deserializedCassandraRoleDefinitionResourceProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraTableCreateUpdateProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraTableCreateUpdateProperties.java index 33668ee35913..75652ae41400 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraTableCreateUpdateProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraTableCreateUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraTableGetProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraTableGetProperties.java index d4556a6fd5de..1676a74ac816 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraTableGetProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraTableGetProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The properties of an Azure Cosmos DB Cassandra table. */ -@Fluent +@Immutable public final class CassandraTableGetProperties implements JsonSerializable { /* * The resource property. @@ -31,7 +31,7 @@ public final class CassandraTableGetProperties implements JsonSerializable tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Identity for the resource. + */ + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -42,7 +64,7 @@ public final class CassandraTableGetResultsInner extends ArmResourceProperties { /** * Creates an instance of CassandraTableGetResultsInner class. */ - public CassandraTableGetResultsInner() { + private CassandraTableGetResultsInner() { } /** @@ -54,6 +76,42 @@ private CassandraTableGetProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -84,24 +142,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public CassandraTableGetResultsInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CassandraTableGetResultsInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the resource property: The resource property. * @@ -111,20 +151,6 @@ public CassandraTableGetPropertiesResource resource() { return this.innerProperties() == null ? null : this.innerProperties().resource(); } - /** - * Set the resource property: The resource property. - * - * @param resource the resource value to set. - * @return the CassandraTableGetResultsInner object itself. - */ - public CassandraTableGetResultsInner withResource(CassandraTableGetPropertiesResource resource) { - if (this.innerProperties() == null) { - this.innerProperties = new CassandraTableGetProperties(); - } - this.innerProperties().withResource(resource); - return this; - } - /** * Get the options property: The options property. * @@ -134,30 +160,18 @@ public CassandraTableGetPropertiesOptions options() { return this.innerProperties() == null ? null : this.innerProperties().options(); } - /** - * Set the options property: The options property. - * - * @param options the options value to set. - * @return the CassandraTableGetResultsInner object itself. - */ - public CassandraTableGetResultsInner withOptions(CassandraTableGetPropertiesOptions options) { - if (this.innerProperties() == null) { - this.innerProperties = new CassandraTableGetProperties(); - } - this.innerProperties().withOptions(options); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() != null) { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } /** @@ -166,9 +180,10 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -195,14 +210,18 @@ public static CassandraTableGetResultsInner fromJson(JsonReader jsonReader) thro deserializedCassandraTableGetResultsInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedCassandraTableGetResultsInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedCassandraTableGetResultsInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedCassandraTableGetResultsInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedCassandraTableGetResultsInner.innerProperties = CassandraTableGetProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCassandraTableGetResultsInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedCassandraTableGetResultsInner.location = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedCassandraTableGetResultsInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCassandraTableGetResultsInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraViewCreateUpdateProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraViewCreateUpdateProperties.java new file mode 100644 index 000000000000..a1cbdc91afe9 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraViewCreateUpdateProperties.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.CassandraViewResource; +import com.azure.resourcemanager.cosmos.models.CreateUpdateOptions; +import java.io.IOException; + +/** + * Properties to create and update Azure Cosmos DB Cassandra view. + */ +@Fluent +public final class CassandraViewCreateUpdateProperties + implements JsonSerializable { + /* + * The standard JSON format of a Cassandra view + */ + private CassandraViewResource resource; + + /* + * A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + */ + private CreateUpdateOptions options; + + /** + * Creates an instance of CassandraViewCreateUpdateProperties class. + */ + public CassandraViewCreateUpdateProperties() { + } + + /** + * Get the resource property: The standard JSON format of a Cassandra view. + * + * @return the resource value. + */ + public CassandraViewResource resource() { + return this.resource; + } + + /** + * Set the resource property: The standard JSON format of a Cassandra view. + * + * @param resource the resource value to set. + * @return the CassandraViewCreateUpdateProperties object itself. + */ + public CassandraViewCreateUpdateProperties withResource(CassandraViewResource resource) { + this.resource = resource; + return this; + } + + /** + * Get the options property: A key-value pair of options to be applied for the request. This corresponds to the + * headers sent with the request. + * + * @return the options value. + */ + public CreateUpdateOptions options() { + return this.options; + } + + /** + * Set the options property: A key-value pair of options to be applied for the request. This corresponds to the + * headers sent with the request. + * + * @param options the options value to set. + * @return the CassandraViewCreateUpdateProperties object itself. + */ + public CassandraViewCreateUpdateProperties withOptions(CreateUpdateOptions options) { + this.options = options; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resource() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property resource in model CassandraViewCreateUpdateProperties")); + } else { + resource().validate(); + } + if (options() != null) { + options().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CassandraViewCreateUpdateProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("resource", this.resource); + jsonWriter.writeJsonField("options", this.options); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CassandraViewCreateUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CassandraViewCreateUpdateProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CassandraViewCreateUpdateProperties. + */ + public static CassandraViewCreateUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CassandraViewCreateUpdateProperties deserializedCassandraViewCreateUpdateProperties + = new CassandraViewCreateUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resource".equals(fieldName)) { + deserializedCassandraViewCreateUpdateProperties.resource = CassandraViewResource.fromJson(reader); + } else if ("options".equals(fieldName)) { + deserializedCassandraViewCreateUpdateProperties.options = CreateUpdateOptions.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCassandraViewCreateUpdateProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraViewGetProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraViewGetProperties.java new file mode 100644 index 000000000000..39ee31616821 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraViewGetProperties.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.CassandraViewGetPropertiesOptions; +import com.azure.resourcemanager.cosmos.models.CassandraViewGetPropertiesResource; +import java.io.IOException; + +/** + * The properties of an Azure Cosmos DB Cassandra view. + */ +@Immutable +public final class CassandraViewGetProperties implements JsonSerializable { + /* + * The resource property. + */ + private CassandraViewGetPropertiesResource resource; + + /* + * The options property. + */ + private CassandraViewGetPropertiesOptions options; + + /** + * Creates an instance of CassandraViewGetProperties class. + */ + private CassandraViewGetProperties() { + } + + /** + * Get the resource property: The resource property. + * + * @return the resource value. + */ + public CassandraViewGetPropertiesResource resource() { + return this.resource; + } + + /** + * Get the options property: The options property. + * + * @return the options value. + */ + public CassandraViewGetPropertiesOptions options() { + return this.options; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resource() != null) { + resource().validate(); + } + if (options() != null) { + options().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("resource", this.resource); + jsonWriter.writeJsonField("options", this.options); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CassandraViewGetProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CassandraViewGetProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CassandraViewGetProperties. + */ + public static CassandraViewGetProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CassandraViewGetProperties deserializedCassandraViewGetProperties = new CassandraViewGetProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resource".equals(fieldName)) { + deserializedCassandraViewGetProperties.resource + = CassandraViewGetPropertiesResource.fromJson(reader); + } else if ("options".equals(fieldName)) { + deserializedCassandraViewGetProperties.options = CassandraViewGetPropertiesOptions.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCassandraViewGetProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraViewGetResultsInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraViewGetResultsInner.java new file mode 100644 index 000000000000..919133d78ef6 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraViewGetResultsInner.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.CassandraViewGetPropertiesOptions; +import com.azure.resourcemanager.cosmos.models.CassandraViewGetPropertiesResource; +import com.azure.resourcemanager.cosmos.models.ManagedServiceIdentity; +import java.io.IOException; +import java.util.Map; + +/** + * An Azure Cosmos DB Cassandra view. + */ +@Immutable +public final class CassandraViewGetResultsInner extends ProxyResource { + /* + * The properties of an Azure Cosmos DB Cassandra view + */ + private CassandraViewGetProperties innerProperties; + + /* + * Resource tags. + */ + private Map tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Identity for the resource. + */ + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of CassandraViewGetResultsInner class. + */ + private CassandraViewGetResultsInner() { + } + + /** + * Get the innerProperties property: The properties of an Azure Cosmos DB Cassandra view. + * + * @return the innerProperties value. + */ + private CassandraViewGetProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the resource property: The resource property. + * + * @return the resource value. + */ + public CassandraViewGetPropertiesResource resource() { + return this.innerProperties() == null ? null : this.innerProperties().resource(); + } + + /** + * Get the options property: The options property. + * + * @return the options value. + */ + public CassandraViewGetPropertiesOptions options() { + return this.innerProperties() == null ? null : this.innerProperties().options(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CassandraViewGetResultsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CassandraViewGetResultsInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CassandraViewGetResultsInner. + */ + public static CassandraViewGetResultsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CassandraViewGetResultsInner deserializedCassandraViewGetResultsInner = new CassandraViewGetResultsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCassandraViewGetResultsInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCassandraViewGetResultsInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCassandraViewGetResultsInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedCassandraViewGetResultsInner.innerProperties + = CassandraViewGetProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCassandraViewGetResultsInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedCassandraViewGetResultsInner.location = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedCassandraViewGetResultsInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCassandraViewGetResultsInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCassandraViewGetResultsInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ChaosFaultProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ChaosFaultProperties.java new file mode 100644 index 000000000000..1082245896ad --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ChaosFaultProperties.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.SupportedActions; +import java.io.IOException; + +/** + * A request object to enable/disable the chaos fault. + */ +@Fluent +public final class ChaosFaultProperties implements JsonSerializable { + /* + * Indicates whether what action to take for the Chaos Fault. + */ + private SupportedActions action; + + /* + * Region of the account where the Chaos Fault is to be enabled/disabled. + */ + private String region; + + /* + * Database name. + */ + private String databaseName; + + /* + * Container name. + */ + private String containerName; + + /* + * A provisioning state of the Chaos Fault. + */ + private String provisioningState; + + /** + * Creates an instance of ChaosFaultProperties class. + */ + public ChaosFaultProperties() { + } + + /** + * Get the action property: Indicates whether what action to take for the Chaos Fault. + * + * @return the action value. + */ + public SupportedActions action() { + return this.action; + } + + /** + * Set the action property: Indicates whether what action to take for the Chaos Fault. + * + * @param action the action value to set. + * @return the ChaosFaultProperties object itself. + */ + public ChaosFaultProperties withAction(SupportedActions action) { + this.action = action; + return this; + } + + /** + * Get the region property: Region of the account where the Chaos Fault is to be enabled/disabled. + * + * @return the region value. + */ + public String region() { + return this.region; + } + + /** + * Set the region property: Region of the account where the Chaos Fault is to be enabled/disabled. + * + * @param region the region value to set. + * @return the ChaosFaultProperties object itself. + */ + public ChaosFaultProperties withRegion(String region) { + this.region = region; + return this; + } + + /** + * Get the databaseName property: Database name. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: Database name. + * + * @param databaseName the databaseName value to set. + * @return the ChaosFaultProperties object itself. + */ + public ChaosFaultProperties withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the containerName property: Container name. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: Container name. + * + * @param containerName the containerName value to set. + * @return the ChaosFaultProperties object itself. + */ + public ChaosFaultProperties withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the provisioningState property: A provisioning state of the Chaos Fault. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("action", this.action == null ? null : this.action.toString()); + jsonWriter.writeStringField("region", this.region); + jsonWriter.writeStringField("databaseName", this.databaseName); + jsonWriter.writeStringField("containerName", this.containerName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChaosFaultProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChaosFaultProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ChaosFaultProperties. + */ + public static ChaosFaultProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ChaosFaultProperties deserializedChaosFaultProperties = new ChaosFaultProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("action".equals(fieldName)) { + deserializedChaosFaultProperties.action = SupportedActions.fromString(reader.getString()); + } else if ("region".equals(fieldName)) { + deserializedChaosFaultProperties.region = reader.getString(); + } else if ("databaseName".equals(fieldName)) { + deserializedChaosFaultProperties.databaseName = reader.getString(); + } else if ("containerName".equals(fieldName)) { + deserializedChaosFaultProperties.containerName = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedChaosFaultProperties.provisioningState = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedChaosFaultProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ChaosFaultResourceInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ChaosFaultResourceInner.java new file mode 100644 index 000000000000..65d6b6e8da21 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ChaosFaultResourceInner.java @@ -0,0 +1,256 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.SupportedActions; +import java.io.IOException; + +/** + * A request object to enable/disable the chaos fault. + */ +@Fluent +public final class ChaosFaultResourceInner extends ProxyResource { + /* + * A request object to enable/disable the chaos fault. + */ + private ChaosFaultProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ChaosFaultResourceInner class. + */ + public ChaosFaultResourceInner() { + } + + /** + * Get the innerProperties property: A request object to enable/disable the chaos fault. + * + * @return the innerProperties value. + */ + private ChaosFaultProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the action property: Indicates whether what action to take for the Chaos Fault. + * + * @return the action value. + */ + public SupportedActions action() { + return this.innerProperties() == null ? null : this.innerProperties().action(); + } + + /** + * Set the action property: Indicates whether what action to take for the Chaos Fault. + * + * @param action the action value to set. + * @return the ChaosFaultResourceInner object itself. + */ + public ChaosFaultResourceInner withAction(SupportedActions action) { + if (this.innerProperties() == null) { + this.innerProperties = new ChaosFaultProperties(); + } + this.innerProperties().withAction(action); + return this; + } + + /** + * Get the region property: Region of the account where the Chaos Fault is to be enabled/disabled. + * + * @return the region value. + */ + public String region() { + return this.innerProperties() == null ? null : this.innerProperties().region(); + } + + /** + * Set the region property: Region of the account where the Chaos Fault is to be enabled/disabled. + * + * @param region the region value to set. + * @return the ChaosFaultResourceInner object itself. + */ + public ChaosFaultResourceInner withRegion(String region) { + if (this.innerProperties() == null) { + this.innerProperties = new ChaosFaultProperties(); + } + this.innerProperties().withRegion(region); + return this; + } + + /** + * Get the databaseName property: Database name. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.innerProperties() == null ? null : this.innerProperties().databaseName(); + } + + /** + * Set the databaseName property: Database name. + * + * @param databaseName the databaseName value to set. + * @return the ChaosFaultResourceInner object itself. + */ + public ChaosFaultResourceInner withDatabaseName(String databaseName) { + if (this.innerProperties() == null) { + this.innerProperties = new ChaosFaultProperties(); + } + this.innerProperties().withDatabaseName(databaseName); + return this; + } + + /** + * Get the containerName property: Container name. + * + * @return the containerName value. + */ + public String containerName() { + return this.innerProperties() == null ? null : this.innerProperties().containerName(); + } + + /** + * Set the containerName property: Container name. + * + * @param containerName the containerName value to set. + * @return the ChaosFaultResourceInner object itself. + */ + public ChaosFaultResourceInner withContainerName(String containerName) { + if (this.innerProperties() == null) { + this.innerProperties = new ChaosFaultProperties(); + } + this.innerProperties().withContainerName(containerName); + return this; + } + + /** + * Get the provisioningState property: A provisioning state of the Chaos Fault. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChaosFaultResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChaosFaultResourceInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ChaosFaultResourceInner. + */ + public static ChaosFaultResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ChaosFaultResourceInner deserializedChaosFaultResourceInner = new ChaosFaultResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedChaosFaultResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedChaosFaultResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedChaosFaultResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedChaosFaultResourceInner.innerProperties = ChaosFaultProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedChaosFaultResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedChaosFaultResourceInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ClientEncryptionKeyCreateUpdateProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ClientEncryptionKeyCreateUpdateProperties.java index aa3acc1156f3..57562004a843 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ClientEncryptionKeyCreateUpdateProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ClientEncryptionKeyCreateUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ClientEncryptionKeyGetProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ClientEncryptionKeyGetProperties.java index 2d9ae3a5ee7b..05e0bc818cf0 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ClientEncryptionKeyGetProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ClientEncryptionKeyGetProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The properties of a ClientEncryptionKey resource. */ -@Fluent +@Immutable public final class ClientEncryptionKeyGetProperties implements JsonSerializable { /* * The resource property. @@ -25,7 +25,7 @@ public final class ClientEncryptionKeyGetProperties implements JsonSerializable< /** * Creates an instance of ClientEncryptionKeyGetProperties class. */ - public ClientEncryptionKeyGetProperties() { + private ClientEncryptionKeyGetProperties() { } /** @@ -37,17 +37,6 @@ public ClientEncryptionKeyGetPropertiesResource resource() { return this.resource; } - /** - * Set the resource property: The resource property. - * - * @param resource the resource value to set. - * @return the ClientEncryptionKeyGetProperties object itself. - */ - public ClientEncryptionKeyGetProperties withResource(ClientEncryptionKeyGetPropertiesResource resource) { - this.resource = resource; - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ClientEncryptionKeyGetResultsInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ClientEncryptionKeyGetResultsInner.java index 52ba96f1ad59..9a08893555b0 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ClientEncryptionKeyGetResultsInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ClientEncryptionKeyGetResultsInner.java @@ -1,27 +1,33 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cosmos.models.ArmProxyResource; import com.azure.resourcemanager.cosmos.models.ClientEncryptionKeyGetPropertiesResource; import java.io.IOException; /** * Client Encryption Key. */ -@Fluent -public final class ClientEncryptionKeyGetResultsInner extends ArmProxyResource { +@Immutable +public final class ClientEncryptionKeyGetResultsInner extends ProxyResource { /* * The properties of a ClientEncryptionKey */ private ClientEncryptionKeyGetProperties innerProperties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -40,7 +46,7 @@ public final class ClientEncryptionKeyGetResultsInner extends ArmProxyResource { /** * Creates an instance of ClientEncryptionKeyGetResultsInner class. */ - public ClientEncryptionKeyGetResultsInner() { + private ClientEncryptionKeyGetResultsInner() { } /** @@ -52,6 +58,15 @@ private ClientEncryptionKeyGetProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -91,26 +106,11 @@ public ClientEncryptionKeyGetPropertiesResource resource() { return this.innerProperties() == null ? null : this.innerProperties().resource(); } - /** - * Set the resource property: The resource property. - * - * @param resource the resource value to set. - * @return the ClientEncryptionKeyGetResultsInner object itself. - */ - public ClientEncryptionKeyGetResultsInner withResource(ClientEncryptionKeyGetPropertiesResource resource) { - if (this.innerProperties() == null) { - this.innerProperties = new ClientEncryptionKeyGetProperties(); - } - this.innerProperties().withResource(resource); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() != null) { innerProperties().validate(); @@ -153,6 +153,8 @@ public static ClientEncryptionKeyGetResultsInner fromJson(JsonReader jsonReader) } else if ("properties".equals(fieldName)) { deserializedClientEncryptionKeyGetResultsInner.innerProperties = ClientEncryptionKeyGetProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedClientEncryptionKeyGetResultsInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ClusterResourceInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ClusterResourceInner.java index 2f2c82c449a8..1179f349a028 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ClusterResourceInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ClusterResourceInner.java @@ -1,15 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.cosmos.models.ClusterResourceProperties; -import com.azure.resourcemanager.cosmos.models.ManagedCassandraArmResourceProperties; import com.azure.resourcemanager.cosmos.models.ManagedCassandraManagedServiceIdentity; import java.io.IOException; import java.util.Map; @@ -18,12 +19,32 @@ * Representation of a managed Cassandra cluster. */ @Fluent -public final class ClusterResourceInner extends ManagedCassandraArmResourceProperties { +public final class ClusterResourceInner extends ProxyResource { /* * Properties of a managed Cassandra cluster. */ private ClusterResourceProperties properties; + /* + * Resource tags. + */ + private Map tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Identity for the resource. + */ + private ManagedCassandraManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -66,60 +87,102 @@ public ClusterResourceInner withProperties(ClusterResourceProperties properties) } /** - * Get the type property: The type of the resource. + * Get the tags property: Resource tags. * - * @return the type value. + * @return the tags value. */ - @Override - public String type() { - return this.type; + public Map tags() { + return this.tags; } /** - * Get the name property: The name of the resource. + * Set the tags property: Resource tags. * - * @return the name value. + * @param tags the tags value to set. + * @return the ClusterResourceInner object itself. */ - @Override - public String name() { - return this.name; + public ClusterResourceInner withTags(Map tags) { + this.tags = tags; + return this; } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the location property: The geo-location where the resource lives. * - * @return the id value. + * @return the location value. */ - @Override - public String id() { - return this.id; + public String location() { + return this.location; } /** - * {@inheritDoc} + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the ClusterResourceInner object itself. + */ + public ClusterResourceInner withLocation(String location) { + this.location = location; + return this; + } + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public ManagedCassandraManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Identity for the resource. + * + * @param identity the identity value to set. + * @return the ClusterResourceInner object itself. */ - @Override public ClusterResourceInner withIdentity(ManagedCassandraManagedServiceIdentity identity) { - super.withIdentity(identity); + this.identity = identity; return this; } /** - * {@inheritDoc} + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. */ @Override - public ClusterResourceInner withLocation(String location) { - super.withLocation(location); - return this; + public String type() { + return this.type; } /** - * {@inheritDoc} + * Get the name property: The name of the resource. + * + * @return the name value. */ @Override - public ClusterResourceInner withTags(Map tags) { - super.withTags(tags); - return this; + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; } /** @@ -127,7 +190,6 @@ public ClusterResourceInner withTags(Map tags) { * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (properties() != null) { properties().validate(); @@ -143,10 +205,10 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); - jsonWriter.writeJsonField("identity", identity()); jsonWriter.writeJsonField("properties", this.properties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -172,16 +234,17 @@ public static ClusterResourceInner fromJson(JsonReader jsonReader) throws IOExce deserializedClusterResourceInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedClusterResourceInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedClusterResourceInner.withLocation(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedClusterResourceInner.properties = ClusterResourceProperties.fromJson(reader); } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedClusterResourceInner.withTags(tags); + deserializedClusterResourceInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedClusterResourceInner.location = reader.getString(); } else if ("identity".equals(fieldName)) { - deserializedClusterResourceInner - .withIdentity(ManagedCassandraManagedServiceIdentity.fromJson(reader)); - } else if ("properties".equals(fieldName)) { - deserializedClusterResourceInner.properties = ClusterResourceProperties.fromJson(reader); + deserializedClusterResourceInner.identity = ManagedCassandraManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedClusterResourceInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CommandOutputInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CommandOutputInner.java index 0bb6708eebdf..bb78779780a0 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CommandOutputInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CommandOutputInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Response of /command api. */ -@Fluent +@Immutable public final class CommandOutputInner implements JsonSerializable { /* * Output of the command. @@ -24,7 +24,7 @@ public final class CommandOutputInner implements JsonSerializable { + /* + * The command which should be run + */ + private String command; + + /* + * The unique id of command + */ + private String commandId; + + /* + * The arguments for the command to be run + */ + private Object arguments; + + /* + * IP address of the cassandra host to run the command on + */ + private String host; + + /* + * Whether command has admin privileges + */ + private Boolean isAdmin; + + /* + * If true, stops cassandra before executing the command and then start it again + */ + private Boolean cassandraStopStart; + + /* + * If true, allows the command to *write* to the cassandra directory, otherwise read-only. + */ + private Boolean readWrite; + + /* + * Result output of the command. + */ + private String result; + + /* + * Status of the command. + */ + private CommandStatus status; + + /* + * The name of the file where the result is written. + */ + private String outputFile; + + /** + * Creates an instance of CommandPublicResourceInner class. + */ + private CommandPublicResourceInner() { + } + + /** + * Get the command property: The command which should be run. + * + * @return the command value. + */ + public String command() { + return this.command; + } + + /** + * Get the commandId property: The unique id of command. + * + * @return the commandId value. + */ + public String commandId() { + return this.commandId; + } + + /** + * Get the arguments property: The arguments for the command to be run. + * + * @return the arguments value. + */ + public Object arguments() { + return this.arguments; + } + + /** + * Get the host property: IP address of the cassandra host to run the command on. + * + * @return the host value. + */ + public String host() { + return this.host; + } + + /** + * Get the isAdmin property: Whether command has admin privileges. + * + * @return the isAdmin value. + */ + public Boolean isAdmin() { + return this.isAdmin; + } + + /** + * Get the cassandraStopStart property: If true, stops cassandra before executing the command and then start it + * again. + * + * @return the cassandraStopStart value. + */ + public Boolean cassandraStopStart() { + return this.cassandraStopStart; + } + + /** + * Get the readWrite property: If true, allows the command to *write* to the cassandra directory, otherwise + * read-only. + * + * @return the readWrite value. + */ + public Boolean readWrite() { + return this.readWrite; + } + + /** + * Get the result property: Result output of the command. + * + * @return the result value. + */ + public String result() { + return this.result; + } + + /** + * Get the status property: Status of the command. + * + * @return the status value. + */ + public CommandStatus status() { + return this.status; + } + + /** + * Get the outputFile property: The name of the file where the result is written. + * + * @return the outputFile value. + */ + public String outputFile() { + return this.outputFile; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("command", this.command); + jsonWriter.writeStringField("commandId", this.commandId); + if (this.arguments != null) { + jsonWriter.writeUntypedField("arguments", this.arguments); + } + jsonWriter.writeStringField("host", this.host); + jsonWriter.writeBooleanField("isAdmin", this.isAdmin); + jsonWriter.writeBooleanField("cassandraStopStart", this.cassandraStopStart); + jsonWriter.writeBooleanField("readWrite", this.readWrite); + jsonWriter.writeStringField("result", this.result); + jsonWriter.writeStringField("status", this.status == null ? null : this.status.toString()); + jsonWriter.writeStringField("outputFile", this.outputFile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CommandPublicResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CommandPublicResourceInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CommandPublicResourceInner. + */ + public static CommandPublicResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CommandPublicResourceInner deserializedCommandPublicResourceInner = new CommandPublicResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("command".equals(fieldName)) { + deserializedCommandPublicResourceInner.command = reader.getString(); + } else if ("commandId".equals(fieldName)) { + deserializedCommandPublicResourceInner.commandId = reader.getString(); + } else if ("arguments".equals(fieldName)) { + deserializedCommandPublicResourceInner.arguments = reader.readUntyped(); + } else if ("host".equals(fieldName)) { + deserializedCommandPublicResourceInner.host = reader.getString(); + } else if ("isAdmin".equals(fieldName)) { + deserializedCommandPublicResourceInner.isAdmin = reader.getNullable(JsonReader::getBoolean); + } else if ("cassandraStopStart".equals(fieldName)) { + deserializedCommandPublicResourceInner.cassandraStopStart + = reader.getNullable(JsonReader::getBoolean); + } else if ("readWrite".equals(fieldName)) { + deserializedCommandPublicResourceInner.readWrite = reader.getNullable(JsonReader::getBoolean); + } else if ("result".equals(fieldName)) { + deserializedCommandPublicResourceInner.result = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedCommandPublicResourceInner.status = CommandStatus.fromString(reader.getString()); + } else if ("outputFile".equals(fieldName)) { + deserializedCommandPublicResourceInner.outputFile = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCommandPublicResourceInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CopyJobGetResultsInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CopyJobGetResultsInner.java new file mode 100644 index 000000000000..7efbc9c53f3f --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CopyJobGetResultsInner.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.CopyJobProperties; +import java.io.IOException; + +/** + * A Cosmos DB Copy Job. + */ +@Fluent +public final class CopyJobGetResultsInner extends ProxyResource { + /* + * The properties of a Copy Job + */ + private CopyJobProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of CopyJobGetResultsInner class. + */ + public CopyJobGetResultsInner() { + } + + /** + * Get the properties property: The properties of a Copy Job. + * + * @return the properties value. + */ + public CopyJobProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The properties of a Copy Job. + * + * @param properties the properties value to set. + * @return the CopyJobGetResultsInner object itself. + */ + public CopyJobGetResultsInner withProperties(CopyJobProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property properties in model CopyJobGetResultsInner")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CopyJobGetResultsInner.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CopyJobGetResultsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CopyJobGetResultsInner if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CopyJobGetResultsInner. + */ + public static CopyJobGetResultsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CopyJobGetResultsInner deserializedCopyJobGetResultsInner = new CopyJobGetResultsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCopyJobGetResultsInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCopyJobGetResultsInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCopyJobGetResultsInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedCopyJobGetResultsInner.properties = CopyJobProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedCopyJobGetResultsInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCopyJobGetResultsInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DataCenterResourceInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DataCenterResourceInner.java index 1fed62491c51..875e55f4ef47 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DataCenterResourceInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DataCenterResourceInner.java @@ -1,14 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cosmos.models.ArmProxyResource; import com.azure.resourcemanager.cosmos.models.DataCenterResourceProperties; import java.io.IOException; @@ -16,12 +17,17 @@ * A managed Cassandra data center. */ @Fluent -public final class DataCenterResourceInner extends ArmProxyResource { +public final class DataCenterResourceInner extends ProxyResource { /* * Properties of a managed Cassandra data center. */ private DataCenterResourceProperties properties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -63,6 +69,15 @@ public DataCenterResourceInner withProperties(DataCenterResourceProperties prope return this; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -98,7 +113,6 @@ public String id() { * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (properties() != null) { properties().validate(); @@ -139,6 +153,8 @@ public static DataCenterResourceInner fromJson(JsonReader jsonReader) throws IOE deserializedDataCenterResourceInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { deserializedDataCenterResourceInner.properties = DataCenterResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDataCenterResourceInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DataTransferJobGetResultsInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DataTransferJobGetResultsInner.java new file mode 100644 index 000000000000..09337d8691f0 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DataTransferJobGetResultsInner.java @@ -0,0 +1,259 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.core.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.DataTransferDataSourceSink; +import com.azure.resourcemanager.cosmos.models.DataTransferJobMode; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * A Cosmos DB Data Transfer Job. + */ +@Immutable +public final class DataTransferJobGetResultsInner extends ProxyResource { + /* + * The properties of a DataTransfer Job + */ + private DataTransferJobProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of DataTransferJobGetResultsInner class. + */ + private DataTransferJobGetResultsInner() { + } + + /** + * Get the innerProperties property: The properties of a DataTransfer Job. + * + * @return the innerProperties value. + */ + private DataTransferJobProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the jobName property: Job Name. + * + * @return the jobName value. + */ + public String jobName() { + return this.innerProperties() == null ? null : this.innerProperties().jobName(); + } + + /** + * Get the source property: Source DataStore details. + * + * @return the source value. + */ + public DataTransferDataSourceSink source() { + return this.innerProperties() == null ? null : this.innerProperties().source(); + } + + /** + * Get the destination property: Destination DataStore details. + * + * @return the destination value. + */ + public DataTransferDataSourceSink destination() { + return this.innerProperties() == null ? null : this.innerProperties().destination(); + } + + /** + * Get the status property: Job Status. + * + * @return the status value. + */ + public String status() { + return this.innerProperties() == null ? null : this.innerProperties().status(); + } + + /** + * Get the processedCount property: Processed Count. + * + * @return the processedCount value. + */ + public Long processedCount() { + return this.innerProperties() == null ? null : this.innerProperties().processedCount(); + } + + /** + * Get the totalCount property: Total Count. + * + * @return the totalCount value. + */ + public Long totalCount() { + return this.innerProperties() == null ? null : this.innerProperties().totalCount(); + } + + /** + * Get the lastUpdatedUtcTime property: Last Updated Time (ISO-8601 format). + * + * @return the lastUpdatedUtcTime value. + */ + public OffsetDateTime lastUpdatedUtcTime() { + return this.innerProperties() == null ? null : this.innerProperties().lastUpdatedUtcTime(); + } + + /** + * Get the workerCount property: Worker count. + * + * @return the workerCount value. + */ + public Integer workerCount() { + return this.innerProperties() == null ? null : this.innerProperties().workerCount(); + } + + /** + * Get the error property: Error response for Faulted job. + * + * @return the error value. + */ + public ManagementError error() { + return this.innerProperties() == null ? null : this.innerProperties().error(); + } + + /** + * Get the duration property: Total Duration of Job. + * + * @return the duration value. + */ + public String duration() { + return this.innerProperties() == null ? null : this.innerProperties().duration(); + } + + /** + * Get the mode property: Mode of job execution. + * + * @return the mode value. + */ + public DataTransferJobMode mode() { + return this.innerProperties() == null ? null : this.innerProperties().mode(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataTransferJobGetResultsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataTransferJobGetResultsInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataTransferJobGetResultsInner. + */ + public static DataTransferJobGetResultsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataTransferJobGetResultsInner deserializedDataTransferJobGetResultsInner + = new DataTransferJobGetResultsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedDataTransferJobGetResultsInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedDataTransferJobGetResultsInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedDataTransferJobGetResultsInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedDataTransferJobGetResultsInner.innerProperties + = DataTransferJobProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedDataTransferJobGetResultsInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedDataTransferJobGetResultsInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DataTransferJobProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DataTransferJobProperties.java new file mode 100644 index 000000000000..72bb55a42b0b --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DataTransferJobProperties.java @@ -0,0 +1,313 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.DataTransferDataSourceSink; +import com.azure.resourcemanager.cosmos.models.DataTransferJobMode; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * The properties of a DataTransfer Job. + */ +@Fluent +public final class DataTransferJobProperties implements JsonSerializable { + /* + * Job Name + */ + private String jobName; + + /* + * Source DataStore details + */ + private DataTransferDataSourceSink source; + + /* + * Destination DataStore details + */ + private DataTransferDataSourceSink destination; + + /* + * Job Status + */ + private String status; + + /* + * Processed Count. + */ + private Long processedCount; + + /* + * Total Count. + */ + private Long totalCount; + + /* + * Last Updated Time (ISO-8601 format). + */ + private OffsetDateTime lastUpdatedUtcTime; + + /* + * Worker count + */ + private Integer workerCount; + + /* + * Error response for Faulted job + */ + private ManagementError error; + + /* + * Total Duration of Job + */ + private String duration; + + /* + * Mode of job execution + */ + private DataTransferJobMode mode; + + /** + * Creates an instance of DataTransferJobProperties class. + */ + public DataTransferJobProperties() { + } + + /** + * Get the jobName property: Job Name. + * + * @return the jobName value. + */ + public String jobName() { + return this.jobName; + } + + /** + * Get the source property: Source DataStore details. + * + * @return the source value. + */ + public DataTransferDataSourceSink source() { + return this.source; + } + + /** + * Set the source property: Source DataStore details. + * + * @param source the source value to set. + * @return the DataTransferJobProperties object itself. + */ + public DataTransferJobProperties withSource(DataTransferDataSourceSink source) { + this.source = source; + return this; + } + + /** + * Get the destination property: Destination DataStore details. + * + * @return the destination value. + */ + public DataTransferDataSourceSink destination() { + return this.destination; + } + + /** + * Set the destination property: Destination DataStore details. + * + * @param destination the destination value to set. + * @return the DataTransferJobProperties object itself. + */ + public DataTransferJobProperties withDestination(DataTransferDataSourceSink destination) { + this.destination = destination; + return this; + } + + /** + * Get the status property: Job Status. + * + * @return the status value. + */ + public String status() { + return this.status; + } + + /** + * Get the processedCount property: Processed Count. + * + * @return the processedCount value. + */ + public Long processedCount() { + return this.processedCount; + } + + /** + * Get the totalCount property: Total Count. + * + * @return the totalCount value. + */ + public Long totalCount() { + return this.totalCount; + } + + /** + * Get the lastUpdatedUtcTime property: Last Updated Time (ISO-8601 format). + * + * @return the lastUpdatedUtcTime value. + */ + public OffsetDateTime lastUpdatedUtcTime() { + return this.lastUpdatedUtcTime; + } + + /** + * Get the workerCount property: Worker count. + * + * @return the workerCount value. + */ + public Integer workerCount() { + return this.workerCount; + } + + /** + * Set the workerCount property: Worker count. + * + * @param workerCount the workerCount value to set. + * @return the DataTransferJobProperties object itself. + */ + public DataTransferJobProperties withWorkerCount(Integer workerCount) { + this.workerCount = workerCount; + return this; + } + + /** + * Get the error property: Error response for Faulted job. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Get the duration property: Total Duration of Job. + * + * @return the duration value. + */ + public String duration() { + return this.duration; + } + + /** + * Get the mode property: Mode of job execution. + * + * @return the mode value. + */ + public DataTransferJobMode mode() { + return this.mode; + } + + /** + * Set the mode property: Mode of job execution. + * + * @param mode the mode value to set. + * @return the DataTransferJobProperties object itself. + */ + public DataTransferJobProperties withMode(DataTransferJobMode mode) { + this.mode = mode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (source() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property source in model DataTransferJobProperties")); + } else { + source().validate(); + } + if (destination() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property destination in model DataTransferJobProperties")); + } else { + destination().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataTransferJobProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("source", this.source); + jsonWriter.writeJsonField("destination", this.destination); + jsonWriter.writeNumberField("workerCount", this.workerCount); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataTransferJobProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataTransferJobProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataTransferJobProperties. + */ + public static DataTransferJobProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataTransferJobProperties deserializedDataTransferJobProperties = new DataTransferJobProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("source".equals(fieldName)) { + deserializedDataTransferJobProperties.source = DataTransferDataSourceSink.fromJson(reader); + } else if ("destination".equals(fieldName)) { + deserializedDataTransferJobProperties.destination = DataTransferDataSourceSink.fromJson(reader); + } else if ("jobName".equals(fieldName)) { + deserializedDataTransferJobProperties.jobName = reader.getString(); + } else if ("status".equals(fieldName)) { + deserializedDataTransferJobProperties.status = reader.getString(); + } else if ("processedCount".equals(fieldName)) { + deserializedDataTransferJobProperties.processedCount = reader.getNullable(JsonReader::getLong); + } else if ("totalCount".equals(fieldName)) { + deserializedDataTransferJobProperties.totalCount = reader.getNullable(JsonReader::getLong); + } else if ("lastUpdatedUtcTime".equals(fieldName)) { + deserializedDataTransferJobProperties.lastUpdatedUtcTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("workerCount".equals(fieldName)) { + deserializedDataTransferJobProperties.workerCount = reader.getNullable(JsonReader::getInt); + } else if ("error".equals(fieldName)) { + deserializedDataTransferJobProperties.error = ManagementError.fromJson(reader); + } else if ("duration".equals(fieldName)) { + deserializedDataTransferJobProperties.duration = reader.getString(); + } else if ("mode".equals(fieldName)) { + deserializedDataTransferJobProperties.mode = DataTransferJobMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDataTransferJobProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountCreateUpdateProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountCreateUpdateProperties.java index 1e4cc8dedc03..4d12f2a74e62 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountCreateUpdateProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountCreateUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; @@ -15,12 +15,14 @@ import com.azure.resourcemanager.cosmos.models.BackupPolicy; import com.azure.resourcemanager.cosmos.models.Capability; import com.azure.resourcemanager.cosmos.models.Capacity; +import com.azure.resourcemanager.cosmos.models.CapacityMode; import com.azure.resourcemanager.cosmos.models.ConnectorOffer; import com.azure.resourcemanager.cosmos.models.ConsistencyPolicy; import com.azure.resourcemanager.cosmos.models.CorsPolicy; import com.azure.resourcemanager.cosmos.models.CreateMode; import com.azure.resourcemanager.cosmos.models.DatabaseAccountKeysMetadata; import com.azure.resourcemanager.cosmos.models.DefaultPriorityLevel; +import com.azure.resourcemanager.cosmos.models.DiagnosticLogSettings; import com.azure.resourcemanager.cosmos.models.IpAddressOrRange; import com.azure.resourcemanager.cosmos.models.Location; import com.azure.resourcemanager.cosmos.models.MinimalTlsVersion; @@ -48,7 +50,7 @@ public final class DatabaseAccountCreateUpdateProperties private List locations; /* - * The offer type for the database + * The offer type for the Cosmos DB database account. */ private final String databaseAccountOfferType = "Standard"; @@ -160,6 +162,11 @@ public final class DatabaseAccountCreateUpdateProperties */ private List networkAclBypassResourceIds; + /* + * The Object representing the different Diagnostic log settings for the Cosmos DB Account. + */ + private DiagnosticLogSettings diagnosticLogSettings; + /* * Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. */ @@ -175,6 +182,16 @@ public final class DatabaseAccountCreateUpdateProperties */ private Capacity capacity; + /* + * Indicates the capacityMode of the Cosmos DB account. + */ + private CapacityMode capacityMode; + + /* + * Flag to indicate whether to enable MaterializedViews on the Cosmos DB account + */ + private Boolean enableMaterializedViews; + /* * This property is ignored during the update/create operation, as the metadata is read-only. The object represents * the metadata for the Account Keys of the Cosmos DB account. @@ -187,15 +204,15 @@ public final class DatabaseAccountCreateUpdateProperties private Boolean enablePartitionMerge; /* - * Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with - * Tls 1.2. + * Flag to indicate enabling/disabling of Burst Capacity Preview feature on the account */ - private MinimalTlsVersion minimalTlsVersion; + private Boolean enableBurstCapacity; /* - * Flag to indicate enabling/disabling of Burst Capacity feature on the account + * Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which + * only work with Tls 1.2. */ - private Boolean enableBurstCapacity; + private MinimalTlsVersion minimalTlsVersion; /* * Indicates the status of the Customer Managed Key feature on the account. In case there are errors, the property @@ -203,11 +220,6 @@ public final class DatabaseAccountCreateUpdateProperties */ private String customerManagedKeyStatus; - /* - * Flag to indicate enabling/disabling of PerRegionPerPartitionAutoscale feature on the account - */ - private Boolean enablePerRegionPerPartitionAutoscale; - /* * Flag to indicate enabling/disabling of Priority Based Execution Preview feature on the account */ @@ -218,6 +230,16 @@ public final class DatabaseAccountCreateUpdateProperties */ private DefaultPriorityLevel defaultPriorityLevel; + /* + * Flag to indicate enabling/disabling of Per-Region Per-partition autoscale Preview feature on the account + */ + private Boolean enablePerRegionPerPartitionAutoscale; + + /* + * Flag to indicate if All Versions and Deletes Change feed feature is enabled on the account + */ + private Boolean enableAllVersionsAndDeletesChangeFeed; + /** * Creates an instance of DatabaseAccountCreateUpdateProperties class. */ @@ -267,7 +289,7 @@ public DatabaseAccountCreateUpdateProperties withLocations(List locati } /** - * Get the databaseAccountOfferType property: The offer type for the database. + * Get the databaseAccountOfferType property: The offer type for the Cosmos DB database account. * * @return the databaseAccountOfferType value. */ @@ -714,6 +736,29 @@ public List networkAclBypassResourceIds() { return this; } + /** + * Get the diagnosticLogSettings property: The Object representing the different Diagnostic log settings for the + * Cosmos DB Account. + * + * @return the diagnosticLogSettings value. + */ + public DiagnosticLogSettings diagnosticLogSettings() { + return this.diagnosticLogSettings; + } + + /** + * Set the diagnosticLogSettings property: The Object representing the different Diagnostic log settings for the + * Cosmos DB Account. + * + * @param diagnosticLogSettings the diagnosticLogSettings value to set. + * @return the DatabaseAccountCreateUpdateProperties object itself. + */ + public DatabaseAccountCreateUpdateProperties + withDiagnosticLogSettings(DiagnosticLogSettings diagnosticLogSettings) { + this.diagnosticLogSettings = diagnosticLogSettings; + return this; + } + /** * Get the disableLocalAuth property: Opt-out of local authentication and ensure only MSI and AAD can be used * exclusively for authentication. @@ -778,6 +823,48 @@ public DatabaseAccountCreateUpdateProperties withCapacity(Capacity capacity) { return this; } + /** + * Get the capacityMode property: Indicates the capacityMode of the Cosmos DB account. + * + * @return the capacityMode value. + */ + public CapacityMode capacityMode() { + return this.capacityMode; + } + + /** + * Set the capacityMode property: Indicates the capacityMode of the Cosmos DB account. + * + * @param capacityMode the capacityMode value to set. + * @return the DatabaseAccountCreateUpdateProperties object itself. + */ + public DatabaseAccountCreateUpdateProperties withCapacityMode(CapacityMode capacityMode) { + this.capacityMode = capacityMode; + return this; + } + + /** + * Get the enableMaterializedViews property: Flag to indicate whether to enable MaterializedViews on the Cosmos DB + * account. + * + * @return the enableMaterializedViews value. + */ + public Boolean enableMaterializedViews() { + return this.enableMaterializedViews; + } + + /** + * Set the enableMaterializedViews property: Flag to indicate whether to enable MaterializedViews on the Cosmos DB + * account. + * + * @param enableMaterializedViews the enableMaterializedViews value to set. + * @return the DatabaseAccountCreateUpdateProperties object itself. + */ + public DatabaseAccountCreateUpdateProperties withEnableMaterializedViews(Boolean enableMaterializedViews) { + this.enableMaterializedViews = enableMaterializedViews; + return this; + } + /** * Get the keysMetadata property: This property is ignored during the update/create operation, as the metadata is * read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. @@ -811,46 +898,46 @@ public DatabaseAccountCreateUpdateProperties withEnablePartitionMerge(Boolean en } /** - * Get the minimalTlsVersion property: Indicates the minimum allowed Tls version. The default value is Tls 1.2. - * Cassandra and Mongo APIs only work with Tls 1.2. + * Get the enableBurstCapacity property: Flag to indicate enabling/disabling of Burst Capacity Preview feature on + * the account. * - * @return the minimalTlsVersion value. + * @return the enableBurstCapacity value. */ - public MinimalTlsVersion minimalTlsVersion() { - return this.minimalTlsVersion; + public Boolean enableBurstCapacity() { + return this.enableBurstCapacity; } /** - * Set the minimalTlsVersion property: Indicates the minimum allowed Tls version. The default value is Tls 1.2. - * Cassandra and Mongo APIs only work with Tls 1.2. + * Set the enableBurstCapacity property: Flag to indicate enabling/disabling of Burst Capacity Preview feature on + * the account. * - * @param minimalTlsVersion the minimalTlsVersion value to set. + * @param enableBurstCapacity the enableBurstCapacity value to set. * @return the DatabaseAccountCreateUpdateProperties object itself. */ - public DatabaseAccountCreateUpdateProperties withMinimalTlsVersion(MinimalTlsVersion minimalTlsVersion) { - this.minimalTlsVersion = minimalTlsVersion; + public DatabaseAccountCreateUpdateProperties withEnableBurstCapacity(Boolean enableBurstCapacity) { + this.enableBurstCapacity = enableBurstCapacity; return this; } /** - * Get the enableBurstCapacity property: Flag to indicate enabling/disabling of Burst Capacity feature on the - * account. + * Get the minimalTlsVersion property: Indicates the minimum allowed Tls version. The default is Tls 1.0, except for + * Cassandra and Mongo API's, which only work with Tls 1.2. * - * @return the enableBurstCapacity value. + * @return the minimalTlsVersion value. */ - public Boolean enableBurstCapacity() { - return this.enableBurstCapacity; + public MinimalTlsVersion minimalTlsVersion() { + return this.minimalTlsVersion; } /** - * Set the enableBurstCapacity property: Flag to indicate enabling/disabling of Burst Capacity feature on the - * account. + * Set the minimalTlsVersion property: Indicates the minimum allowed Tls version. The default is Tls 1.0, except for + * Cassandra and Mongo API's, which only work with Tls 1.2. * - * @param enableBurstCapacity the enableBurstCapacity value to set. + * @param minimalTlsVersion the minimalTlsVersion value to set. * @return the DatabaseAccountCreateUpdateProperties object itself. */ - public DatabaseAccountCreateUpdateProperties withEnableBurstCapacity(Boolean enableBurstCapacity) { - this.enableBurstCapacity = enableBurstCapacity; + public DatabaseAccountCreateUpdateProperties withMinimalTlsVersion(MinimalTlsVersion minimalTlsVersion) { + this.minimalTlsVersion = minimalTlsVersion; return this; } @@ -876,29 +963,6 @@ public DatabaseAccountCreateUpdateProperties withCustomerManagedKeyStatus(String return this; } - /** - * Get the enablePerRegionPerPartitionAutoscale property: Flag to indicate enabling/disabling of - * PerRegionPerPartitionAutoscale feature on the account. - * - * @return the enablePerRegionPerPartitionAutoscale value. - */ - public Boolean enablePerRegionPerPartitionAutoscale() { - return this.enablePerRegionPerPartitionAutoscale; - } - - /** - * Set the enablePerRegionPerPartitionAutoscale property: Flag to indicate enabling/disabling of - * PerRegionPerPartitionAutoscale feature on the account. - * - * @param enablePerRegionPerPartitionAutoscale the enablePerRegionPerPartitionAutoscale value to set. - * @return the DatabaseAccountCreateUpdateProperties object itself. - */ - public DatabaseAccountCreateUpdateProperties - withEnablePerRegionPerPartitionAutoscale(Boolean enablePerRegionPerPartitionAutoscale) { - this.enablePerRegionPerPartitionAutoscale = enablePerRegionPerPartitionAutoscale; - return this; - } - /** * Get the enablePriorityBasedExecution property: Flag to indicate enabling/disabling of Priority Based Execution * Preview feature on the account. @@ -944,6 +1008,52 @@ public DatabaseAccountCreateUpdateProperties withDefaultPriorityLevel(DefaultPri return this; } + /** + * Get the enablePerRegionPerPartitionAutoscale property: Flag to indicate enabling/disabling of Per-Region + * Per-partition autoscale Preview feature on the account. + * + * @return the enablePerRegionPerPartitionAutoscale value. + */ + public Boolean enablePerRegionPerPartitionAutoscale() { + return this.enablePerRegionPerPartitionAutoscale; + } + + /** + * Set the enablePerRegionPerPartitionAutoscale property: Flag to indicate enabling/disabling of Per-Region + * Per-partition autoscale Preview feature on the account. + * + * @param enablePerRegionPerPartitionAutoscale the enablePerRegionPerPartitionAutoscale value to set. + * @return the DatabaseAccountCreateUpdateProperties object itself. + */ + public DatabaseAccountCreateUpdateProperties + withEnablePerRegionPerPartitionAutoscale(Boolean enablePerRegionPerPartitionAutoscale) { + this.enablePerRegionPerPartitionAutoscale = enablePerRegionPerPartitionAutoscale; + return this; + } + + /** + * Get the enableAllVersionsAndDeletesChangeFeed property: Flag to indicate if All Versions and Deletes Change feed + * feature is enabled on the account. + * + * @return the enableAllVersionsAndDeletesChangeFeed value. + */ + public Boolean enableAllVersionsAndDeletesChangeFeed() { + return this.enableAllVersionsAndDeletesChangeFeed; + } + + /** + * Set the enableAllVersionsAndDeletesChangeFeed property: Flag to indicate if All Versions and Deletes Change feed + * feature is enabled on the account. + * + * @param enableAllVersionsAndDeletesChangeFeed the enableAllVersionsAndDeletesChangeFeed value to set. + * @return the DatabaseAccountCreateUpdateProperties object itself. + */ + public DatabaseAccountCreateUpdateProperties + withEnableAllVersionsAndDeletesChangeFeed(Boolean enableAllVersionsAndDeletesChangeFeed) { + this.enableAllVersionsAndDeletesChangeFeed = enableAllVersionsAndDeletesChangeFeed; + return this; + } + /** * Validates the instance. * @@ -981,6 +1091,9 @@ public void validate() { if (cors() != null) { cors().forEach(e -> e.validate()); } + if (diagnosticLogSettings() != null) { + diagnosticLogSettings().validate(); + } if (restoreParameters() != null) { restoreParameters().validate(); } @@ -1029,18 +1142,23 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { this.networkAclBypass == null ? null : this.networkAclBypass.toString()); jsonWriter.writeArrayField("networkAclBypassResourceIds", this.networkAclBypassResourceIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("diagnosticLogSettings", this.diagnosticLogSettings); jsonWriter.writeBooleanField("disableLocalAuth", this.disableLocalAuth); jsonWriter.writeJsonField("restoreParameters", this.restoreParameters); jsonWriter.writeJsonField("capacity", this.capacity); + jsonWriter.writeStringField("capacityMode", this.capacityMode == null ? null : this.capacityMode.toString()); + jsonWriter.writeBooleanField("enableMaterializedViews", this.enableMaterializedViews); jsonWriter.writeBooleanField("enablePartitionMerge", this.enablePartitionMerge); + jsonWriter.writeBooleanField("enableBurstCapacity", this.enableBurstCapacity); jsonWriter.writeStringField("minimalTlsVersion", this.minimalTlsVersion == null ? null : this.minimalTlsVersion.toString()); - jsonWriter.writeBooleanField("enableBurstCapacity", this.enableBurstCapacity); jsonWriter.writeStringField("customerManagedKeyStatus", this.customerManagedKeyStatus); - jsonWriter.writeBooleanField("enablePerRegionPerPartitionAutoscale", this.enablePerRegionPerPartitionAutoscale); jsonWriter.writeBooleanField("enablePriorityBasedExecution", this.enablePriorityBasedExecution); jsonWriter.writeStringField("defaultPriorityLevel", this.defaultPriorityLevel == null ? null : this.defaultPriorityLevel.toString()); + jsonWriter.writeBooleanField("enablePerRegionPerPartitionAutoscale", this.enablePerRegionPerPartitionAutoscale); + jsonWriter.writeBooleanField("enableAllVersionsAndDeletesChangeFeed", + this.enableAllVersionsAndDeletesChangeFeed); return jsonWriter.writeEndObject(); } @@ -1128,6 +1246,9 @@ public static DatabaseAccountCreateUpdateProperties fromJson(JsonReader jsonRead List networkAclBypassResourceIds = reader.readArray(reader1 -> reader1.getString()); deserializedDatabaseAccountCreateUpdateProperties.networkAclBypassResourceIds = networkAclBypassResourceIds; + } else if ("diagnosticLogSettings".equals(fieldName)) { + deserializedDatabaseAccountCreateUpdateProperties.diagnosticLogSettings + = DiagnosticLogSettings.fromJson(reader); } else if ("disableLocalAuth".equals(fieldName)) { deserializedDatabaseAccountCreateUpdateProperties.disableLocalAuth = reader.getNullable(JsonReader::getBoolean); @@ -1136,29 +1257,38 @@ public static DatabaseAccountCreateUpdateProperties fromJson(JsonReader jsonRead = RestoreParameters.fromJson(reader); } else if ("capacity".equals(fieldName)) { deserializedDatabaseAccountCreateUpdateProperties.capacity = Capacity.fromJson(reader); + } else if ("capacityMode".equals(fieldName)) { + deserializedDatabaseAccountCreateUpdateProperties.capacityMode + = CapacityMode.fromString(reader.getString()); + } else if ("enableMaterializedViews".equals(fieldName)) { + deserializedDatabaseAccountCreateUpdateProperties.enableMaterializedViews + = reader.getNullable(JsonReader::getBoolean); } else if ("keysMetadata".equals(fieldName)) { deserializedDatabaseAccountCreateUpdateProperties.keysMetadata = DatabaseAccountKeysMetadata.fromJson(reader); } else if ("enablePartitionMerge".equals(fieldName)) { deserializedDatabaseAccountCreateUpdateProperties.enablePartitionMerge = reader.getNullable(JsonReader::getBoolean); - } else if ("minimalTlsVersion".equals(fieldName)) { - deserializedDatabaseAccountCreateUpdateProperties.minimalTlsVersion - = MinimalTlsVersion.fromString(reader.getString()); } else if ("enableBurstCapacity".equals(fieldName)) { deserializedDatabaseAccountCreateUpdateProperties.enableBurstCapacity = reader.getNullable(JsonReader::getBoolean); + } else if ("minimalTlsVersion".equals(fieldName)) { + deserializedDatabaseAccountCreateUpdateProperties.minimalTlsVersion + = MinimalTlsVersion.fromString(reader.getString()); } else if ("customerManagedKeyStatus".equals(fieldName)) { deserializedDatabaseAccountCreateUpdateProperties.customerManagedKeyStatus = reader.getString(); - } else if ("enablePerRegionPerPartitionAutoscale".equals(fieldName)) { - deserializedDatabaseAccountCreateUpdateProperties.enablePerRegionPerPartitionAutoscale - = reader.getNullable(JsonReader::getBoolean); } else if ("enablePriorityBasedExecution".equals(fieldName)) { deserializedDatabaseAccountCreateUpdateProperties.enablePriorityBasedExecution = reader.getNullable(JsonReader::getBoolean); } else if ("defaultPriorityLevel".equals(fieldName)) { deserializedDatabaseAccountCreateUpdateProperties.defaultPriorityLevel = DefaultPriorityLevel.fromString(reader.getString()); + } else if ("enablePerRegionPerPartitionAutoscale".equals(fieldName)) { + deserializedDatabaseAccountCreateUpdateProperties.enablePerRegionPerPartitionAutoscale + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableAllVersionsAndDeletesChangeFeed".equals(fieldName)) { + deserializedDatabaseAccountCreateUpdateProperties.enableAllVersionsAndDeletesChangeFeed + = reader.getNullable(JsonReader::getBoolean); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountGetProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountGetProperties.java index fe4f03d2c0ee..7a0d2bf25a9a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountGetProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountGetProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; @@ -14,6 +14,8 @@ import com.azure.resourcemanager.cosmos.models.BackupPolicy; import com.azure.resourcemanager.cosmos.models.Capability; import com.azure.resourcemanager.cosmos.models.Capacity; +import com.azure.resourcemanager.cosmos.models.CapacityMode; +import com.azure.resourcemanager.cosmos.models.CapacityModeChangeTransitionState; import com.azure.resourcemanager.cosmos.models.ConnectorOffer; import com.azure.resourcemanager.cosmos.models.ConsistencyPolicy; import com.azure.resourcemanager.cosmos.models.CorsPolicy; @@ -21,6 +23,7 @@ import com.azure.resourcemanager.cosmos.models.DatabaseAccountKeysMetadata; import com.azure.resourcemanager.cosmos.models.DatabaseAccountOfferType; import com.azure.resourcemanager.cosmos.models.DefaultPriorityLevel; +import com.azure.resourcemanager.cosmos.models.DiagnosticLogSettings; import com.azure.resourcemanager.cosmos.models.FailoverPolicy; import com.azure.resourcemanager.cosmos.models.IpAddressOrRange; import com.azure.resourcemanager.cosmos.models.Location; @@ -38,12 +41,7 @@ @Fluent public final class DatabaseAccountGetProperties implements JsonSerializable { /* - * The status of the Cosmos DB account at the time the operation was called. The status can be one of following. - * 'Creating' – the Cosmos DB account is being created. When an account is in Creating state, only properties that - * are specified as input for the Create Cosmos DB account operation are returned. 'Succeeded' – the Cosmos DB - * account is active for use. 'Updating' – the Cosmos DB account is being updated. 'Deleting' – the Cosmos DB - * account is being deleted. 'Failed' – the Cosmos DB account failed creation. 'DeletionFailed' – the Cosmos DB - * account deletion failed. + * The provisioning state of the resource. */ private String provisioningState; @@ -205,6 +203,11 @@ public final class DatabaseAccountGetProperties implements JsonSerializable networkAclBypassResourceIds; + /* + * The Object representing the different Diagnostic log settings for the Cosmos DB Account. + */ + private DiagnosticLogSettings diagnosticLogSettings; + /* * Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. */ @@ -215,6 +218,21 @@ public final class DatabaseAccountGetProperties implements JsonSerializable return this; } + /** + * Get the diagnosticLogSettings property: The Object representing the different Diagnostic log settings for the + * Cosmos DB Account. + * + * @return the diagnosticLogSettings value. + */ + public DiagnosticLogSettings diagnosticLogSettings() { + return this.diagnosticLogSettings; + } + + /** + * Set the diagnosticLogSettings property: The Object representing the different Diagnostic log settings for the + * Cosmos DB Account. + * + * @param diagnosticLogSettings the diagnosticLogSettings value to set. + * @return the DatabaseAccountGetProperties object itself. + */ + public DatabaseAccountGetProperties withDiagnosticLogSettings(DiagnosticLogSettings diagnosticLogSettings) { + this.diagnosticLogSettings = diagnosticLogSettings; + return this; + } + /** * Get the disableLocalAuth property: Opt-out of local authentication and ensure only MSI and AAD can be used * exclusively for authentication. @@ -876,6 +930,71 @@ public DatabaseAccountGetProperties withCapacity(Capacity capacity) { return this; } + /** + * Get the capacityMode property: Indicates the capacityMode of the Cosmos DB account. + * + * @return the capacityMode value. + */ + public CapacityMode capacityMode() { + return this.capacityMode; + } + + /** + * Set the capacityMode property: Indicates the capacityMode of the Cosmos DB account. + * + * @param capacityMode the capacityMode value to set. + * @return the DatabaseAccountGetProperties object itself. + */ + public DatabaseAccountGetProperties withCapacityMode(CapacityMode capacityMode) { + this.capacityMode = capacityMode; + return this; + } + + /** + * Get the capacityModeChangeTransitionState property: The object that represents the migration state for the + * CapacityMode of the Cosmos DB account. + * + * @return the capacityModeChangeTransitionState value. + */ + public CapacityModeChangeTransitionState capacityModeChangeTransitionState() { + return this.capacityModeChangeTransitionState; + } + + /** + * Set the capacityModeChangeTransitionState property: The object that represents the migration state for the + * CapacityMode of the Cosmos DB account. + * + * @param capacityModeChangeTransitionState the capacityModeChangeTransitionState value to set. + * @return the DatabaseAccountGetProperties object itself. + */ + public DatabaseAccountGetProperties + withCapacityModeChangeTransitionState(CapacityModeChangeTransitionState capacityModeChangeTransitionState) { + this.capacityModeChangeTransitionState = capacityModeChangeTransitionState; + return this; + } + + /** + * Get the enableMaterializedViews property: Flag to indicate whether to enable MaterializedViews on the Cosmos DB + * account. + * + * @return the enableMaterializedViews value. + */ + public Boolean enableMaterializedViews() { + return this.enableMaterializedViews; + } + + /** + * Set the enableMaterializedViews property: Flag to indicate whether to enable MaterializedViews on the Cosmos DB + * account. + * + * @param enableMaterializedViews the enableMaterializedViews value to set. + * @return the DatabaseAccountGetProperties object itself. + */ + public DatabaseAccountGetProperties withEnableMaterializedViews(Boolean enableMaterializedViews) { + this.enableMaterializedViews = enableMaterializedViews; + return this; + } + /** * Get the keysMetadata property: The object that represents the metadata for the Account Keys of the Cosmos DB * account. @@ -909,46 +1028,46 @@ public DatabaseAccountGetProperties withEnablePartitionMerge(Boolean enableParti } /** - * Get the minimalTlsVersion property: Indicates the minimum allowed Tls version. The default value is Tls 1.2. - * Cassandra and Mongo APIs only work with Tls 1.2. + * Get the enableBurstCapacity property: Flag to indicate enabling/disabling of Burst Capacity Preview feature on + * the account. * - * @return the minimalTlsVersion value. + * @return the enableBurstCapacity value. */ - public MinimalTlsVersion minimalTlsVersion() { - return this.minimalTlsVersion; + public Boolean enableBurstCapacity() { + return this.enableBurstCapacity; } /** - * Set the minimalTlsVersion property: Indicates the minimum allowed Tls version. The default value is Tls 1.2. - * Cassandra and Mongo APIs only work with Tls 1.2. + * Set the enableBurstCapacity property: Flag to indicate enabling/disabling of Burst Capacity Preview feature on + * the account. * - * @param minimalTlsVersion the minimalTlsVersion value to set. + * @param enableBurstCapacity the enableBurstCapacity value to set. * @return the DatabaseAccountGetProperties object itself. */ - public DatabaseAccountGetProperties withMinimalTlsVersion(MinimalTlsVersion minimalTlsVersion) { - this.minimalTlsVersion = minimalTlsVersion; + public DatabaseAccountGetProperties withEnableBurstCapacity(Boolean enableBurstCapacity) { + this.enableBurstCapacity = enableBurstCapacity; return this; } /** - * Get the enableBurstCapacity property: Flag to indicate enabling/disabling of Burst Capacity feature on the - * account. + * Get the minimalTlsVersion property: Indicates the minimum allowed Tls version. The default is Tls 1.0, except for + * Cassandra and Mongo API's, which only work with Tls 1.2. * - * @return the enableBurstCapacity value. + * @return the minimalTlsVersion value. */ - public Boolean enableBurstCapacity() { - return this.enableBurstCapacity; + public MinimalTlsVersion minimalTlsVersion() { + return this.minimalTlsVersion; } /** - * Set the enableBurstCapacity property: Flag to indicate enabling/disabling of Burst Capacity feature on the - * account. + * Set the minimalTlsVersion property: Indicates the minimum allowed Tls version. The default is Tls 1.0, except for + * Cassandra and Mongo API's, which only work with Tls 1.2. * - * @param enableBurstCapacity the enableBurstCapacity value to set. + * @param minimalTlsVersion the minimalTlsVersion value to set. * @return the DatabaseAccountGetProperties object itself. */ - public DatabaseAccountGetProperties withEnableBurstCapacity(Boolean enableBurstCapacity) { - this.enableBurstCapacity = enableBurstCapacity; + public DatabaseAccountGetProperties withMinimalTlsVersion(MinimalTlsVersion minimalTlsVersion) { + this.minimalTlsVersion = minimalTlsVersion; return this; } @@ -974,29 +1093,6 @@ public DatabaseAccountGetProperties withCustomerManagedKeyStatus(String customer return this; } - /** - * Get the enablePerRegionPerPartitionAutoscale property: Flag to indicate enabling/disabling of - * PerRegionPerPartitionAutoscale feature on the account. - * - * @return the enablePerRegionPerPartitionAutoscale value. - */ - public Boolean enablePerRegionPerPartitionAutoscale() { - return this.enablePerRegionPerPartitionAutoscale; - } - - /** - * Set the enablePerRegionPerPartitionAutoscale property: Flag to indicate enabling/disabling of - * PerRegionPerPartitionAutoscale feature on the account. - * - * @param enablePerRegionPerPartitionAutoscale the enablePerRegionPerPartitionAutoscale value to set. - * @return the DatabaseAccountGetProperties object itself. - */ - public DatabaseAccountGetProperties - withEnablePerRegionPerPartitionAutoscale(Boolean enablePerRegionPerPartitionAutoscale) { - this.enablePerRegionPerPartitionAutoscale = enablePerRegionPerPartitionAutoscale; - return this; - } - /** * Get the keyVaultKeyUriVersion property: The version of the Customer Managed Key currently being used by the * account. @@ -1051,6 +1147,102 @@ public DatabaseAccountGetProperties withDefaultPriorityLevel(DefaultPriorityLeve return this; } + /** + * Get the enablePerRegionPerPartitionAutoscale property: Flag to indicate enabling/disabling of Per-Region + * Per-partition autoscale Preview feature on the account. + * + * @return the enablePerRegionPerPartitionAutoscale value. + */ + public Boolean enablePerRegionPerPartitionAutoscale() { + return this.enablePerRegionPerPartitionAutoscale; + } + + /** + * Set the enablePerRegionPerPartitionAutoscale property: Flag to indicate enabling/disabling of Per-Region + * Per-partition autoscale Preview feature on the account. + * + * @param enablePerRegionPerPartitionAutoscale the enablePerRegionPerPartitionAutoscale value to set. + * @return the DatabaseAccountGetProperties object itself. + */ + public DatabaseAccountGetProperties + withEnablePerRegionPerPartitionAutoscale(Boolean enablePerRegionPerPartitionAutoscale) { + this.enablePerRegionPerPartitionAutoscale = enablePerRegionPerPartitionAutoscale; + return this; + } + + /** + * Get the enableAllVersionsAndDeletesChangeFeed property: Flag to indicate if All Versions and Deletes Change feed + * feature is enabled on the account. + * + * @return the enableAllVersionsAndDeletesChangeFeed value. + */ + public Boolean enableAllVersionsAndDeletesChangeFeed() { + return this.enableAllVersionsAndDeletesChangeFeed; + } + + /** + * Set the enableAllVersionsAndDeletesChangeFeed property: Flag to indicate if All Versions and Deletes Change feed + * feature is enabled on the account. + * + * @param enableAllVersionsAndDeletesChangeFeed the enableAllVersionsAndDeletesChangeFeed value to set. + * @return the DatabaseAccountGetProperties object itself. + */ + public DatabaseAccountGetProperties + withEnableAllVersionsAndDeletesChangeFeed(Boolean enableAllVersionsAndDeletesChangeFeed) { + this.enableAllVersionsAndDeletesChangeFeed = enableAllVersionsAndDeletesChangeFeed; + return this; + } + + /** + * Get the throughputPoolDedicatedRUs property: Total dedicated throughput (RU/s) for database account. Represents + * the sum of all manual provisioned throughput and all autoscale max RU/s across all shared throughput databases + * and dedicated throughput containers in the account for 1 region. READ ONLY. + * + * @return the throughputPoolDedicatedRUs value. + */ + public Long throughputPoolDedicatedRUs() { + return this.throughputPoolDedicatedRUs; + } + + /** + * Set the throughputPoolDedicatedRUs property: Total dedicated throughput (RU/s) for database account. Represents + * the sum of all manual provisioned throughput and all autoscale max RU/s across all shared throughput databases + * and dedicated throughput containers in the account for 1 region. READ ONLY. + * + * @param throughputPoolDedicatedRUs the throughputPoolDedicatedRUs value to set. + * @return the DatabaseAccountGetProperties object itself. + */ + public DatabaseAccountGetProperties withThroughputPoolDedicatedRUs(Long throughputPoolDedicatedRUs) { + this.throughputPoolDedicatedRUs = throughputPoolDedicatedRUs; + return this; + } + + /** + * Get the throughputPoolMaxConsumableRUs property: When this account is part of a fleetspace with throughput + * pooling enabled, this is the maximum additional throughput (RU/s) that can be consumed from the pool, summed + * across all shared throughput databases and dedicated throughput containers in the account for 1 region. READ + * ONLY. + * + * @return the throughputPoolMaxConsumableRUs value. + */ + public Long throughputPoolMaxConsumableRUs() { + return this.throughputPoolMaxConsumableRUs; + } + + /** + * Set the throughputPoolMaxConsumableRUs property: When this account is part of a fleetspace with throughput + * pooling enabled, this is the maximum additional throughput (RU/s) that can be consumed from the pool, summed + * across all shared throughput databases and dedicated throughput containers in the account for 1 region. READ + * ONLY. + * + * @param throughputPoolMaxConsumableRUs the throughputPoolMaxConsumableRUs value to set. + * @return the DatabaseAccountGetProperties object itself. + */ + public DatabaseAccountGetProperties withThroughputPoolMaxConsumableRUs(Long throughputPoolMaxConsumableRUs) { + this.throughputPoolMaxConsumableRUs = throughputPoolMaxConsumableRUs; + return this; + } + /** * Validates the instance. * @@ -1099,9 +1291,15 @@ public void validate() { if (cors() != null) { cors().forEach(e -> e.validate()); } + if (diagnosticLogSettings() != null) { + diagnosticLogSettings().validate(); + } if (capacity() != null) { capacity().validate(); } + if (capacityModeChangeTransitionState() != null) { + capacityModeChangeTransitionState().validate(); + } if (keysMetadata() != null) { keysMetadata().validate(); } @@ -1141,17 +1339,25 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { this.networkAclBypass == null ? null : this.networkAclBypass.toString()); jsonWriter.writeArrayField("networkAclBypassResourceIds", this.networkAclBypassResourceIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("diagnosticLogSettings", this.diagnosticLogSettings); jsonWriter.writeBooleanField("disableLocalAuth", this.disableLocalAuth); jsonWriter.writeJsonField("capacity", this.capacity); + jsonWriter.writeStringField("capacityMode", this.capacityMode == null ? null : this.capacityMode.toString()); + jsonWriter.writeJsonField("capacityModeChangeTransitionState", this.capacityModeChangeTransitionState); + jsonWriter.writeBooleanField("enableMaterializedViews", this.enableMaterializedViews); jsonWriter.writeBooleanField("enablePartitionMerge", this.enablePartitionMerge); + jsonWriter.writeBooleanField("enableBurstCapacity", this.enableBurstCapacity); jsonWriter.writeStringField("minimalTlsVersion", this.minimalTlsVersion == null ? null : this.minimalTlsVersion.toString()); - jsonWriter.writeBooleanField("enableBurstCapacity", this.enableBurstCapacity); jsonWriter.writeStringField("customerManagedKeyStatus", this.customerManagedKeyStatus); - jsonWriter.writeBooleanField("enablePerRegionPerPartitionAutoscale", this.enablePerRegionPerPartitionAutoscale); jsonWriter.writeBooleanField("enablePriorityBasedExecution", this.enablePriorityBasedExecution); jsonWriter.writeStringField("defaultPriorityLevel", this.defaultPriorityLevel == null ? null : this.defaultPriorityLevel.toString()); + jsonWriter.writeBooleanField("enablePerRegionPerPartitionAutoscale", this.enablePerRegionPerPartitionAutoscale); + jsonWriter.writeBooleanField("enableAllVersionsAndDeletesChangeFeed", + this.enableAllVersionsAndDeletesChangeFeed); + jsonWriter.writeNumberField("throughputPoolDedicatedRUs", this.throughputPoolDedicatedRUs); + jsonWriter.writeNumberField("throughputPoolMaxConsumableRUs", this.throughputPoolMaxConsumableRUs); return jsonWriter.writeEndObject(); } @@ -1259,28 +1465,36 @@ public static DatabaseAccountGetProperties fromJson(JsonReader jsonReader) throw } else if ("networkAclBypassResourceIds".equals(fieldName)) { List networkAclBypassResourceIds = reader.readArray(reader1 -> reader1.getString()); deserializedDatabaseAccountGetProperties.networkAclBypassResourceIds = networkAclBypassResourceIds; + } else if ("diagnosticLogSettings".equals(fieldName)) { + deserializedDatabaseAccountGetProperties.diagnosticLogSettings + = DiagnosticLogSettings.fromJson(reader); } else if ("disableLocalAuth".equals(fieldName)) { deserializedDatabaseAccountGetProperties.disableLocalAuth = reader.getNullable(JsonReader::getBoolean); } else if ("capacity".equals(fieldName)) { deserializedDatabaseAccountGetProperties.capacity = Capacity.fromJson(reader); + } else if ("capacityMode".equals(fieldName)) { + deserializedDatabaseAccountGetProperties.capacityMode = CapacityMode.fromString(reader.getString()); + } else if ("capacityModeChangeTransitionState".equals(fieldName)) { + deserializedDatabaseAccountGetProperties.capacityModeChangeTransitionState + = CapacityModeChangeTransitionState.fromJson(reader); + } else if ("enableMaterializedViews".equals(fieldName)) { + deserializedDatabaseAccountGetProperties.enableMaterializedViews + = reader.getNullable(JsonReader::getBoolean); } else if ("keysMetadata".equals(fieldName)) { deserializedDatabaseAccountGetProperties.keysMetadata = DatabaseAccountKeysMetadata.fromJson(reader); } else if ("enablePartitionMerge".equals(fieldName)) { deserializedDatabaseAccountGetProperties.enablePartitionMerge = reader.getNullable(JsonReader::getBoolean); - } else if ("minimalTlsVersion".equals(fieldName)) { - deserializedDatabaseAccountGetProperties.minimalTlsVersion - = MinimalTlsVersion.fromString(reader.getString()); } else if ("enableBurstCapacity".equals(fieldName)) { deserializedDatabaseAccountGetProperties.enableBurstCapacity = reader.getNullable(JsonReader::getBoolean); + } else if ("minimalTlsVersion".equals(fieldName)) { + deserializedDatabaseAccountGetProperties.minimalTlsVersion + = MinimalTlsVersion.fromString(reader.getString()); } else if ("customerManagedKeyStatus".equals(fieldName)) { deserializedDatabaseAccountGetProperties.customerManagedKeyStatus = reader.getString(); - } else if ("enablePerRegionPerPartitionAutoscale".equals(fieldName)) { - deserializedDatabaseAccountGetProperties.enablePerRegionPerPartitionAutoscale - = reader.getNullable(JsonReader::getBoolean); } else if ("keyVaultKeyUriVersion".equals(fieldName)) { deserializedDatabaseAccountGetProperties.keyVaultKeyUriVersion = reader.getString(); } else if ("enablePriorityBasedExecution".equals(fieldName)) { @@ -1289,6 +1503,18 @@ public static DatabaseAccountGetProperties fromJson(JsonReader jsonReader) throw } else if ("defaultPriorityLevel".equals(fieldName)) { deserializedDatabaseAccountGetProperties.defaultPriorityLevel = DefaultPriorityLevel.fromString(reader.getString()); + } else if ("enablePerRegionPerPartitionAutoscale".equals(fieldName)) { + deserializedDatabaseAccountGetProperties.enablePerRegionPerPartitionAutoscale + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableAllVersionsAndDeletesChangeFeed".equals(fieldName)) { + deserializedDatabaseAccountGetProperties.enableAllVersionsAndDeletesChangeFeed + = reader.getNullable(JsonReader::getBoolean); + } else if ("throughputPoolDedicatedRUs".equals(fieldName)) { + deserializedDatabaseAccountGetProperties.throughputPoolDedicatedRUs + = reader.getNullable(JsonReader::getLong); + } else if ("throughputPoolMaxConsumableRUs".equals(fieldName)) { + deserializedDatabaseAccountGetProperties.throughputPoolMaxConsumableRUs + = reader.getNullable(JsonReader::getLong); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountGetResultsInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountGetResultsInner.java index 3b73f48f766b..82d08ec2a744 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountGetResultsInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountGetResultsInner.java @@ -1,20 +1,21 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. - +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.cosmos.models.AnalyticalStorageConfiguration; import com.azure.resourcemanager.cosmos.models.ApiProperties; -import com.azure.resourcemanager.cosmos.models.ArmResourceProperties; import com.azure.resourcemanager.cosmos.models.BackupPolicy; import com.azure.resourcemanager.cosmos.models.Capability; import com.azure.resourcemanager.cosmos.models.Capacity; +import com.azure.resourcemanager.cosmos.models.CapacityMode; +import com.azure.resourcemanager.cosmos.models.CapacityModeChangeTransitionState; import com.azure.resourcemanager.cosmos.models.ConnectorOffer; import com.azure.resourcemanager.cosmos.models.ConsistencyPolicy; import com.azure.resourcemanager.cosmos.models.CorsPolicy; @@ -23,6 +24,7 @@ import com.azure.resourcemanager.cosmos.models.DatabaseAccountKind; import com.azure.resourcemanager.cosmos.models.DatabaseAccountOfferType; import com.azure.resourcemanager.cosmos.models.DefaultPriorityLevel; +import com.azure.resourcemanager.cosmos.models.DiagnosticLogSettings; import com.azure.resourcemanager.cosmos.models.FailoverPolicy; import com.azure.resourcemanager.cosmos.models.IpAddressOrRange; import com.azure.resourcemanager.cosmos.models.Location; @@ -40,11 +42,22 @@ * An Azure Cosmos DB database account. */ @Fluent -public final class DatabaseAccountGetResultsInner extends ArmResourceProperties { +public final class DatabaseAccountGetResultsInner extends Resource { + /* - * Indicates the type of database account. This can only be set at database account creation. + * Properties for the database account. */ - private DatabaseAccountKind kind; + private DatabaseAccountGetProperties innerProperties; + + /* + * Resource tags. + */ + private Map tags; + + /* + * The geo-location where the resource lives + */ + private String location; /* * Identity for the resource. @@ -52,12 +65,12 @@ public final class DatabaseAccountGetResultsInner extends ArmResourceProperties private ManagedServiceIdentity identity; /* - * Properties for the database account. + * Indicates the type of database account. This can only be set at database account creation. */ - private DatabaseAccountGetProperties innerProperties; + private DatabaseAccountKind kind; /* - * The system meta data relating to this resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ private SystemData systemData; @@ -83,28 +96,57 @@ public DatabaseAccountGetResultsInner() { } /** - * Get the kind property: Indicates the type of database account. This can only be set at database account creation. - * - * @return the kind value. + * Get the innerProperties property: Properties for the database account. + * + * @return the innerProperties value. */ - public DatabaseAccountKind kind() { - return this.kind; + private DatabaseAccountGetProperties innerProperties() { + return this.innerProperties; } /** - * Set the kind property: Indicates the type of database account. This can only be set at database account creation. - * - * @param kind the kind value to set. + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Resource tags. + * + * @param tags the tags value to set. * @return the DatabaseAccountGetResultsInner object itself. */ - public DatabaseAccountGetResultsInner withKind(DatabaseAccountKind kind) { - this.kind = kind; + public DatabaseAccountGetResultsInner withTags(Map tags) { + this.tags = tags; + return this; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The geo-location where the resource lives. + * + * @param location the location value to set. + * @return the DatabaseAccountGetResultsInner object itself. + */ + public DatabaseAccountGetResultsInner withLocation(String location) { + this.location = location; return this; } /** * Get the identity property: Identity for the resource. - * + * * @return the identity value. */ public ManagedServiceIdentity identity() { @@ -113,7 +155,7 @@ public ManagedServiceIdentity identity() { /** * Set the identity property: Identity for the resource. - * + * * @param identity the identity value to set. * @return the DatabaseAccountGetResultsInner object itself. */ @@ -123,17 +165,28 @@ public DatabaseAccountGetResultsInner withIdentity(ManagedServiceIdentity identi } /** - * Get the innerProperties property: Properties for the database account. - * - * @return the innerProperties value. + * Get the kind property: Indicates the type of database account. This can only be set at database account creation. + * + * @return the kind value. */ - private DatabaseAccountGetProperties innerProperties() { - return this.innerProperties; + public DatabaseAccountKind kind() { + return this.kind; + } + + /** + * Set the kind property: Indicates the type of database account. This can only be set at database account creation. + * + * @param kind the kind value to set. + * @return the DatabaseAccountGetResultsInner object itself. + */ + public DatabaseAccountGetResultsInner withKind(DatabaseAccountKind kind) { + this.kind = kind; + return this; } /** - * Get the systemData property: The system meta data relating to this resource. - * + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * * @return the systemData value. */ public SystemData systemData() { @@ -142,7 +195,7 @@ public SystemData systemData() { /** * Get the type property: The type of the resource. - * + * * @return the type value. */ @Override @@ -152,7 +205,7 @@ public String type() { /** * Get the name property: The name of the resource. - * + * * @return the name value. */ @Override @@ -162,7 +215,7 @@ public String name() { /** * Get the id property: Fully qualified resource Id for the resource. - * + * * @return the id value. */ @Override @@ -171,31 +224,8 @@ public String id() { } /** - * {@inheritDoc} - */ - @Override - public DatabaseAccountGetResultsInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DatabaseAccountGetResultsInner withTags(Map tags) { - super.withTags(tags); - return this; - } - - /** - * Get the provisioningState property: The status of the Cosmos DB account at the time the operation was called. The - * status can be one of following. 'Creating' – the Cosmos DB account is being created. When an account is in - * Creating state, only properties that are specified as input for the Create Cosmos DB account operation are - * returned. 'Succeeded' – the Cosmos DB account is active for use. 'Updating' – the Cosmos DB account is being - * updated. 'Deleting' – the Cosmos DB account is being deleted. 'Failed' – the Cosmos DB account failed creation. - * 'DeletionFailed' – the Cosmos DB account deletion failed. - * + * Get the provisioningState property: The provisioning state of the resource. + * * @return the provisioningState value. */ public String provisioningState() { @@ -204,7 +234,7 @@ public String provisioningState() { /** * Get the documentEndpoint property: The connection endpoint for the Cosmos DB database account. - * + * * @return the documentEndpoint value. */ public String documentEndpoint() { @@ -214,7 +244,7 @@ public String documentEndpoint() { /** * Get the databaseAccountOfferType property: The offer type for the Cosmos DB database account. Default value: * Standard. - * + * * @return the databaseAccountOfferType value. */ public DatabaseAccountOfferType databaseAccountOfferType() { @@ -223,7 +253,7 @@ public DatabaseAccountOfferType databaseAccountOfferType() { /** * Get the ipRules property: List of IpRules. - * + * * @return the ipRules value. */ public List ipRules() { @@ -232,7 +262,7 @@ public List ipRules() { /** * Set the ipRules property: List of IpRules. - * + * * @param ipRules the ipRules value to set. * @return the DatabaseAccountGetResultsInner object itself. */ @@ -247,7 +277,7 @@ public DatabaseAccountGetResultsInner withIpRules(List ipRules /** * Get the isVirtualNetworkFilterEnabled property: Flag to indicate whether to enable/disable Virtual Network ACL * rules. - * + * * @return the isVirtualNetworkFilterEnabled value. */ public Boolean isVirtualNetworkFilterEnabled() { @@ -257,7 +287,7 @@ public Boolean isVirtualNetworkFilterEnabled() { /** * Set the isVirtualNetworkFilterEnabled property: Flag to indicate whether to enable/disable Virtual Network ACL * rules. - * + * * @param isVirtualNetworkFilterEnabled the isVirtualNetworkFilterEnabled value to set. * @return the DatabaseAccountGetResultsInner object itself. */ @@ -273,7 +303,7 @@ public DatabaseAccountGetResultsInner withIsVirtualNetworkFilterEnabled(Boolean * Get the enableAutomaticFailover property: Enables automatic failover of the write region in the rare event that * the region is unavailable due to an outage. Automatic failover will result in a new write region for the account * and is chosen based on the failover priorities configured for the account. - * + * * @return the enableAutomaticFailover value. */ public Boolean enableAutomaticFailover() { @@ -284,7 +314,7 @@ public Boolean enableAutomaticFailover() { * Set the enableAutomaticFailover property: Enables automatic failover of the write region in the rare event that * the region is unavailable due to an outage. Automatic failover will result in a new write region for the account * and is chosen based on the failover priorities configured for the account. - * + * * @param enableAutomaticFailover the enableAutomaticFailover value to set. * @return the DatabaseAccountGetResultsInner object itself. */ @@ -298,7 +328,7 @@ public DatabaseAccountGetResultsInner withEnableAutomaticFailover(Boolean enable /** * Get the consistencyPolicy property: The consistency policy for the Cosmos DB database account. - * + * * @return the consistencyPolicy value. */ public ConsistencyPolicy consistencyPolicy() { @@ -307,7 +337,7 @@ public ConsistencyPolicy consistencyPolicy() { /** * Set the consistencyPolicy property: The consistency policy for the Cosmos DB database account. - * + * * @param consistencyPolicy the consistencyPolicy value to set. * @return the DatabaseAccountGetResultsInner object itself. */ @@ -321,7 +351,7 @@ public DatabaseAccountGetResultsInner withConsistencyPolicy(ConsistencyPolicy co /** * Get the capabilities property: List of Cosmos DB capabilities for the account. - * + * * @return the capabilities value. */ public List capabilities() { @@ -330,7 +360,7 @@ public List capabilities() { /** * Set the capabilities property: List of Cosmos DB capabilities for the account. - * + * * @param capabilities the capabilities value to set. * @return the DatabaseAccountGetResultsInner object itself. */ @@ -344,7 +374,7 @@ public DatabaseAccountGetResultsInner withCapabilities(List capabili /** * Get the writeLocations property: An array that contains the write location for the Cosmos DB account. - * + * * @return the writeLocations value. */ public List writeLocations() { @@ -353,7 +383,7 @@ public List writeLocations() { /** * Get the readLocations property: An array that contains of the read locations enabled for the Cosmos DB account. - * + * * @return the readLocations value. */ public List readLocations() { @@ -362,7 +392,7 @@ public List readLocations() { /** * Get the locations property: An array that contains all of the locations enabled for the Cosmos DB account. - * + * * @return the locations value. */ public List locations() { @@ -371,7 +401,7 @@ public List locations() { /** * Get the failoverPolicies property: An array that contains the regions ordered by their failover priorities. - * + * * @return the failoverPolicies value. */ public List failoverPolicies() { @@ -380,7 +410,7 @@ public List failoverPolicies() { /** * Get the virtualNetworkRules property: List of Virtual Network ACL rules configured for the Cosmos DB account. - * + * * @return the virtualNetworkRules value. */ public List virtualNetworkRules() { @@ -389,7 +419,7 @@ public List virtualNetworkRules() { /** * Set the virtualNetworkRules property: List of Virtual Network ACL rules configured for the Cosmos DB account. - * + * * @param virtualNetworkRules the virtualNetworkRules value to set. * @return the DatabaseAccountGetResultsInner object itself. */ @@ -404,7 +434,7 @@ public DatabaseAccountGetResultsInner withVirtualNetworkRules(List privateEndpointConnections() { @@ -413,7 +443,7 @@ public List privateEndpointConnections() { /** * Get the enableMultipleWriteLocations property: Enables the account to write in multiple locations. - * + * * @return the enableMultipleWriteLocations value. */ public Boolean enableMultipleWriteLocations() { @@ -422,7 +452,7 @@ public Boolean enableMultipleWriteLocations() { /** * Set the enableMultipleWriteLocations property: Enables the account to write in multiple locations. - * + * * @param enableMultipleWriteLocations the enableMultipleWriteLocations value to set. * @return the DatabaseAccountGetResultsInner object itself. */ @@ -436,7 +466,7 @@ public DatabaseAccountGetResultsInner withEnableMultipleWriteLocations(Boolean e /** * Get the enableCassandraConnector property: Enables the cassandra connector on the Cosmos DB C* account. - * + * * @return the enableCassandraConnector value. */ public Boolean enableCassandraConnector() { @@ -445,7 +475,7 @@ public Boolean enableCassandraConnector() { /** * Set the enableCassandraConnector property: Enables the cassandra connector on the Cosmos DB C* account. - * + * * @param enableCassandraConnector the enableCassandraConnector value to set. * @return the DatabaseAccountGetResultsInner object itself. */ @@ -459,7 +489,7 @@ public DatabaseAccountGetResultsInner withEnableCassandraConnector(Boolean enabl /** * Get the connectorOffer property: The cassandra connector offer type for the Cosmos DB database C* account. - * + * * @return the connectorOffer value. */ public ConnectorOffer connectorOffer() { @@ -468,7 +498,7 @@ public ConnectorOffer connectorOffer() { /** * Set the connectorOffer property: The cassandra connector offer type for the Cosmos DB database C* account. - * + * * @param connectorOffer the connectorOffer value to set. * @return the DatabaseAccountGetResultsInner object itself. */ @@ -483,7 +513,7 @@ public DatabaseAccountGetResultsInner withConnectorOffer(ConnectorOffer connecto /** * Get the disableKeyBasedMetadataWriteAccess property: Disable write operations on metadata resources (databases, * containers, throughput) via account keys. - * + * * @return the disableKeyBasedMetadataWriteAccess value. */ public Boolean disableKeyBasedMetadataWriteAccess() { @@ -493,7 +523,7 @@ public Boolean disableKeyBasedMetadataWriteAccess() { /** * Set the disableKeyBasedMetadataWriteAccess property: Disable write operations on metadata resources (databases, * containers, throughput) via account keys. - * + * * @param disableKeyBasedMetadataWriteAccess the disableKeyBasedMetadataWriteAccess value to set. * @return the DatabaseAccountGetResultsInner object itself. */ @@ -508,7 +538,7 @@ public Boolean disableKeyBasedMetadataWriteAccess() { /** * Get the keyVaultKeyUri property: The URI of the key vault. - * + * * @return the keyVaultKeyUri value. */ public String keyVaultKeyUri() { @@ -517,7 +547,7 @@ public String keyVaultKeyUri() { /** * Set the keyVaultKeyUri property: The URI of the key vault. - * + * * @param keyVaultKeyUri the keyVaultKeyUri value to set. * @return the DatabaseAccountGetResultsInner object itself. */ @@ -533,7 +563,7 @@ public DatabaseAccountGetResultsInner withKeyVaultKeyUri(String keyVaultKeyUri) * Get the defaultIdentity property: The default identity for accessing key vault used in features like customer * managed keys. The default identity needs to be explicitly set by the users. It can be "FirstPartyIdentity", * "SystemAssignedIdentity" and more. - * + * * @return the defaultIdentity value. */ public String defaultIdentity() { @@ -544,7 +574,7 @@ public String defaultIdentity() { * Set the defaultIdentity property: The default identity for accessing key vault used in features like customer * managed keys. The default identity needs to be explicitly set by the users. It can be "FirstPartyIdentity", * "SystemAssignedIdentity" and more. - * + * * @param defaultIdentity the defaultIdentity value to set. * @return the DatabaseAccountGetResultsInner object itself. */ @@ -558,7 +588,7 @@ public DatabaseAccountGetResultsInner withDefaultIdentity(String defaultIdentity /** * Get the publicNetworkAccess property: Whether requests from Public Network are allowed. - * + * * @return the publicNetworkAccess value. */ public PublicNetworkAccess publicNetworkAccess() { @@ -567,7 +597,7 @@ public PublicNetworkAccess publicNetworkAccess() { /** * Set the publicNetworkAccess property: Whether requests from Public Network are allowed. - * + * * @param publicNetworkAccess the publicNetworkAccess value to set. * @return the DatabaseAccountGetResultsInner object itself. */ @@ -581,7 +611,7 @@ public DatabaseAccountGetResultsInner withPublicNetworkAccess(PublicNetworkAcces /** * Get the enableFreeTier property: Flag to indicate whether Free Tier is enabled. - * + * * @return the enableFreeTier value. */ public Boolean enableFreeTier() { @@ -590,7 +620,7 @@ public Boolean enableFreeTier() { /** * Set the enableFreeTier property: Flag to indicate whether Free Tier is enabled. - * + * * @param enableFreeTier the enableFreeTier value to set. * @return the DatabaseAccountGetResultsInner object itself. */ @@ -604,7 +634,7 @@ public DatabaseAccountGetResultsInner withEnableFreeTier(Boolean enableFreeTier) /** * Get the apiProperties property: API specific properties. - * + * * @return the apiProperties value. */ public ApiProperties apiProperties() { @@ -613,7 +643,7 @@ public ApiProperties apiProperties() { /** * Set the apiProperties property: API specific properties. - * + * * @param apiProperties the apiProperties value to set. * @return the DatabaseAccountGetResultsInner object itself. */ @@ -627,7 +657,7 @@ public DatabaseAccountGetResultsInner withApiProperties(ApiProperties apiPropert /** * Get the enableAnalyticalStorage property: Flag to indicate whether to enable storage analytics. - * + * * @return the enableAnalyticalStorage value. */ public Boolean enableAnalyticalStorage() { @@ -636,7 +666,7 @@ public Boolean enableAnalyticalStorage() { /** * Set the enableAnalyticalStorage property: Flag to indicate whether to enable storage analytics. - * + * * @param enableAnalyticalStorage the enableAnalyticalStorage value to set. * @return the DatabaseAccountGetResultsInner object itself. */ @@ -650,7 +680,7 @@ public DatabaseAccountGetResultsInner withEnableAnalyticalStorage(Boolean enable /** * Get the analyticalStorageConfiguration property: Analytical storage specific properties. - * + * * @return the analyticalStorageConfiguration value. */ public AnalyticalStorageConfiguration analyticalStorageConfiguration() { @@ -659,7 +689,7 @@ public AnalyticalStorageConfiguration analyticalStorageConfiguration() { /** * Set the analyticalStorageConfiguration property: Analytical storage specific properties. - * + * * @param analyticalStorageConfiguration the analyticalStorageConfiguration value to set. * @return the DatabaseAccountGetResultsInner object itself. */ @@ -674,7 +704,7 @@ public AnalyticalStorageConfiguration analyticalStorageConfiguration() { /** * Get the instanceId property: A unique identifier assigned to the database account. - * + * * @return the instanceId value. */ public String instanceId() { @@ -683,7 +713,7 @@ public String instanceId() { /** * Get the createMode property: Enum to indicate the mode of account creation. - * + * * @return the createMode value. */ public CreateMode createMode() { @@ -692,7 +722,7 @@ public CreateMode createMode() { /** * Set the createMode property: Enum to indicate the mode of account creation. - * + * * @param createMode the createMode value to set. * @return the DatabaseAccountGetResultsInner object itself. */ @@ -706,7 +736,7 @@ public DatabaseAccountGetResultsInner withCreateMode(CreateMode createMode) { /** * Get the restoreParameters property: Parameters to indicate the information about the restore. - * + * * @return the restoreParameters value. */ public RestoreParameters restoreParameters() { @@ -715,7 +745,7 @@ public RestoreParameters restoreParameters() { /** * Set the restoreParameters property: Parameters to indicate the information about the restore. - * + * * @param restoreParameters the restoreParameters value to set. * @return the DatabaseAccountGetResultsInner object itself. */ @@ -729,7 +759,7 @@ public DatabaseAccountGetResultsInner withRestoreParameters(RestoreParameters re /** * Get the backupPolicy property: The object representing the policy for taking backups on an account. - * + * * @return the backupPolicy value. */ public BackupPolicy backupPolicy() { @@ -738,7 +768,7 @@ public BackupPolicy backupPolicy() { /** * Set the backupPolicy property: The object representing the policy for taking backups on an account. - * + * * @param backupPolicy the backupPolicy value to set. * @return the DatabaseAccountGetResultsInner object itself. */ @@ -752,7 +782,7 @@ public DatabaseAccountGetResultsInner withBackupPolicy(BackupPolicy backupPolicy /** * Get the cors property: The CORS policy for the Cosmos DB database account. - * + * * @return the cors value. */ public List cors() { @@ -761,7 +791,7 @@ public List cors() { /** * Set the cors property: The CORS policy for the Cosmos DB database account. - * + * * @param cors the cors value to set. * @return the DatabaseAccountGetResultsInner object itself. */ @@ -775,7 +805,7 @@ public DatabaseAccountGetResultsInner withCors(List cors) { /** * Get the networkAclBypass property: Indicates what services are allowed to bypass firewall checks. - * + * * @return the networkAclBypass value. */ public NetworkAclBypass networkAclBypass() { @@ -784,7 +814,7 @@ public NetworkAclBypass networkAclBypass() { /** * Set the networkAclBypass property: Indicates what services are allowed to bypass firewall checks. - * + * * @param networkAclBypass the networkAclBypass value to set. * @return the DatabaseAccountGetResultsInner object itself. */ @@ -799,7 +829,7 @@ public DatabaseAccountGetResultsInner withNetworkAclBypass(NetworkAclBypass netw /** * Get the networkAclBypassResourceIds property: An array that contains the Resource Ids for Network Acl Bypass for * the Cosmos DB account. - * + * * @return the networkAclBypassResourceIds value. */ public List networkAclBypassResourceIds() { @@ -809,7 +839,7 @@ public List networkAclBypassResourceIds() { /** * Set the networkAclBypassResourceIds property: An array that contains the Resource Ids for Network Acl Bypass for * the Cosmos DB account. - * + * * @param networkAclBypassResourceIds the networkAclBypassResourceIds value to set. * @return the DatabaseAccountGetResultsInner object itself. */ @@ -821,10 +851,35 @@ public DatabaseAccountGetResultsInner withNetworkAclBypassResourceIds(List writer.writeString(element)); - jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); - jsonWriter.writeJsonField("identity", this.identity); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("identity", this.identity); + jsonWriter.writeStringField("kind", this.kind == null ? null : this.kind.toString()); return jsonWriter.writeEndObject(); } /** * Reads an instance of DatabaseAccountGetResultsInner from the JsonReader. - * + * * @param jsonReader The JsonReader being read. * @return An instance of DatabaseAccountGetResultsInner if the JsonReader was pointing to an instance of it, or * null if it was pointing to JSON null. @@ -1112,33 +1322,31 @@ public static DatabaseAccountGetResultsInner fromJson(JsonReader jsonReader) thr while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("id".equals(fieldName)) { deserializedDatabaseAccountGetResultsInner.id = reader.getString(); } else if ("name".equals(fieldName)) { deserializedDatabaseAccountGetResultsInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedDatabaseAccountGetResultsInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedDatabaseAccountGetResultsInner.withLocation(reader.getString()); + } else if ("properties".equals(fieldName)) { + deserializedDatabaseAccountGetResultsInner.innerProperties + = DatabaseAccountGetProperties.fromJson(reader); } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedDatabaseAccountGetResultsInner.withTags(tags); + deserializedDatabaseAccountGetResultsInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedDatabaseAccountGetResultsInner.location = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedDatabaseAccountGetResultsInner.identity = ManagedServiceIdentity.fromJson(reader); } else if ("kind".equals(fieldName)) { deserializedDatabaseAccountGetResultsInner.kind = DatabaseAccountKind.fromString(reader.getString()); - } else if ("identity".equals(fieldName)) { - deserializedDatabaseAccountGetResultsInner.identity = ManagedServiceIdentity.fromJson(reader); - } else if ("properties".equals(fieldName)) { - deserializedDatabaseAccountGetResultsInner.innerProperties - = DatabaseAccountGetProperties.fromJson(reader); } else if ("systemData".equals(fieldName)) { deserializedDatabaseAccountGetResultsInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } } - return deserializedDatabaseAccountGetResultsInner; }); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountListConnectionStringsResultInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountListConnectionStringsResultInner.java index 43653f91c59a..bd19f02a0809 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountListConnectionStringsResultInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountListConnectionStringsResultInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The connection strings for the given database account. */ -@Fluent +@Immutable public final class DatabaseAccountListConnectionStringsResultInner implements JsonSerializable { /* @@ -27,7 +27,7 @@ public final class DatabaseAccountListConnectionStringsResultInner /** * Creates an instance of DatabaseAccountListConnectionStringsResultInner class. */ - public DatabaseAccountListConnectionStringsResultInner() { + private DatabaseAccountListConnectionStringsResultInner() { } /** @@ -39,18 +39,6 @@ public List connectionStrings() { return this.connectionStrings; } - /** - * Set the connectionStrings property: An array that contains the connection strings for the Cosmos DB account. - * - * @param connectionStrings the connectionStrings value to set. - * @return the DatabaseAccountListConnectionStringsResultInner object itself. - */ - public DatabaseAccountListConnectionStringsResultInner - withConnectionStrings(List connectionStrings) { - this.connectionStrings = connectionStrings; - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountListKeysResultInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountListKeysResultInner.java index 62e33416dbc0..6bc6ef043689 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountListKeysResultInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountListKeysResultInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; @@ -38,7 +38,7 @@ public final class DatabaseAccountListKeysResultInner extends DatabaseAccountLis /** * Creates an instance of DatabaseAccountListKeysResultInner class. */ - public DatabaseAccountListKeysResultInner() { + private DatabaseAccountListKeysResultInner() { } /** diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountListReadOnlyKeysResultInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountListReadOnlyKeysResultInner.java index 6d93f873ebe0..33e439282178 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountListReadOnlyKeysResultInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountListReadOnlyKeysResultInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; @@ -30,7 +30,7 @@ public class DatabaseAccountListReadOnlyKeysResultInner /** * Creates an instance of DatabaseAccountListReadOnlyKeysResultInner class. */ - public DatabaseAccountListReadOnlyKeysResultInner() { + protected DatabaseAccountListReadOnlyKeysResultInner() { } /** diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountUpdateProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountUpdateProperties.java index 792279a417a6..6c13bec7c159 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountUpdateProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; @@ -14,11 +14,13 @@ import com.azure.resourcemanager.cosmos.models.BackupPolicy; import com.azure.resourcemanager.cosmos.models.Capability; import com.azure.resourcemanager.cosmos.models.Capacity; +import com.azure.resourcemanager.cosmos.models.CapacityMode; import com.azure.resourcemanager.cosmos.models.ConnectorOffer; import com.azure.resourcemanager.cosmos.models.ConsistencyPolicy; import com.azure.resourcemanager.cosmos.models.CorsPolicy; import com.azure.resourcemanager.cosmos.models.DatabaseAccountKeysMetadata; import com.azure.resourcemanager.cosmos.models.DefaultPriorityLevel; +import com.azure.resourcemanager.cosmos.models.DiagnosticLogSettings; import com.azure.resourcemanager.cosmos.models.IpAddressOrRange; import com.azure.resourcemanager.cosmos.models.Location; import com.azure.resourcemanager.cosmos.models.MinimalTlsVersion; @@ -146,6 +148,11 @@ public final class DatabaseAccountUpdateProperties implements JsonSerializable networkAclBypassResourceIds; + /* + * The Object representing the different Diagnostic log settings for the Cosmos DB Account. + */ + private DiagnosticLogSettings diagnosticLogSettings; + /* * Opt-out of local authentication and ensure only MSI and AAD can be used exclusively for authentication. */ @@ -156,6 +163,16 @@ public final class DatabaseAccountUpdateProperties implements JsonSerializable e.validate()); } + if (diagnosticLogSettings() != null) { + diagnosticLogSettings().validate(); + } if (capacity() != null) { capacity().validate(); } @@ -946,17 +1058,22 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { this.networkAclBypass == null ? null : this.networkAclBypass.toString()); jsonWriter.writeArrayField("networkAclBypassResourceIds", this.networkAclBypassResourceIds, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("diagnosticLogSettings", this.diagnosticLogSettings); jsonWriter.writeBooleanField("disableLocalAuth", this.disableLocalAuth); jsonWriter.writeJsonField("capacity", this.capacity); + jsonWriter.writeStringField("capacityMode", this.capacityMode == null ? null : this.capacityMode.toString()); + jsonWriter.writeBooleanField("enableMaterializedViews", this.enableMaterializedViews); jsonWriter.writeBooleanField("enablePartitionMerge", this.enablePartitionMerge); + jsonWriter.writeBooleanField("enableBurstCapacity", this.enableBurstCapacity); jsonWriter.writeStringField("minimalTlsVersion", this.minimalTlsVersion == null ? null : this.minimalTlsVersion.toString()); - jsonWriter.writeBooleanField("enableBurstCapacity", this.enableBurstCapacity); jsonWriter.writeStringField("customerManagedKeyStatus", this.customerManagedKeyStatus); - jsonWriter.writeBooleanField("enablePerRegionPerPartitionAutoscale", this.enablePerRegionPerPartitionAutoscale); jsonWriter.writeBooleanField("enablePriorityBasedExecution", this.enablePriorityBasedExecution); jsonWriter.writeStringField("defaultPriorityLevel", this.defaultPriorityLevel == null ? null : this.defaultPriorityLevel.toString()); + jsonWriter.writeBooleanField("enablePerRegionPerPartitionAutoscale", this.enablePerRegionPerPartitionAutoscale); + jsonWriter.writeBooleanField("enableAllVersionsAndDeletesChangeFeed", + this.enableAllVersionsAndDeletesChangeFeed); return jsonWriter.writeEndObject(); } @@ -1039,34 +1156,46 @@ public static DatabaseAccountUpdateProperties fromJson(JsonReader jsonReader) th List networkAclBypassResourceIds = reader.readArray(reader1 -> reader1.getString()); deserializedDatabaseAccountUpdateProperties.networkAclBypassResourceIds = networkAclBypassResourceIds; + } else if ("diagnosticLogSettings".equals(fieldName)) { + deserializedDatabaseAccountUpdateProperties.diagnosticLogSettings + = DiagnosticLogSettings.fromJson(reader); } else if ("disableLocalAuth".equals(fieldName)) { deserializedDatabaseAccountUpdateProperties.disableLocalAuth = reader.getNullable(JsonReader::getBoolean); } else if ("capacity".equals(fieldName)) { deserializedDatabaseAccountUpdateProperties.capacity = Capacity.fromJson(reader); + } else if ("capacityMode".equals(fieldName)) { + deserializedDatabaseAccountUpdateProperties.capacityMode + = CapacityMode.fromString(reader.getString()); + } else if ("enableMaterializedViews".equals(fieldName)) { + deserializedDatabaseAccountUpdateProperties.enableMaterializedViews + = reader.getNullable(JsonReader::getBoolean); } else if ("keysMetadata".equals(fieldName)) { deserializedDatabaseAccountUpdateProperties.keysMetadata = DatabaseAccountKeysMetadata.fromJson(reader); } else if ("enablePartitionMerge".equals(fieldName)) { deserializedDatabaseAccountUpdateProperties.enablePartitionMerge = reader.getNullable(JsonReader::getBoolean); - } else if ("minimalTlsVersion".equals(fieldName)) { - deserializedDatabaseAccountUpdateProperties.minimalTlsVersion - = MinimalTlsVersion.fromString(reader.getString()); } else if ("enableBurstCapacity".equals(fieldName)) { deserializedDatabaseAccountUpdateProperties.enableBurstCapacity = reader.getNullable(JsonReader::getBoolean); + } else if ("minimalTlsVersion".equals(fieldName)) { + deserializedDatabaseAccountUpdateProperties.minimalTlsVersion + = MinimalTlsVersion.fromString(reader.getString()); } else if ("customerManagedKeyStatus".equals(fieldName)) { deserializedDatabaseAccountUpdateProperties.customerManagedKeyStatus = reader.getString(); - } else if ("enablePerRegionPerPartitionAutoscale".equals(fieldName)) { - deserializedDatabaseAccountUpdateProperties.enablePerRegionPerPartitionAutoscale - = reader.getNullable(JsonReader::getBoolean); } else if ("enablePriorityBasedExecution".equals(fieldName)) { deserializedDatabaseAccountUpdateProperties.enablePriorityBasedExecution = reader.getNullable(JsonReader::getBoolean); } else if ("defaultPriorityLevel".equals(fieldName)) { deserializedDatabaseAccountUpdateProperties.defaultPriorityLevel = DefaultPriorityLevel.fromString(reader.getString()); + } else if ("enablePerRegionPerPartitionAutoscale".equals(fieldName)) { + deserializedDatabaseAccountUpdateProperties.enablePerRegionPerPartitionAutoscale + = reader.getNullable(JsonReader::getBoolean); + } else if ("enableAllVersionsAndDeletesChangeFeed".equals(fieldName)) { + deserializedDatabaseAccountUpdateProperties.enableAllVersionsAndDeletesChangeFeed + = reader.getNullable(JsonReader::getBoolean); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetAnalyticsProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetAnalyticsProperties.java new file mode 100644 index 000000000000..aa7e960946e6 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetAnalyticsProperties.java @@ -0,0 +1,142 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.FleetAnalyticsPropertiesStorageLocationType; +import com.azure.resourcemanager.cosmos.models.Status; +import java.io.IOException; + +/** + * The FleetAnalyticsProperties model. + */ +@Fluent +public final class FleetAnalyticsProperties implements JsonSerializable { + /* + * A provisioning state of the FleetAnalytics. + */ + private Status provisioningState; + + /* + * The type of the fleet analytics resource. + */ + private FleetAnalyticsPropertiesStorageLocationType storageLocationType; + + /* + * The unique identifier of the fleet analytics resource. + */ + private String storageLocationUri; + + /** + * Creates an instance of FleetAnalyticsProperties class. + */ + public FleetAnalyticsProperties() { + } + + /** + * Get the provisioningState property: A provisioning state of the FleetAnalytics. + * + * @return the provisioningState value. + */ + public Status provisioningState() { + return this.provisioningState; + } + + /** + * Get the storageLocationType property: The type of the fleet analytics resource. + * + * @return the storageLocationType value. + */ + public FleetAnalyticsPropertiesStorageLocationType storageLocationType() { + return this.storageLocationType; + } + + /** + * Set the storageLocationType property: The type of the fleet analytics resource. + * + * @param storageLocationType the storageLocationType value to set. + * @return the FleetAnalyticsProperties object itself. + */ + public FleetAnalyticsProperties + withStorageLocationType(FleetAnalyticsPropertiesStorageLocationType storageLocationType) { + this.storageLocationType = storageLocationType; + return this; + } + + /** + * Get the storageLocationUri property: The unique identifier of the fleet analytics resource. + * + * @return the storageLocationUri value. + */ + public String storageLocationUri() { + return this.storageLocationUri; + } + + /** + * Set the storageLocationUri property: The unique identifier of the fleet analytics resource. + * + * @param storageLocationUri the storageLocationUri value to set. + * @return the FleetAnalyticsProperties object itself. + */ + public FleetAnalyticsProperties withStorageLocationUri(String storageLocationUri) { + this.storageLocationUri = storageLocationUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("storageLocationType", + this.storageLocationType == null ? null : this.storageLocationType.toString()); + jsonWriter.writeStringField("storageLocationUri", this.storageLocationUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FleetAnalyticsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FleetAnalyticsProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the FleetAnalyticsProperties. + */ + public static FleetAnalyticsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FleetAnalyticsProperties deserializedFleetAnalyticsProperties = new FleetAnalyticsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedFleetAnalyticsProperties.provisioningState = Status.fromString(reader.getString()); + } else if ("storageLocationType".equals(fieldName)) { + deserializedFleetAnalyticsProperties.storageLocationType + = FleetAnalyticsPropertiesStorageLocationType.fromString(reader.getString()); + } else if ("storageLocationUri".equals(fieldName)) { + deserializedFleetAnalyticsProperties.storageLocationUri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFleetAnalyticsProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetAnalyticsResourceInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetAnalyticsResourceInner.java new file mode 100644 index 000000000000..9ff5fc03313d --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetAnalyticsResourceInner.java @@ -0,0 +1,212 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.FleetAnalyticsPropertiesStorageLocationType; +import com.azure.resourcemanager.cosmos.models.Status; +import java.io.IOException; + +/** + * An Azure Cosmos DB FleetAnalytics. + */ +@Fluent +public final class FleetAnalyticsResourceInner extends ProxyResource { + /* + * The properties property. + */ + private FleetAnalyticsProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of FleetAnalyticsResourceInner class. + */ + public FleetAnalyticsResourceInner() { + } + + /** + * Get the innerProperties property: The properties property. + * + * @return the innerProperties value. + */ + private FleetAnalyticsProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the provisioningState property: A provisioning state of the FleetAnalytics. + * + * @return the provisioningState value. + */ + public Status provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the storageLocationType property: The type of the fleet analytics resource. + * + * @return the storageLocationType value. + */ + public FleetAnalyticsPropertiesStorageLocationType storageLocationType() { + return this.innerProperties() == null ? null : this.innerProperties().storageLocationType(); + } + + /** + * Set the storageLocationType property: The type of the fleet analytics resource. + * + * @param storageLocationType the storageLocationType value to set. + * @return the FleetAnalyticsResourceInner object itself. + */ + public FleetAnalyticsResourceInner + withStorageLocationType(FleetAnalyticsPropertiesStorageLocationType storageLocationType) { + if (this.innerProperties() == null) { + this.innerProperties = new FleetAnalyticsProperties(); + } + this.innerProperties().withStorageLocationType(storageLocationType); + return this; + } + + /** + * Get the storageLocationUri property: The unique identifier of the fleet analytics resource. + * + * @return the storageLocationUri value. + */ + public String storageLocationUri() { + return this.innerProperties() == null ? null : this.innerProperties().storageLocationUri(); + } + + /** + * Set the storageLocationUri property: The unique identifier of the fleet analytics resource. + * + * @param storageLocationUri the storageLocationUri value to set. + * @return the FleetAnalyticsResourceInner object itself. + */ + public FleetAnalyticsResourceInner withStorageLocationUri(String storageLocationUri) { + if (this.innerProperties() == null) { + this.innerProperties = new FleetAnalyticsProperties(); + } + this.innerProperties().withStorageLocationUri(storageLocationUri); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FleetAnalyticsResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FleetAnalyticsResourceInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FleetAnalyticsResourceInner. + */ + public static FleetAnalyticsResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FleetAnalyticsResourceInner deserializedFleetAnalyticsResourceInner = new FleetAnalyticsResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedFleetAnalyticsResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedFleetAnalyticsResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedFleetAnalyticsResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedFleetAnalyticsResourceInner.innerProperties = FleetAnalyticsProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedFleetAnalyticsResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedFleetAnalyticsResourceInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetResourceInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetResourceInner.java index 8bef1f960d0d..e141cd3d6068 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetResourceInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetResourceInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; @@ -125,20 +125,6 @@ public Status provisioningState() { return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } - /** - * Set the provisioningState property: A provisioning state of the Fleet. - * - * @param provisioningState the provisioningState value to set. - * @return the FleetResourceInner object itself. - */ - public FleetResourceInner withProvisioningState(Status provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new FleetResourceProperties(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetResourceProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetResourceProperties.java index ead4044ebc97..934e6811824c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetResourceProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetResourceProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Properties to update Azure Cosmos DB fleet resource. */ -@Fluent +@Immutable public final class FleetResourceProperties implements JsonSerializable { /* * A provisioning state of the Fleet. @@ -37,17 +37,6 @@ public Status provisioningState() { return this.provisioningState; } - /** - * Set the provisioningState property: A provisioning state of the Fleet. - * - * @param provisioningState the provisioningState value to set. - * @return the FleetResourceProperties object itself. - */ - public FleetResourceProperties withProvisioningState(Status provisioningState) { - this.provisioningState = provisioningState; - return this; - } - /** * Validates the instance. * @@ -62,8 +51,6 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("provisioningState", - this.provisioningState == null ? null : this.provisioningState.toString()); return jsonWriter.writeEndObject(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetspaceAccountProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetspaceAccountProperties.java index 5121cdfd4e0a..a891bddc5812 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetspaceAccountProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetspaceAccountProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; @@ -43,17 +43,6 @@ public Status provisioningState() { return this.provisioningState; } - /** - * Set the provisioningState property: A provisioning state of the Fleetspace Account. - * - * @param provisioningState the provisioningState value to set. - * @return the FleetspaceAccountProperties object itself. - */ - public FleetspaceAccountProperties withProvisioningState(Status provisioningState) { - this.provisioningState = provisioningState; - return this; - } - /** * Get the globalDatabaseAccountProperties property: Configuration for fleetspace Account in the fleetspace. * @@ -92,8 +81,6 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("provisioningState", - this.provisioningState == null ? null : this.provisioningState.toString()); jsonWriter.writeJsonField("globalDatabaseAccountProperties", this.globalDatabaseAccountProperties); return jsonWriter.writeEndObject(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetspaceAccountResourceInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetspaceAccountResourceInner.java index af000d0f37e6..551997dadb9f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetspaceAccountResourceInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetspaceAccountResourceInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; @@ -108,20 +108,6 @@ public Status provisioningState() { return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } - /** - * Set the provisioningState property: A provisioning state of the Fleetspace Account. - * - * @param provisioningState the provisioningState value to set. - * @return the FleetspaceAccountResourceInner object itself. - */ - public FleetspaceAccountResourceInner withProvisioningState(Status provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new FleetspaceAccountProperties(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - /** * Get the globalDatabaseAccountProperties property: Configuration for fleetspace Account in the fleetspace. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetspaceProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetspaceProperties.java index be0150b88a73..8c4cc9092355 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetspaceProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetspaceProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; @@ -62,17 +62,6 @@ public Status provisioningState() { return this.provisioningState; } - /** - * Set the provisioningState property: A provisioning state of the Fleetspace. - * - * @param provisioningState the provisioningState value to set. - * @return the FleetspaceProperties object itself. - */ - public FleetspaceProperties withProvisioningState(Status provisioningState) { - this.provisioningState = provisioningState; - return this; - } - /** * Get the fleetspaceApiKind property: The kind of API this fleetspace belongs to. Acceptable values: 'NoSQL'. * @@ -173,8 +162,6 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("provisioningState", - this.provisioningState == null ? null : this.provisioningState.toString()); jsonWriter.writeStringField("fleetspaceApiKind", this.fleetspaceApiKind == null ? null : this.fleetspaceApiKind.toString()); jsonWriter.writeStringField("serviceTier", this.serviceTier == null ? null : this.serviceTier.toString()); diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetspaceResourceInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetspaceResourceInner.java index 23f36013a576..881954dcfb82 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetspaceResourceInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetspaceResourceInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; @@ -110,20 +110,6 @@ public Status provisioningState() { return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } - /** - * Set the provisioningState property: A provisioning state of the Fleetspace. - * - * @param provisioningState the provisioningState value to set. - * @return the FleetspaceResourceInner object itself. - */ - public FleetspaceResourceInner withProvisioningState(Status provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new FleetspaceProperties(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - /** * Get the fleetspaceApiKind property: The kind of API this fleetspace belongs to. Acceptable values: 'NoSQL'. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ManagedCassandraArmResourceProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GarnetClusterResourceInner.java similarity index 51% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ManagedCassandraArmResourceProperties.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GarnetClusterResourceInner.java index c16ff920e408..8166f0080ff9 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ManagedCassandraArmResourceProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GarnetClusterResourceInner.java @@ -1,27 +1,40 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.GarnetClusterProperties; +import com.azure.resourcemanager.cosmos.models.ManagedCassandraManagedServiceIdentity; import java.io.IOException; import java.util.Map; /** - * The core properties of ARM resources. + * Representation of a Garnet cache cluster. */ @Fluent -public class ManagedCassandraArmResourceProperties extends Resource { +public final class GarnetClusterResourceInner extends Resource { + /* + * The resource-specific properties for this resource. + */ + private GarnetClusterProperties properties; + /* * Identity for the resource. */ private ManagedCassandraManagedServiceIdentity identity; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -38,9 +51,29 @@ public class ManagedCassandraArmResourceProperties extends Resource { private String id; /** - * Creates an instance of ManagedCassandraArmResourceProperties class. + * Creates an instance of GarnetClusterResourceInner class. */ - public ManagedCassandraArmResourceProperties() { + public GarnetClusterResourceInner() { + } + + /** + * Get the properties property: The resource-specific properties for this resource. + * + * @return the properties value. + */ + public GarnetClusterProperties properties() { + return this.properties; + } + + /** + * Set the properties property: The resource-specific properties for this resource. + * + * @param properties the properties value to set. + * @return the GarnetClusterResourceInner object itself. + */ + public GarnetClusterResourceInner withProperties(GarnetClusterProperties properties) { + this.properties = properties; + return this; } /** @@ -56,13 +89,22 @@ public ManagedCassandraManagedServiceIdentity identity() { * Set the identity property: Identity for the resource. * * @param identity the identity value to set. - * @return the ManagedCassandraArmResourceProperties object itself. + * @return the GarnetClusterResourceInner object itself. */ - public ManagedCassandraArmResourceProperties withIdentity(ManagedCassandraManagedServiceIdentity identity) { + public GarnetClusterResourceInner withIdentity(ManagedCassandraManagedServiceIdentity identity) { this.identity = identity; return this; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -97,7 +139,7 @@ public String id() { * {@inheritDoc} */ @Override - public ManagedCassandraArmResourceProperties withLocation(String location) { + public GarnetClusterResourceInner withLocation(String location) { super.withLocation(location); return this; } @@ -106,7 +148,7 @@ public ManagedCassandraArmResourceProperties withLocation(String location) { * {@inheritDoc} */ @Override - public ManagedCassandraArmResourceProperties withTags(Map tags) { + public GarnetClusterResourceInner withTags(Map tags) { super.withTags(tags); return this; } @@ -117,6 +159,9 @@ public ManagedCassandraArmResourceProperties withTags(Map tags) * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (properties() != null) { + properties().validate(); + } if (identity() != null) { identity().validate(); } @@ -130,47 +175,51 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.properties); jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } /** - * Reads an instance of ManagedCassandraArmResourceProperties from the JsonReader. + * Reads an instance of GarnetClusterResourceInner from the JsonReader. * * @param jsonReader The JsonReader being read. - * @return An instance of ManagedCassandraArmResourceProperties if the JsonReader was pointing to an instance of it, - * or null if it was pointing to JSON null. + * @return An instance of GarnetClusterResourceInner if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. * @throws IllegalStateException If the deserialized JSON object was missing any required properties. - * @throws IOException If an error occurs while reading the ManagedCassandraArmResourceProperties. + * @throws IOException If an error occurs while reading the GarnetClusterResourceInner. */ - public static ManagedCassandraArmResourceProperties fromJson(JsonReader jsonReader) throws IOException { + public static GarnetClusterResourceInner fromJson(JsonReader jsonReader) throws IOException { return jsonReader.readObject(reader -> { - ManagedCassandraArmResourceProperties deserializedManagedCassandraArmResourceProperties - = new ManagedCassandraArmResourceProperties(); + GarnetClusterResourceInner deserializedGarnetClusterResourceInner = new GarnetClusterResourceInner(); while (reader.nextToken() != JsonToken.END_OBJECT) { String fieldName = reader.getFieldName(); reader.nextToken(); if ("id".equals(fieldName)) { - deserializedManagedCassandraArmResourceProperties.id = reader.getString(); + deserializedGarnetClusterResourceInner.id = reader.getString(); } else if ("name".equals(fieldName)) { - deserializedManagedCassandraArmResourceProperties.name = reader.getString(); + deserializedGarnetClusterResourceInner.name = reader.getString(); } else if ("type".equals(fieldName)) { - deserializedManagedCassandraArmResourceProperties.type = reader.getString(); + deserializedGarnetClusterResourceInner.type = reader.getString(); } else if ("location".equals(fieldName)) { - deserializedManagedCassandraArmResourceProperties.withLocation(reader.getString()); + deserializedGarnetClusterResourceInner.withLocation(reader.getString()); } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedManagedCassandraArmResourceProperties.withTags(tags); + deserializedGarnetClusterResourceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedGarnetClusterResourceInner.properties = GarnetClusterProperties.fromJson(reader); } else if ("identity".equals(fieldName)) { - deserializedManagedCassandraArmResourceProperties.identity + deserializedGarnetClusterResourceInner.identity = ManagedCassandraManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedGarnetClusterResourceInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } } - return deserializedManagedCassandraArmResourceProperties; + return deserializedGarnetClusterResourceInner; }); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GraphResourceCreateUpdateProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GraphResourceCreateUpdateProperties.java new file mode 100644 index 000000000000..b551a7383790 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GraphResourceCreateUpdateProperties.java @@ -0,0 +1,141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.CreateUpdateOptions; +import com.azure.resourcemanager.cosmos.models.GraphResource; +import java.io.IOException; + +/** + * Properties to create and update Azure Cosmos DB Graph resource. + */ +@Fluent +public final class GraphResourceCreateUpdateProperties + implements JsonSerializable { + /* + * The standard JSON format of a Graph resource + */ + private GraphResource resource; + + /* + * A key-value pair of options to be applied for the request. This corresponds to the headers sent with the request. + */ + private CreateUpdateOptions options; + + /** + * Creates an instance of GraphResourceCreateUpdateProperties class. + */ + public GraphResourceCreateUpdateProperties() { + } + + /** + * Get the resource property: The standard JSON format of a Graph resource. + * + * @return the resource value. + */ + public GraphResource resource() { + return this.resource; + } + + /** + * Set the resource property: The standard JSON format of a Graph resource. + * + * @param resource the resource value to set. + * @return the GraphResourceCreateUpdateProperties object itself. + */ + public GraphResourceCreateUpdateProperties withResource(GraphResource resource) { + this.resource = resource; + return this; + } + + /** + * Get the options property: A key-value pair of options to be applied for the request. This corresponds to the + * headers sent with the request. + * + * @return the options value. + */ + public CreateUpdateOptions options() { + return this.options; + } + + /** + * Set the options property: A key-value pair of options to be applied for the request. This corresponds to the + * headers sent with the request. + * + * @param options the options value to set. + * @return the GraphResourceCreateUpdateProperties object itself. + */ + public GraphResourceCreateUpdateProperties withOptions(CreateUpdateOptions options) { + this.options = options; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resource() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property resource in model GraphResourceCreateUpdateProperties")); + } else { + resource().validate(); + } + if (options() != null) { + options().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GraphResourceCreateUpdateProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("resource", this.resource); + jsonWriter.writeJsonField("options", this.options); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphResourceCreateUpdateProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphResourceCreateUpdateProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GraphResourceCreateUpdateProperties. + */ + public static GraphResourceCreateUpdateProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphResourceCreateUpdateProperties deserializedGraphResourceCreateUpdateProperties + = new GraphResourceCreateUpdateProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resource".equals(fieldName)) { + deserializedGraphResourceCreateUpdateProperties.resource = GraphResource.fromJson(reader); + } else if ("options".equals(fieldName)) { + deserializedGraphResourceCreateUpdateProperties.options = CreateUpdateOptions.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGraphResourceCreateUpdateProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GraphResourceGetProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GraphResourceGetProperties.java new file mode 100644 index 000000000000..f910b60b16e8 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GraphResourceGetProperties.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.GraphResourceGetPropertiesOptions; +import com.azure.resourcemanager.cosmos.models.GraphResourceGetPropertiesResource; +import java.io.IOException; + +/** + * The properties of an Azure Cosmos DB SQL database. + */ +@Immutable +public final class GraphResourceGetProperties implements JsonSerializable { + /* + * The resource property. + */ + private GraphResourceGetPropertiesResource resource; + + /* + * The options property. + */ + private GraphResourceGetPropertiesOptions options; + + /** + * Creates an instance of GraphResourceGetProperties class. + */ + private GraphResourceGetProperties() { + } + + /** + * Get the resource property: The resource property. + * + * @return the resource value. + */ + public GraphResourceGetPropertiesResource resource() { + return this.resource; + } + + /** + * Get the options property: The options property. + * + * @return the options value. + */ + public GraphResourceGetPropertiesOptions options() { + return this.options; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resource() != null) { + resource().validate(); + } + if (options() != null) { + options().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("resource", this.resource); + jsonWriter.writeJsonField("options", this.options); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphResourceGetProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphResourceGetProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GraphResourceGetProperties. + */ + public static GraphResourceGetProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphResourceGetProperties deserializedGraphResourceGetProperties = new GraphResourceGetProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resource".equals(fieldName)) { + deserializedGraphResourceGetProperties.resource + = GraphResourceGetPropertiesResource.fromJson(reader); + } else if ("options".equals(fieldName)) { + deserializedGraphResourceGetProperties.options = GraphResourceGetPropertiesOptions.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGraphResourceGetProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GraphResourceGetResultsInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GraphResourceGetResultsInner.java new file mode 100644 index 000000000000..763f550a3ef2 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GraphResourceGetResultsInner.java @@ -0,0 +1,232 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.GraphResourceGetPropertiesOptions; +import com.azure.resourcemanager.cosmos.models.GraphResourceGetPropertiesResource; +import com.azure.resourcemanager.cosmos.models.ManagedServiceIdentity; +import java.io.IOException; +import java.util.Map; + +/** + * An Azure Cosmos DB Graph resource. + */ +@Immutable +public final class GraphResourceGetResultsInner extends ProxyResource { + /* + * The properties of an Azure Cosmos DB Graph resource. + */ + private GraphResourceGetProperties innerProperties; + + /* + * Resource tags. + */ + private Map tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Identity for the resource. + */ + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of GraphResourceGetResultsInner class. + */ + private GraphResourceGetResultsInner() { + } + + /** + * Get the innerProperties property: The properties of an Azure Cosmos DB Graph resource. + * + * @return the innerProperties value. + */ + private GraphResourceGetProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the resource property: The resource property. + * + * @return the resource value. + */ + public GraphResourceGetPropertiesResource resource() { + return this.innerProperties() == null ? null : this.innerProperties().resource(); + } + + /** + * Get the options property: The options property. + * + * @return the options value. + */ + public GraphResourceGetPropertiesOptions options() { + return this.innerProperties() == null ? null : this.innerProperties().options(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("identity", this.identity); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphResourceGetResultsInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphResourceGetResultsInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GraphResourceGetResultsInner. + */ + public static GraphResourceGetResultsInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphResourceGetResultsInner deserializedGraphResourceGetResultsInner = new GraphResourceGetResultsInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedGraphResourceGetResultsInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedGraphResourceGetResultsInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedGraphResourceGetResultsInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedGraphResourceGetResultsInner.innerProperties + = GraphResourceGetProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedGraphResourceGetResultsInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedGraphResourceGetResultsInner.location = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedGraphResourceGetResultsInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedGraphResourceGetResultsInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGraphResourceGetResultsInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinDatabaseCreateUpdateProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinDatabaseCreateUpdateProperties.java index af2a2f088e51..5e7c4f45df3d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinDatabaseCreateUpdateProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinDatabaseCreateUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinDatabaseGetProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinDatabaseGetProperties.java index 3e0bdc4996fe..18f0c2ad5790 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinDatabaseGetProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinDatabaseGetProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The properties of an Azure Cosmos DB SQL database. */ -@Fluent +@Immutable public final class GremlinDatabaseGetProperties implements JsonSerializable { /* * The resource property. @@ -31,7 +31,7 @@ public final class GremlinDatabaseGetProperties implements JsonSerializable tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Identity for the resource. + */ + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -42,7 +64,7 @@ public final class GremlinDatabaseGetResultsInner extends ArmResourceProperties /** * Creates an instance of GremlinDatabaseGetResultsInner class. */ - public GremlinDatabaseGetResultsInner() { + private GremlinDatabaseGetResultsInner() { } /** @@ -54,6 +76,42 @@ private GremlinDatabaseGetProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -84,24 +142,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public GremlinDatabaseGetResultsInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GremlinDatabaseGetResultsInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the resource property: The resource property. * @@ -111,20 +151,6 @@ public GremlinDatabaseGetPropertiesResource resource() { return this.innerProperties() == null ? null : this.innerProperties().resource(); } - /** - * Set the resource property: The resource property. - * - * @param resource the resource value to set. - * @return the GremlinDatabaseGetResultsInner object itself. - */ - public GremlinDatabaseGetResultsInner withResource(GremlinDatabaseGetPropertiesResource resource) { - if (this.innerProperties() == null) { - this.innerProperties = new GremlinDatabaseGetProperties(); - } - this.innerProperties().withResource(resource); - return this; - } - /** * Get the options property: The options property. * @@ -134,30 +160,18 @@ public GremlinDatabaseGetPropertiesOptions options() { return this.innerProperties() == null ? null : this.innerProperties().options(); } - /** - * Set the options property: The options property. - * - * @param options the options value to set. - * @return the GremlinDatabaseGetResultsInner object itself. - */ - public GremlinDatabaseGetResultsInner withOptions(GremlinDatabaseGetPropertiesOptions options) { - if (this.innerProperties() == null) { - this.innerProperties = new GremlinDatabaseGetProperties(); - } - this.innerProperties().withOptions(options); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() != null) { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } /** @@ -166,9 +180,10 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -195,14 +210,18 @@ public static GremlinDatabaseGetResultsInner fromJson(JsonReader jsonReader) thr deserializedGremlinDatabaseGetResultsInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedGremlinDatabaseGetResultsInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedGremlinDatabaseGetResultsInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedGremlinDatabaseGetResultsInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedGremlinDatabaseGetResultsInner.innerProperties = GremlinDatabaseGetProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedGremlinDatabaseGetResultsInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedGremlinDatabaseGetResultsInner.location = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedGremlinDatabaseGetResultsInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedGremlinDatabaseGetResultsInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinGraphCreateUpdateProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinGraphCreateUpdateProperties.java index c9c4c5671580..1a359b2ca485 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinGraphCreateUpdateProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinGraphCreateUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinGraphGetProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinGraphGetProperties.java index b4c04c41a55f..6b5a325a721a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinGraphGetProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinGraphGetProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The properties of an Azure Cosmos DB Gremlin graph. */ -@Fluent +@Immutable public final class GremlinGraphGetProperties implements JsonSerializable { /* * The resource property. @@ -31,7 +31,7 @@ public final class GremlinGraphGetProperties implements JsonSerializable tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Identity for the resource. + */ + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -42,7 +64,7 @@ public final class GremlinGraphGetResultsInner extends ArmResourceProperties { /** * Creates an instance of GremlinGraphGetResultsInner class. */ - public GremlinGraphGetResultsInner() { + private GremlinGraphGetResultsInner() { } /** @@ -54,6 +76,42 @@ private GremlinGraphGetProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -84,24 +142,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public GremlinGraphGetResultsInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GremlinGraphGetResultsInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the resource property: The resource property. * @@ -111,20 +151,6 @@ public GremlinGraphGetPropertiesResource resource() { return this.innerProperties() == null ? null : this.innerProperties().resource(); } - /** - * Set the resource property: The resource property. - * - * @param resource the resource value to set. - * @return the GremlinGraphGetResultsInner object itself. - */ - public GremlinGraphGetResultsInner withResource(GremlinGraphGetPropertiesResource resource) { - if (this.innerProperties() == null) { - this.innerProperties = new GremlinGraphGetProperties(); - } - this.innerProperties().withResource(resource); - return this; - } - /** * Get the options property: The options property. * @@ -134,30 +160,18 @@ public GremlinGraphGetPropertiesOptions options() { return this.innerProperties() == null ? null : this.innerProperties().options(); } - /** - * Set the options property: The options property. - * - * @param options the options value to set. - * @return the GremlinGraphGetResultsInner object itself. - */ - public GremlinGraphGetResultsInner withOptions(GremlinGraphGetPropertiesOptions options) { - if (this.innerProperties() == null) { - this.innerProperties = new GremlinGraphGetProperties(); - } - this.innerProperties().withOptions(options); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() != null) { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } /** @@ -166,9 +180,10 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -194,14 +209,18 @@ public static GremlinGraphGetResultsInner fromJson(JsonReader jsonReader) throws deserializedGremlinGraphGetResultsInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedGremlinGraphGetResultsInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedGremlinGraphGetResultsInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedGremlinGraphGetResultsInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedGremlinGraphGetResultsInner.innerProperties = GremlinGraphGetProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedGremlinGraphGetResultsInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedGremlinGraphGetResultsInner.location = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedGremlinGraphGetResultsInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedGremlinGraphGetResultsInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinRoleAssignmentResourceInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinRoleAssignmentResourceInner.java new file mode 100644 index 000000000000..30386cdf7828 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinRoleAssignmentResourceInner.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters to create and update an Azure Cosmos DB Gremlin Role Assignment. + */ +@Fluent +public final class GremlinRoleAssignmentResourceInner extends ProxyResource { + /* + * Properties to create and update an Azure Cosmos DB Gremlin Role Assignment. + */ + private GremlinRoleAssignmentResourceProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of GremlinRoleAssignmentResourceInner class. + */ + public GremlinRoleAssignmentResourceInner() { + } + + /** + * Get the innerProperties property: Properties to create and update an Azure Cosmos DB Gremlin Role Assignment. + * + * @return the innerProperties value. + */ + private GremlinRoleAssignmentResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the roleDefinitionId property: The unique identifier for the associated Role Definition. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.innerProperties() == null ? null : this.innerProperties().roleDefinitionId(); + } + + /** + * Set the roleDefinitionId property: The unique identifier for the associated Role Definition. + * + * @param roleDefinitionId the roleDefinitionId value to set. + * @return the GremlinRoleAssignmentResourceInner object itself. + */ + public GremlinRoleAssignmentResourceInner withRoleDefinitionId(String roleDefinitionId) { + if (this.innerProperties() == null) { + this.innerProperties = new GremlinRoleAssignmentResourceProperties(); + } + this.innerProperties().withRoleDefinitionId(roleDefinitionId); + return this; + } + + /** + * Get the scope property: The data plane resource path for which access is being granted through this Gremlin Role + * Assignment. + * + * @return the scope value. + */ + public String scope() { + return this.innerProperties() == null ? null : this.innerProperties().scope(); + } + + /** + * Set the scope property: The data plane resource path for which access is being granted through this Gremlin Role + * Assignment. + * + * @param scope the scope value to set. + * @return the GremlinRoleAssignmentResourceInner object itself. + */ + public GremlinRoleAssignmentResourceInner withScope(String scope) { + if (this.innerProperties() == null) { + this.innerProperties = new GremlinRoleAssignmentResourceProperties(); + } + this.innerProperties().withScope(scope); + return this; + } + + /** + * Get the principalId property: The unique identifier for the associated AAD principal in the AAD graph to which + * access is being granted through this Gremlin Role Assignment. Tenant ID for the principal is inferred using the + * tenant associated with the subscription. + * + * @return the principalId value. + */ + public String principalId() { + return this.innerProperties() == null ? null : this.innerProperties().principalId(); + } + + /** + * Set the principalId property: The unique identifier for the associated AAD principal in the AAD graph to which + * access is being granted through this Gremlin Role Assignment. Tenant ID for the principal is inferred using the + * tenant associated with the subscription. + * + * @param principalId the principalId value to set. + * @return the GremlinRoleAssignmentResourceInner object itself. + */ + public GremlinRoleAssignmentResourceInner withPrincipalId(String principalId) { + if (this.innerProperties() == null) { + this.innerProperties = new GremlinRoleAssignmentResourceProperties(); + } + this.innerProperties().withPrincipalId(principalId); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GremlinRoleAssignmentResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GremlinRoleAssignmentResourceInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GremlinRoleAssignmentResourceInner. + */ + public static GremlinRoleAssignmentResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GremlinRoleAssignmentResourceInner deserializedGremlinRoleAssignmentResourceInner + = new GremlinRoleAssignmentResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedGremlinRoleAssignmentResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedGremlinRoleAssignmentResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedGremlinRoleAssignmentResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedGremlinRoleAssignmentResourceInner.innerProperties + = GremlinRoleAssignmentResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedGremlinRoleAssignmentResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGremlinRoleAssignmentResourceInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinRoleAssignmentResourceProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinRoleAssignmentResourceProperties.java new file mode 100644 index 000000000000..973cf42ed92a --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinRoleAssignmentResourceProperties.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Azure Cosmos DB Gremlin Role Assignment resource object. + */ +@Fluent +public final class GremlinRoleAssignmentResourceProperties + implements JsonSerializable { + /* + * The unique identifier for the associated Role Definition. + */ + private String roleDefinitionId; + + /* + * The data plane resource path for which access is being granted through this Gremlin Role Assignment. + */ + private String scope; + + /* + * The unique identifier for the associated AAD principal in the AAD graph to which access is being granted through + * this Gremlin Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the + * subscription. + */ + private String principalId; + + /* + * Provisioning state of the resource. + */ + private String provisioningState; + + /** + * Creates an instance of GremlinRoleAssignmentResourceProperties class. + */ + public GremlinRoleAssignmentResourceProperties() { + } + + /** + * Get the roleDefinitionId property: The unique identifier for the associated Role Definition. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.roleDefinitionId; + } + + /** + * Set the roleDefinitionId property: The unique identifier for the associated Role Definition. + * + * @param roleDefinitionId the roleDefinitionId value to set. + * @return the GremlinRoleAssignmentResourceProperties object itself. + */ + public GremlinRoleAssignmentResourceProperties withRoleDefinitionId(String roleDefinitionId) { + this.roleDefinitionId = roleDefinitionId; + return this; + } + + /** + * Get the scope property: The data plane resource path for which access is being granted through this Gremlin Role + * Assignment. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: The data plane resource path for which access is being granted through this Gremlin Role + * Assignment. + * + * @param scope the scope value to set. + * @return the GremlinRoleAssignmentResourceProperties object itself. + */ + public GremlinRoleAssignmentResourceProperties withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the principalId property: The unique identifier for the associated AAD principal in the AAD graph to which + * access is being granted through this Gremlin Role Assignment. Tenant ID for the principal is inferred using the + * tenant associated with the subscription. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The unique identifier for the associated AAD principal in the AAD graph to which + * access is being granted through this Gremlin Role Assignment. Tenant ID for the principal is inferred using the + * tenant associated with the subscription. + * + * @param principalId the principalId value to set. + * @return the GremlinRoleAssignmentResourceProperties object itself. + */ + public GremlinRoleAssignmentResourceProperties withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("roleDefinitionId", this.roleDefinitionId); + jsonWriter.writeStringField("scope", this.scope); + jsonWriter.writeStringField("principalId", this.principalId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GremlinRoleAssignmentResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GremlinRoleAssignmentResourceProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GremlinRoleAssignmentResourceProperties. + */ + public static GremlinRoleAssignmentResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GremlinRoleAssignmentResourceProperties deserializedGremlinRoleAssignmentResourceProperties + = new GremlinRoleAssignmentResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("roleDefinitionId".equals(fieldName)) { + deserializedGremlinRoleAssignmentResourceProperties.roleDefinitionId = reader.getString(); + } else if ("scope".equals(fieldName)) { + deserializedGremlinRoleAssignmentResourceProperties.scope = reader.getString(); + } else if ("principalId".equals(fieldName)) { + deserializedGremlinRoleAssignmentResourceProperties.principalId = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedGremlinRoleAssignmentResourceProperties.provisioningState = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGremlinRoleAssignmentResourceProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinRoleDefinitionResourceInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinRoleDefinitionResourceInner.java new file mode 100644 index 000000000000..fefa591b2da6 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinRoleDefinitionResourceInner.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.Permission; +import com.azure.resourcemanager.cosmos.models.RoleDefinitionType; +import java.io.IOException; +import java.util.List; + +/** + * Parameters to create and update an Azure Cosmos DB Gremlin Role Definition. + */ +@Fluent +public final class GremlinRoleDefinitionResourceInner extends ProxyResource { + /* + * Properties to create and update an Azure Cosmos DB Gremlin Role Definition. + */ + private GremlinRoleDefinitionResourceProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of GremlinRoleDefinitionResourceInner class. + */ + public GremlinRoleDefinitionResourceInner() { + } + + /** + * Get the innerProperties property: Properties to create and update an Azure Cosmos DB Gremlin Role Definition. + * + * @return the innerProperties value. + */ + private GremlinRoleDefinitionResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the id property: The path id for the Role Definition. + * + * @return the id value. + */ + public String idPropertiesId() { + return this.innerProperties() == null ? null : this.innerProperties().id(); + } + + /** + * Set the id property: The path id for the Role Definition. + * + * @param id the id value to set. + * @return the GremlinRoleDefinitionResourceInner object itself. + */ + public GremlinRoleDefinitionResourceInner withIdPropertiesId(String id) { + if (this.innerProperties() == null) { + this.innerProperties = new GremlinRoleDefinitionResourceProperties(); + } + this.innerProperties().withId(id); + return this; + } + + /** + * Get the roleName property: A user-friendly name for the Role Definition. Must be unique for the database account. + * + * @return the roleName value. + */ + public String roleName() { + return this.innerProperties() == null ? null : this.innerProperties().roleName(); + } + + /** + * Set the roleName property: A user-friendly name for the Role Definition. Must be unique for the database account. + * + * @param roleName the roleName value to set. + * @return the GremlinRoleDefinitionResourceInner object itself. + */ + public GremlinRoleDefinitionResourceInner withRoleName(String roleName) { + if (this.innerProperties() == null) { + this.innerProperties = new GremlinRoleDefinitionResourceProperties(); + } + this.innerProperties().withRoleName(roleName); + return this; + } + + /** + * Get the type property: Indicates whether the Role Definition was built-in or user created. + * + * @return the type value. + */ + public RoleDefinitionType typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: Indicates whether the Role Definition was built-in or user created. + * + * @param type the type value to set. + * @return the GremlinRoleDefinitionResourceInner object itself. + */ + public GremlinRoleDefinitionResourceInner withTypePropertiesType(RoleDefinitionType type) { + if (this.innerProperties() == null) { + this.innerProperties = new GremlinRoleDefinitionResourceProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the assignableScopes property: A set of fully qualified Scopes at or below which Gremlin Role Assignments may + * be created using this Role Definition. This will allow application of this Role Definition on the entire database + * account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database + * account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not + * exist. + * + * @return the assignableScopes value. + */ + public List assignableScopes() { + return this.innerProperties() == null ? null : this.innerProperties().assignableScopes(); + } + + /** + * Set the assignableScopes property: A set of fully qualified Scopes at or below which Gremlin Role Assignments may + * be created using this Role Definition. This will allow application of this Role Definition on the entire database + * account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database + * account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not + * exist. + * + * @param assignableScopes the assignableScopes value to set. + * @return the GremlinRoleDefinitionResourceInner object itself. + */ + public GremlinRoleDefinitionResourceInner withAssignableScopes(List assignableScopes) { + if (this.innerProperties() == null) { + this.innerProperties = new GremlinRoleDefinitionResourceProperties(); + } + this.innerProperties().withAssignableScopes(assignableScopes); + return this; + } + + /** + * Get the permissions property: The set of operations allowed through this Role Definition. + * + * @return the permissions value. + */ + public List permissions() { + return this.innerProperties() == null ? null : this.innerProperties().permissions(); + } + + /** + * Set the permissions property: The set of operations allowed through this Role Definition. + * + * @param permissions the permissions value to set. + * @return the GremlinRoleDefinitionResourceInner object itself. + */ + public GremlinRoleDefinitionResourceInner withPermissions(List permissions) { + if (this.innerProperties() == null) { + this.innerProperties = new GremlinRoleDefinitionResourceProperties(); + } + this.innerProperties().withPermissions(permissions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GremlinRoleDefinitionResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GremlinRoleDefinitionResourceInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GremlinRoleDefinitionResourceInner. + */ + public static GremlinRoleDefinitionResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GremlinRoleDefinitionResourceInner deserializedGremlinRoleDefinitionResourceInner + = new GremlinRoleDefinitionResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedGremlinRoleDefinitionResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedGremlinRoleDefinitionResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedGremlinRoleDefinitionResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedGremlinRoleDefinitionResourceInner.innerProperties + = GremlinRoleDefinitionResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedGremlinRoleDefinitionResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGremlinRoleDefinitionResourceInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinRoleDefinitionResourceProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinRoleDefinitionResourceProperties.java new file mode 100644 index 000000000000..a549437dbe11 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinRoleDefinitionResourceProperties.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.Permission; +import com.azure.resourcemanager.cosmos.models.RoleDefinitionType; +import java.io.IOException; +import java.util.List; + +/** + * Azure Cosmos DB Gremlin Role Definition resource object. + */ +@Fluent +public final class GremlinRoleDefinitionResourceProperties + implements JsonSerializable { + /* + * The path id for the Role Definition. + */ + private String id; + + /* + * A user-friendly name for the Role Definition. Must be unique for the database account. + */ + private String roleName; + + /* + * Indicates whether the Role Definition was built-in or user created. + */ + private RoleDefinitionType type; + + /* + * A set of fully qualified Scopes at or below which Gremlin Role Assignments may be created using this Role + * Definition. This will allow application of this Role Definition on the entire database account or any underlying + * Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as + * assignable Scopes. Note that resources referenced in assignable Scopes need not exist. + */ + private List assignableScopes; + + /* + * The set of operations allowed through this Role Definition. + */ + private List permissions; + + /** + * Creates an instance of GremlinRoleDefinitionResourceProperties class. + */ + public GremlinRoleDefinitionResourceProperties() { + } + + /** + * Get the id property: The path id for the Role Definition. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The path id for the Role Definition. + * + * @param id the id value to set. + * @return the GremlinRoleDefinitionResourceProperties object itself. + */ + public GremlinRoleDefinitionResourceProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the roleName property: A user-friendly name for the Role Definition. Must be unique for the database account. + * + * @return the roleName value. + */ + public String roleName() { + return this.roleName; + } + + /** + * Set the roleName property: A user-friendly name for the Role Definition. Must be unique for the database account. + * + * @param roleName the roleName value to set. + * @return the GremlinRoleDefinitionResourceProperties object itself. + */ + public GremlinRoleDefinitionResourceProperties withRoleName(String roleName) { + this.roleName = roleName; + return this; + } + + /** + * Get the type property: Indicates whether the Role Definition was built-in or user created. + * + * @return the type value. + */ + public RoleDefinitionType type() { + return this.type; + } + + /** + * Set the type property: Indicates whether the Role Definition was built-in or user created. + * + * @param type the type value to set. + * @return the GremlinRoleDefinitionResourceProperties object itself. + */ + public GremlinRoleDefinitionResourceProperties withType(RoleDefinitionType type) { + this.type = type; + return this; + } + + /** + * Get the assignableScopes property: A set of fully qualified Scopes at or below which Gremlin Role Assignments may + * be created using this Role Definition. This will allow application of this Role Definition on the entire database + * account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database + * account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not + * exist. + * + * @return the assignableScopes value. + */ + public List assignableScopes() { + return this.assignableScopes; + } + + /** + * Set the assignableScopes property: A set of fully qualified Scopes at or below which Gremlin Role Assignments may + * be created using this Role Definition. This will allow application of this Role Definition on the entire database + * account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database + * account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not + * exist. + * + * @param assignableScopes the assignableScopes value to set. + * @return the GremlinRoleDefinitionResourceProperties object itself. + */ + public GremlinRoleDefinitionResourceProperties withAssignableScopes(List assignableScopes) { + this.assignableScopes = assignableScopes; + return this; + } + + /** + * Get the permissions property: The set of operations allowed through this Role Definition. + * + * @return the permissions value. + */ + public List permissions() { + return this.permissions; + } + + /** + * Set the permissions property: The set of operations allowed through this Role Definition. + * + * @param permissions the permissions value to set. + * @return the GremlinRoleDefinitionResourceProperties object itself. + */ + public GremlinRoleDefinitionResourceProperties withPermissions(List permissions) { + this.permissions = permissions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (permissions() != null) { + permissions().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("roleName", this.roleName); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeArrayField("assignableScopes", this.assignableScopes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("permissions", this.permissions, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GremlinRoleDefinitionResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GremlinRoleDefinitionResourceProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GremlinRoleDefinitionResourceProperties. + */ + public static GremlinRoleDefinitionResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GremlinRoleDefinitionResourceProperties deserializedGremlinRoleDefinitionResourceProperties + = new GremlinRoleDefinitionResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedGremlinRoleDefinitionResourceProperties.id = reader.getString(); + } else if ("roleName".equals(fieldName)) { + deserializedGremlinRoleDefinitionResourceProperties.roleName = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedGremlinRoleDefinitionResourceProperties.type + = RoleDefinitionType.fromString(reader.getString()); + } else if ("assignableScopes".equals(fieldName)) { + List assignableScopes = reader.readArray(reader1 -> reader1.getString()); + deserializedGremlinRoleDefinitionResourceProperties.assignableScopes = assignableScopes; + } else if ("permissions".equals(fieldName)) { + List permissions = reader.readArray(reader1 -> Permission.fromJson(reader1)); + deserializedGremlinRoleDefinitionResourceProperties.permissions = permissions; + } else { + reader.skipChildren(); + } + } + + return deserializedGremlinRoleDefinitionResourceProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/LocationGetResultInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/LocationGetResultInner.java index 2b70e4299570..5d6f4bbe73d5 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/LocationGetResultInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/LocationGetResultInner.java @@ -1,27 +1,33 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cosmos.models.ArmProxyResource; import com.azure.resourcemanager.cosmos.models.LocationProperties; import java.io.IOException; /** * Cosmos DB location get result. */ -@Fluent -public final class LocationGetResultInner extends ArmProxyResource { +@Immutable +public final class LocationGetResultInner extends ProxyResource { /* * Cosmos DB location metadata */ private LocationProperties properties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -40,7 +46,7 @@ public final class LocationGetResultInner extends ArmProxyResource { /** * Creates an instance of LocationGetResultInner class. */ - public LocationGetResultInner() { + private LocationGetResultInner() { } /** @@ -53,14 +59,12 @@ public LocationProperties properties() { } /** - * Set the properties property: Cosmos DB location metadata. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @param properties the properties value to set. - * @return the LocationGetResultInner object itself. + * @return the systemData value. */ - public LocationGetResultInner withProperties(LocationProperties properties) { - this.properties = properties; - return this; + public SystemData systemData() { + return this.systemData; } /** @@ -98,7 +102,6 @@ public String id() { * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (properties() != null) { properties().validate(); @@ -139,6 +142,8 @@ public static LocationGetResultInner fromJson(JsonReader jsonReader) throws IOEx deserializedLocationGetResultInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { deserializedLocationGetResultInner.properties = LocationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedLocationGetResultInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MetricDefinitionInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MetricDefinitionInner.java index ff60879803ea..60c7a4f230a5 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MetricDefinitionInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MetricDefinitionInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; @@ -49,7 +49,7 @@ public final class MetricDefinitionInner implements JsonSerializable { /** * Creates an instance of MetricInner class. */ - public MetricInner() { + protected MetricInner() { } /** diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBCollectionCreateUpdateProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBCollectionCreateUpdateProperties.java index dd7c1956bc3e..c645f2a46f3e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBCollectionCreateUpdateProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBCollectionCreateUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBCollectionGetProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBCollectionGetProperties.java index e8ece9cae8ea..c295f43ce387 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBCollectionGetProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBCollectionGetProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The properties of an Azure Cosmos DB MongoDB collection. */ -@Fluent +@Immutable public final class MongoDBCollectionGetProperties implements JsonSerializable { /* * The resource property. @@ -31,7 +31,7 @@ public final class MongoDBCollectionGetProperties implements JsonSerializable tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Identity for the resource. + */ + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -42,7 +64,7 @@ public final class MongoDBCollectionGetResultsInner extends ArmResourcePropertie /** * Creates an instance of MongoDBCollectionGetResultsInner class. */ - public MongoDBCollectionGetResultsInner() { + private MongoDBCollectionGetResultsInner() { } /** @@ -54,6 +76,42 @@ private MongoDBCollectionGetProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -84,24 +142,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public MongoDBCollectionGetResultsInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MongoDBCollectionGetResultsInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the resource property: The resource property. * @@ -111,20 +151,6 @@ public MongoDBCollectionGetPropertiesResource resource() { return this.innerProperties() == null ? null : this.innerProperties().resource(); } - /** - * Set the resource property: The resource property. - * - * @param resource the resource value to set. - * @return the MongoDBCollectionGetResultsInner object itself. - */ - public MongoDBCollectionGetResultsInner withResource(MongoDBCollectionGetPropertiesResource resource) { - if (this.innerProperties() == null) { - this.innerProperties = new MongoDBCollectionGetProperties(); - } - this.innerProperties().withResource(resource); - return this; - } - /** * Get the options property: The options property. * @@ -134,30 +160,18 @@ public MongoDBCollectionGetPropertiesOptions options() { return this.innerProperties() == null ? null : this.innerProperties().options(); } - /** - * Set the options property: The options property. - * - * @param options the options value to set. - * @return the MongoDBCollectionGetResultsInner object itself. - */ - public MongoDBCollectionGetResultsInner withOptions(MongoDBCollectionGetPropertiesOptions options) { - if (this.innerProperties() == null) { - this.innerProperties = new MongoDBCollectionGetProperties(); - } - this.innerProperties().withOptions(options); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() != null) { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } /** @@ -166,9 +180,10 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -195,14 +210,18 @@ public static MongoDBCollectionGetResultsInner fromJson(JsonReader jsonReader) t deserializedMongoDBCollectionGetResultsInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedMongoDBCollectionGetResultsInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedMongoDBCollectionGetResultsInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedMongoDBCollectionGetResultsInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedMongoDBCollectionGetResultsInner.innerProperties = MongoDBCollectionGetProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedMongoDBCollectionGetResultsInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedMongoDBCollectionGetResultsInner.location = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedMongoDBCollectionGetResultsInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedMongoDBCollectionGetResultsInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBDatabaseCreateUpdateProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBDatabaseCreateUpdateProperties.java index 1f4b57e11107..d116d427f807 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBDatabaseCreateUpdateProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBDatabaseCreateUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBDatabaseGetProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBDatabaseGetProperties.java index 96aeb2c7859f..efb6d3afd8bf 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBDatabaseGetProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBDatabaseGetProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The properties of an Azure Cosmos DB MongoDB database. */ -@Fluent +@Immutable public final class MongoDBDatabaseGetProperties implements JsonSerializable { /* * The resource property. @@ -31,7 +31,7 @@ public final class MongoDBDatabaseGetProperties implements JsonSerializable tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Identity for the resource. + */ + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -42,7 +64,7 @@ public final class MongoDBDatabaseGetResultsInner extends ArmResourceProperties /** * Creates an instance of MongoDBDatabaseGetResultsInner class. */ - public MongoDBDatabaseGetResultsInner() { + private MongoDBDatabaseGetResultsInner() { } /** @@ -54,6 +76,42 @@ private MongoDBDatabaseGetProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -84,24 +142,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public MongoDBDatabaseGetResultsInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MongoDBDatabaseGetResultsInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the resource property: The resource property. * @@ -111,20 +151,6 @@ public MongoDBDatabaseGetPropertiesResource resource() { return this.innerProperties() == null ? null : this.innerProperties().resource(); } - /** - * Set the resource property: The resource property. - * - * @param resource the resource value to set. - * @return the MongoDBDatabaseGetResultsInner object itself. - */ - public MongoDBDatabaseGetResultsInner withResource(MongoDBDatabaseGetPropertiesResource resource) { - if (this.innerProperties() == null) { - this.innerProperties = new MongoDBDatabaseGetProperties(); - } - this.innerProperties().withResource(resource); - return this; - } - /** * Get the options property: The options property. * @@ -134,30 +160,18 @@ public MongoDBDatabaseGetPropertiesOptions options() { return this.innerProperties() == null ? null : this.innerProperties().options(); } - /** - * Set the options property: The options property. - * - * @param options the options value to set. - * @return the MongoDBDatabaseGetResultsInner object itself. - */ - public MongoDBDatabaseGetResultsInner withOptions(MongoDBDatabaseGetPropertiesOptions options) { - if (this.innerProperties() == null) { - this.innerProperties = new MongoDBDatabaseGetProperties(); - } - this.innerProperties().withOptions(options); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() != null) { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } /** @@ -166,9 +180,10 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -195,14 +210,18 @@ public static MongoDBDatabaseGetResultsInner fromJson(JsonReader jsonReader) thr deserializedMongoDBDatabaseGetResultsInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedMongoDBDatabaseGetResultsInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedMongoDBDatabaseGetResultsInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedMongoDBDatabaseGetResultsInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedMongoDBDatabaseGetResultsInner.innerProperties = MongoDBDatabaseGetProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedMongoDBDatabaseGetResultsInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedMongoDBDatabaseGetResultsInner.location = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedMongoDBDatabaseGetResultsInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedMongoDBDatabaseGetResultsInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoMIRoleAssignmentResourceInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoMIRoleAssignmentResourceInner.java new file mode 100644 index 000000000000..95a1346bacc1 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoMIRoleAssignmentResourceInner.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters to create and update an Azure Cosmos DB MongoMI Role Assignment. + */ +@Fluent +public final class MongoMIRoleAssignmentResourceInner extends ProxyResource { + /* + * Properties to create and update an Azure Cosmos DB MongoMI Role Assignment. + */ + private MongoMIRoleAssignmentResourceProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of MongoMIRoleAssignmentResourceInner class. + */ + public MongoMIRoleAssignmentResourceInner() { + } + + /** + * Get the innerProperties property: Properties to create and update an Azure Cosmos DB MongoMI Role Assignment. + * + * @return the innerProperties value. + */ + private MongoMIRoleAssignmentResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the roleDefinitionId property: The unique identifier for the associated Role Definition. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.innerProperties() == null ? null : this.innerProperties().roleDefinitionId(); + } + + /** + * Set the roleDefinitionId property: The unique identifier for the associated Role Definition. + * + * @param roleDefinitionId the roleDefinitionId value to set. + * @return the MongoMIRoleAssignmentResourceInner object itself. + */ + public MongoMIRoleAssignmentResourceInner withRoleDefinitionId(String roleDefinitionId) { + if (this.innerProperties() == null) { + this.innerProperties = new MongoMIRoleAssignmentResourceProperties(); + } + this.innerProperties().withRoleDefinitionId(roleDefinitionId); + return this; + } + + /** + * Get the scope property: The data plane resource path for which access is being granted through this MongoMI Role + * Assignment. + * + * @return the scope value. + */ + public String scope() { + return this.innerProperties() == null ? null : this.innerProperties().scope(); + } + + /** + * Set the scope property: The data plane resource path for which access is being granted through this MongoMI Role + * Assignment. + * + * @param scope the scope value to set. + * @return the MongoMIRoleAssignmentResourceInner object itself. + */ + public MongoMIRoleAssignmentResourceInner withScope(String scope) { + if (this.innerProperties() == null) { + this.innerProperties = new MongoMIRoleAssignmentResourceProperties(); + } + this.innerProperties().withScope(scope); + return this; + } + + /** + * Get the principalId property: The unique identifier for the associated AAD principal in the AAD graph to which + * access is being granted through this MongoMI Role Assignment. Tenant ID for the principal is inferred using the + * tenant associated with the subscription. + * + * @return the principalId value. + */ + public String principalId() { + return this.innerProperties() == null ? null : this.innerProperties().principalId(); + } + + /** + * Set the principalId property: The unique identifier for the associated AAD principal in the AAD graph to which + * access is being granted through this MongoMI Role Assignment. Tenant ID for the principal is inferred using the + * tenant associated with the subscription. + * + * @param principalId the principalId value to set. + * @return the MongoMIRoleAssignmentResourceInner object itself. + */ + public MongoMIRoleAssignmentResourceInner withPrincipalId(String principalId) { + if (this.innerProperties() == null) { + this.innerProperties = new MongoMIRoleAssignmentResourceProperties(); + } + this.innerProperties().withPrincipalId(principalId); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoMIRoleAssignmentResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoMIRoleAssignmentResourceInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MongoMIRoleAssignmentResourceInner. + */ + public static MongoMIRoleAssignmentResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoMIRoleAssignmentResourceInner deserializedMongoMIRoleAssignmentResourceInner + = new MongoMIRoleAssignmentResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMongoMIRoleAssignmentResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMongoMIRoleAssignmentResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMongoMIRoleAssignmentResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedMongoMIRoleAssignmentResourceInner.innerProperties + = MongoMIRoleAssignmentResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedMongoMIRoleAssignmentResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoMIRoleAssignmentResourceInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoMIRoleAssignmentResourceProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoMIRoleAssignmentResourceProperties.java new file mode 100644 index 000000000000..a11c1979f342 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoMIRoleAssignmentResourceProperties.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Azure Cosmos DB MongoMI Role Assignment resource object. + */ +@Fluent +public final class MongoMIRoleAssignmentResourceProperties + implements JsonSerializable { + /* + * The unique identifier for the associated Role Definition. + */ + private String roleDefinitionId; + + /* + * The data plane resource path for which access is being granted through this MongoMI Role Assignment. + */ + private String scope; + + /* + * The unique identifier for the associated AAD principal in the AAD graph to which access is being granted through + * this MongoMI Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the + * subscription. + */ + private String principalId; + + /* + * Provisioning state of the resource. + */ + private String provisioningState; + + /** + * Creates an instance of MongoMIRoleAssignmentResourceProperties class. + */ + public MongoMIRoleAssignmentResourceProperties() { + } + + /** + * Get the roleDefinitionId property: The unique identifier for the associated Role Definition. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.roleDefinitionId; + } + + /** + * Set the roleDefinitionId property: The unique identifier for the associated Role Definition. + * + * @param roleDefinitionId the roleDefinitionId value to set. + * @return the MongoMIRoleAssignmentResourceProperties object itself. + */ + public MongoMIRoleAssignmentResourceProperties withRoleDefinitionId(String roleDefinitionId) { + this.roleDefinitionId = roleDefinitionId; + return this; + } + + /** + * Get the scope property: The data plane resource path for which access is being granted through this MongoMI Role + * Assignment. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: The data plane resource path for which access is being granted through this MongoMI Role + * Assignment. + * + * @param scope the scope value to set. + * @return the MongoMIRoleAssignmentResourceProperties object itself. + */ + public MongoMIRoleAssignmentResourceProperties withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the principalId property: The unique identifier for the associated AAD principal in the AAD graph to which + * access is being granted through this MongoMI Role Assignment. Tenant ID for the principal is inferred using the + * tenant associated with the subscription. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The unique identifier for the associated AAD principal in the AAD graph to which + * access is being granted through this MongoMI Role Assignment. Tenant ID for the principal is inferred using the + * tenant associated with the subscription. + * + * @param principalId the principalId value to set. + * @return the MongoMIRoleAssignmentResourceProperties object itself. + */ + public MongoMIRoleAssignmentResourceProperties withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("roleDefinitionId", this.roleDefinitionId); + jsonWriter.writeStringField("scope", this.scope); + jsonWriter.writeStringField("principalId", this.principalId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoMIRoleAssignmentResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoMIRoleAssignmentResourceProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MongoMIRoleAssignmentResourceProperties. + */ + public static MongoMIRoleAssignmentResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoMIRoleAssignmentResourceProperties deserializedMongoMIRoleAssignmentResourceProperties + = new MongoMIRoleAssignmentResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("roleDefinitionId".equals(fieldName)) { + deserializedMongoMIRoleAssignmentResourceProperties.roleDefinitionId = reader.getString(); + } else if ("scope".equals(fieldName)) { + deserializedMongoMIRoleAssignmentResourceProperties.scope = reader.getString(); + } else if ("principalId".equals(fieldName)) { + deserializedMongoMIRoleAssignmentResourceProperties.principalId = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedMongoMIRoleAssignmentResourceProperties.provisioningState = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoMIRoleAssignmentResourceProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoMIRoleDefinitionResourceInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoMIRoleDefinitionResourceInner.java new file mode 100644 index 000000000000..37b2ebd2ee4c --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoMIRoleDefinitionResourceInner.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.Permission; +import com.azure.resourcemanager.cosmos.models.RoleDefinitionType; +import java.io.IOException; +import java.util.List; + +/** + * Parameters to create and update an Azure Cosmos DB MongoMI Role Definition. + */ +@Fluent +public final class MongoMIRoleDefinitionResourceInner extends ProxyResource { + /* + * Properties to create and update an Azure Cosmos DB MongoMI Role Definition. + */ + private MongoMIRoleDefinitionResourceProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of MongoMIRoleDefinitionResourceInner class. + */ + public MongoMIRoleDefinitionResourceInner() { + } + + /** + * Get the innerProperties property: Properties to create and update an Azure Cosmos DB MongoMI Role Definition. + * + * @return the innerProperties value. + */ + private MongoMIRoleDefinitionResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the id property: The path id for the Role Definition. + * + * @return the id value. + */ + public String idPropertiesId() { + return this.innerProperties() == null ? null : this.innerProperties().id(); + } + + /** + * Set the id property: The path id for the Role Definition. + * + * @param id the id value to set. + * @return the MongoMIRoleDefinitionResourceInner object itself. + */ + public MongoMIRoleDefinitionResourceInner withIdPropertiesId(String id) { + if (this.innerProperties() == null) { + this.innerProperties = new MongoMIRoleDefinitionResourceProperties(); + } + this.innerProperties().withId(id); + return this; + } + + /** + * Get the roleName property: A user-friendly name for the Role Definition. Must be unique for the database account. + * + * @return the roleName value. + */ + public String roleName() { + return this.innerProperties() == null ? null : this.innerProperties().roleName(); + } + + /** + * Set the roleName property: A user-friendly name for the Role Definition. Must be unique for the database account. + * + * @param roleName the roleName value to set. + * @return the MongoMIRoleDefinitionResourceInner object itself. + */ + public MongoMIRoleDefinitionResourceInner withRoleName(String roleName) { + if (this.innerProperties() == null) { + this.innerProperties = new MongoMIRoleDefinitionResourceProperties(); + } + this.innerProperties().withRoleName(roleName); + return this; + } + + /** + * Get the type property: Indicates whether the Role Definition was built-in or user created. + * + * @return the type value. + */ + public RoleDefinitionType typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: Indicates whether the Role Definition was built-in or user created. + * + * @param type the type value to set. + * @return the MongoMIRoleDefinitionResourceInner object itself. + */ + public MongoMIRoleDefinitionResourceInner withTypePropertiesType(RoleDefinitionType type) { + if (this.innerProperties() == null) { + this.innerProperties = new MongoMIRoleDefinitionResourceProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the assignableScopes property: A set of fully qualified Scopes at or below which MongoMI Role Assignments may + * be created using this Role Definition. This will allow application of this Role Definition on the entire database + * account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database + * account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not + * exist. + * + * @return the assignableScopes value. + */ + public List assignableScopes() { + return this.innerProperties() == null ? null : this.innerProperties().assignableScopes(); + } + + /** + * Set the assignableScopes property: A set of fully qualified Scopes at or below which MongoMI Role Assignments may + * be created using this Role Definition. This will allow application of this Role Definition on the entire database + * account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database + * account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not + * exist. + * + * @param assignableScopes the assignableScopes value to set. + * @return the MongoMIRoleDefinitionResourceInner object itself. + */ + public MongoMIRoleDefinitionResourceInner withAssignableScopes(List assignableScopes) { + if (this.innerProperties() == null) { + this.innerProperties = new MongoMIRoleDefinitionResourceProperties(); + } + this.innerProperties().withAssignableScopes(assignableScopes); + return this; + } + + /** + * Get the permissions property: The set of operations allowed through this Role Definition. + * + * @return the permissions value. + */ + public List permissions() { + return this.innerProperties() == null ? null : this.innerProperties().permissions(); + } + + /** + * Set the permissions property: The set of operations allowed through this Role Definition. + * + * @param permissions the permissions value to set. + * @return the MongoMIRoleDefinitionResourceInner object itself. + */ + public MongoMIRoleDefinitionResourceInner withPermissions(List permissions) { + if (this.innerProperties() == null) { + this.innerProperties = new MongoMIRoleDefinitionResourceProperties(); + } + this.innerProperties().withPermissions(permissions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoMIRoleDefinitionResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoMIRoleDefinitionResourceInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MongoMIRoleDefinitionResourceInner. + */ + public static MongoMIRoleDefinitionResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoMIRoleDefinitionResourceInner deserializedMongoMIRoleDefinitionResourceInner + = new MongoMIRoleDefinitionResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMongoMIRoleDefinitionResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedMongoMIRoleDefinitionResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMongoMIRoleDefinitionResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedMongoMIRoleDefinitionResourceInner.innerProperties + = MongoMIRoleDefinitionResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedMongoMIRoleDefinitionResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoMIRoleDefinitionResourceInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoMIRoleDefinitionResourceProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoMIRoleDefinitionResourceProperties.java new file mode 100644 index 000000000000..a7457e05d42a --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoMIRoleDefinitionResourceProperties.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.Permission; +import com.azure.resourcemanager.cosmos.models.RoleDefinitionType; +import java.io.IOException; +import java.util.List; + +/** + * Azure Cosmos DB MongoMI Role Definition resource object. + */ +@Fluent +public final class MongoMIRoleDefinitionResourceProperties + implements JsonSerializable { + /* + * The path id for the Role Definition. + */ + private String id; + + /* + * A user-friendly name for the Role Definition. Must be unique for the database account. + */ + private String roleName; + + /* + * Indicates whether the Role Definition was built-in or user created. + */ + private RoleDefinitionType type; + + /* + * A set of fully qualified Scopes at or below which MongoMI Role Assignments may be created using this Role + * Definition. This will allow application of this Role Definition on the entire database account or any underlying + * Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as + * assignable Scopes. Note that resources referenced in assignable Scopes need not exist. + */ + private List assignableScopes; + + /* + * The set of operations allowed through this Role Definition. + */ + private List permissions; + + /** + * Creates an instance of MongoMIRoleDefinitionResourceProperties class. + */ + public MongoMIRoleDefinitionResourceProperties() { + } + + /** + * Get the id property: The path id for the Role Definition. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The path id for the Role Definition. + * + * @param id the id value to set. + * @return the MongoMIRoleDefinitionResourceProperties object itself. + */ + public MongoMIRoleDefinitionResourceProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the roleName property: A user-friendly name for the Role Definition. Must be unique for the database account. + * + * @return the roleName value. + */ + public String roleName() { + return this.roleName; + } + + /** + * Set the roleName property: A user-friendly name for the Role Definition. Must be unique for the database account. + * + * @param roleName the roleName value to set. + * @return the MongoMIRoleDefinitionResourceProperties object itself. + */ + public MongoMIRoleDefinitionResourceProperties withRoleName(String roleName) { + this.roleName = roleName; + return this; + } + + /** + * Get the type property: Indicates whether the Role Definition was built-in or user created. + * + * @return the type value. + */ + public RoleDefinitionType type() { + return this.type; + } + + /** + * Set the type property: Indicates whether the Role Definition was built-in or user created. + * + * @param type the type value to set. + * @return the MongoMIRoleDefinitionResourceProperties object itself. + */ + public MongoMIRoleDefinitionResourceProperties withType(RoleDefinitionType type) { + this.type = type; + return this; + } + + /** + * Get the assignableScopes property: A set of fully qualified Scopes at or below which MongoMI Role Assignments may + * be created using this Role Definition. This will allow application of this Role Definition on the entire database + * account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database + * account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not + * exist. + * + * @return the assignableScopes value. + */ + public List assignableScopes() { + return this.assignableScopes; + } + + /** + * Set the assignableScopes property: A set of fully qualified Scopes at or below which MongoMI Role Assignments may + * be created using this Role Definition. This will allow application of this Role Definition on the entire database + * account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database + * account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not + * exist. + * + * @param assignableScopes the assignableScopes value to set. + * @return the MongoMIRoleDefinitionResourceProperties object itself. + */ + public MongoMIRoleDefinitionResourceProperties withAssignableScopes(List assignableScopes) { + this.assignableScopes = assignableScopes; + return this; + } + + /** + * Get the permissions property: The set of operations allowed through this Role Definition. + * + * @return the permissions value. + */ + public List permissions() { + return this.permissions; + } + + /** + * Set the permissions property: The set of operations allowed through this Role Definition. + * + * @param permissions the permissions value to set. + * @return the MongoMIRoleDefinitionResourceProperties object itself. + */ + public MongoMIRoleDefinitionResourceProperties withPermissions(List permissions) { + this.permissions = permissions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (permissions() != null) { + permissions().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("roleName", this.roleName); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeArrayField("assignableScopes", this.assignableScopes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("permissions", this.permissions, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoMIRoleDefinitionResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoMIRoleDefinitionResourceProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MongoMIRoleDefinitionResourceProperties. + */ + public static MongoMIRoleDefinitionResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoMIRoleDefinitionResourceProperties deserializedMongoMIRoleDefinitionResourceProperties + = new MongoMIRoleDefinitionResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMongoMIRoleDefinitionResourceProperties.id = reader.getString(); + } else if ("roleName".equals(fieldName)) { + deserializedMongoMIRoleDefinitionResourceProperties.roleName = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedMongoMIRoleDefinitionResourceProperties.type + = RoleDefinitionType.fromString(reader.getString()); + } else if ("assignableScopes".equals(fieldName)) { + List assignableScopes = reader.readArray(reader1 -> reader1.getString()); + deserializedMongoMIRoleDefinitionResourceProperties.assignableScopes = assignableScopes; + } else if ("permissions".equals(fieldName)) { + List permissions = reader.readArray(reader1 -> Permission.fromJson(reader1)); + deserializedMongoMIRoleDefinitionResourceProperties.permissions = permissions; + } else { + reader.skipChildren(); + } + } + + return deserializedMongoMIRoleDefinitionResourceProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoRoleDefinitionGetResultsInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoRoleDefinitionGetResultsInner.java index 767e4d4da987..10513cc524ac 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoRoleDefinitionGetResultsInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoRoleDefinitionGetResultsInner.java @@ -1,14 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cosmos.models.ArmProxyResource; import com.azure.resourcemanager.cosmos.models.MongoRoleDefinitionType; import com.azure.resourcemanager.cosmos.models.Privilege; import com.azure.resourcemanager.cosmos.models.Role; @@ -18,13 +19,18 @@ /** * An Azure Cosmos DB Mongo Role Definition. */ -@Fluent -public final class MongoRoleDefinitionGetResultsInner extends ArmProxyResource { +@Immutable +public final class MongoRoleDefinitionGetResultsInner extends ProxyResource { /* * Properties related to the Mongo Role Definition. */ private MongoRoleDefinitionResource innerProperties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -43,7 +49,7 @@ public final class MongoRoleDefinitionGetResultsInner extends ArmProxyResource { /** * Creates an instance of MongoRoleDefinitionGetResultsInner class. */ - public MongoRoleDefinitionGetResultsInner() { + private MongoRoleDefinitionGetResultsInner() { } /** @@ -55,6 +61,15 @@ private MongoRoleDefinitionResource innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -94,20 +109,6 @@ public String roleName() { return this.innerProperties() == null ? null : this.innerProperties().roleName(); } - /** - * Set the roleName property: A user-friendly name for the Role Definition. Must be unique for the database account. - * - * @param roleName the roleName value to set. - * @return the MongoRoleDefinitionGetResultsInner object itself. - */ - public MongoRoleDefinitionGetResultsInner withRoleName(String roleName) { - if (this.innerProperties() == null) { - this.innerProperties = new MongoRoleDefinitionResource(); - } - this.innerProperties().withRoleName(roleName); - return this; - } - /** * Get the type property: Indicates whether the Role Definition was built-in or user created. * @@ -117,20 +118,6 @@ public MongoRoleDefinitionType typePropertiesType() { return this.innerProperties() == null ? null : this.innerProperties().type(); } - /** - * Set the type property: Indicates whether the Role Definition was built-in or user created. - * - * @param type the type value to set. - * @return the MongoRoleDefinitionGetResultsInner object itself. - */ - public MongoRoleDefinitionGetResultsInner withTypePropertiesType(MongoRoleDefinitionType type) { - if (this.innerProperties() == null) { - this.innerProperties = new MongoRoleDefinitionResource(); - } - this.innerProperties().withType(type); - return this; - } - /** * Get the databaseName property: The database name for which access is being granted for this Role Definition. * @@ -140,20 +127,6 @@ public String databaseName() { return this.innerProperties() == null ? null : this.innerProperties().databaseName(); } - /** - * Set the databaseName property: The database name for which access is being granted for this Role Definition. - * - * @param databaseName the databaseName value to set. - * @return the MongoRoleDefinitionGetResultsInner object itself. - */ - public MongoRoleDefinitionGetResultsInner withDatabaseName(String databaseName) { - if (this.innerProperties() == null) { - this.innerProperties = new MongoRoleDefinitionResource(); - } - this.innerProperties().withDatabaseName(databaseName); - return this; - } - /** * Get the privileges property: A set of privileges contained by the Role Definition. This will allow application of * this Role Definition on the entire database account or any underlying Database / Collection. Scopes higher than @@ -165,22 +138,6 @@ public List privileges() { return this.innerProperties() == null ? null : this.innerProperties().privileges(); } - /** - * Set the privileges property: A set of privileges contained by the Role Definition. This will allow application of - * this Role Definition on the entire database account or any underlying Database / Collection. Scopes higher than - * Database are not enforceable as privilege. - * - * @param privileges the privileges value to set. - * @return the MongoRoleDefinitionGetResultsInner object itself. - */ - public MongoRoleDefinitionGetResultsInner withPrivileges(List privileges) { - if (this.innerProperties() == null) { - this.innerProperties = new MongoRoleDefinitionResource(); - } - this.innerProperties().withPrivileges(privileges); - return this; - } - /** * Get the roles property: The set of roles inherited by this Role Definition. * @@ -190,26 +147,11 @@ public List roles() { return this.innerProperties() == null ? null : this.innerProperties().roles(); } - /** - * Set the roles property: The set of roles inherited by this Role Definition. - * - * @param roles the roles value to set. - * @return the MongoRoleDefinitionGetResultsInner object itself. - */ - public MongoRoleDefinitionGetResultsInner withRoles(List roles) { - if (this.innerProperties() == null) { - this.innerProperties = new MongoRoleDefinitionResource(); - } - this.innerProperties().withRoles(roles); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() != null) { innerProperties().validate(); @@ -252,6 +194,8 @@ public static MongoRoleDefinitionGetResultsInner fromJson(JsonReader jsonReader) } else if ("properties".equals(fieldName)) { deserializedMongoRoleDefinitionGetResultsInner.innerProperties = MongoRoleDefinitionResource.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedMongoRoleDefinitionGetResultsInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoRoleDefinitionResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoRoleDefinitionResource.java index c3090adfdbf1..c9d905be4594 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoRoleDefinitionResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoRoleDefinitionResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoUserDefinitionGetResultsInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoUserDefinitionGetResultsInner.java index 25eb1777612d..4261577f0e5f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoUserDefinitionGetResultsInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoUserDefinitionGetResultsInner.java @@ -1,14 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cosmos.models.ArmProxyResource; import com.azure.resourcemanager.cosmos.models.Role; import java.io.IOException; import java.util.List; @@ -16,13 +17,18 @@ /** * An Azure Cosmos DB User Definition. */ -@Fluent -public final class MongoUserDefinitionGetResultsInner extends ArmProxyResource { +@Immutable +public final class MongoUserDefinitionGetResultsInner extends ProxyResource { /* * Properties related to the User Definition. */ private MongoUserDefinitionResource innerProperties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -41,7 +47,7 @@ public final class MongoUserDefinitionGetResultsInner extends ArmProxyResource { /** * Creates an instance of MongoUserDefinitionGetResultsInner class. */ - public MongoUserDefinitionGetResultsInner() { + private MongoUserDefinitionGetResultsInner() { } /** @@ -53,6 +59,15 @@ private MongoUserDefinitionResource innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -92,20 +107,6 @@ public String username() { return this.innerProperties() == null ? null : this.innerProperties().username(); } - /** - * Set the username property: The user name for User Definition. - * - * @param username the username value to set. - * @return the MongoUserDefinitionGetResultsInner object itself. - */ - public MongoUserDefinitionGetResultsInner withUsername(String username) { - if (this.innerProperties() == null) { - this.innerProperties = new MongoUserDefinitionResource(); - } - this.innerProperties().withUsername(username); - return this; - } - /** * Get the password property: The password for User Definition. Response does not contain user password. * @@ -115,20 +116,6 @@ public String password() { return this.innerProperties() == null ? null : this.innerProperties().password(); } - /** - * Set the password property: The password for User Definition. Response does not contain user password. - * - * @param password the password value to set. - * @return the MongoUserDefinitionGetResultsInner object itself. - */ - public MongoUserDefinitionGetResultsInner withPassword(String password) { - if (this.innerProperties() == null) { - this.innerProperties = new MongoUserDefinitionResource(); - } - this.innerProperties().withPassword(password); - return this; - } - /** * Get the databaseName property: The database name for which access is being granted for this User Definition. * @@ -138,20 +125,6 @@ public String databaseName() { return this.innerProperties() == null ? null : this.innerProperties().databaseName(); } - /** - * Set the databaseName property: The database name for which access is being granted for this User Definition. - * - * @param databaseName the databaseName value to set. - * @return the MongoUserDefinitionGetResultsInner object itself. - */ - public MongoUserDefinitionGetResultsInner withDatabaseName(String databaseName) { - if (this.innerProperties() == null) { - this.innerProperties = new MongoUserDefinitionResource(); - } - this.innerProperties().withDatabaseName(databaseName); - return this; - } - /** * Get the customData property: A custom definition for the USer Definition. * @@ -161,20 +134,6 @@ public String customData() { return this.innerProperties() == null ? null : this.innerProperties().customData(); } - /** - * Set the customData property: A custom definition for the USer Definition. - * - * @param customData the customData value to set. - * @return the MongoUserDefinitionGetResultsInner object itself. - */ - public MongoUserDefinitionGetResultsInner withCustomData(String customData) { - if (this.innerProperties() == null) { - this.innerProperties = new MongoUserDefinitionResource(); - } - this.innerProperties().withCustomData(customData); - return this; - } - /** * Get the roles property: The set of roles inherited by the User Definition. * @@ -184,20 +143,6 @@ public List roles() { return this.innerProperties() == null ? null : this.innerProperties().roles(); } - /** - * Set the roles property: The set of roles inherited by the User Definition. - * - * @param roles the roles value to set. - * @return the MongoUserDefinitionGetResultsInner object itself. - */ - public MongoUserDefinitionGetResultsInner withRoles(List roles) { - if (this.innerProperties() == null) { - this.innerProperties = new MongoUserDefinitionResource(); - } - this.innerProperties().withRoles(roles); - return this; - } - /** * Get the mechanisms property: The Mongo Auth mechanism. For now, we only support auth mechanism SCRAM-SHA-256. * @@ -207,26 +152,11 @@ public String mechanisms() { return this.innerProperties() == null ? null : this.innerProperties().mechanisms(); } - /** - * Set the mechanisms property: The Mongo Auth mechanism. For now, we only support auth mechanism SCRAM-SHA-256. - * - * @param mechanisms the mechanisms value to set. - * @return the MongoUserDefinitionGetResultsInner object itself. - */ - public MongoUserDefinitionGetResultsInner withMechanisms(String mechanisms) { - if (this.innerProperties() == null) { - this.innerProperties = new MongoUserDefinitionResource(); - } - this.innerProperties().withMechanisms(mechanisms); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() != null) { innerProperties().validate(); @@ -269,6 +199,8 @@ public static MongoUserDefinitionGetResultsInner fromJson(JsonReader jsonReader) } else if ("properties".equals(fieldName)) { deserializedMongoUserDefinitionGetResultsInner.innerProperties = MongoUserDefinitionResource.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedMongoUserDefinitionGetResultsInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoUserDefinitionResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoUserDefinitionResource.java index c98898c57de3..e5a32925d3a8 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoUserDefinitionResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoUserDefinitionResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/NetworkSecurityPerimeterConfigurationInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/NetworkSecurityPerimeterConfigurationInner.java new file mode 100644 index 000000000000..45958799e1d5 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/NetworkSecurityPerimeterConfigurationInner.java @@ -0,0 +1,157 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.NetworkSecurityPerimeterConfigurationProperties; +import java.io.IOException; + +/** + * Network security perimeter (NSP) configuration resource. + */ +@Immutable +public final class NetworkSecurityPerimeterConfigurationInner extends ProxyResource { + /* + * Network security configuration properties. + */ + private NetworkSecurityPerimeterConfigurationProperties properties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of NetworkSecurityPerimeterConfigurationInner class. + */ + private NetworkSecurityPerimeterConfigurationInner() { + } + + /** + * Get the properties property: Network security configuration properties. + * + * @return the properties value. + */ + public NetworkSecurityPerimeterConfigurationProperties properties() { + return this.properties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityPerimeterConfigurationInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityPerimeterConfigurationInner if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NetworkSecurityPerimeterConfigurationInner. + */ + public static NetworkSecurityPerimeterConfigurationInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityPerimeterConfigurationInner deserializedNetworkSecurityPerimeterConfigurationInner + = new NetworkSecurityPerimeterConfigurationInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationInner.properties + = NetworkSecurityPerimeterConfigurationProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityPerimeterConfigurationInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/NotebookWorkspaceConnectionInfoResultInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/NotebookWorkspaceConnectionInfoResultInner.java index eb9b48950c21..b1764897409c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/NotebookWorkspaceConnectionInfoResultInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/NotebookWorkspaceConnectionInfoResultInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; @@ -30,7 +30,7 @@ public final class NotebookWorkspaceConnectionInfoResultInner /** * Creates an instance of NotebookWorkspaceConnectionInfoResultInner class. */ - public NotebookWorkspaceConnectionInfoResultInner() { + private NotebookWorkspaceConnectionInfoResultInner() { } /** diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/NotebookWorkspaceInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/NotebookWorkspaceInner.java index ee38c0cf48b8..80a96fb4ab77 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/NotebookWorkspaceInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/NotebookWorkspaceInner.java @@ -1,26 +1,32 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cosmos.models.ArmProxyResource; import java.io.IOException; /** * A notebook workspace resource. */ @Immutable -public final class NotebookWorkspaceInner extends ArmProxyResource { +public final class NotebookWorkspaceInner extends ProxyResource { /* * Resource properties. */ private NotebookWorkspaceProperties innerProperties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -39,7 +45,7 @@ public final class NotebookWorkspaceInner extends ArmProxyResource { /** * Creates an instance of NotebookWorkspaceInner class. */ - public NotebookWorkspaceInner() { + private NotebookWorkspaceInner() { } /** @@ -51,6 +57,15 @@ private NotebookWorkspaceProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -105,7 +120,6 @@ public String status() { * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() != null) { innerProperties().validate(); @@ -146,6 +160,8 @@ public static NotebookWorkspaceInner fromJson(JsonReader jsonReader) throws IOEx deserializedNotebookWorkspaceInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { deserializedNotebookWorkspaceInner.innerProperties = NotebookWorkspaceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedNotebookWorkspaceInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/NotebookWorkspaceProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/NotebookWorkspaceProperties.java index 93db025c8bb0..95c96d713d6c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/NotebookWorkspaceProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/NotebookWorkspaceProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; @@ -29,7 +29,7 @@ public final class NotebookWorkspaceProperties implements JsonSerializable { /* * Operation name: {provider}/{resource}/{operation} @@ -30,7 +30,7 @@ public final class OperationInner implements JsonSerializable { /** * Creates an instance of OperationInner class. */ - public OperationInner() { + private OperationInner() { } /** @@ -42,17 +42,6 @@ public String name() { return this.name; } - /** - * Set the name property: Operation name: {provider}/{resource}/{operation}. - * - * @param name the name value to set. - * @return the OperationInner object itself. - */ - public OperationInner withName(String name) { - this.name = name; - return this; - } - /** * Get the display property: The object that represents the operation. * @@ -62,17 +51,6 @@ public OperationDisplay display() { return this.display; } - /** - * Set the display property: The object that represents the operation. - * - * @param display the display value to set. - * @return the OperationInner object itself. - */ - public OperationInner withDisplay(OperationDisplay display) { - this.display = display; - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PartitionMetricInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PartitionMetricInner.java index 0e8c2565279a..e86b48b6ff6d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PartitionMetricInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PartitionMetricInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; @@ -64,7 +64,7 @@ public final class PartitionMetricInner extends MetricInner { /** * Creates an instance of PartitionMetricInner class. */ - public PartitionMetricInner() { + private PartitionMetricInner() { } /** diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PartitionUsageInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PartitionUsageInner.java index ce86770fe04c..a8cac8883f1c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PartitionUsageInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PartitionUsageInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; @@ -55,7 +55,7 @@ public final class PartitionUsageInner extends UsageInner { /** * Creates an instance of PartitionUsageInner class. */ - public PartitionUsageInner() { + private PartitionUsageInner() { } /** diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PercentileMetricInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PercentileMetricInner.java index 5bf4aa6db4a9..e4a2392ea815 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PercentileMetricInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PercentileMetricInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; @@ -55,7 +55,7 @@ public final class PercentileMetricInner implements JsonSerializable { + /* + * List of physical partitions and their properties. + */ + private List physicalPartitionStorageInfoCollection; + + /** + * Creates an instance of PhysicalPartitionStorageInfoCollectionInner class. + */ + private PhysicalPartitionStorageInfoCollectionInner() { + } + + /** + * Get the physicalPartitionStorageInfoCollection property: List of physical partitions and their properties. + * + * @return the physicalPartitionStorageInfoCollection value. + */ + public List physicalPartitionStorageInfoCollection() { + return this.physicalPartitionStorageInfoCollection; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (physicalPartitionStorageInfoCollection() != null) { + physicalPartitionStorageInfoCollection().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PhysicalPartitionStorageInfoCollectionInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PhysicalPartitionStorageInfoCollectionInner if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PhysicalPartitionStorageInfoCollectionInner. + */ + public static PhysicalPartitionStorageInfoCollectionInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PhysicalPartitionStorageInfoCollectionInner deserializedPhysicalPartitionStorageInfoCollectionInner + = new PhysicalPartitionStorageInfoCollectionInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("physicalPartitionStorageInfoCollection".equals(fieldName)) { + List physicalPartitionStorageInfoCollection + = reader.readArray(reader1 -> PhysicalPartitionStorageInfo.fromJson(reader1)); + deserializedPhysicalPartitionStorageInfoCollectionInner.physicalPartitionStorageInfoCollection + = physicalPartitionStorageInfoCollection; + } else { + reader.skipChildren(); + } + } + + return deserializedPhysicalPartitionStorageInfoCollectionInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PhysicalPartitionThroughputInfoResultInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PhysicalPartitionThroughputInfoResultInner.java new file mode 100644 index 000000000000..5b1af924c213 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PhysicalPartitionThroughputInfoResultInner.java @@ -0,0 +1,166 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.ArmResourceProperties; +import com.azure.resourcemanager.cosmos.models.ManagedServiceIdentity; +import com.azure.resourcemanager.cosmos.models.PhysicalPartitionThroughputInfoResultPropertiesResource; +import java.io.IOException; +import java.util.Map; + +/** + * An Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ +@Immutable +public final class PhysicalPartitionThroughputInfoResultInner extends ArmResourceProperties { + /* + * The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object + */ + private PhysicalPartitionThroughputInfoResultProperties innerProperties; + + /* + * The type of Azure resource. + */ + private String type; + + /* + * The name of the ARM resource. + */ + private String name; + + /* + * The unique resource identifier of the ARM resource. + */ + private String id; + + /** + * Creates an instance of PhysicalPartitionThroughputInfoResultInner class. + */ + private PhysicalPartitionThroughputInfoResultInner() { + } + + /** + * Get the innerProperties property: The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult + * object. + * + * @return the innerProperties value. + */ + private PhysicalPartitionThroughputInfoResultProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the type property: The type of Azure resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the ARM resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: The unique resource identifier of the ARM resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the resource property: properties of physical partition throughput info. + * + * @return the resource value. + */ + public PhysicalPartitionThroughputInfoResultPropertiesResource resource() { + return this.innerProperties() == null ? null : this.innerProperties().resource(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", identity()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PhysicalPartitionThroughputInfoResultInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PhysicalPartitionThroughputInfoResultInner if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PhysicalPartitionThroughputInfoResultInner. + */ + public static PhysicalPartitionThroughputInfoResultInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PhysicalPartitionThroughputInfoResultInner deserializedPhysicalPartitionThroughputInfoResultInner + = new PhysicalPartitionThroughputInfoResultInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPhysicalPartitionThroughputInfoResultInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedPhysicalPartitionThroughputInfoResultInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedPhysicalPartitionThroughputInfoResultInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedPhysicalPartitionThroughputInfoResultInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedPhysicalPartitionThroughputInfoResultInner.withTags(tags); + } else if ("identity".equals(fieldName)) { + deserializedPhysicalPartitionThroughputInfoResultInner + .withIdentity(ManagedServiceIdentity.fromJson(reader)); + } else if ("properties".equals(fieldName)) { + deserializedPhysicalPartitionThroughputInfoResultInner.innerProperties + = PhysicalPartitionThroughputInfoResultProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPhysicalPartitionThroughputInfoResultInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PhysicalPartitionThroughputInfoResultProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PhysicalPartitionThroughputInfoResultProperties.java new file mode 100644 index 000000000000..56cfe13432cd --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PhysicalPartitionThroughputInfoResultProperties.java @@ -0,0 +1,89 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.PhysicalPartitionThroughputInfoResultPropertiesResource; +import java.io.IOException; + +/** + * The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ +@Immutable +public final class PhysicalPartitionThroughputInfoResultProperties + implements JsonSerializable { + /* + * properties of physical partition throughput info + */ + private PhysicalPartitionThroughputInfoResultPropertiesResource resource; + + /** + * Creates an instance of PhysicalPartitionThroughputInfoResultProperties class. + */ + private PhysicalPartitionThroughputInfoResultProperties() { + } + + /** + * Get the resource property: properties of physical partition throughput info. + * + * @return the resource value. + */ + public PhysicalPartitionThroughputInfoResultPropertiesResource resource() { + return this.resource; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resource() != null) { + resource().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("resource", this.resource); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PhysicalPartitionThroughputInfoResultProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PhysicalPartitionThroughputInfoResultProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PhysicalPartitionThroughputInfoResultProperties. + */ + public static PhysicalPartitionThroughputInfoResultProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PhysicalPartitionThroughputInfoResultProperties deserializedPhysicalPartitionThroughputInfoResultProperties + = new PhysicalPartitionThroughputInfoResultProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resource".equals(fieldName)) { + deserializedPhysicalPartitionThroughputInfoResultProperties.resource + = PhysicalPartitionThroughputInfoResultPropertiesResource.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedPhysicalPartitionThroughputInfoResultProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PrivateEndpointConnectionInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PrivateEndpointConnectionInner.java index c38f63144190..495e58b40181 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PrivateEndpointConnectionInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PrivateEndpointConnectionInner.java @@ -1,11 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; import com.azure.core.annotation.Fluent; import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -23,6 +24,11 @@ public final class PrivateEndpointConnectionInner extends ProxyResource { */ private PrivateEndpointConnectionProperties innerProperties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -53,6 +59,15 @@ private PrivateEndpointConnectionProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -223,6 +238,8 @@ public static PrivateEndpointConnectionInner fromJson(JsonReader jsonReader) thr } else if ("properties".equals(fieldName)) { deserializedPrivateEndpointConnectionInner.innerProperties = PrivateEndpointConnectionProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateEndpointConnectionInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PrivateEndpointConnectionProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PrivateEndpointConnectionProperties.java index 9636fe3a18ed..fcc0ffb2f1b9 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PrivateEndpointConnectionProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PrivateEndpointConnectionProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PrivateLinkResourceInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PrivateLinkResourceInner.java index baf2dbd00df0..0ffac6e929b5 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PrivateLinkResourceInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PrivateLinkResourceInner.java @@ -1,14 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cosmos.models.ArmProxyResource; import java.io.IOException; import java.util.List; @@ -16,12 +17,17 @@ * A private link resource. */ @Immutable -public final class PrivateLinkResourceInner extends ArmProxyResource { +public final class PrivateLinkResourceInner extends ProxyResource { /* * Resource properties. */ private PrivateLinkResourceProperties innerProperties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -40,7 +46,7 @@ public final class PrivateLinkResourceInner extends ArmProxyResource { /** * Creates an instance of PrivateLinkResourceInner class. */ - public PrivateLinkResourceInner() { + private PrivateLinkResourceInner() { } /** @@ -52,6 +58,15 @@ private PrivateLinkResourceProperties innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -114,7 +129,6 @@ public List requiredZoneNames() { * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() != null) { innerProperties().validate(); @@ -156,6 +170,8 @@ public static PrivateLinkResourceInner fromJson(JsonReader jsonReader) throws IO } else if ("properties".equals(fieldName)) { deserializedPrivateLinkResourceInner.innerProperties = PrivateLinkResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedPrivateLinkResourceInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PrivateLinkResourceProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PrivateLinkResourceProperties.java index e3f1e026e70c..24112f81cdf5 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PrivateLinkResourceProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PrivateLinkResourceProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; @@ -35,7 +35,7 @@ public final class PrivateLinkResourceProperties implements JsonSerializable { + /* + * The standard JSON format of a resource throughput + */ + private RedistributeThroughputPropertiesResource resource; + + /** + * Creates an instance of RedistributeThroughputProperties class. + */ + public RedistributeThroughputProperties() { + } + + /** + * Get the resource property: The standard JSON format of a resource throughput. + * + * @return the resource value. + */ + public RedistributeThroughputPropertiesResource resource() { + return this.resource; + } + + /** + * Set the resource property: The standard JSON format of a resource throughput. + * + * @param resource the resource value to set. + * @return the RedistributeThroughputProperties object itself. + */ + public RedistributeThroughputProperties withResource(RedistributeThroughputPropertiesResource resource) { + this.resource = resource; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resource() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property resource in model RedistributeThroughputProperties")); + } else { + resource().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RedistributeThroughputProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("resource", this.resource); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RedistributeThroughputProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RedistributeThroughputProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RedistributeThroughputProperties. + */ + public static RedistributeThroughputProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RedistributeThroughputProperties deserializedRedistributeThroughputProperties + = new RedistributeThroughputProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resource".equals(fieldName)) { + deserializedRedistributeThroughputProperties.resource + = RedistributeThroughputPropertiesResource.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRedistributeThroughputProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableDatabaseAccountGetResultInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableDatabaseAccountGetResultInner.java index 37c37dd6ac5b..e4ec1b904627 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableDatabaseAccountGetResultInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableDatabaseAccountGetResultInner.java @@ -1,12 +1,13 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import com.azure.resourcemanager.cosmos.models.ApiType; @@ -18,38 +19,42 @@ /** * A Azure Cosmos DB restorable database account. */ -@Fluent -public final class RestorableDatabaseAccountGetResultInner - implements JsonSerializable { +@Immutable +public final class RestorableDatabaseAccountGetResultInner extends ProxyResource { /* * The properties of a restorable database account. */ private RestorableDatabaseAccountProperties innerProperties; /* - * The unique resource identifier of the ARM resource. + * The location of the resource group to which the resource belongs. */ - private String id; + private String location; /* - * The name of the ARM resource. + * Azure Resource Manager metadata containing createdBy and modifiedBy information. */ - private String name; + private SystemData systemData; /* - * The type of Azure resource. + * The type of the resource. */ private String type; /* - * The location of the resource group to which the resource belongs. + * The name of the resource. */ - private String location; + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; /** * Creates an instance of RestorableDatabaseAccountGetResultInner class. */ - public RestorableDatabaseAccountGetResultInner() { + private RestorableDatabaseAccountGetResultInner() { } /** @@ -62,50 +67,51 @@ private RestorableDatabaseAccountProperties innerProperties() { } /** - * Get the id property: The unique resource identifier of the ARM resource. + * Get the location property: The location of the resource group to which the resource belongs. * - * @return the id value. + * @return the location value. */ - public String id() { - return this.id; + public String location() { + return this.location; } /** - * Get the name property: The name of the ARM resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @return the name value. + * @return the systemData value. */ - public String name() { - return this.name; + public SystemData systemData() { + return this.systemData; } /** - * Get the type property: The type of Azure resource. + * Get the type property: The type of the resource. * * @return the type value. */ + @Override public String type() { return this.type; } /** - * Get the location property: The location of the resource group to which the resource belongs. + * Get the name property: The name of the resource. * - * @return the location value. + * @return the name value. */ - public String location() { - return this.location; + @Override + public String name() { + return this.name; } /** - * Set the location property: The location of the resource group to which the resource belongs. + * Get the id property: Fully qualified resource Id for the resource. * - * @param location the location value to set. - * @return the RestorableDatabaseAccountGetResultInner object itself. + * @return the id value. */ - public RestorableDatabaseAccountGetResultInner withLocation(String location) { - this.location = location; - return this; + @Override + public String id() { + return this.id; } /** @@ -117,20 +123,6 @@ public String accountName() { return this.innerProperties() == null ? null : this.innerProperties().accountName(); } - /** - * Set the accountName property: The name of the global database account. - * - * @param accountName the accountName value to set. - * @return the RestorableDatabaseAccountGetResultInner object itself. - */ - public RestorableDatabaseAccountGetResultInner withAccountName(String accountName) { - if (this.innerProperties() == null) { - this.innerProperties = new RestorableDatabaseAccountProperties(); - } - this.innerProperties().withAccountName(accountName); - return this; - } - /** * Get the creationTime property: The creation time of the restorable database account (ISO-8601 format). * @@ -140,45 +132,6 @@ public OffsetDateTime creationTime() { return this.innerProperties() == null ? null : this.innerProperties().creationTime(); } - /** - * Set the creationTime property: The creation time of the restorable database account (ISO-8601 format). - * - * @param creationTime the creationTime value to set. - * @return the RestorableDatabaseAccountGetResultInner object itself. - */ - public RestorableDatabaseAccountGetResultInner withCreationTime(OffsetDateTime creationTime) { - if (this.innerProperties() == null) { - this.innerProperties = new RestorableDatabaseAccountProperties(); - } - this.innerProperties().withCreationTime(creationTime); - return this; - } - - /** - * Get the deletionTime property: The time at which the restorable database account has been deleted (ISO-8601 - * format). - * - * @return the deletionTime value. - */ - public OffsetDateTime deletionTime() { - return this.innerProperties() == null ? null : this.innerProperties().deletionTime(); - } - - /** - * Set the deletionTime property: The time at which the restorable database account has been deleted (ISO-8601 - * format). - * - * @param deletionTime the deletionTime value to set. - * @return the RestorableDatabaseAccountGetResultInner object itself. - */ - public RestorableDatabaseAccountGetResultInner withDeletionTime(OffsetDateTime deletionTime) { - if (this.innerProperties() == null) { - this.innerProperties = new RestorableDatabaseAccountProperties(); - } - this.innerProperties().withDeletionTime(deletionTime); - return this; - } - /** * Get the oldestRestorableTime property: The least recent time at which the database account can be restored to * (ISO-8601 format). @@ -190,18 +143,13 @@ public OffsetDateTime oldestRestorableTime() { } /** - * Set the oldestRestorableTime property: The least recent time at which the database account can be restored to - * (ISO-8601 format). + * Get the deletionTime property: The time at which the restorable database account has been deleted (ISO-8601 + * format). * - * @param oldestRestorableTime the oldestRestorableTime value to set. - * @return the RestorableDatabaseAccountGetResultInner object itself. + * @return the deletionTime value. */ - public RestorableDatabaseAccountGetResultInner withOldestRestorableTime(OffsetDateTime oldestRestorableTime) { - if (this.innerProperties() == null) { - this.innerProperties = new RestorableDatabaseAccountProperties(); - } - this.innerProperties().withOldestRestorableTime(oldestRestorableTime); - return this; + public OffsetDateTime deletionTime() { + return this.innerProperties() == null ? null : this.innerProperties().deletionTime(); } /** @@ -250,6 +198,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of RestorableDatabaseAccountGetResultInner if the JsonReader was pointing to an instance of * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the RestorableDatabaseAccountGetResultInner. */ public static RestorableDatabaseAccountGetResultInner fromJson(JsonReader jsonReader) throws IOException { @@ -260,17 +209,19 @@ public static RestorableDatabaseAccountGetResultInner fromJson(JsonReader jsonRe String fieldName = reader.getFieldName(); reader.nextToken(); - if ("properties".equals(fieldName)) { - deserializedRestorableDatabaseAccountGetResultInner.innerProperties - = RestorableDatabaseAccountProperties.fromJson(reader); - } else if ("id".equals(fieldName)) { + if ("id".equals(fieldName)) { deserializedRestorableDatabaseAccountGetResultInner.id = reader.getString(); } else if ("name".equals(fieldName)) { deserializedRestorableDatabaseAccountGetResultInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedRestorableDatabaseAccountGetResultInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedRestorableDatabaseAccountGetResultInner.innerProperties + = RestorableDatabaseAccountProperties.fromJson(reader); } else if ("location".equals(fieldName)) { deserializedRestorableDatabaseAccountGetResultInner.location = reader.getString(); + } else if ("systemData".equals(fieldName)) { + deserializedRestorableDatabaseAccountGetResultInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableDatabaseAccountProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableDatabaseAccountProperties.java index d2bc219b7494..1ede5596ad69 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableDatabaseAccountProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableDatabaseAccountProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -20,7 +20,7 @@ /** * The properties of a restorable database account. */ -@Fluent +@Immutable public final class RestorableDatabaseAccountProperties implements JsonSerializable { /* @@ -34,14 +34,14 @@ public final class RestorableDatabaseAccountProperties private OffsetDateTime creationTime; /* - * The time at which the restorable database account has been deleted (ISO-8601 format). + * The least recent time at which the database account can be restored to (ISO-8601 format). */ - private OffsetDateTime deletionTime; + private OffsetDateTime oldestRestorableTime; /* - * The least recent time at which the database account can be restored to (ISO-8601 format). + * The time at which the restorable database account has been deleted (ISO-8601 format). */ - private OffsetDateTime oldestRestorableTime; + private OffsetDateTime deletionTime; /* * The API type of the restorable database account. @@ -56,7 +56,7 @@ public final class RestorableDatabaseAccountProperties /** * Creates an instance of RestorableDatabaseAccountProperties class. */ - public RestorableDatabaseAccountProperties() { + private RestorableDatabaseAccountProperties() { } /** @@ -68,17 +68,6 @@ public String accountName() { return this.accountName; } - /** - * Set the accountName property: The name of the global database account. - * - * @param accountName the accountName value to set. - * @return the RestorableDatabaseAccountProperties object itself. - */ - public RestorableDatabaseAccountProperties withAccountName(String accountName) { - this.accountName = accountName; - return this; - } - /** * Get the creationTime property: The creation time of the restorable database account (ISO-8601 format). * @@ -88,39 +77,6 @@ public OffsetDateTime creationTime() { return this.creationTime; } - /** - * Set the creationTime property: The creation time of the restorable database account (ISO-8601 format). - * - * @param creationTime the creationTime value to set. - * @return the RestorableDatabaseAccountProperties object itself. - */ - public RestorableDatabaseAccountProperties withCreationTime(OffsetDateTime creationTime) { - this.creationTime = creationTime; - return this; - } - - /** - * Get the deletionTime property: The time at which the restorable database account has been deleted (ISO-8601 - * format). - * - * @return the deletionTime value. - */ - public OffsetDateTime deletionTime() { - return this.deletionTime; - } - - /** - * Set the deletionTime property: The time at which the restorable database account has been deleted (ISO-8601 - * format). - * - * @param deletionTime the deletionTime value to set. - * @return the RestorableDatabaseAccountProperties object itself. - */ - public RestorableDatabaseAccountProperties withDeletionTime(OffsetDateTime deletionTime) { - this.deletionTime = deletionTime; - return this; - } - /** * Get the oldestRestorableTime property: The least recent time at which the database account can be restored to * (ISO-8601 format). @@ -132,15 +88,13 @@ public OffsetDateTime oldestRestorableTime() { } /** - * Set the oldestRestorableTime property: The least recent time at which the database account can be restored to - * (ISO-8601 format). + * Get the deletionTime property: The time at which the restorable database account has been deleted (ISO-8601 + * format). * - * @param oldestRestorableTime the oldestRestorableTime value to set. - * @return the RestorableDatabaseAccountProperties object itself. + * @return the deletionTime value. */ - public RestorableDatabaseAccountProperties withOldestRestorableTime(OffsetDateTime oldestRestorableTime) { - this.oldestRestorableTime = oldestRestorableTime; - return this; + public OffsetDateTime deletionTime() { + return this.deletionTime; } /** @@ -181,12 +135,12 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("accountName", this.accountName); jsonWriter.writeStringField("creationTime", this.creationTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.creationTime)); - jsonWriter.writeStringField("deletionTime", - this.deletionTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.deletionTime)); jsonWriter.writeStringField("oldestRestorableTime", this.oldestRestorableTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.oldestRestorableTime)); + jsonWriter.writeStringField("deletionTime", + this.deletionTime == null ? null : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.deletionTime)); return jsonWriter.writeEndObject(); } @@ -211,12 +165,12 @@ public static RestorableDatabaseAccountProperties fromJson(JsonReader jsonReader } else if ("creationTime".equals(fieldName)) { deserializedRestorableDatabaseAccountProperties.creationTime = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); - } else if ("deletionTime".equals(fieldName)) { - deserializedRestorableDatabaseAccountProperties.deletionTime = reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("oldestRestorableTime".equals(fieldName)) { deserializedRestorableDatabaseAccountProperties.oldestRestorableTime = reader .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("deletionTime".equals(fieldName)) { + deserializedRestorableDatabaseAccountProperties.deletionTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("apiType".equals(fieldName)) { deserializedRestorableDatabaseAccountProperties.apiType = ApiType.fromString(reader.getString()); } else if ("restorableLocations".equals(fieldName)) { diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinDatabaseGetResultInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinDatabaseGetResultInner.java index d7ee154d11fc..68460c35a654 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinDatabaseGetResultInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinDatabaseGetResultInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * An Azure Cosmos DB Gremlin database event. */ -@Fluent +@Immutable public final class RestorableGremlinDatabaseGetResultInner implements JsonSerializable { /* @@ -41,7 +41,7 @@ public final class RestorableGremlinDatabaseGetResultInner /** * Creates an instance of RestorableGremlinDatabaseGetResultInner class. */ - public RestorableGremlinDatabaseGetResultInner() { + private RestorableGremlinDatabaseGetResultInner() { } /** @@ -89,20 +89,6 @@ public RestorableGremlinDatabasePropertiesResource resource() { return this.innerProperties() == null ? null : this.innerProperties().resource(); } - /** - * Set the resource property: The resource of an Azure Cosmos DB Gremlin database event. - * - * @param resource the resource value to set. - * @return the RestorableGremlinDatabaseGetResultInner object itself. - */ - public RestorableGremlinDatabaseGetResultInner withResource(RestorableGremlinDatabasePropertiesResource resource) { - if (this.innerProperties() == null) { - this.innerProperties = new RestorableGremlinDatabaseProperties(); - } - this.innerProperties().withResource(resource); - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinDatabaseProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinDatabaseProperties.java index 912444918344..f646d2656c18 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinDatabaseProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinDatabaseProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The properties of an Azure Cosmos DB Gremlin database event. */ -@Fluent +@Immutable public final class RestorableGremlinDatabaseProperties implements JsonSerializable { /* @@ -26,7 +26,7 @@ public final class RestorableGremlinDatabaseProperties /** * Creates an instance of RestorableGremlinDatabaseProperties class. */ - public RestorableGremlinDatabaseProperties() { + private RestorableGremlinDatabaseProperties() { } /** @@ -38,17 +38,6 @@ public RestorableGremlinDatabasePropertiesResource resource() { return this.resource; } - /** - * Set the resource property: The resource of an Azure Cosmos DB Gremlin database event. - * - * @param resource the resource value to set. - * @return the RestorableGremlinDatabaseProperties object itself. - */ - public RestorableGremlinDatabaseProperties withResource(RestorableGremlinDatabasePropertiesResource resource) { - this.resource = resource; - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinGraphGetResultInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinGraphGetResultInner.java index de61a4057860..806735abcd7c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinGraphGetResultInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinGraphGetResultInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * An Azure Cosmos DB Gremlin graph event. */ -@Fluent +@Immutable public final class RestorableGremlinGraphGetResultInner implements JsonSerializable { /* @@ -41,7 +41,7 @@ public final class RestorableGremlinGraphGetResultInner /** * Creates an instance of RestorableGremlinGraphGetResultInner class. */ - public RestorableGremlinGraphGetResultInner() { + private RestorableGremlinGraphGetResultInner() { } /** @@ -89,20 +89,6 @@ public RestorableGremlinGraphPropertiesResource resource() { return this.innerProperties() == null ? null : this.innerProperties().resource(); } - /** - * Set the resource property: The resource of an Azure Cosmos DB Gremlin graph event. - * - * @param resource the resource value to set. - * @return the RestorableGremlinGraphGetResultInner object itself. - */ - public RestorableGremlinGraphGetResultInner withResource(RestorableGremlinGraphPropertiesResource resource) { - if (this.innerProperties() == null) { - this.innerProperties = new RestorableGremlinGraphProperties(); - } - this.innerProperties().withResource(resource); - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinGraphProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinGraphProperties.java index 0c2fa0ef0ff1..68785f550077 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinGraphProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinGraphProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The properties of an Azure Cosmos DB Gremlin graph event. */ -@Fluent +@Immutable public final class RestorableGremlinGraphProperties implements JsonSerializable { /* * The resource of an Azure Cosmos DB Gremlin graph event @@ -25,7 +25,7 @@ public final class RestorableGremlinGraphProperties implements JsonSerializable< /** * Creates an instance of RestorableGremlinGraphProperties class. */ - public RestorableGremlinGraphProperties() { + private RestorableGremlinGraphProperties() { } /** @@ -37,17 +37,6 @@ public RestorableGremlinGraphPropertiesResource resource() { return this.resource; } - /** - * Set the resource property: The resource of an Azure Cosmos DB Gremlin graph event. - * - * @param resource the resource value to set. - * @return the RestorableGremlinGraphProperties object itself. - */ - public RestorableGremlinGraphProperties withResource(RestorableGremlinGraphPropertiesResource resource) { - this.resource = resource; - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinResourcesGetResultInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinResourcesGetResultInner.java index 5d3c46144cd1..b7a3da9882c4 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinResourcesGetResultInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinResourcesGetResultInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Specific Databases to restore. */ -@Fluent +@Immutable public final class RestorableGremlinResourcesGetResultInner implements JsonSerializable { /* @@ -46,7 +46,7 @@ public final class RestorableGremlinResourcesGetResultInner /** * Creates an instance of RestorableGremlinResourcesGetResultInner class. */ - public RestorableGremlinResourcesGetResultInner() { + private RestorableGremlinResourcesGetResultInner() { } /** @@ -85,17 +85,6 @@ public String databaseName() { return this.databaseName; } - /** - * Set the databaseName property: The name of the gremlin database available for restore. - * - * @param databaseName the databaseName value to set. - * @return the RestorableGremlinResourcesGetResultInner object itself. - */ - public RestorableGremlinResourcesGetResultInner withDatabaseName(String databaseName) { - this.databaseName = databaseName; - return this; - } - /** * Get the graphNames property: The names of the graphs available for restore. * @@ -105,17 +94,6 @@ public List graphNames() { return this.graphNames; } - /** - * Set the graphNames property: The names of the graphs available for restore. - * - * @param graphNames the graphNames value to set. - * @return the RestorableGremlinResourcesGetResultInner object itself. - */ - public RestorableGremlinResourcesGetResultInner withGraphNames(List graphNames) { - this.graphNames = graphNames; - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbCollectionGetResultInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbCollectionGetResultInner.java index 1622c33a1b2e..076857fb22a9 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbCollectionGetResultInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbCollectionGetResultInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * An Azure Cosmos DB MongoDB collection event. */ -@Fluent +@Immutable public final class RestorableMongodbCollectionGetResultInner implements JsonSerializable { /* @@ -41,7 +41,7 @@ public final class RestorableMongodbCollectionGetResultInner /** * Creates an instance of RestorableMongodbCollectionGetResultInner class. */ - public RestorableMongodbCollectionGetResultInner() { + private RestorableMongodbCollectionGetResultInner() { } /** @@ -89,21 +89,6 @@ public RestorableMongodbCollectionPropertiesResource resource() { return this.innerProperties() == null ? null : this.innerProperties().resource(); } - /** - * Set the resource property: The resource of an Azure Cosmos DB MongoDB collection event. - * - * @param resource the resource value to set. - * @return the RestorableMongodbCollectionGetResultInner object itself. - */ - public RestorableMongodbCollectionGetResultInner - withResource(RestorableMongodbCollectionPropertiesResource resource) { - if (this.innerProperties() == null) { - this.innerProperties = new RestorableMongodbCollectionProperties(); - } - this.innerProperties().withResource(resource); - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbCollectionProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbCollectionProperties.java index 82a093f8b3a6..a8c63c966908 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbCollectionProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbCollectionProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The properties of an Azure Cosmos DB MongoDB collection event. */ -@Fluent +@Immutable public final class RestorableMongodbCollectionProperties implements JsonSerializable { /* @@ -26,7 +26,7 @@ public final class RestorableMongodbCollectionProperties /** * Creates an instance of RestorableMongodbCollectionProperties class. */ - public RestorableMongodbCollectionProperties() { + private RestorableMongodbCollectionProperties() { } /** @@ -38,17 +38,6 @@ public RestorableMongodbCollectionPropertiesResource resource() { return this.resource; } - /** - * Set the resource property: The resource of an Azure Cosmos DB MongoDB collection event. - * - * @param resource the resource value to set. - * @return the RestorableMongodbCollectionProperties object itself. - */ - public RestorableMongodbCollectionProperties withResource(RestorableMongodbCollectionPropertiesResource resource) { - this.resource = resource; - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbDatabaseGetResultInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbDatabaseGetResultInner.java index 74baddb3b58a..1bf3f6b21424 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbDatabaseGetResultInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbDatabaseGetResultInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * An Azure Cosmos DB MongoDB database event. */ -@Fluent +@Immutable public final class RestorableMongodbDatabaseGetResultInner implements JsonSerializable { /* @@ -41,7 +41,7 @@ public final class RestorableMongodbDatabaseGetResultInner /** * Creates an instance of RestorableMongodbDatabaseGetResultInner class. */ - public RestorableMongodbDatabaseGetResultInner() { + private RestorableMongodbDatabaseGetResultInner() { } /** @@ -89,20 +89,6 @@ public RestorableMongodbDatabasePropertiesResource resource() { return this.innerProperties() == null ? null : this.innerProperties().resource(); } - /** - * Set the resource property: The resource of an Azure Cosmos DB MongoDB database event. - * - * @param resource the resource value to set. - * @return the RestorableMongodbDatabaseGetResultInner object itself. - */ - public RestorableMongodbDatabaseGetResultInner withResource(RestorableMongodbDatabasePropertiesResource resource) { - if (this.innerProperties() == null) { - this.innerProperties = new RestorableMongodbDatabaseProperties(); - } - this.innerProperties().withResource(resource); - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbDatabaseProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbDatabaseProperties.java index 727f12155096..942e079b5d08 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbDatabaseProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbDatabaseProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The properties of an Azure Cosmos DB MongoDB database event. */ -@Fluent +@Immutable public final class RestorableMongodbDatabaseProperties implements JsonSerializable { /* @@ -26,7 +26,7 @@ public final class RestorableMongodbDatabaseProperties /** * Creates an instance of RestorableMongodbDatabaseProperties class. */ - public RestorableMongodbDatabaseProperties() { + private RestorableMongodbDatabaseProperties() { } /** @@ -38,17 +38,6 @@ public RestorableMongodbDatabasePropertiesResource resource() { return this.resource; } - /** - * Set the resource property: The resource of an Azure Cosmos DB MongoDB database event. - * - * @param resource the resource value to set. - * @return the RestorableMongodbDatabaseProperties object itself. - */ - public RestorableMongodbDatabaseProperties withResource(RestorableMongodbDatabasePropertiesResource resource) { - this.resource = resource; - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbResourcesGetResultInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbResourcesGetResultInner.java index 142129dfed57..5981e576350d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbResourcesGetResultInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbResourcesGetResultInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Specific Databases to restore. */ -@Fluent +@Immutable public final class RestorableMongodbResourcesGetResultInner implements JsonSerializable { /* @@ -46,7 +46,7 @@ public final class RestorableMongodbResourcesGetResultInner /** * Creates an instance of RestorableMongodbResourcesGetResultInner class. */ - public RestorableMongodbResourcesGetResultInner() { + private RestorableMongodbResourcesGetResultInner() { } /** @@ -85,17 +85,6 @@ public String databaseName() { return this.databaseName; } - /** - * Set the databaseName property: The name of the database available for restore. - * - * @param databaseName the databaseName value to set. - * @return the RestorableMongodbResourcesGetResultInner object itself. - */ - public RestorableMongodbResourcesGetResultInner withDatabaseName(String databaseName) { - this.databaseName = databaseName; - return this; - } - /** * Get the collectionNames property: The names of the collections available for restore. * @@ -105,17 +94,6 @@ public List collectionNames() { return this.collectionNames; } - /** - * Set the collectionNames property: The names of the collections available for restore. - * - * @param collectionNames the collectionNames value to set. - * @return the RestorableMongodbResourcesGetResultInner object itself. - */ - public RestorableMongodbResourcesGetResultInner withCollectionNames(List collectionNames) { - this.collectionNames = collectionNames; - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlContainerGetResultInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlContainerGetResultInner.java index dfd9cdc5ff22..cd70c21ea20c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlContainerGetResultInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlContainerGetResultInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * An Azure Cosmos DB SQL container event. */ -@Fluent +@Immutable public final class RestorableSqlContainerGetResultInner implements JsonSerializable { /* @@ -41,7 +41,7 @@ public final class RestorableSqlContainerGetResultInner /** * Creates an instance of RestorableSqlContainerGetResultInner class. */ - public RestorableSqlContainerGetResultInner() { + private RestorableSqlContainerGetResultInner() { } /** @@ -89,20 +89,6 @@ public RestorableSqlContainerPropertiesResource resource() { return this.innerProperties() == null ? null : this.innerProperties().resource(); } - /** - * Set the resource property: The resource of an Azure Cosmos DB SQL container event. - * - * @param resource the resource value to set. - * @return the RestorableSqlContainerGetResultInner object itself. - */ - public RestorableSqlContainerGetResultInner withResource(RestorableSqlContainerPropertiesResource resource) { - if (this.innerProperties() == null) { - this.innerProperties = new RestorableSqlContainerProperties(); - } - this.innerProperties().withResource(resource); - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlContainerProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlContainerProperties.java index 5fb5fb22de5d..4360a4df35cc 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlContainerProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlContainerProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The properties of an Azure Cosmos DB SQL container event. */ -@Fluent +@Immutable public final class RestorableSqlContainerProperties implements JsonSerializable { /* * The resource of an Azure Cosmos DB SQL container event @@ -25,7 +25,7 @@ public final class RestorableSqlContainerProperties implements JsonSerializable< /** * Creates an instance of RestorableSqlContainerProperties class. */ - public RestorableSqlContainerProperties() { + private RestorableSqlContainerProperties() { } /** @@ -37,17 +37,6 @@ public RestorableSqlContainerPropertiesResource resource() { return this.resource; } - /** - * Set the resource property: The resource of an Azure Cosmos DB SQL container event. - * - * @param resource the resource value to set. - * @return the RestorableSqlContainerProperties object itself. - */ - public RestorableSqlContainerProperties withResource(RestorableSqlContainerPropertiesResource resource) { - this.resource = resource; - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlDatabaseGetResultInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlDatabaseGetResultInner.java index 5d76b742a06c..1e54510546b0 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlDatabaseGetResultInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlDatabaseGetResultInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * An Azure Cosmos DB SQL database event. */ -@Fluent +@Immutable public final class RestorableSqlDatabaseGetResultInner implements JsonSerializable { /* @@ -41,7 +41,7 @@ public final class RestorableSqlDatabaseGetResultInner /** * Creates an instance of RestorableSqlDatabaseGetResultInner class. */ - public RestorableSqlDatabaseGetResultInner() { + private RestorableSqlDatabaseGetResultInner() { } /** @@ -89,20 +89,6 @@ public RestorableSqlDatabasePropertiesResource resource() { return this.innerProperties() == null ? null : this.innerProperties().resource(); } - /** - * Set the resource property: The resource of an Azure Cosmos DB SQL database event. - * - * @param resource the resource value to set. - * @return the RestorableSqlDatabaseGetResultInner object itself. - */ - public RestorableSqlDatabaseGetResultInner withResource(RestorableSqlDatabasePropertiesResource resource) { - if (this.innerProperties() == null) { - this.innerProperties = new RestorableSqlDatabaseProperties(); - } - this.innerProperties().withResource(resource); - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlDatabaseProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlDatabaseProperties.java index cfff9fcb044a..4599c9a15b39 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlDatabaseProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlDatabaseProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The properties of an Azure Cosmos DB SQL database event. */ -@Fluent +@Immutable public final class RestorableSqlDatabaseProperties implements JsonSerializable { /* * The resource of an Azure Cosmos DB SQL database event @@ -25,7 +25,7 @@ public final class RestorableSqlDatabaseProperties implements JsonSerializable { /* @@ -46,7 +46,7 @@ public final class RestorableSqlResourcesGetResultInner /** * Creates an instance of RestorableSqlResourcesGetResultInner class. */ - public RestorableSqlResourcesGetResultInner() { + private RestorableSqlResourcesGetResultInner() { } /** @@ -85,17 +85,6 @@ public String databaseName() { return this.databaseName; } - /** - * Set the databaseName property: The name of the database available for restore. - * - * @param databaseName the databaseName value to set. - * @return the RestorableSqlResourcesGetResultInner object itself. - */ - public RestorableSqlResourcesGetResultInner withDatabaseName(String databaseName) { - this.databaseName = databaseName; - return this; - } - /** * Get the collectionNames property: The names of the collections available for restore. * @@ -105,17 +94,6 @@ public List collectionNames() { return this.collectionNames; } - /** - * Set the collectionNames property: The names of the collections available for restore. - * - * @param collectionNames the collectionNames value to set. - * @return the RestorableSqlResourcesGetResultInner object itself. - */ - public RestorableSqlResourcesGetResultInner withCollectionNames(List collectionNames) { - this.collectionNames = collectionNames; - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableTableGetResultInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableTableGetResultInner.java index 49c0eab8a41e..336863babb84 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableTableGetResultInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableTableGetResultInner.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * An Azure Cosmos DB Table event. */ -@Fluent +@Immutable public final class RestorableTableGetResultInner implements JsonSerializable { /* * The properties of a Table event. @@ -40,7 +40,7 @@ public final class RestorableTableGetResultInner implements JsonSerializable { /* * The resource of an Azure Cosmos DB Table event @@ -25,7 +25,7 @@ public final class RestorableTableProperties implements JsonSerializable { + /* + * The standard JSON format of a resource throughput + */ + private RetrieveThroughputPropertiesResource resource; + + /** + * Creates an instance of RetrieveThroughputProperties class. + */ + public RetrieveThroughputProperties() { + } + + /** + * Get the resource property: The standard JSON format of a resource throughput. + * + * @return the resource value. + */ + public RetrieveThroughputPropertiesResource resource() { + return this.resource; + } + + /** + * Set the resource property: The standard JSON format of a resource throughput. + * + * @param resource the resource value to set. + * @return the RetrieveThroughputProperties object itself. + */ + public RetrieveThroughputProperties withResource(RetrieveThroughputPropertiesResource resource) { + this.resource = resource; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (resource() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property resource in model RetrieveThroughputProperties")); + } else { + resource().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RetrieveThroughputProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("resource", this.resource); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RetrieveThroughputProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RetrieveThroughputProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RetrieveThroughputProperties. + */ + public static RetrieveThroughputProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RetrieveThroughputProperties deserializedRetrieveThroughputProperties = new RetrieveThroughputProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("resource".equals(fieldName)) { + deserializedRetrieveThroughputProperties.resource + = RetrieveThroughputPropertiesResource.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRetrieveThroughputProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ServiceResourceInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ServiceResourceInner.java index 8360d0c3e548..b6b1755c9ebd 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ServiceResourceInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ServiceResourceInner.java @@ -1,27 +1,33 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cosmos.models.ArmProxyResource; import com.azure.resourcemanager.cosmos.models.ServiceResourceProperties; import java.io.IOException; /** * Properties for the database account. */ -@Fluent -public final class ServiceResourceInner extends ArmProxyResource { +@Immutable +public final class ServiceResourceInner extends ProxyResource { /* * Services response resource. */ private ServiceResourceProperties properties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -40,7 +46,7 @@ public final class ServiceResourceInner extends ArmProxyResource { /** * Creates an instance of ServiceResourceInner class. */ - public ServiceResourceInner() { + private ServiceResourceInner() { } /** @@ -53,14 +59,12 @@ public ServiceResourceProperties properties() { } /** - * Set the properties property: Services response resource. + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. * - * @param properties the properties value to set. - * @return the ServiceResourceInner object itself. + * @return the systemData value. */ - public ServiceResourceInner withProperties(ServiceResourceProperties properties) { - this.properties = properties; - return this; + public SystemData systemData() { + return this.systemData; } /** @@ -98,7 +102,6 @@ public String id() { * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (properties() != null) { properties().validate(); @@ -139,6 +142,8 @@ public static ServiceResourceInner fromJson(JsonReader jsonReader) throws IOExce deserializedServiceResourceInner.type = reader.getString(); } else if ("properties".equals(fieldName)) { deserializedServiceResourceInner.properties = ServiceResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedServiceResourceInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlContainerCreateUpdateProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlContainerCreateUpdateProperties.java index 0b19194af21b..4f52c5c31a77 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlContainerCreateUpdateProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlContainerCreateUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlContainerGetProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlContainerGetProperties.java index 9bc3d4f33c90..eae2fa2c7b2a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlContainerGetProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlContainerGetProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The properties of an Azure Cosmos DB container. */ -@Fluent +@Immutable public final class SqlContainerGetProperties implements JsonSerializable { /* * The resource property. @@ -31,7 +31,7 @@ public final class SqlContainerGetProperties implements JsonSerializable tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Identity for the resource. + */ + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -42,7 +64,7 @@ public final class SqlContainerGetResultsInner extends ArmResourceProperties { /** * Creates an instance of SqlContainerGetResultsInner class. */ - public SqlContainerGetResultsInner() { + private SqlContainerGetResultsInner() { } /** @@ -54,6 +76,42 @@ private SqlContainerGetProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -84,24 +142,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public SqlContainerGetResultsInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SqlContainerGetResultsInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the resource property: The resource property. * @@ -111,20 +151,6 @@ public SqlContainerGetPropertiesResource resource() { return this.innerProperties() == null ? null : this.innerProperties().resource(); } - /** - * Set the resource property: The resource property. - * - * @param resource the resource value to set. - * @return the SqlContainerGetResultsInner object itself. - */ - public SqlContainerGetResultsInner withResource(SqlContainerGetPropertiesResource resource) { - if (this.innerProperties() == null) { - this.innerProperties = new SqlContainerGetProperties(); - } - this.innerProperties().withResource(resource); - return this; - } - /** * Get the options property: The options property. * @@ -134,30 +160,18 @@ public SqlContainerGetPropertiesOptions options() { return this.innerProperties() == null ? null : this.innerProperties().options(); } - /** - * Set the options property: The options property. - * - * @param options the options value to set. - * @return the SqlContainerGetResultsInner object itself. - */ - public SqlContainerGetResultsInner withOptions(SqlContainerGetPropertiesOptions options) { - if (this.innerProperties() == null) { - this.innerProperties = new SqlContainerGetProperties(); - } - this.innerProperties().withOptions(options); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() != null) { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } /** @@ -166,9 +180,10 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -194,14 +209,18 @@ public static SqlContainerGetResultsInner fromJson(JsonReader jsonReader) throws deserializedSqlContainerGetResultsInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedSqlContainerGetResultsInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedSqlContainerGetResultsInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedSqlContainerGetResultsInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedSqlContainerGetResultsInner.innerProperties = SqlContainerGetProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSqlContainerGetResultsInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedSqlContainerGetResultsInner.location = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedSqlContainerGetResultsInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSqlContainerGetResultsInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlDatabaseCreateUpdateProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlDatabaseCreateUpdateProperties.java index 63f092e3adb4..1db44560e226 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlDatabaseCreateUpdateProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlDatabaseCreateUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlDatabaseGetProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlDatabaseGetProperties.java index 0854ff1d4d22..f712473ec14a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlDatabaseGetProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlDatabaseGetProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The properties of an Azure Cosmos DB SQL database. */ -@Fluent +@Immutable public final class SqlDatabaseGetProperties implements JsonSerializable { /* * The resource property. @@ -31,7 +31,7 @@ public final class SqlDatabaseGetProperties implements JsonSerializable tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Identity for the resource. + */ + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -42,7 +64,7 @@ public final class SqlDatabaseGetResultsInner extends ArmResourceProperties { /** * Creates an instance of SqlDatabaseGetResultsInner class. */ - public SqlDatabaseGetResultsInner() { + private SqlDatabaseGetResultsInner() { } /** @@ -54,6 +76,42 @@ private SqlDatabaseGetProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -84,24 +142,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public SqlDatabaseGetResultsInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SqlDatabaseGetResultsInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the resource property: The resource property. * @@ -111,20 +151,6 @@ public SqlDatabaseGetPropertiesResource resource() { return this.innerProperties() == null ? null : this.innerProperties().resource(); } - /** - * Set the resource property: The resource property. - * - * @param resource the resource value to set. - * @return the SqlDatabaseGetResultsInner object itself. - */ - public SqlDatabaseGetResultsInner withResource(SqlDatabaseGetPropertiesResource resource) { - if (this.innerProperties() == null) { - this.innerProperties = new SqlDatabaseGetProperties(); - } - this.innerProperties().withResource(resource); - return this; - } - /** * Get the options property: The options property. * @@ -134,30 +160,18 @@ public SqlDatabaseGetPropertiesOptions options() { return this.innerProperties() == null ? null : this.innerProperties().options(); } - /** - * Set the options property: The options property. - * - * @param options the options value to set. - * @return the SqlDatabaseGetResultsInner object itself. - */ - public SqlDatabaseGetResultsInner withOptions(SqlDatabaseGetPropertiesOptions options) { - if (this.innerProperties() == null) { - this.innerProperties = new SqlDatabaseGetProperties(); - } - this.innerProperties().withOptions(options); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() != null) { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } /** @@ -166,9 +180,10 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -194,13 +209,17 @@ public static SqlDatabaseGetResultsInner fromJson(JsonReader jsonReader) throws deserializedSqlDatabaseGetResultsInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedSqlDatabaseGetResultsInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedSqlDatabaseGetResultsInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedSqlDatabaseGetResultsInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedSqlDatabaseGetResultsInner.innerProperties = SqlDatabaseGetProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSqlDatabaseGetResultsInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedSqlDatabaseGetResultsInner.location = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedSqlDatabaseGetResultsInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSqlDatabaseGetResultsInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlRoleAssignmentGetResultsInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlRoleAssignmentGetResultsInner.java index 0aa4049297c7..5ca2b6020a44 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlRoleAssignmentGetResultsInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlRoleAssignmentGetResultsInner.java @@ -1,26 +1,32 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cosmos.models.ArmProxyResource; import java.io.IOException; /** * An Azure Cosmos DB Role Assignment. */ -@Fluent -public final class SqlRoleAssignmentGetResultsInner extends ArmProxyResource { +@Immutable +public final class SqlRoleAssignmentGetResultsInner extends ProxyResource { /* * Properties related to the Role Assignment. */ private SqlRoleAssignmentResource innerProperties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -39,7 +45,7 @@ public final class SqlRoleAssignmentGetResultsInner extends ArmProxyResource { /** * Creates an instance of SqlRoleAssignmentGetResultsInner class. */ - public SqlRoleAssignmentGetResultsInner() { + private SqlRoleAssignmentGetResultsInner() { } /** @@ -51,6 +57,15 @@ private SqlRoleAssignmentResource innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -90,20 +105,6 @@ public String roleDefinitionId() { return this.innerProperties() == null ? null : this.innerProperties().roleDefinitionId(); } - /** - * Set the roleDefinitionId property: The unique identifier for the associated Role Definition. - * - * @param roleDefinitionId the roleDefinitionId value to set. - * @return the SqlRoleAssignmentGetResultsInner object itself. - */ - public SqlRoleAssignmentGetResultsInner withRoleDefinitionId(String roleDefinitionId) { - if (this.innerProperties() == null) { - this.innerProperties = new SqlRoleAssignmentResource(); - } - this.innerProperties().withRoleDefinitionId(roleDefinitionId); - return this; - } - /** * Get the scope property: The data plane resource path for which access is being granted through this Role * Assignment. @@ -114,21 +115,6 @@ public String scope() { return this.innerProperties() == null ? null : this.innerProperties().scope(); } - /** - * Set the scope property: The data plane resource path for which access is being granted through this Role - * Assignment. - * - * @param scope the scope value to set. - * @return the SqlRoleAssignmentGetResultsInner object itself. - */ - public SqlRoleAssignmentGetResultsInner withScope(String scope) { - if (this.innerProperties() == null) { - this.innerProperties = new SqlRoleAssignmentResource(); - } - this.innerProperties().withScope(scope); - return this; - } - /** * Get the principalId property: The unique identifier for the associated AAD principal in the AAD graph to which * access is being granted through this Role Assignment. Tenant ID for the principal is inferred using the tenant @@ -140,28 +126,11 @@ public String principalId() { return this.innerProperties() == null ? null : this.innerProperties().principalId(); } - /** - * Set the principalId property: The unique identifier for the associated AAD principal in the AAD graph to which - * access is being granted through this Role Assignment. Tenant ID for the principal is inferred using the tenant - * associated with the subscription. - * - * @param principalId the principalId value to set. - * @return the SqlRoleAssignmentGetResultsInner object itself. - */ - public SqlRoleAssignmentGetResultsInner withPrincipalId(String principalId) { - if (this.innerProperties() == null) { - this.innerProperties = new SqlRoleAssignmentResource(); - } - this.innerProperties().withPrincipalId(principalId); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() != null) { innerProperties().validate(); @@ -204,6 +173,8 @@ public static SqlRoleAssignmentGetResultsInner fromJson(JsonReader jsonReader) t } else if ("properties".equals(fieldName)) { deserializedSqlRoleAssignmentGetResultsInner.innerProperties = SqlRoleAssignmentResource.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSqlRoleAssignmentGetResultsInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlRoleAssignmentResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlRoleAssignmentResource.java index 43120100c12b..c48eb0307236 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlRoleAssignmentResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlRoleAssignmentResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlRoleDefinitionGetResultsInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlRoleDefinitionGetResultsInner.java index de38214b4f2b..c502abd90bbf 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlRoleDefinitionGetResultsInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlRoleDefinitionGetResultsInner.java @@ -1,14 +1,15 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cosmos.models.ArmProxyResource; import com.azure.resourcemanager.cosmos.models.Permission; import com.azure.resourcemanager.cosmos.models.RoleDefinitionType; import java.io.IOException; @@ -17,13 +18,18 @@ /** * An Azure Cosmos DB SQL Role Definition. */ -@Fluent -public final class SqlRoleDefinitionGetResultsInner extends ArmProxyResource { +@Immutable +public final class SqlRoleDefinitionGetResultsInner extends ProxyResource { /* * Properties related to the Role Definition. */ private SqlRoleDefinitionResource innerProperties; + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -42,7 +48,7 @@ public final class SqlRoleDefinitionGetResultsInner extends ArmProxyResource { /** * Creates an instance of SqlRoleDefinitionGetResultsInner class. */ - public SqlRoleDefinitionGetResultsInner() { + private SqlRoleDefinitionGetResultsInner() { } /** @@ -54,6 +60,15 @@ private SqlRoleDefinitionResource innerProperties() { return this.innerProperties; } + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -93,20 +108,6 @@ public String roleName() { return this.innerProperties() == null ? null : this.innerProperties().roleName(); } - /** - * Set the roleName property: A user-friendly name for the Role Definition. Must be unique for the database account. - * - * @param roleName the roleName value to set. - * @return the SqlRoleDefinitionGetResultsInner object itself. - */ - public SqlRoleDefinitionGetResultsInner withRoleName(String roleName) { - if (this.innerProperties() == null) { - this.innerProperties = new SqlRoleDefinitionResource(); - } - this.innerProperties().withRoleName(roleName); - return this; - } - /** * Get the type property: Indicates whether the Role Definition was built-in or user created. * @@ -116,20 +117,6 @@ public RoleDefinitionType typePropertiesType() { return this.innerProperties() == null ? null : this.innerProperties().type(); } - /** - * Set the type property: Indicates whether the Role Definition was built-in or user created. - * - * @param type the type value to set. - * @return the SqlRoleDefinitionGetResultsInner object itself. - */ - public SqlRoleDefinitionGetResultsInner withTypePropertiesType(RoleDefinitionType type) { - if (this.innerProperties() == null) { - this.innerProperties = new SqlRoleDefinitionResource(); - } - this.innerProperties().withType(type); - return this; - } - /** * Get the assignableScopes property: A set of fully qualified Scopes at or below which Role Assignments may be * created using this Role Definition. This will allow application of this Role Definition on the entire database @@ -143,24 +130,6 @@ public List assignableScopes() { return this.innerProperties() == null ? null : this.innerProperties().assignableScopes(); } - /** - * Set the assignableScopes property: A set of fully qualified Scopes at or below which Role Assignments may be - * created using this Role Definition. This will allow application of this Role Definition on the entire database - * account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database - * account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not - * exist. - * - * @param assignableScopes the assignableScopes value to set. - * @return the SqlRoleDefinitionGetResultsInner object itself. - */ - public SqlRoleDefinitionGetResultsInner withAssignableScopes(List assignableScopes) { - if (this.innerProperties() == null) { - this.innerProperties = new SqlRoleDefinitionResource(); - } - this.innerProperties().withAssignableScopes(assignableScopes); - return this; - } - /** * Get the permissions property: The set of operations allowed through this Role Definition. * @@ -170,26 +139,11 @@ public List permissions() { return this.innerProperties() == null ? null : this.innerProperties().permissions(); } - /** - * Set the permissions property: The set of operations allowed through this Role Definition. - * - * @param permissions the permissions value to set. - * @return the SqlRoleDefinitionGetResultsInner object itself. - */ - public SqlRoleDefinitionGetResultsInner withPermissions(List permissions) { - if (this.innerProperties() == null) { - this.innerProperties = new SqlRoleDefinitionResource(); - } - this.innerProperties().withPermissions(permissions); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() != null) { innerProperties().validate(); @@ -232,6 +186,8 @@ public static SqlRoleDefinitionGetResultsInner fromJson(JsonReader jsonReader) t } else if ("properties".equals(fieldName)) { deserializedSqlRoleDefinitionGetResultsInner.innerProperties = SqlRoleDefinitionResource.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSqlRoleDefinitionGetResultsInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlRoleDefinitionResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlRoleDefinitionResource.java index 70a547e66893..e8466bbab248 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlRoleDefinitionResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlRoleDefinitionResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlStoredProcedureCreateUpdateProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlStoredProcedureCreateUpdateProperties.java index 333f4de2d1ac..4f9ab29aa7b8 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlStoredProcedureCreateUpdateProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlStoredProcedureCreateUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlStoredProcedureGetProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlStoredProcedureGetProperties.java index 8479682b9293..c219673861ee 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlStoredProcedureGetProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlStoredProcedureGetProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The properties of an Azure Cosmos DB StoredProcedure. */ -@Fluent +@Immutable public final class SqlStoredProcedureGetProperties implements JsonSerializable { /* * The resource property. @@ -25,7 +25,7 @@ public final class SqlStoredProcedureGetProperties implements JsonSerializable tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Identity for the resource. + */ + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -41,7 +63,7 @@ public final class SqlStoredProcedureGetResultsInner extends ArmResourceProperti /** * Creates an instance of SqlStoredProcedureGetResultsInner class. */ - public SqlStoredProcedureGetResultsInner() { + private SqlStoredProcedureGetResultsInner() { } /** @@ -53,6 +75,42 @@ private SqlStoredProcedureGetProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -83,24 +141,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public SqlStoredProcedureGetResultsInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SqlStoredProcedureGetResultsInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the resource property: The resource property. * @@ -110,30 +150,18 @@ public SqlStoredProcedureGetPropertiesResource resource() { return this.innerProperties() == null ? null : this.innerProperties().resource(); } - /** - * Set the resource property: The resource property. - * - * @param resource the resource value to set. - * @return the SqlStoredProcedureGetResultsInner object itself. - */ - public SqlStoredProcedureGetResultsInner withResource(SqlStoredProcedureGetPropertiesResource resource) { - if (this.innerProperties() == null) { - this.innerProperties = new SqlStoredProcedureGetProperties(); - } - this.innerProperties().withResource(resource); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() != null) { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } /** @@ -142,9 +170,10 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -171,14 +200,18 @@ public static SqlStoredProcedureGetResultsInner fromJson(JsonReader jsonReader) deserializedSqlStoredProcedureGetResultsInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedSqlStoredProcedureGetResultsInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedSqlStoredProcedureGetResultsInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedSqlStoredProcedureGetResultsInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedSqlStoredProcedureGetResultsInner.innerProperties = SqlStoredProcedureGetProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSqlStoredProcedureGetResultsInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedSqlStoredProcedureGetResultsInner.location = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedSqlStoredProcedureGetResultsInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSqlStoredProcedureGetResultsInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlTriggerCreateUpdateProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlTriggerCreateUpdateProperties.java index f55c7253f2ce..f59e0b528578 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlTriggerCreateUpdateProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlTriggerCreateUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlTriggerGetProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlTriggerGetProperties.java index 131378d5e30e..ca16f8fc7be8 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlTriggerGetProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlTriggerGetProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The properties of an Azure Cosmos DB trigger. */ -@Fluent +@Immutable public final class SqlTriggerGetProperties implements JsonSerializable { /* * The resource property. @@ -25,7 +25,7 @@ public final class SqlTriggerGetProperties implements JsonSerializable tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Identity for the resource. + */ + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -41,7 +63,7 @@ public final class SqlTriggerGetResultsInner extends ArmResourceProperties { /** * Creates an instance of SqlTriggerGetResultsInner class. */ - public SqlTriggerGetResultsInner() { + private SqlTriggerGetResultsInner() { } /** @@ -53,6 +75,42 @@ private SqlTriggerGetProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -83,24 +141,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public SqlTriggerGetResultsInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SqlTriggerGetResultsInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the resource property: The resource property. * @@ -110,30 +150,18 @@ public SqlTriggerGetPropertiesResource resource() { return this.innerProperties() == null ? null : this.innerProperties().resource(); } - /** - * Set the resource property: The resource property. - * - * @param resource the resource value to set. - * @return the SqlTriggerGetResultsInner object itself. - */ - public SqlTriggerGetResultsInner withResource(SqlTriggerGetPropertiesResource resource) { - if (this.innerProperties() == null) { - this.innerProperties = new SqlTriggerGetProperties(); - } - this.innerProperties().withResource(resource); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() != null) { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } /** @@ -142,9 +170,10 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -170,13 +199,17 @@ public static SqlTriggerGetResultsInner fromJson(JsonReader jsonReader) throws I deserializedSqlTriggerGetResultsInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedSqlTriggerGetResultsInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedSqlTriggerGetResultsInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedSqlTriggerGetResultsInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedSqlTriggerGetResultsInner.innerProperties = SqlTriggerGetProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSqlTriggerGetResultsInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedSqlTriggerGetResultsInner.location = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedSqlTriggerGetResultsInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSqlTriggerGetResultsInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlUserDefinedFunctionCreateUpdateProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlUserDefinedFunctionCreateUpdateProperties.java index 940c9e4acb8f..08bdda9b10cb 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlUserDefinedFunctionCreateUpdateProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlUserDefinedFunctionCreateUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlUserDefinedFunctionGetProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlUserDefinedFunctionGetProperties.java index 0257a5ae3e5d..aecd8ff5a4ce 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlUserDefinedFunctionGetProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlUserDefinedFunctionGetProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The properties of an Azure Cosmos DB userDefinedFunction. */ -@Fluent +@Immutable public final class SqlUserDefinedFunctionGetProperties implements JsonSerializable { /* @@ -26,7 +26,7 @@ public final class SqlUserDefinedFunctionGetProperties /** * Creates an instance of SqlUserDefinedFunctionGetProperties class. */ - public SqlUserDefinedFunctionGetProperties() { + private SqlUserDefinedFunctionGetProperties() { } /** @@ -38,17 +38,6 @@ public SqlUserDefinedFunctionGetPropertiesResource resource() { return this.resource; } - /** - * Set the resource property: The resource property. - * - * @param resource the resource value to set. - * @return the SqlUserDefinedFunctionGetProperties object itself. - */ - public SqlUserDefinedFunctionGetProperties withResource(SqlUserDefinedFunctionGetPropertiesResource resource) { - this.resource = resource; - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlUserDefinedFunctionGetResultsInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlUserDefinedFunctionGetResultsInner.java index 3fe9866c34d2..4a332503480c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlUserDefinedFunctionGetResultsInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlUserDefinedFunctionGetResultsInner.java @@ -1,14 +1,16 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; -import com.azure.resourcemanager.cosmos.models.ArmResourceProperties; +import com.azure.resourcemanager.cosmos.models.ManagedServiceIdentity; import com.azure.resourcemanager.cosmos.models.SqlUserDefinedFunctionGetPropertiesResource; import java.io.IOException; import java.util.Map; @@ -16,13 +18,33 @@ /** * An Azure Cosmos DB userDefinedFunction. */ -@Fluent -public final class SqlUserDefinedFunctionGetResultsInner extends ArmResourceProperties { +@Immutable +public final class SqlUserDefinedFunctionGetResultsInner extends ProxyResource { /* * The properties of an Azure Cosmos DB userDefinedFunction */ private SqlUserDefinedFunctionGetProperties innerProperties; + /* + * Resource tags. + */ + private Map tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Identity for the resource. + */ + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -41,7 +63,7 @@ public final class SqlUserDefinedFunctionGetResultsInner extends ArmResourceProp /** * Creates an instance of SqlUserDefinedFunctionGetResultsInner class. */ - public SqlUserDefinedFunctionGetResultsInner() { + private SqlUserDefinedFunctionGetResultsInner() { } /** @@ -53,6 +75,42 @@ private SqlUserDefinedFunctionGetProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -83,24 +141,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public SqlUserDefinedFunctionGetResultsInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SqlUserDefinedFunctionGetResultsInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the resource property: The resource property. * @@ -110,30 +150,18 @@ public SqlUserDefinedFunctionGetPropertiesResource resource() { return this.innerProperties() == null ? null : this.innerProperties().resource(); } - /** - * Set the resource property: The resource property. - * - * @param resource the resource value to set. - * @return the SqlUserDefinedFunctionGetResultsInner object itself. - */ - public SqlUserDefinedFunctionGetResultsInner withResource(SqlUserDefinedFunctionGetPropertiesResource resource) { - if (this.innerProperties() == null) { - this.innerProperties = new SqlUserDefinedFunctionGetProperties(); - } - this.innerProperties().withResource(resource); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() != null) { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } /** @@ -142,9 +170,10 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -171,14 +200,19 @@ public static SqlUserDefinedFunctionGetResultsInner fromJson(JsonReader jsonRead deserializedSqlUserDefinedFunctionGetResultsInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedSqlUserDefinedFunctionGetResultsInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedSqlUserDefinedFunctionGetResultsInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedSqlUserDefinedFunctionGetResultsInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedSqlUserDefinedFunctionGetResultsInner.innerProperties = SqlUserDefinedFunctionGetProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedSqlUserDefinedFunctionGetResultsInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedSqlUserDefinedFunctionGetResultsInner.location = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedSqlUserDefinedFunctionGetResultsInner.identity + = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedSqlUserDefinedFunctionGetResultsInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableCreateUpdateProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableCreateUpdateProperties.java index 8ea785be8334..da673dc8ddc1 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableCreateUpdateProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableCreateUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableGetProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableGetProperties.java index 6c8cee4bae2d..de4d3545d98b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableGetProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableGetProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The properties of an Azure Cosmos Table. */ -@Fluent +@Immutable public final class TableGetProperties implements JsonSerializable { /* * The resource property. @@ -31,7 +31,7 @@ public final class TableGetProperties implements JsonSerializable tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Identity for the resource. + */ + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -42,7 +64,7 @@ public final class TableGetResultsInner extends ArmResourceProperties { /** * Creates an instance of TableGetResultsInner class. */ - public TableGetResultsInner() { + private TableGetResultsInner() { } /** @@ -54,6 +76,42 @@ private TableGetProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -84,24 +142,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public TableGetResultsInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public TableGetResultsInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the resource property: The resource property. * @@ -111,20 +151,6 @@ public TableGetPropertiesResource resource() { return this.innerProperties() == null ? null : this.innerProperties().resource(); } - /** - * Set the resource property: The resource property. - * - * @param resource the resource value to set. - * @return the TableGetResultsInner object itself. - */ - public TableGetResultsInner withResource(TableGetPropertiesResource resource) { - if (this.innerProperties() == null) { - this.innerProperties = new TableGetProperties(); - } - this.innerProperties().withResource(resource); - return this; - } - /** * Get the options property: The options property. * @@ -134,30 +160,18 @@ public TableGetPropertiesOptions options() { return this.innerProperties() == null ? null : this.innerProperties().options(); } - /** - * Set the options property: The options property. - * - * @param options the options value to set. - * @return the TableGetResultsInner object itself. - */ - public TableGetResultsInner withOptions(TableGetPropertiesOptions options) { - if (this.innerProperties() == null) { - this.innerProperties = new TableGetProperties(); - } - this.innerProperties().withOptions(options); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() != null) { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } /** @@ -166,9 +180,10 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -194,13 +209,17 @@ public static TableGetResultsInner fromJson(JsonReader jsonReader) throws IOExce deserializedTableGetResultsInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedTableGetResultsInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedTableGetResultsInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedTableGetResultsInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedTableGetResultsInner.innerProperties = TableGetProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedTableGetResultsInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedTableGetResultsInner.location = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedTableGetResultsInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedTableGetResultsInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableRoleAssignmentResourceInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableRoleAssignmentResourceInner.java new file mode 100644 index 000000000000..f2a3e423684c --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableRoleAssignmentResourceInner.java @@ -0,0 +1,240 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Parameters to create and update an Azure Cosmos DB Table Role Assignment. + */ +@Fluent +public final class TableRoleAssignmentResourceInner extends ProxyResource { + /* + * Properties to create and update an Azure Cosmos DB Table Role Assignment. + */ + private TableRoleAssignmentResourceProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of TableRoleAssignmentResourceInner class. + */ + public TableRoleAssignmentResourceInner() { + } + + /** + * Get the innerProperties property: Properties to create and update an Azure Cosmos DB Table Role Assignment. + * + * @return the innerProperties value. + */ + private TableRoleAssignmentResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the roleDefinitionId property: The unique identifier for the associated Role Definition. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.innerProperties() == null ? null : this.innerProperties().roleDefinitionId(); + } + + /** + * Set the roleDefinitionId property: The unique identifier for the associated Role Definition. + * + * @param roleDefinitionId the roleDefinitionId value to set. + * @return the TableRoleAssignmentResourceInner object itself. + */ + public TableRoleAssignmentResourceInner withRoleDefinitionId(String roleDefinitionId) { + if (this.innerProperties() == null) { + this.innerProperties = new TableRoleAssignmentResourceProperties(); + } + this.innerProperties().withRoleDefinitionId(roleDefinitionId); + return this; + } + + /** + * Get the scope property: The data plane resource path for which access is being granted through this Table Role + * Assignment. + * + * @return the scope value. + */ + public String scope() { + return this.innerProperties() == null ? null : this.innerProperties().scope(); + } + + /** + * Set the scope property: The data plane resource path for which access is being granted through this Table Role + * Assignment. + * + * @param scope the scope value to set. + * @return the TableRoleAssignmentResourceInner object itself. + */ + public TableRoleAssignmentResourceInner withScope(String scope) { + if (this.innerProperties() == null) { + this.innerProperties = new TableRoleAssignmentResourceProperties(); + } + this.innerProperties().withScope(scope); + return this; + } + + /** + * Get the principalId property: The unique identifier for the associated AAD principal in the AAD graph to which + * access is being granted through this Table Role Assignment. Tenant ID for the principal is inferred using the + * tenant associated with the subscription. + * + * @return the principalId value. + */ + public String principalId() { + return this.innerProperties() == null ? null : this.innerProperties().principalId(); + } + + /** + * Set the principalId property: The unique identifier for the associated AAD principal in the AAD graph to which + * access is being granted through this Table Role Assignment. Tenant ID for the principal is inferred using the + * tenant associated with the subscription. + * + * @param principalId the principalId value to set. + * @return the TableRoleAssignmentResourceInner object itself. + */ + public TableRoleAssignmentResourceInner withPrincipalId(String principalId) { + if (this.innerProperties() == null) { + this.innerProperties = new TableRoleAssignmentResourceProperties(); + } + this.innerProperties().withPrincipalId(principalId); + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TableRoleAssignmentResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TableRoleAssignmentResourceInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TableRoleAssignmentResourceInner. + */ + public static TableRoleAssignmentResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TableRoleAssignmentResourceInner deserializedTableRoleAssignmentResourceInner + = new TableRoleAssignmentResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedTableRoleAssignmentResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedTableRoleAssignmentResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedTableRoleAssignmentResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedTableRoleAssignmentResourceInner.innerProperties + = TableRoleAssignmentResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedTableRoleAssignmentResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTableRoleAssignmentResourceInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableRoleAssignmentResourceProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableRoleAssignmentResourceProperties.java new file mode 100644 index 000000000000..afdfd8edb88c --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableRoleAssignmentResourceProperties.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Azure Cosmos DB Table Role Assignment resource object. + */ +@Fluent +public final class TableRoleAssignmentResourceProperties + implements JsonSerializable { + /* + * The unique identifier for the associated Role Definition. + */ + private String roleDefinitionId; + + /* + * The data plane resource path for which access is being granted through this Table Role Assignment. + */ + private String scope; + + /* + * The unique identifier for the associated AAD principal in the AAD graph to which access is being granted through + * this Table Role Assignment. Tenant ID for the principal is inferred using the tenant associated with the + * subscription. + */ + private String principalId; + + /* + * Provisioning state of the resource. + */ + private String provisioningState; + + /** + * Creates an instance of TableRoleAssignmentResourceProperties class. + */ + public TableRoleAssignmentResourceProperties() { + } + + /** + * Get the roleDefinitionId property: The unique identifier for the associated Role Definition. + * + * @return the roleDefinitionId value. + */ + public String roleDefinitionId() { + return this.roleDefinitionId; + } + + /** + * Set the roleDefinitionId property: The unique identifier for the associated Role Definition. + * + * @param roleDefinitionId the roleDefinitionId value to set. + * @return the TableRoleAssignmentResourceProperties object itself. + */ + public TableRoleAssignmentResourceProperties withRoleDefinitionId(String roleDefinitionId) { + this.roleDefinitionId = roleDefinitionId; + return this; + } + + /** + * Get the scope property: The data plane resource path for which access is being granted through this Table Role + * Assignment. + * + * @return the scope value. + */ + public String scope() { + return this.scope; + } + + /** + * Set the scope property: The data plane resource path for which access is being granted through this Table Role + * Assignment. + * + * @param scope the scope value to set. + * @return the TableRoleAssignmentResourceProperties object itself. + */ + public TableRoleAssignmentResourceProperties withScope(String scope) { + this.scope = scope; + return this; + } + + /** + * Get the principalId property: The unique identifier for the associated AAD principal in the AAD graph to which + * access is being granted through this Table Role Assignment. Tenant ID for the principal is inferred using the + * tenant associated with the subscription. + * + * @return the principalId value. + */ + public String principalId() { + return this.principalId; + } + + /** + * Set the principalId property: The unique identifier for the associated AAD principal in the AAD graph to which + * access is being granted through this Table Role Assignment. Tenant ID for the principal is inferred using the + * tenant associated with the subscription. + * + * @param principalId the principalId value to set. + * @return the TableRoleAssignmentResourceProperties object itself. + */ + public TableRoleAssignmentResourceProperties withPrincipalId(String principalId) { + this.principalId = principalId; + return this; + } + + /** + * Get the provisioningState property: Provisioning state of the resource. + * + * @return the provisioningState value. + */ + public String provisioningState() { + return this.provisioningState; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("roleDefinitionId", this.roleDefinitionId); + jsonWriter.writeStringField("scope", this.scope); + jsonWriter.writeStringField("principalId", this.principalId); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TableRoleAssignmentResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TableRoleAssignmentResourceProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TableRoleAssignmentResourceProperties. + */ + public static TableRoleAssignmentResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TableRoleAssignmentResourceProperties deserializedTableRoleAssignmentResourceProperties + = new TableRoleAssignmentResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("roleDefinitionId".equals(fieldName)) { + deserializedTableRoleAssignmentResourceProperties.roleDefinitionId = reader.getString(); + } else if ("scope".equals(fieldName)) { + deserializedTableRoleAssignmentResourceProperties.scope = reader.getString(); + } else if ("principalId".equals(fieldName)) { + deserializedTableRoleAssignmentResourceProperties.principalId = reader.getString(); + } else if ("provisioningState".equals(fieldName)) { + deserializedTableRoleAssignmentResourceProperties.provisioningState = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTableRoleAssignmentResourceProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableRoleDefinitionResourceInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableRoleDefinitionResourceInner.java new file mode 100644 index 000000000000..39afbfa8ab18 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableRoleDefinitionResourceInner.java @@ -0,0 +1,282 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.Permission; +import com.azure.resourcemanager.cosmos.models.RoleDefinitionType; +import java.io.IOException; +import java.util.List; + +/** + * Parameters to create and update an Azure Cosmos DB Table Role Definition. + */ +@Fluent +public final class TableRoleDefinitionResourceInner extends ProxyResource { + /* + * Properties to create and update an Azure Cosmos DB Table Role Definition. + */ + private TableRoleDefinitionResourceProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of TableRoleDefinitionResourceInner class. + */ + public TableRoleDefinitionResourceInner() { + } + + /** + * Get the innerProperties property: Properties to create and update an Azure Cosmos DB Table Role Definition. + * + * @return the innerProperties value. + */ + private TableRoleDefinitionResourceProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the id property: The path id for the Role Definition. + * + * @return the id value. + */ + public String idPropertiesId() { + return this.innerProperties() == null ? null : this.innerProperties().id(); + } + + /** + * Set the id property: The path id for the Role Definition. + * + * @param id the id value to set. + * @return the TableRoleDefinitionResourceInner object itself. + */ + public TableRoleDefinitionResourceInner withIdPropertiesId(String id) { + if (this.innerProperties() == null) { + this.innerProperties = new TableRoleDefinitionResourceProperties(); + } + this.innerProperties().withId(id); + return this; + } + + /** + * Get the roleName property: A user-friendly name for the Role Definition. Must be unique for the database account. + * + * @return the roleName value. + */ + public String roleName() { + return this.innerProperties() == null ? null : this.innerProperties().roleName(); + } + + /** + * Set the roleName property: A user-friendly name for the Role Definition. Must be unique for the database account. + * + * @param roleName the roleName value to set. + * @return the TableRoleDefinitionResourceInner object itself. + */ + public TableRoleDefinitionResourceInner withRoleName(String roleName) { + if (this.innerProperties() == null) { + this.innerProperties = new TableRoleDefinitionResourceProperties(); + } + this.innerProperties().withRoleName(roleName); + return this; + } + + /** + * Get the type property: Indicates whether the Role Definition was built-in or user created. + * + * @return the type value. + */ + public RoleDefinitionType typePropertiesType() { + return this.innerProperties() == null ? null : this.innerProperties().type(); + } + + /** + * Set the type property: Indicates whether the Role Definition was built-in or user created. + * + * @param type the type value to set. + * @return the TableRoleDefinitionResourceInner object itself. + */ + public TableRoleDefinitionResourceInner withTypePropertiesType(RoleDefinitionType type) { + if (this.innerProperties() == null) { + this.innerProperties = new TableRoleDefinitionResourceProperties(); + } + this.innerProperties().withType(type); + return this; + } + + /** + * Get the assignableScopes property: A set of fully qualified Scopes at or below which Table Role Assignments may + * be created using this Role Definition. This will allow application of this Role Definition on the entire database + * account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database + * account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not + * exist. + * + * @return the assignableScopes value. + */ + public List assignableScopes() { + return this.innerProperties() == null ? null : this.innerProperties().assignableScopes(); + } + + /** + * Set the assignableScopes property: A set of fully qualified Scopes at or below which Table Role Assignments may + * be created using this Role Definition. This will allow application of this Role Definition on the entire database + * account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database + * account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not + * exist. + * + * @param assignableScopes the assignableScopes value to set. + * @return the TableRoleDefinitionResourceInner object itself. + */ + public TableRoleDefinitionResourceInner withAssignableScopes(List assignableScopes) { + if (this.innerProperties() == null) { + this.innerProperties = new TableRoleDefinitionResourceProperties(); + } + this.innerProperties().withAssignableScopes(assignableScopes); + return this; + } + + /** + * Get the permissions property: The set of operations allowed through this Role Definition. + * + * @return the permissions value. + */ + public List permissions() { + return this.innerProperties() == null ? null : this.innerProperties().permissions(); + } + + /** + * Set the permissions property: The set of operations allowed through this Role Definition. + * + * @param permissions the permissions value to set. + * @return the TableRoleDefinitionResourceInner object itself. + */ + public TableRoleDefinitionResourceInner withPermissions(List permissions) { + if (this.innerProperties() == null) { + this.innerProperties = new TableRoleDefinitionResourceProperties(); + } + this.innerProperties().withPermissions(permissions); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TableRoleDefinitionResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TableRoleDefinitionResourceInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TableRoleDefinitionResourceInner. + */ + public static TableRoleDefinitionResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TableRoleDefinitionResourceInner deserializedTableRoleDefinitionResourceInner + = new TableRoleDefinitionResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedTableRoleDefinitionResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedTableRoleDefinitionResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedTableRoleDefinitionResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedTableRoleDefinitionResourceInner.innerProperties + = TableRoleDefinitionResourceProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedTableRoleDefinitionResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedTableRoleDefinitionResourceInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableRoleDefinitionResourceProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableRoleDefinitionResourceProperties.java new file mode 100644 index 000000000000..ab03f008ad93 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableRoleDefinitionResourceProperties.java @@ -0,0 +1,228 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.Permission; +import com.azure.resourcemanager.cosmos.models.RoleDefinitionType; +import java.io.IOException; +import java.util.List; + +/** + * Azure Cosmos DB Table Role Definition resource object. + */ +@Fluent +public final class TableRoleDefinitionResourceProperties + implements JsonSerializable { + /* + * The path id for the Role Definition. + */ + private String id; + + /* + * A user-friendly name for the Role Definition. Must be unique for the database account. + */ + private String roleName; + + /* + * Indicates whether the Role Definition was built-in or user created. + */ + private RoleDefinitionType type; + + /* + * A set of fully qualified Scopes at or below which Table Role Assignments may be created using this Role + * Definition. This will allow application of this Role Definition on the entire database account or any underlying + * Database / Collection. Must have at least one element. Scopes higher than Database account are not enforceable as + * assignable Scopes. Note that resources referenced in assignable Scopes need not exist. + */ + private List assignableScopes; + + /* + * The set of operations allowed through this Role Definition. + */ + private List permissions; + + /** + * Creates an instance of TableRoleDefinitionResourceProperties class. + */ + public TableRoleDefinitionResourceProperties() { + } + + /** + * Get the id property: The path id for the Role Definition. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The path id for the Role Definition. + * + * @param id the id value to set. + * @return the TableRoleDefinitionResourceProperties object itself. + */ + public TableRoleDefinitionResourceProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the roleName property: A user-friendly name for the Role Definition. Must be unique for the database account. + * + * @return the roleName value. + */ + public String roleName() { + return this.roleName; + } + + /** + * Set the roleName property: A user-friendly name for the Role Definition. Must be unique for the database account. + * + * @param roleName the roleName value to set. + * @return the TableRoleDefinitionResourceProperties object itself. + */ + public TableRoleDefinitionResourceProperties withRoleName(String roleName) { + this.roleName = roleName; + return this; + } + + /** + * Get the type property: Indicates whether the Role Definition was built-in or user created. + * + * @return the type value. + */ + public RoleDefinitionType type() { + return this.type; + } + + /** + * Set the type property: Indicates whether the Role Definition was built-in or user created. + * + * @param type the type value to set. + * @return the TableRoleDefinitionResourceProperties object itself. + */ + public TableRoleDefinitionResourceProperties withType(RoleDefinitionType type) { + this.type = type; + return this; + } + + /** + * Get the assignableScopes property: A set of fully qualified Scopes at or below which Table Role Assignments may + * be created using this Role Definition. This will allow application of this Role Definition on the entire database + * account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database + * account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not + * exist. + * + * @return the assignableScopes value. + */ + public List assignableScopes() { + return this.assignableScopes; + } + + /** + * Set the assignableScopes property: A set of fully qualified Scopes at or below which Table Role Assignments may + * be created using this Role Definition. This will allow application of this Role Definition on the entire database + * account or any underlying Database / Collection. Must have at least one element. Scopes higher than Database + * account are not enforceable as assignable Scopes. Note that resources referenced in assignable Scopes need not + * exist. + * + * @param assignableScopes the assignableScopes value to set. + * @return the TableRoleDefinitionResourceProperties object itself. + */ + public TableRoleDefinitionResourceProperties withAssignableScopes(List assignableScopes) { + this.assignableScopes = assignableScopes; + return this; + } + + /** + * Get the permissions property: The set of operations allowed through this Role Definition. + * + * @return the permissions value. + */ + public List permissions() { + return this.permissions; + } + + /** + * Set the permissions property: The set of operations allowed through this Role Definition. + * + * @param permissions the permissions value to set. + * @return the TableRoleDefinitionResourceProperties object itself. + */ + public TableRoleDefinitionResourceProperties withPermissions(List permissions) { + this.permissions = permissions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (permissions() != null) { + permissions().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("roleName", this.roleName); + jsonWriter.writeStringField("type", this.type == null ? null : this.type.toString()); + jsonWriter.writeArrayField("assignableScopes", this.assignableScopes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("permissions", this.permissions, (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TableRoleDefinitionResourceProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TableRoleDefinitionResourceProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the TableRoleDefinitionResourceProperties. + */ + public static TableRoleDefinitionResourceProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TableRoleDefinitionResourceProperties deserializedTableRoleDefinitionResourceProperties + = new TableRoleDefinitionResourceProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedTableRoleDefinitionResourceProperties.id = reader.getString(); + } else if ("roleName".equals(fieldName)) { + deserializedTableRoleDefinitionResourceProperties.roleName = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedTableRoleDefinitionResourceProperties.type + = RoleDefinitionType.fromString(reader.getString()); + } else if ("assignableScopes".equals(fieldName)) { + List assignableScopes = reader.readArray(reader1 -> reader1.getString()); + deserializedTableRoleDefinitionResourceProperties.assignableScopes = assignableScopes; + } else if ("permissions".equals(fieldName)) { + List permissions = reader.readArray(reader1 -> Permission.fromJson(reader1)); + deserializedTableRoleDefinitionResourceProperties.permissions = permissions; + } else { + reader.skipChildren(); + } + } + + return deserializedTableRoleDefinitionResourceProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolAccountProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolAccountProperties.java new file mode 100644 index 000000000000..1af7ab51d1d5 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolAccountProperties.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.Status; +import java.io.IOException; + +/** + * An Azure Cosmos DB Global Database Account which is part of a Throughputpool. + */ +@Fluent +public final class ThroughputPoolAccountProperties implements JsonSerializable { + /* + * A provisioning state of the ThroughputPool Account. + */ + private Status provisioningState; + + /* + * The resource identifier of global database account in the throughputPool. + */ + private String accountResourceIdentifier; + + /* + * The location of global database account in the throughputPool. + */ + private String accountLocation; + + /* + * The instance id of global database account in the throughputPool. + */ + private String accountInstanceId; + + /** + * Creates an instance of ThroughputPoolAccountProperties class. + */ + public ThroughputPoolAccountProperties() { + } + + /** + * Get the provisioningState property: A provisioning state of the ThroughputPool Account. + * + * @return the provisioningState value. + */ + public Status provisioningState() { + return this.provisioningState; + } + + /** + * Get the accountResourceIdentifier property: The resource identifier of global database account in the + * throughputPool. + * + * @return the accountResourceIdentifier value. + */ + public String accountResourceIdentifier() { + return this.accountResourceIdentifier; + } + + /** + * Set the accountResourceIdentifier property: The resource identifier of global database account in the + * throughputPool. + * + * @param accountResourceIdentifier the accountResourceIdentifier value to set. + * @return the ThroughputPoolAccountProperties object itself. + */ + public ThroughputPoolAccountProperties withAccountResourceIdentifier(String accountResourceIdentifier) { + this.accountResourceIdentifier = accountResourceIdentifier; + return this; + } + + /** + * Get the accountLocation property: The location of global database account in the throughputPool. + * + * @return the accountLocation value. + */ + public String accountLocation() { + return this.accountLocation; + } + + /** + * Set the accountLocation property: The location of global database account in the throughputPool. + * + * @param accountLocation the accountLocation value to set. + * @return the ThroughputPoolAccountProperties object itself. + */ + public ThroughputPoolAccountProperties withAccountLocation(String accountLocation) { + this.accountLocation = accountLocation; + return this; + } + + /** + * Get the accountInstanceId property: The instance id of global database account in the throughputPool. + * + * @return the accountInstanceId value. + */ + public String accountInstanceId() { + return this.accountInstanceId; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("accountResourceIdentifier", this.accountResourceIdentifier); + jsonWriter.writeStringField("accountLocation", this.accountLocation); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ThroughputPoolAccountProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThroughputPoolAccountProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ThroughputPoolAccountProperties. + */ + public static ThroughputPoolAccountProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThroughputPoolAccountProperties deserializedThroughputPoolAccountProperties + = new ThroughputPoolAccountProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedThroughputPoolAccountProperties.provisioningState + = Status.fromString(reader.getString()); + } else if ("accountResourceIdentifier".equals(fieldName)) { + deserializedThroughputPoolAccountProperties.accountResourceIdentifier = reader.getString(); + } else if ("accountLocation".equals(fieldName)) { + deserializedThroughputPoolAccountProperties.accountLocation = reader.getString(); + } else if ("accountInstanceId".equals(fieldName)) { + deserializedThroughputPoolAccountProperties.accountInstanceId = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedThroughputPoolAccountProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolAccountResourceInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolAccountResourceInner.java new file mode 100644 index 000000000000..24436e9a10e6 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolAccountResourceInner.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.ProxyResource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.Status; +import java.io.IOException; + +/** + * An Azure Cosmos DB Throughputpool Account. + */ +@Fluent +public final class ThroughputPoolAccountResourceInner extends ProxyResource { + /* + * An Azure Cosmos DB Global Database Account which is part of a Throughputpool. + */ + private ThroughputPoolAccountProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ThroughputPoolAccountResourceInner class. + */ + public ThroughputPoolAccountResourceInner() { + } + + /** + * Get the innerProperties property: An Azure Cosmos DB Global Database Account which is part of a Throughputpool. + * + * @return the innerProperties value. + */ + private ThroughputPoolAccountProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Get the provisioningState property: A provisioning state of the ThroughputPool Account. + * + * @return the provisioningState value. + */ + public Status provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Get the accountResourceIdentifier property: The resource identifier of global database account in the + * throughputPool. + * + * @return the accountResourceIdentifier value. + */ + public String accountResourceIdentifier() { + return this.innerProperties() == null ? null : this.innerProperties().accountResourceIdentifier(); + } + + /** + * Set the accountResourceIdentifier property: The resource identifier of global database account in the + * throughputPool. + * + * @param accountResourceIdentifier the accountResourceIdentifier value to set. + * @return the ThroughputPoolAccountResourceInner object itself. + */ + public ThroughputPoolAccountResourceInner withAccountResourceIdentifier(String accountResourceIdentifier) { + if (this.innerProperties() == null) { + this.innerProperties = new ThroughputPoolAccountProperties(); + } + this.innerProperties().withAccountResourceIdentifier(accountResourceIdentifier); + return this; + } + + /** + * Get the accountLocation property: The location of global database account in the throughputPool. + * + * @return the accountLocation value. + */ + public String accountLocation() { + return this.innerProperties() == null ? null : this.innerProperties().accountLocation(); + } + + /** + * Set the accountLocation property: The location of global database account in the throughputPool. + * + * @param accountLocation the accountLocation value to set. + * @return the ThroughputPoolAccountResourceInner object itself. + */ + public ThroughputPoolAccountResourceInner withAccountLocation(String accountLocation) { + if (this.innerProperties() == null) { + this.innerProperties = new ThroughputPoolAccountProperties(); + } + this.innerProperties().withAccountLocation(accountLocation); + return this; + } + + /** + * Get the accountInstanceId property: The instance id of global database account in the throughputPool. + * + * @return the accountInstanceId value. + */ + public String accountInstanceId() { + return this.innerProperties() == null ? null : this.innerProperties().accountInstanceId(); + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ThroughputPoolAccountResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThroughputPoolAccountResourceInner if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ThroughputPoolAccountResourceInner. + */ + public static ThroughputPoolAccountResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThroughputPoolAccountResourceInner deserializedThroughputPoolAccountResourceInner + = new ThroughputPoolAccountResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedThroughputPoolAccountResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedThroughputPoolAccountResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedThroughputPoolAccountResourceInner.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedThroughputPoolAccountResourceInner.innerProperties + = ThroughputPoolAccountProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedThroughputPoolAccountResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedThroughputPoolAccountResourceInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolProperties.java new file mode 100644 index 000000000000..db2903c4740e --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolProperties.java @@ -0,0 +1,123 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.Status; +import java.io.IOException; + +/** + * Properties to update Azure Cosmos DB throughput pool. + */ +@Fluent +public final class ThroughputPoolProperties implements JsonSerializable { + /* + * A provisioning state of the ThroughputPool. + */ + private Status provisioningState; + + /* + * Value for throughput to be shared among CosmosDB resources in the pool. + */ + private Integer maxThroughput; + + /** + * Creates an instance of ThroughputPoolProperties class. + */ + public ThroughputPoolProperties() { + } + + /** + * Get the provisioningState property: A provisioning state of the ThroughputPool. + * + * @return the provisioningState value. + */ + public Status provisioningState() { + return this.provisioningState; + } + + /** + * Set the provisioningState property: A provisioning state of the ThroughputPool. + * + * @param provisioningState the provisioningState value to set. + * @return the ThroughputPoolProperties object itself. + */ + public ThroughputPoolProperties withProvisioningState(Status provisioningState) { + this.provisioningState = provisioningState; + return this; + } + + /** + * Get the maxThroughput property: Value for throughput to be shared among CosmosDB resources in the pool. + * + * @return the maxThroughput value. + */ + public Integer maxThroughput() { + return this.maxThroughput; + } + + /** + * Set the maxThroughput property: Value for throughput to be shared among CosmosDB resources in the pool. + * + * @param maxThroughput the maxThroughput value to set. + * @return the ThroughputPoolProperties object itself. + */ + public ThroughputPoolProperties withMaxThroughput(Integer maxThroughput) { + this.maxThroughput = maxThroughput; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("provisioningState", + this.provisioningState == null ? null : this.provisioningState.toString()); + jsonWriter.writeNumberField("maxThroughput", this.maxThroughput); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ThroughputPoolProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThroughputPoolProperties if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ThroughputPoolProperties. + */ + public static ThroughputPoolProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThroughputPoolProperties deserializedThroughputPoolProperties = new ThroughputPoolProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedThroughputPoolProperties.provisioningState = Status.fromString(reader.getString()); + } else if ("maxThroughput".equals(fieldName)) { + deserializedThroughputPoolProperties.maxThroughput = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedThroughputPoolProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolResourceInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolResourceInner.java new file mode 100644 index 000000000000..db5d7a6c292d --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolResourceInner.java @@ -0,0 +1,227 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.fluent.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.Resource; +import com.azure.core.management.SystemData; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.models.Status; +import java.io.IOException; +import java.util.Map; + +/** + * An Azure Cosmos DB Throughputpool. + */ +@Fluent +public final class ThroughputPoolResourceInner extends Resource { + /* + * Properties to update Azure Cosmos DB throughput pool. + */ + private ThroughputPoolProperties innerProperties; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + + /* + * The type of the resource. + */ + private String type; + + /* + * The name of the resource. + */ + private String name; + + /* + * Fully qualified resource Id for the resource. + */ + private String id; + + /** + * Creates an instance of ThroughputPoolResourceInner class. + */ + public ThroughputPoolResourceInner() { + } + + /** + * Get the innerProperties property: Properties to update Azure Cosmos DB throughput pool. + * + * @return the innerProperties value. + */ + private ThroughputPoolProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + + /** + * Get the type property: The type of the resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: Fully qualified resource Id for the resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public ThroughputPoolResourceInner withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public ThroughputPoolResourceInner withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * Get the provisioningState property: A provisioning state of the ThroughputPool. + * + * @return the provisioningState value. + */ + public Status provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Set the provisioningState property: A provisioning state of the ThroughputPool. + * + * @param provisioningState the provisioningState value to set. + * @return the ThroughputPoolResourceInner object itself. + */ + public ThroughputPoolResourceInner withProvisioningState(Status provisioningState) { + if (this.innerProperties() == null) { + this.innerProperties = new ThroughputPoolProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + return this; + } + + /** + * Get the maxThroughput property: Value for throughput to be shared among CosmosDB resources in the pool. + * + * @return the maxThroughput value. + */ + public Integer maxThroughput() { + return this.innerProperties() == null ? null : this.innerProperties().maxThroughput(); + } + + /** + * Set the maxThroughput property: Value for throughput to be shared among CosmosDB resources in the pool. + * + * @param maxThroughput the maxThroughput value to set. + * @return the ThroughputPoolResourceInner object itself. + */ + public ThroughputPoolResourceInner withMaxThroughput(Integer maxThroughput) { + if (this.innerProperties() == null) { + this.innerProperties = new ThroughputPoolProperties(); + } + this.innerProperties().withMaxThroughput(maxThroughput); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ThroughputPoolResourceInner from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThroughputPoolResourceInner if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ThroughputPoolResourceInner. + */ + public static ThroughputPoolResourceInner fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThroughputPoolResourceInner deserializedThroughputPoolResourceInner = new ThroughputPoolResourceInner(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedThroughputPoolResourceInner.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedThroughputPoolResourceInner.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedThroughputPoolResourceInner.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedThroughputPoolResourceInner.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedThroughputPoolResourceInner.withTags(tags); + } else if ("properties".equals(fieldName)) { + deserializedThroughputPoolResourceInner.innerProperties = ThroughputPoolProperties.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedThroughputPoolResourceInner.systemData = SystemData.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedThroughputPoolResourceInner; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputSettingsGetProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputSettingsGetProperties.java index 22b53fecdb36..581c708f963b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputSettingsGetProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputSettingsGetProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The properties of an Azure Cosmos DB resource throughput. */ -@Fluent +@Immutable public final class ThroughputSettingsGetProperties implements JsonSerializable { /* * The resource property. @@ -25,7 +25,7 @@ public final class ThroughputSettingsGetProperties implements JsonSerializable tags; + + /* + * The geo-location where the resource lives + */ + private String location; + + /* + * Identity for the resource. + */ + private ManagedServiceIdentity identity; + + /* + * Azure Resource Manager metadata containing createdBy and modifiedBy information. + */ + private SystemData systemData; + /* * The type of the resource. */ @@ -41,7 +63,7 @@ public final class ThroughputSettingsGetResultsInner extends ArmResourceProperti /** * Creates an instance of ThroughputSettingsGetResultsInner class. */ - public ThroughputSettingsGetResultsInner() { + private ThroughputSettingsGetResultsInner() { } /** @@ -53,6 +75,42 @@ private ThroughputSettingsGetProperties innerProperties() { return this.innerProperties; } + /** + * Get the tags property: Resource tags. + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Get the location property: The geo-location where the resource lives. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Get the systemData property: Azure Resource Manager metadata containing createdBy and modifiedBy information. + * + * @return the systemData value. + */ + public SystemData systemData() { + return this.systemData; + } + /** * Get the type property: The type of the resource. * @@ -83,24 +141,6 @@ public String id() { return this.id; } - /** - * {@inheritDoc} - */ - @Override - public ThroughputSettingsGetResultsInner withLocation(String location) { - super.withLocation(location); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ThroughputSettingsGetResultsInner withTags(Map tags) { - super.withTags(tags); - return this; - } - /** * Get the resource property: The resource property. * @@ -110,30 +150,18 @@ public ThroughputSettingsGetPropertiesResource resource() { return this.innerProperties() == null ? null : this.innerProperties().resource(); } - /** - * Set the resource property: The resource property. - * - * @param resource the resource value to set. - * @return the ThroughputSettingsGetResultsInner object itself. - */ - public ThroughputSettingsGetResultsInner withResource(ThroughputSettingsGetPropertiesResource resource) { - if (this.innerProperties() == null) { - this.innerProperties = new ThroughputSettingsGetProperties(); - } - this.innerProperties().withResource(resource); - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ - @Override public void validate() { if (innerProperties() != null) { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } /** @@ -142,9 +170,10 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); jsonWriter.writeJsonField("properties", this.innerProperties); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -171,14 +200,18 @@ public static ThroughputSettingsGetResultsInner fromJson(JsonReader jsonReader) deserializedThroughputSettingsGetResultsInner.name = reader.getString(); } else if ("type".equals(fieldName)) { deserializedThroughputSettingsGetResultsInner.type = reader.getString(); - } else if ("location".equals(fieldName)) { - deserializedThroughputSettingsGetResultsInner.withLocation(reader.getString()); - } else if ("tags".equals(fieldName)) { - Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedThroughputSettingsGetResultsInner.withTags(tags); } else if ("properties".equals(fieldName)) { deserializedThroughputSettingsGetResultsInner.innerProperties = ThroughputSettingsGetProperties.fromJson(reader); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedThroughputSettingsGetResultsInner.tags = tags; + } else if ("location".equals(fieldName)) { + deserializedThroughputSettingsGetResultsInner.location = reader.getString(); + } else if ("identity".equals(fieldName)) { + deserializedThroughputSettingsGetResultsInner.identity = ManagedServiceIdentity.fromJson(reader); + } else if ("systemData".equals(fieldName)) { + deserializedThroughputSettingsGetResultsInner.systemData = SystemData.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputSettingsUpdateProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputSettingsUpdateProperties.java index 2bf8a24266ff..577742eff30d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputSettingsUpdateProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputSettingsUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/UsageInner.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/UsageInner.java index a8432247a350..523d99a6844d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/UsageInner.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/UsageInner.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.fluent.models; @@ -46,7 +46,7 @@ public class UsageInner implements JsonSerializable { /** * Creates an instance of UsageInner class. */ - public UsageInner() { + protected UsageInner() { } /** diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/package-info.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/package-info.java index 5f07026553f8..c0d5bb206e24 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/package-info.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the inner data models for CosmosDBManagementClient. - * Azure Cosmos DB Database Service Resource Provider REST API. + * Package containing the inner data models for DocumentDB. + * Azure Cosmos DB Throughput Pool REST API. */ package com.azure.resourcemanager.cosmos.fluent.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/package-info.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/package-info.java index 1c80a66163d5..70b1d563e460 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/package-info.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/fluent/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the service clients for CosmosDBManagementClient. - * Azure Cosmos DB Database Service Resource Provider REST API. + * Package containing the service clients for DocumentDB. + * Azure Cosmos DB Throughput Pool REST API. */ package com.azure.resourcemanager.cosmos.fluent; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CassandraClustersClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CassandraClustersClientImpl.java index 8faf2b59c880..b7ef874bd48d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CassandraClustersClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CassandraClustersClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -34,11 +34,16 @@ import com.azure.core.util.polling.PollerFlux; import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.cosmos.fluent.CassandraClustersClient; +import com.azure.resourcemanager.cosmos.fluent.models.BackupResourceInner; import com.azure.resourcemanager.cosmos.fluent.models.CassandraClusterPublicStatusInner; import com.azure.resourcemanager.cosmos.fluent.models.ClusterResourceInner; import com.azure.resourcemanager.cosmos.fluent.models.CommandOutputInner; +import com.azure.resourcemanager.cosmos.fluent.models.CommandPublicResourceInner; +import com.azure.resourcemanager.cosmos.implementation.models.ListBackups; +import com.azure.resourcemanager.cosmos.implementation.models.ListClusters; +import com.azure.resourcemanager.cosmos.implementation.models.ListCommands; +import com.azure.resourcemanager.cosmos.models.CommandAsyncPostBody; import com.azure.resourcemanager.cosmos.models.CommandPostBody; -import com.azure.resourcemanager.cosmos.models.ListClusters; import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; @@ -76,112 +81,188 @@ public final class CassandraClustersClientImpl implements InnerSupportsGet> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, @HeaderParam("Accept") String accept, Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ClusterResourceInner body, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ClusterResourceInner body, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}") + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/cassandraClusters") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/invokeCommand") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> invokeCommand(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CommandPostBody body, Context context); - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}") - @ExpectedResponses({ 202, 204 }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/invokeCommandAsync") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> invokeCommandAsyncResource(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CommandAsyncPostBody body, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}") - @ExpectedResponses({ 200, 201 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/commands") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listCommand(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ClusterResourceInner body, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}") - @ExpectedResponses({ 200, 202 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/commands/{commandId}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getCommandAsyncResource(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") ClusterResourceInner body, - @HeaderParam("Accept") String accept, Context context); + @PathParam("commandId") String commandId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/invokeCommand") - @ExpectedResponses({ 202 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> invokeCommand(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listBackups(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") CommandPostBody body, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/backups/{backupId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getBackup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("backupId") String backupId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/deallocate") @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deallocate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> deallocate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("x-ms-force-deallocate") String forceDeallocate, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/start") @ExpectedResponses({ 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> start(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> start(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/status") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> status(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> status(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCommandNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBackupsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * List all managed Cassandra clusters in this subscription. + * Get the properties of a managed Cassandra cluster. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster 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 list of managed Cassandra clusters along with {@link PagedResponse} on successful completion of + * @return the properties of a managed Cassandra cluster along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { + public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String clusterName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -190,27 +271,35 @@ private Mono> listSinglePageAsync() { 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List all managed Cassandra clusters in this subscription. + * Get the properties of a managed Cassandra cluster. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster 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 list of managed Cassandra clusters along with {@link PagedResponse} on successful completion of + * @return the properties of a managed Cassandra cluster along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(Context context) { + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String clusterName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -219,79 +308,83 @@ private Mono> listSinglePageAsync(Context co 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context); } /** - * List all managed Cassandra clusters in this subscription. + * Get the properties of a managed Cassandra cluster. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster 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 list of managed Cassandra clusters as paginated response with {@link PagedFlux}. + * @return the properties of a managed Cassandra cluster on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync()); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync(String resourceGroupName, String clusterName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * List all managed Cassandra clusters in this subscription. + * Get the properties of a managed Cassandra cluster. * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster 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 list of managed Cassandra clusters as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context)); - } - - /** - * List all managed Cassandra clusters in this subscription. - * - * @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 list of managed Cassandra clusters as paginated response with {@link PagedIterable}. + * @return the properties of a managed Cassandra cluster along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, + Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); } /** - * List all managed Cassandra clusters in this subscription. + * Get the properties of a managed Cassandra cluster. * - * @param context The context to associate with this operation. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster 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 list of managed Cassandra clusters as paginated response with {@link PagedIterable}. + * @return the properties of a managed Cassandra cluster. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterResourceInner getByResourceGroup(String resourceGroupName, String clusterName) { + return getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); } /** - * List all managed Cassandra clusters in this resource group. + * Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update + * only some properties, use PATCH. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body The properties specifying the desired state of the managed Cassandra cluster. * @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 list of managed Cassandra clusters along with {@link PagedResponse} on successful completion of + * @return representation of a managed Cassandra cluster along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + public Mono>> createUpdateWithResponseAsync(String resourceGroupName, String clusterName, + ClusterResourceInner body) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -304,29 +397,39 @@ private Mono> listByResourceGroupSinglePageA return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .withContext(context -> service.createUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, body, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * List all managed Cassandra clusters in this resource group. + * Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update + * only some properties, use PATCH. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body The properties specifying the desired state of the managed Cassandra cluster. * @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 list of managed Cassandra clusters along with {@link PagedResponse} on successful completion of + * @return representation of a managed Cassandra cluster along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - Context context) { + private Mono>> createUpdateWithResponseAsync(String resourceGroupName, String clusterName, + ClusterResourceInner body, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -339,87 +442,743 @@ private Mono> listByResourceGroupSinglePageA return Mono .error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.")); } + if (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + return service.createUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, body, context); } /** - * List all managed Cassandra clusters in this resource group. + * Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update + * only some properties, use PATCH. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body The properties specifying the desired state of the managed Cassandra cluster. * @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 list of managed Cassandra clusters as paginated response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of representation of a managed Cassandra cluster. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, ClusterResourceInner> + beginCreateUpdateAsync(String resourceGroupName, String clusterName, ClusterResourceInner body) { + Mono>> mono = createUpdateWithResponseAsync(resourceGroupName, clusterName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ClusterResourceInner.class, ClusterResourceInner.class, this.client.getContext()); } /** - * List all managed Cassandra clusters in this resource group. + * Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update + * only some properties, use PATCH. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body The properties specifying the desired state of the managed Cassandra cluster. * @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 list of managed Cassandra clusters as paginated response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of representation of a managed Cassandra cluster. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterResourceInner> beginCreateUpdateAsync( + String resourceGroupName, String clusterName, ClusterResourceInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createUpdateWithResponseAsync(resourceGroupName, clusterName, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ClusterResourceInner.class, ClusterResourceInner.class, context); } /** - * List all managed Cassandra clusters in this resource group. + * Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update + * only some properties, use PATCH. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body The properties specifying the desired state of the managed Cassandra cluster. * @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 list of managed Cassandra clusters as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of representation of a managed Cassandra cluster. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterResourceInner> + beginCreateUpdate(String resourceGroupName, String clusterName, ClusterResourceInner body) { + return this.beginCreateUpdateAsync(resourceGroupName, clusterName, body).getSyncPoller(); } /** - * List all managed Cassandra clusters in this resource group. + * Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update + * only some properties, use PATCH. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body The properties specifying the desired state of the managed Cassandra cluster. * @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 list of managed Cassandra clusters as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of representation of a managed Cassandra cluster. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterResourceInner> + beginCreateUpdate(String resourceGroupName, String clusterName, ClusterResourceInner body, Context context) { + return this.beginCreateUpdateAsync(resourceGroupName, clusterName, body, context).getSyncPoller(); } /** - * Get the properties of a managed Cassandra cluster. + * Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update + * only some properties, use PATCH. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. + * @param body The properties specifying the desired state of the managed Cassandra cluster. * @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 properties of a managed Cassandra cluster along with {@link Response} on successful completion of + * @return representation of a managed Cassandra cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createUpdateAsync(String resourceGroupName, String clusterName, + ClusterResourceInner body) { + return beginCreateUpdateAsync(resourceGroupName, clusterName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update + * only some properties, use PATCH. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body The properties specifying the desired state of the managed Cassandra cluster. + * @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 representation of a managed Cassandra cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createUpdateAsync(String resourceGroupName, String clusterName, + ClusterResourceInner body, Context context) { + return beginCreateUpdateAsync(resourceGroupName, clusterName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update + * only some properties, use PATCH. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body The properties specifying the desired state of the managed Cassandra cluster. + * @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 representation of a managed Cassandra cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterResourceInner createUpdate(String resourceGroupName, String clusterName, ClusterResourceInner body) { + return createUpdateAsync(resourceGroupName, clusterName, body).block(); + } + + /** + * Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update + * only some properties, use PATCH. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body The properties specifying the desired state of the managed Cassandra cluster. + * @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 representation of a managed Cassandra cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterResourceInner createUpdate(String resourceGroupName, String clusterName, ClusterResourceInner body, + Context context) { + return createUpdateAsync(resourceGroupName, clusterName, body, context).block(); + } + + /** + * Updates some of the properties of a managed Cassandra cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Parameters to provide for specifying the managed Cassandra cluster. + * @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 representation of a managed Cassandra cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, + ClusterResourceInner body) { + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates some of the properties of a managed Cassandra cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Parameters to provide for specifying the managed Cassandra cluster. + * @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 representation of a managed Cassandra cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, + ClusterResourceInner body, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, contentType, accept, body, context); + } + + /** + * Updates some of the properties of a managed Cassandra cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Parameters to provide for specifying the managed Cassandra cluster. + * @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 representation of a managed Cassandra cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, ClusterResourceInner> beginUpdateAsync(String resourceGroupName, + String clusterName, ClusterResourceInner body) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, clusterName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ClusterResourceInner.class, ClusterResourceInner.class, this.client.getContext()); + } + + /** + * Updates some of the properties of a managed Cassandra cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Parameters to provide for specifying the managed Cassandra cluster. + * @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 representation of a managed Cassandra cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ClusterResourceInner> + beginUpdateAsync(String resourceGroupName, String clusterName, ClusterResourceInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, clusterName, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + ClusterResourceInner.class, ClusterResourceInner.class, context); + } + + /** + * Updates some of the properties of a managed Cassandra cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Parameters to provide for specifying the managed Cassandra cluster. + * @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 representation of a managed Cassandra cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterResourceInner> beginUpdate(String resourceGroupName, + String clusterName, ClusterResourceInner body) { + return this.beginUpdateAsync(resourceGroupName, clusterName, body).getSyncPoller(); + } + + /** + * Updates some of the properties of a managed Cassandra cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Parameters to provide for specifying the managed Cassandra cluster. + * @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 representation of a managed Cassandra cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ClusterResourceInner> beginUpdate(String resourceGroupName, + String clusterName, ClusterResourceInner body, Context context) { + return this.beginUpdateAsync(resourceGroupName, clusterName, body, context).getSyncPoller(); + } + + /** + * Updates some of the properties of a managed Cassandra cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Parameters to provide for specifying the managed Cassandra cluster. + * @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 representation of a managed Cassandra cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync(String resourceGroupName, String clusterName, + ClusterResourceInner body) { + return beginUpdateAsync(resourceGroupName, clusterName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates some of the properties of a managed Cassandra cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Parameters to provide for specifying the managed Cassandra cluster. + * @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 representation of a managed Cassandra cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String clusterName, + ClusterResourceInner body, Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates some of the properties of a managed Cassandra cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Parameters to provide for specifying the managed Cassandra cluster. + * @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 representation of a managed Cassandra cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterResourceInner update(String resourceGroupName, String clusterName, ClusterResourceInner body) { + return updateAsync(resourceGroupName, clusterName, body).block(); + } + + /** + * Updates some of the properties of a managed Cassandra cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param body Parameters to provide for specifying the managed Cassandra cluster. + * @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 representation of a managed Cassandra cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ClusterResourceInner update(String resourceGroupName, String clusterName, ClusterResourceInner body, + Context context) { + return updateAsync(resourceGroupName, clusterName, body, context).block(); + } + + /** + * Deletes a managed Cassandra cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster 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>> deleteWithResponseAsync(String resourceGroupName, String clusterName) { + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a managed Cassandra cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster 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>> deleteWithResponseAsync(String resourceGroupName, String clusterName, + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, context); + } + + /** + * Deletes a managed Cassandra cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster 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> beginDeleteAsync(String resourceGroupName, String clusterName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a managed Cassandra cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster 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> beginDeleteAsync(String resourceGroupName, String clusterName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes a managed Cassandra cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster 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> beginDelete(String resourceGroupName, String clusterName) { + return this.beginDeleteAsync(resourceGroupName, clusterName).getSyncPoller(); + } + + /** + * Deletes a managed Cassandra cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster 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> beginDelete(String resourceGroupName, String clusterName, + Context context) { + return this.beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); + } + + /** + * Deletes a managed Cassandra cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster 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 deleteAsync(String resourceGroupName, String clusterName) { + return beginDeleteAsync(resourceGroupName, clusterName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a managed Cassandra cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster 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 deleteAsync(String resourceGroupName, String clusterName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a managed Cassandra cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster 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 delete(String resourceGroupName, String clusterName) { + deleteAsync(resourceGroupName, clusterName).block(); + } + + /** + * Deletes a managed Cassandra cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster 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 delete(String resourceGroupName, String clusterName, Context context) { + deleteAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * List all managed Cassandra clusters in this resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of managed Cassandra clusters along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all managed Cassandra clusters in this resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of managed Cassandra clusters along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List all managed Cassandra clusters in this resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of managed Cassandra clusters as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List all managed Cassandra clusters in this resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of managed Cassandra clusters as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List all managed Cassandra clusters in this resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of managed Cassandra clusters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List all managed Cassandra clusters in this resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of managed Cassandra clusters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * List all managed Cassandra clusters in this subscription. + * + * @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 list of managed Cassandra clusters along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String clusterName) { + private Mono> listSinglePageAsync() { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -428,36 +1187,27 @@ public Mono> getByResourceGroupWithResponseAsync( 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 (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get the properties of a managed Cassandra cluster. + * List all managed Cassandra clusters in this subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Managed Cassandra cluster 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 properties of a managed Cassandra cluster along with {@link Response} on successful completion of + * @return list of managed Cassandra clusters along with {@link PagedResponse} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, - String clusterName, Context context) { + private Mono> listSinglePageAsync(Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -466,79 +1216,83 @@ private Mono> getByResourceGroupWithResponseAsync 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 (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, this.client.getApiVersion(), accept, context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Get the properties of a managed Cassandra cluster. + * List all managed Cassandra clusters in this subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Managed Cassandra cluster 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 properties of a managed Cassandra cluster on successful completion of {@link Mono}. + * @return list of managed Cassandra clusters as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByResourceGroupAsync(String resourceGroupName, String clusterName) { - return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); } /** - * Get the properties of a managed Cassandra cluster. + * List all managed Cassandra clusters in this subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Managed Cassandra cluster 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 properties of a managed Cassandra cluster along with {@link Response}. + * @return list of managed Cassandra clusters as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByResourceGroupWithResponse(String resourceGroupName, String clusterName, - Context context) { - return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); } /** - * Get the properties of a managed Cassandra cluster. + * List all managed Cassandra clusters in this subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Managed Cassandra cluster name. + * @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 list of managed Cassandra clusters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List all managed Cassandra clusters in this subscription. + * + * @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 properties of a managed Cassandra cluster. + * @return list of managed Cassandra clusters as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterResourceInner getByResourceGroup(String resourceGroupName, String clusterName) { - return getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); } /** - * Deletes a managed Cassandra cluster. + * Invoke a command like nodetool for cassandra maintenance. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. * @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}. + * @return response of /command api along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName) { + public Mono>> invokeCommandWithResponseAsync(String resourceGroupName, String clusterName, + CommandPostBody body) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -554,27 +1308,34 @@ public Mono>> deleteWithResponseAsync(String resourceG if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.invokeCommand(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, body, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes a managed Cassandra cluster. + * Invoke a command like nodetool for cassandra maintenance. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. * @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}. + * @return response of /command api along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, - Context context) { + private Mono>> invokeCommandWithResponseAsync(String resourceGroupName, + String clusterName, CommandPostBody body, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -590,158 +1351,179 @@ private Mono>> deleteWithResponseAsync(String resource if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, this.client.getApiVersion(), accept, context); + return service.invokeCommand(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, body, context); } /** - * Deletes a managed Cassandra cluster. + * Invoke a command like nodetool for cassandra maintenance. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. * @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. + * @return the {@link PollerFlux} for polling of response of /command api. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + public PollerFlux, CommandOutputInner> + beginInvokeCommandAsync(String resourceGroupName, String clusterName, CommandPostBody body) { + Mono>> mono = invokeCommandWithResponseAsync(resourceGroupName, clusterName, body); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CommandOutputInner.class, CommandOutputInner.class, this.client.getContext()); } /** - * Deletes a managed Cassandra cluster. + * Invoke a command like nodetool for cassandra maintenance. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. * @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. + * @return the {@link PollerFlux} for polling of response of /command api. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, - Context context) { + private PollerFlux, CommandOutputInner> + beginInvokeCommandAsync(String resourceGroupName, String clusterName, CommandPostBody body, Context context) { context = this.client.mergeContext(context); - Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + Mono>> mono + = invokeCommandWithResponseAsync(resourceGroupName, clusterName, body, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + CommandOutputInner.class, CommandOutputInner.class, context); } /** - * Deletes a managed Cassandra cluster. + * Invoke a command like nodetool for cassandra maintenance. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. * @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. + * @return the {@link SyncPoller} for polling of response of /command api. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName) { - return this.beginDeleteAsync(resourceGroupName, clusterName).getSyncPoller(); + public SyncPoller, CommandOutputInner> beginInvokeCommand(String resourceGroupName, + String clusterName, CommandPostBody body) { + return this.beginInvokeCommandAsync(resourceGroupName, clusterName, body).getSyncPoller(); } /** - * Deletes a managed Cassandra cluster. + * Invoke a command like nodetool for cassandra maintenance. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. * @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. + * @return the {@link SyncPoller} for polling of response of /command api. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, - Context context) { - return this.beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); + public SyncPoller, CommandOutputInner> beginInvokeCommand(String resourceGroupName, + String clusterName, CommandPostBody body, Context context) { + return this.beginInvokeCommandAsync(resourceGroupName, clusterName, body, context).getSyncPoller(); } /** - * Deletes a managed Cassandra cluster. + * Invoke a command like nodetool for cassandra maintenance. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. * @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. + * @return response of /command api on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String clusterName) { - return beginDeleteAsync(resourceGroupName, clusterName).last().flatMap(this.client::getLroFinalResultOrError); + public Mono invokeCommandAsync(String resourceGroupName, String clusterName, + CommandPostBody body) { + return beginInvokeCommandAsync(resourceGroupName, clusterName, body).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes a managed Cassandra cluster. + * Invoke a command like nodetool for cassandra maintenance. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. * @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. + * @return response of /command api on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String clusterName, Context context) { - return beginDeleteAsync(resourceGroupName, clusterName, context).last() + private Mono invokeCommandAsync(String resourceGroupName, String clusterName, + CommandPostBody body, Context context) { + return beginInvokeCommandAsync(resourceGroupName, clusterName, body, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes a managed Cassandra cluster. + * Invoke a command like nodetool for cassandra maintenance. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. * @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 response of /command api. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String clusterName) { - deleteAsync(resourceGroupName, clusterName).block(); + public CommandOutputInner invokeCommand(String resourceGroupName, String clusterName, CommandPostBody body) { + return invokeCommandAsync(resourceGroupName, clusterName, body).block(); } /** - * Deletes a managed Cassandra cluster. + * Invoke a command like nodetool for cassandra maintenance. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. + * @param body Specification which command to run where. * @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 response of /command api. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String clusterName, Context context) { - deleteAsync(resourceGroupName, clusterName, context).block(); + public CommandOutputInner invokeCommand(String resourceGroupName, String clusterName, CommandPostBody body, + Context context) { + return invokeCommandAsync(resourceGroupName, clusterName, body, context).block(); } /** - * Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update - * only some properties, use PATCH. + * Invoke a command like nodetool for cassandra maintenance asynchronously. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body The properties specifying the desired state of the managed Cassandra cluster. + * @param body Specification which command to run where. * @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 representation of a managed Cassandra cluster along with {@link Response} on successful completion of - * {@link Mono}. + * @return resource representing a command along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createUpdateWithResponseAsync(String resourceGroupName, String clusterName, - ClusterResourceInner body) { + public Mono>> invokeCommandAsyncResourceWithResponseAsync(String resourceGroupName, + String clusterName, CommandAsyncPostBody body) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -762,30 +1544,30 @@ public Mono>> createUpdateWithResponseAsync(String res } else { body.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, this.client.getApiVersion(), body, accept, context)) + .withContext(context -> service.invokeCommandAsyncResource(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, clusterName, + contentType, accept, body, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update - * only some properties, use PATCH. + * Invoke a command like nodetool for cassandra maintenance asynchronously. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body The properties specifying the desired state of the managed Cassandra cluster. + * @param body Specification which command to run where. * @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 representation of a managed Cassandra cluster along with {@link Response} on successful completion of - * {@link Mono}. + * @return resource representing a command along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createUpdateWithResponseAsync(String resourceGroupName, String clusterName, - ClusterResourceInner body, Context context) { + private Mono>> invokeCommandAsyncResourceWithResponseAsync(String resourceGroupName, + String clusterName, CommandAsyncPostBody body, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -806,182 +1588,178 @@ private Mono>> createUpdateWithResponseAsync(String re } else { body.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, this.client.getApiVersion(), body, accept, context); + return service.invokeCommandAsyncResource(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, body, context); } /** - * Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update - * only some properties, use PATCH. + * Invoke a command like nodetool for cassandra maintenance asynchronously. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body The properties specifying the desired state of the managed Cassandra cluster. + * @param body Specification which command to run where. * @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 representation of a managed Cassandra cluster. + * @return the {@link PollerFlux} for polling of resource representing a command. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, ClusterResourceInner> - beginCreateUpdateAsync(String resourceGroupName, String clusterName, ClusterResourceInner body) { - Mono>> mono = createUpdateWithResponseAsync(resourceGroupName, clusterName, body); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ClusterResourceInner.class, ClusterResourceInner.class, this.client.getContext()); + public PollerFlux, CommandPublicResourceInner> + beginInvokeCommandAsyncResourceAsync(String resourceGroupName, String clusterName, CommandAsyncPostBody body) { + Mono>> mono + = invokeCommandAsyncResourceWithResponseAsync(resourceGroupName, clusterName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CommandPublicResourceInner.class, CommandPublicResourceInner.class, + this.client.getContext()); } /** - * Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update - * only some properties, use PATCH. + * Invoke a command like nodetool for cassandra maintenance asynchronously. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body The properties specifying the desired state of the managed Cassandra cluster. + * @param body Specification which command to run where. * @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 representation of a managed Cassandra cluster. + * @return the {@link PollerFlux} for polling of resource representing a command. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ClusterResourceInner> beginCreateUpdateAsync( - String resourceGroupName, String clusterName, ClusterResourceInner body, Context context) { + private PollerFlux, CommandPublicResourceInner> + beginInvokeCommandAsyncResourceAsync(String resourceGroupName, String clusterName, CommandAsyncPostBody body, + Context context) { context = this.client.mergeContext(context); Mono>> mono - = createUpdateWithResponseAsync(resourceGroupName, clusterName, body, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ClusterResourceInner.class, ClusterResourceInner.class, context); + = invokeCommandAsyncResourceWithResponseAsync(resourceGroupName, clusterName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CommandPublicResourceInner.class, CommandPublicResourceInner.class, context); } /** - * Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update - * only some properties, use PATCH. + * Invoke a command like nodetool for cassandra maintenance asynchronously. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body The properties specifying the desired state of the managed Cassandra cluster. + * @param body Specification which command to run where. * @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 representation of a managed Cassandra cluster. + * @return the {@link SyncPoller} for polling of resource representing a command. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ClusterResourceInner> - beginCreateUpdate(String resourceGroupName, String clusterName, ClusterResourceInner body) { - return this.beginCreateUpdateAsync(resourceGroupName, clusterName, body).getSyncPoller(); + public SyncPoller, CommandPublicResourceInner> + beginInvokeCommandAsyncResource(String resourceGroupName, String clusterName, CommandAsyncPostBody body) { + return this.beginInvokeCommandAsyncResourceAsync(resourceGroupName, clusterName, body).getSyncPoller(); } /** - * Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update - * only some properties, use PATCH. + * Invoke a command like nodetool for cassandra maintenance asynchronously. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body The properties specifying the desired state of the managed Cassandra cluster. + * @param body Specification which command to run where. * @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 representation of a managed Cassandra cluster. + * @return the {@link SyncPoller} for polling of resource representing a command. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ClusterResourceInner> - beginCreateUpdate(String resourceGroupName, String clusterName, ClusterResourceInner body, Context context) { - return this.beginCreateUpdateAsync(resourceGroupName, clusterName, body, context).getSyncPoller(); + public SyncPoller, CommandPublicResourceInner> + beginInvokeCommandAsyncResource(String resourceGroupName, String clusterName, CommandAsyncPostBody body, + Context context) { + return this.beginInvokeCommandAsyncResourceAsync(resourceGroupName, clusterName, body, context).getSyncPoller(); } /** - * Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update - * only some properties, use PATCH. + * Invoke a command like nodetool for cassandra maintenance asynchronously. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body The properties specifying the desired state of the managed Cassandra cluster. + * @param body Specification which command to run where. * @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 representation of a managed Cassandra cluster on successful completion of {@link Mono}. + * @return resource representing a command on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createUpdateAsync(String resourceGroupName, String clusterName, - ClusterResourceInner body) { - return beginCreateUpdateAsync(resourceGroupName, clusterName, body).last() + public Mono invokeCommandAsyncResourceAsync(String resourceGroupName, + String clusterName, CommandAsyncPostBody body) { + return beginInvokeCommandAsyncResourceAsync(resourceGroupName, clusterName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update - * only some properties, use PATCH. + * Invoke a command like nodetool for cassandra maintenance asynchronously. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body The properties specifying the desired state of the managed Cassandra cluster. + * @param body Specification which command to run where. * @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 representation of a managed Cassandra cluster on successful completion of {@link Mono}. + * @return resource representing a command on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createUpdateAsync(String resourceGroupName, String clusterName, - ClusterResourceInner body, Context context) { - return beginCreateUpdateAsync(resourceGroupName, clusterName, body, context).last() + private Mono invokeCommandAsyncResourceAsync(String resourceGroupName, + String clusterName, CommandAsyncPostBody body, Context context) { + return beginInvokeCommandAsyncResourceAsync(resourceGroupName, clusterName, body, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update - * only some properties, use PATCH. + * Invoke a command like nodetool for cassandra maintenance asynchronously. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body The properties specifying the desired state of the managed Cassandra cluster. + * @param body Specification which command to run where. * @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 representation of a managed Cassandra cluster. + * @return resource representing a command. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterResourceInner createUpdate(String resourceGroupName, String clusterName, ClusterResourceInner body) { - return createUpdateAsync(resourceGroupName, clusterName, body).block(); + public CommandPublicResourceInner invokeCommandAsyncResource(String resourceGroupName, String clusterName, + CommandAsyncPostBody body) { + return invokeCommandAsyncResourceAsync(resourceGroupName, clusterName, body).block(); } /** - * Create or update a managed Cassandra cluster. When updating, you must specify all writable properties. To update - * only some properties, use PATCH. + * Invoke a command like nodetool for cassandra maintenance asynchronously. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body The properties specifying the desired state of the managed Cassandra cluster. + * @param body Specification which command to run where. * @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 representation of a managed Cassandra cluster. + * @return resource representing a command. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterResourceInner createUpdate(String resourceGroupName, String clusterName, ClusterResourceInner body, - Context context) { - return createUpdateAsync(resourceGroupName, clusterName, body, context).block(); + public CommandPublicResourceInner invokeCommandAsyncResource(String resourceGroupName, String clusterName, + CommandAsyncPostBody body, Context context) { + return invokeCommandAsyncResourceAsync(resourceGroupName, clusterName, body, context).block(); } /** - * Updates some of the properties of a managed Cassandra cluster. + * List all commands currently running on ring info. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body Parameters to provide for specifying the managed Cassandra cluster. * @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 representation of a managed Cassandra cluster along with {@link Response} on successful completion of - * {@link Mono}. + * @return list of commands for cluster along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, - ClusterResourceInner body) { + private Mono> listCommandSinglePageAsync(String resourceGroupName, + String clusterName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -997,34 +1775,29 @@ public Mono>> updateWithResponseAsync(String resourceG if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, this.client.getApiVersion(), body, accept, context)) + .withContext(context -> service.listCommand(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Updates some of the properties of a managed Cassandra cluster. + * List all commands currently running on ring info. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body Parameters to provide for specifying the managed Cassandra cluster. * @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 representation of a managed Cassandra cluster along with {@link Response} on successful completion of - * {@link Mono}. + * @return list of commands for cluster along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, - ClusterResourceInner body, Context context) { + private Mono> listCommandSinglePageAsync(String resourceGroupName, + String clusterName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1040,177 +1813,229 @@ private Mono>> updateWithResponseAsync(String resource if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, this.client.getApiVersion(), body, accept, context); + return service + .listCommand(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Updates some of the properties of a managed Cassandra cluster. + * List all commands currently running on ring info. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body Parameters to provide for specifying the managed Cassandra cluster. * @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 representation of a managed Cassandra cluster. + * @return list of commands for cluster as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, ClusterResourceInner> beginUpdateAsync(String resourceGroupName, - String clusterName, ClusterResourceInner body) { - Mono>> mono = updateWithResponseAsync(resourceGroupName, clusterName, body); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ClusterResourceInner.class, ClusterResourceInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listCommandAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listCommandSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listCommandNextSinglePageAsync(nextLink)); } /** - * Updates some of the properties of a managed Cassandra cluster. + * List all commands currently running on ring info. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body Parameters to provide for specifying the managed Cassandra cluster. * @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 representation of a managed Cassandra cluster. + * @return list of commands for cluster as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ClusterResourceInner> - beginUpdateAsync(String resourceGroupName, String clusterName, ClusterResourceInner body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = updateWithResponseAsync(resourceGroupName, clusterName, body, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - ClusterResourceInner.class, ClusterResourceInner.class, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCommandAsync(String resourceGroupName, String clusterName, + Context context) { + return new PagedFlux<>(() -> listCommandSinglePageAsync(resourceGroupName, clusterName, context), + nextLink -> listCommandNextSinglePageAsync(nextLink, context)); } /** - * Updates some of the properties of a managed Cassandra cluster. + * List all commands currently running on ring info. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body Parameters to provide for specifying the managed Cassandra cluster. * @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 representation of a managed Cassandra cluster. + * @return list of commands for cluster as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ClusterResourceInner> beginUpdate(String resourceGroupName, - String clusterName, ClusterResourceInner body) { - return this.beginUpdateAsync(resourceGroupName, clusterName, body).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCommand(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listCommandAsync(resourceGroupName, clusterName)); } /** - * Updates some of the properties of a managed Cassandra cluster. + * List all commands currently running on ring info. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body Parameters to provide for specifying the managed Cassandra cluster. * @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 representation of a managed Cassandra cluster. + * @return list of commands for cluster as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ClusterResourceInner> beginUpdate(String resourceGroupName, - String clusterName, ClusterResourceInner body, Context context) { - return this.beginUpdateAsync(resourceGroupName, clusterName, body, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCommand(String resourceGroupName, String clusterName, + Context context) { + return new PagedIterable<>(listCommandAsync(resourceGroupName, clusterName, context)); } /** - * Updates some of the properties of a managed Cassandra cluster. + * Get details about a specified command that was run asynchronously. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body Parameters to provide for specifying the managed Cassandra cluster. + * @param commandId Managed Cassandra cluster command id. * @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 representation of a managed Cassandra cluster on successful completion of {@link Mono}. + * @return details about a specified command that was run asynchronously along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, String clusterName, - ClusterResourceInner body) { - return beginUpdateAsync(resourceGroupName, clusterName, body).last() - .flatMap(this.client::getLroFinalResultOrError); + public Mono> getCommandAsyncResourceWithResponseAsync(String resourceGroupName, + String clusterName, String commandId) { + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (commandId == null) { + return Mono.error(new IllegalArgumentException("Parameter commandId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getCommandAsyncResource(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, commandId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Updates some of the properties of a managed Cassandra cluster. + * Get details about a specified command that was run asynchronously. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body Parameters to provide for specifying the managed Cassandra cluster. + * @param commandId Managed Cassandra cluster command id. * @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 representation of a managed Cassandra cluster on successful completion of {@link Mono}. + * @return details about a specified command that was run asynchronously along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String clusterName, - ClusterResourceInner body, Context context) { - return beginUpdateAsync(resourceGroupName, clusterName, body, context).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono> getCommandAsyncResourceWithResponseAsync( + String resourceGroupName, String clusterName, String commandId, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (commandId == null) { + return Mono.error(new IllegalArgumentException("Parameter commandId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getCommandAsyncResource(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, commandId, accept, context); } /** - * Updates some of the properties of a managed Cassandra cluster. + * Get details about a specified command that was run asynchronously. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body Parameters to provide for specifying the managed Cassandra cluster. + * @param commandId Managed Cassandra cluster command id. * @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 representation of a managed Cassandra cluster. + * @return details about a specified command that was run asynchronously on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterResourceInner update(String resourceGroupName, String clusterName, ClusterResourceInner body) { - return updateAsync(resourceGroupName, clusterName, body).block(); + public Mono getCommandAsyncResourceAsync(String resourceGroupName, String clusterName, + String commandId) { + return getCommandAsyncResourceWithResponseAsync(resourceGroupName, clusterName, commandId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Updates some of the properties of a managed Cassandra cluster. + * Get details about a specified command that was run asynchronously. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body Parameters to provide for specifying the managed Cassandra cluster. + * @param commandId Managed Cassandra cluster command id. * @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 representation of a managed Cassandra cluster. + * @return details about a specified command that was run asynchronously along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ClusterResourceInner update(String resourceGroupName, String clusterName, ClusterResourceInner body, - Context context) { - return updateAsync(resourceGroupName, clusterName, body, context).block(); + public Response getCommandAsyncResourceWithResponse(String resourceGroupName, + String clusterName, String commandId, Context context) { + return getCommandAsyncResourceWithResponseAsync(resourceGroupName, clusterName, commandId, context).block(); } /** - * Invoke a command like nodetool for cassandra maintenance. + * Get details about a specified command that was run asynchronously. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body Specification which command to run where. + * @param commandId Managed Cassandra cluster command id. * @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 response of /command api along with {@link Response} on successful completion of {@link Mono}. + * @return details about a specified command that was run asynchronously. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> invokeCommandWithResponseAsync(String resourceGroupName, String clusterName, - CommandPostBody body) { + public CommandPublicResourceInner getCommandAsyncResource(String resourceGroupName, String clusterName, + String commandId) { + return getCommandAsyncResourceWithResponse(resourceGroupName, clusterName, commandId, Context.NONE).getValue(); + } + + /** + * List the backups of this cluster that are available to restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster 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 list of restorable backups for a Cassandra cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBackupsSinglePageAsync(String resourceGroupName, + String clusterName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1226,33 +2051,30 @@ public Mono>> invokeCommandWithResponseAsync(String re if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.invokeCommand(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, this.client.getApiVersion(), body, accept, context)) + .withContext(context -> service.listBackups(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Invoke a command like nodetool for cassandra maintenance. + * List the backups of this cluster that are available to restore. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body Specification which command to run where. * @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 response of /command api along with {@link Response} on successful completion of {@link Mono}. + * @return list of restorable backups for a Cassandra cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> invokeCommandWithResponseAsync(String resourceGroupName, - String clusterName, CommandPostBody body, Context context) { + private Mono> listBackupsSinglePageAsync(String resourceGroupName, + String clusterName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1268,162 +2090,212 @@ private Mono>> invokeCommandWithResponseAsync(String r if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.invokeCommand(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, this.client.getApiVersion(), body, accept, context); + return service + .listBackups(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Invoke a command like nodetool for cassandra maintenance. + * List the backups of this cluster that are available to restore. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body Specification which command to run where. * @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 response of /command api. + * @return list of restorable backups for a Cassandra cluster as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, CommandOutputInner> - beginInvokeCommandAsync(String resourceGroupName, String clusterName, CommandPostBody body) { - Mono>> mono = invokeCommandWithResponseAsync(resourceGroupName, clusterName, body); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - CommandOutputInner.class, CommandOutputInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listBackupsAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listBackupsSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listBackupsNextSinglePageAsync(nextLink)); } /** - * Invoke a command like nodetool for cassandra maintenance. + * List the backups of this cluster that are available to restore. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body Specification which command to run where. * @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 response of /command api. + * @return list of restorable backups for a Cassandra cluster as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CommandOutputInner> - beginInvokeCommandAsync(String resourceGroupName, String clusterName, CommandPostBody body, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = invokeCommandWithResponseAsync(resourceGroupName, clusterName, body, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - CommandOutputInner.class, CommandOutputInner.class, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listBackupsAsync(String resourceGroupName, String clusterName, + Context context) { + return new PagedFlux<>(() -> listBackupsSinglePageAsync(resourceGroupName, clusterName, context), + nextLink -> listBackupsNextSinglePageAsync(nextLink, context)); } /** - * Invoke a command like nodetool for cassandra maintenance. + * List the backups of this cluster that are available to restore. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body Specification which command to run where. * @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 response of /command api. + * @return list of restorable backups for a Cassandra cluster as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CommandOutputInner> beginInvokeCommand(String resourceGroupName, - String clusterName, CommandPostBody body) { - return this.beginInvokeCommandAsync(resourceGroupName, clusterName, body).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBackups(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listBackupsAsync(resourceGroupName, clusterName)); } /** - * Invoke a command like nodetool for cassandra maintenance. + * List the backups of this cluster that are available to restore. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body Specification which command to run where. * @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 response of /command api. + * @return list of restorable backups for a Cassandra cluster as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CommandOutputInner> beginInvokeCommand(String resourceGroupName, - String clusterName, CommandPostBody body, Context context) { - return this.beginInvokeCommandAsync(resourceGroupName, clusterName, body, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listBackups(String resourceGroupName, String clusterName, + Context context) { + return new PagedIterable<>(listBackupsAsync(resourceGroupName, clusterName, context)); + } + + /** + * Get the properties of an individual backup of this cluster that is available to restore. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param backupId Id of a restorable backup of a Cassandra cluster. + * @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 properties of an individual backup of this cluster that is available to restore along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getBackupWithResponseAsync(String resourceGroupName, String clusterName, + String backupId) { + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (backupId == null) { + return Mono.error(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getBackup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, backupId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Invoke a command like nodetool for cassandra maintenance. + * Get the properties of an individual backup of this cluster that is available to restore. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body Specification which command to run where. + * @param backupId Id of a restorable backup of a Cassandra cluster. + * @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 response of /command api on successful completion of {@link Mono}. + * @return the properties of an individual backup of this cluster that is available to restore along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono invokeCommandAsync(String resourceGroupName, String clusterName, - CommandPostBody body) { - return beginInvokeCommandAsync(resourceGroupName, clusterName, body).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono> getBackupWithResponseAsync(String resourceGroupName, String clusterName, + String backupId, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (backupId == null) { + return Mono.error(new IllegalArgumentException("Parameter backupId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getBackup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, backupId, accept, context); } /** - * Invoke a command like nodetool for cassandra maintenance. + * Get the properties of an individual backup of this cluster that is available to restore. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body Specification which command to run where. - * @param context The context to associate with this operation. + * @param backupId Id of a restorable backup of a Cassandra cluster. * @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 response of /command api on successful completion of {@link Mono}. + * @return the properties of an individual backup of this cluster that is available to restore on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono invokeCommandAsync(String resourceGroupName, String clusterName, - CommandPostBody body, Context context) { - return beginInvokeCommandAsync(resourceGroupName, clusterName, body, context).last() - .flatMap(this.client::getLroFinalResultOrError); + public Mono getBackupAsync(String resourceGroupName, String clusterName, String backupId) { + return getBackupWithResponseAsync(resourceGroupName, clusterName, backupId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Invoke a command like nodetool for cassandra maintenance. + * Get the properties of an individual backup of this cluster that is available to restore. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body Specification which command to run where. + * @param backupId Id of a restorable backup of a Cassandra cluster. + * @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 response of /command api. + * @return the properties of an individual backup of this cluster that is available to restore along with + * {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CommandOutputInner invokeCommand(String resourceGroupName, String clusterName, CommandPostBody body) { - return invokeCommandAsync(resourceGroupName, clusterName, body).block(); + public Response getBackupWithResponse(String resourceGroupName, String clusterName, + String backupId, Context context) { + return getBackupWithResponseAsync(resourceGroupName, clusterName, backupId, context).block(); } /** - * Invoke a command like nodetool for cassandra maintenance. + * Get the properties of an individual backup of this cluster that is available to restore. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. - * @param body Specification which command to run where. - * @param context The context to associate with this operation. + * @param backupId Id of a restorable backup of a Cassandra cluster. * @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 response of /command api. + * @return the properties of an individual backup of this cluster that is available to restore. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CommandOutputInner invokeCommand(String resourceGroupName, String clusterName, CommandPostBody body, - Context context) { - return invokeCommandAsync(resourceGroupName, clusterName, body, context).block(); + public BackupResourceInner getBackup(String resourceGroupName, String clusterName, String backupId) { + return getBackupWithResponse(resourceGroupName, clusterName, backupId, Context.NONE).getValue(); } /** @@ -1433,13 +2305,16 @@ public CommandOutputInner invokeCommand(String resourceGroupName, String cluster * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. + * @param forceDeallocate Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of + * Cluster Type Production might cause data loss. * @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>> deallocateWithResponseAsync(String resourceGroupName, String clusterName) { + public Mono>> deallocateWithResponseAsync(String resourceGroupName, String clusterName, + String forceDeallocate) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1455,10 +2330,9 @@ public Mono>> deallocateWithResponseAsync(String resou if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.deallocate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.deallocate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, forceDeallocate, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1469,6 +2343,8 @@ public Mono>> deallocateWithResponseAsync(String resou * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. + * @param forceDeallocate Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of + * Cluster Type Production might cause data loss. * @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. @@ -1477,7 +2353,7 @@ public Mono>> deallocateWithResponseAsync(String resou */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deallocateWithResponseAsync(String resourceGroupName, String clusterName, - Context context) { + String forceDeallocate, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1493,10 +2369,32 @@ private Mono>> deallocateWithResponseAsync(String reso if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.deallocate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, this.client.getApiVersion(), accept, context); + return service.deallocate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, forceDeallocate, context); + } + + /** + * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host + * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated + * cluster. Use Start to restart the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param forceDeallocate Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of + * Cluster Type Production might cause data loss. + * @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> beginDeallocateAsync(String resourceGroupName, String clusterName, + String forceDeallocate) { + Mono>> mono + = deallocateWithResponseAsync(resourceGroupName, clusterName, forceDeallocate); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** @@ -1513,7 +2411,9 @@ private Mono>> deallocateWithResponseAsync(String reso */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public PollerFlux, Void> beginDeallocateAsync(String resourceGroupName, String clusterName) { - Mono>> mono = deallocateWithResponseAsync(resourceGroupName, clusterName); + final String forceDeallocate = null; + Mono>> mono + = deallocateWithResponseAsync(resourceGroupName, clusterName, forceDeallocate); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } @@ -1525,6 +2425,8 @@ public PollerFlux, Void> beginDeallocateAsync(String resourceGr * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. + * @param forceDeallocate Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of + * Cluster Type Production might cause data loss. * @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. @@ -1533,9 +2435,10 @@ public PollerFlux, Void> beginDeallocateAsync(String resourceGr */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, Void> beginDeallocateAsync(String resourceGroupName, String clusterName, - Context context) { + String forceDeallocate, Context context) { context = this.client.mergeContext(context); - Mono>> mono = deallocateWithResponseAsync(resourceGroupName, clusterName, context); + Mono>> mono + = deallocateWithResponseAsync(resourceGroupName, clusterName, forceDeallocate, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); } @@ -1554,7 +2457,8 @@ private PollerFlux, Void> beginDeallocateAsync(String resourceG */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDeallocate(String resourceGroupName, String clusterName) { - return this.beginDeallocateAsync(resourceGroupName, clusterName).getSyncPoller(); + final String forceDeallocate = null; + return this.beginDeallocateAsync(resourceGroupName, clusterName, forceDeallocate).getSyncPoller(); } /** @@ -1564,6 +2468,8 @@ public SyncPoller, Void> beginDeallocate(String resourceGroupNa * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. + * @param forceDeallocate Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of + * Cluster Type Production might cause data loss. * @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. @@ -1572,8 +2478,28 @@ public SyncPoller, Void> beginDeallocate(String resourceGroupNa */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, Void> beginDeallocate(String resourceGroupName, String clusterName, - Context context) { - return this.beginDeallocateAsync(resourceGroupName, clusterName, context).getSyncPoller(); + String forceDeallocate, Context context) { + return this.beginDeallocateAsync(resourceGroupName, clusterName, forceDeallocate, context).getSyncPoller(); + } + + /** + * Deallocate the Managed Cassandra Cluster and Associated Data Centers. Deallocation will deallocate the host + * virtual machine of this cluster, and reserved the data disk. This won't do anything on an already deallocated + * cluster. Use Start to restart the cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster name. + * @param forceDeallocate Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of + * Cluster Type Production might cause data loss. + * @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 deallocateAsync(String resourceGroupName, String clusterName, String forceDeallocate) { + return beginDeallocateAsync(resourceGroupName, clusterName, forceDeallocate).last() + .flatMap(this.client::getLroFinalResultOrError); } /** @@ -1590,7 +2516,8 @@ public SyncPoller, Void> beginDeallocate(String resourceGroupNa */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono deallocateAsync(String resourceGroupName, String clusterName) { - return beginDeallocateAsync(resourceGroupName, clusterName).last() + final String forceDeallocate = null; + return beginDeallocateAsync(resourceGroupName, clusterName, forceDeallocate).last() .flatMap(this.client::getLroFinalResultOrError); } @@ -1601,6 +2528,8 @@ public Mono deallocateAsync(String resourceGroupName, String clusterName) * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. + * @param forceDeallocate Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of + * Cluster Type Production might cause data loss. * @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. @@ -1608,8 +2537,9 @@ public Mono deallocateAsync(String resourceGroupName, String clusterName) * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deallocateAsync(String resourceGroupName, String clusterName, Context context) { - return beginDeallocateAsync(resourceGroupName, clusterName, context).last() + private Mono deallocateAsync(String resourceGroupName, String clusterName, String forceDeallocate, + Context context) { + return beginDeallocateAsync(resourceGroupName, clusterName, forceDeallocate, context).last() .flatMap(this.client::getLroFinalResultOrError); } @@ -1626,7 +2556,8 @@ private Mono deallocateAsync(String resourceGroupName, String clusterName, */ @ServiceMethod(returns = ReturnType.SINGLE) public void deallocate(String resourceGroupName, String clusterName) { - deallocateAsync(resourceGroupName, clusterName).block(); + final String forceDeallocate = null; + deallocateAsync(resourceGroupName, clusterName, forceDeallocate).block(); } /** @@ -1636,14 +2567,16 @@ public void deallocate(String resourceGroupName, String clusterName) { * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. + * @param forceDeallocate Force to deallocate a cluster of Cluster Type Production. Force to deallocate a cluster of + * Cluster Type Production might cause data loss. * @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 deallocate(String resourceGroupName, String clusterName, Context context) { - deallocateAsync(resourceGroupName, clusterName, context).block(); + public void deallocate(String resourceGroupName, String clusterName, String forceDeallocate, Context context) { + deallocateAsync(resourceGroupName, clusterName, forceDeallocate, context).block(); } /** @@ -1675,10 +2608,9 @@ public Mono>> startWithResponseAsync(String resourceGr if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.start(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.start(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1713,10 +2645,9 @@ private Mono>> startWithResponseAsync(String resourceG if (clusterName == null) { return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.start(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, - this.client.getApiVersion(), accept, context); + return service.start(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, context); } /** @@ -1896,8 +2827,8 @@ public Mono> statusWithResponseAsync } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.status(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.status(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1933,8 +2864,8 @@ private Mono> statusWithResponseAsyn } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.status(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, this.client.getApiVersion(), accept, context); + return service.status(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, accept, context); } /** @@ -1985,4 +2916,223 @@ public Response statusWithResponse(String res public CassandraClusterPublicStatusInner status(String resourceGroupName, String clusterName) { return statusWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 list of managed Cassandra clusters along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 list of managed Cassandra clusters along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 list of managed Cassandra clusters along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 list of managed Cassandra clusters along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 list of commands for cluster along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCommandNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listCommandNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 list of commands for cluster along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCommandNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listCommandNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 list of restorable backups for a Cassandra cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBackupsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listBackupsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 list of restorable backups for a Cassandra cluster along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBackupsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBackupsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CassandraDataCentersClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CassandraDataCentersClientImpl.java index 724a55d5b85a..6a95348071f6 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CassandraDataCentersClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CassandraDataCentersClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -34,7 +34,7 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.cosmos.fluent.CassandraDataCentersClient; import com.azure.resourcemanager.cosmos.fluent.models.DataCenterResourceInner; -import com.azure.resourcemanager.cosmos.models.ListDataCenters; +import com.azure.resourcemanager.cosmos.implementation.models.ListDataCenters; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -68,201 +68,62 @@ public final class CassandraDataCentersClientImpl implements CassandraDataCenter * The interface defining all the services for CosmosDBManagementClientCassandraDataCenters to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientCassandraDataCenters") public interface CassandraDataCentersService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("dataCenterName") String dataCenterName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}") - @ExpectedResponses({ 202, 204 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("dataCenterName") String dataCenterName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("dataCenterName") String dataCenterName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("dataCenterName") String dataCenterName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DataCenterResourceInner body, @HeaderParam("Accept") String accept, + @PathParam("dataCenterName") String dataCenterName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DataCenterResourceInner body, Context context); - @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, - @PathParam("dataCenterName") String dataCenterName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DataCenterResourceInner body, @HeaderParam("Accept") String accept, + @PathParam("dataCenterName") String dataCenterName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") DataCenterResourceInner body, Context context); - } - - /** - * List all data centers in a particular managed Cassandra cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Managed Cassandra cluster 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 list of managed Cassandra data centers and their properties along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String clusterName) { - 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 (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, 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())); - } - - /** - * List all data centers in a particular managed Cassandra cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Managed Cassandra cluster 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 list of managed Cassandra data centers and their properties along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String clusterName, 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 (clusterName == null) { - return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); - } - - /** - * List all data centers in a particular managed Cassandra cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Managed Cassandra cluster 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 list of managed Cassandra data centers and their properties as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String clusterName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName)); - } - /** - * List all data centers in a particular managed Cassandra cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Managed Cassandra cluster 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 list of managed Cassandra data centers and their properties as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String clusterName, - Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName, context)); - } + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters/{dataCenterName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @PathParam("dataCenterName") String dataCenterName, Context context); - /** - * List all data centers in a particular managed Cassandra cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Managed Cassandra cluster 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 list of managed Cassandra data centers and their properties as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String clusterName) { - return new PagedIterable<>(listAsync(resourceGroupName, clusterName)); - } + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/cassandraClusters/{clusterName}/dataCenters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); - /** - * List all data centers in a particular managed Cassandra cluster. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param clusterName Managed Cassandra cluster 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 list of managed Cassandra data centers and their properties as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String clusterName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, clusterName, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -300,8 +161,8 @@ public Mono> getWithResponseAsync(String resou } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, dataCenterName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, dataCenterName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -341,8 +202,8 @@ private Mono> getWithResponseAsync(String reso } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, clusterName, - dataCenterName, this.client.getApiVersion(), accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, dataCenterName, accept, context); } /** @@ -397,19 +258,21 @@ public DataCenterResourceInner get(String resourceGroupName, String clusterName, } /** - * Delete a managed Cassandra data center. + * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some + * properties, use PATCH. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. + * @param body Parameters specifying the managed Cassandra data center. * @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}. + * @return a managed Cassandra data center along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, - String dataCenterName) { + public Mono>> createUpdateWithResponseAsync(String resourceGroupName, String clusterName, + String dataCenterName, DataCenterResourceInner body) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -428,28 +291,37 @@ public Mono>> deleteWithResponseAsync(String resourceG if (dataCenterName == null) { return Mono.error(new IllegalArgumentException("Parameter dataCenterName is required and cannot be null.")); } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, dataCenterName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.createUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, dataCenterName, contentType, accept, + body, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Delete a managed Cassandra data center. + * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some + * properties, use PATCH. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. + * @param body Parameters specifying the managed Cassandra data center. * @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}. + * @return a managed Cassandra data center along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, - String dataCenterName, Context context) { + private Mono>> createUpdateWithResponseAsync(String resourceGroupName, String clusterName, + String dataCenterName, DataCenterResourceInner body, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -468,170 +340,202 @@ private Mono>> deleteWithResponseAsync(String resource if (dataCenterName == null) { return Mono.error(new IllegalArgumentException("Parameter dataCenterName is required and cannot be null.")); } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, dataCenterName, this.client.getApiVersion(), accept, context); + return service.createUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, dataCenterName, contentType, accept, body, + context); } /** - * Delete a managed Cassandra data center. + * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some + * properties, use PATCH. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. + * @param body Parameters specifying the managed Cassandra data center. * @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. + * @return the {@link PollerFlux} for polling of a managed Cassandra data center. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, - String dataCenterName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, dataCenterName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + public PollerFlux, DataCenterResourceInner> beginCreateUpdateAsync( + String resourceGroupName, String clusterName, String dataCenterName, DataCenterResourceInner body) { + Mono>> mono + = createUpdateWithResponseAsync(resourceGroupName, clusterName, dataCenterName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DataCenterResourceInner.class, DataCenterResourceInner.class, this.client.getContext()); } /** - * Delete a managed Cassandra data center. + * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some + * properties, use PATCH. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. + * @param body Parameters specifying the managed Cassandra data center. * @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. + * @return the {@link PollerFlux} for polling of a managed Cassandra data center. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, - String dataCenterName, Context context) { + private PollerFlux, DataCenterResourceInner> beginCreateUpdateAsync( + String resourceGroupName, String clusterName, String dataCenterName, DataCenterResourceInner body, + Context context) { context = this.client.mergeContext(context); Mono>> mono - = deleteWithResponseAsync(resourceGroupName, clusterName, dataCenterName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + = createUpdateWithResponseAsync(resourceGroupName, clusterName, dataCenterName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), DataCenterResourceInner.class, DataCenterResourceInner.class, context); } /** - * Delete a managed Cassandra data center. + * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some + * properties, use PATCH. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. + * @param body Parameters specifying the managed Cassandra data center. * @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. + * @return the {@link SyncPoller} for polling of a managed Cassandra data center. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, - String dataCenterName) { - return this.beginDeleteAsync(resourceGroupName, clusterName, dataCenterName).getSyncPoller(); + public SyncPoller, DataCenterResourceInner> beginCreateUpdate( + String resourceGroupName, String clusterName, String dataCenterName, DataCenterResourceInner body) { + return this.beginCreateUpdateAsync(resourceGroupName, clusterName, dataCenterName, body).getSyncPoller(); } /** - * Delete a managed Cassandra data center. + * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some + * properties, use PATCH. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. + * @param body Parameters specifying the managed Cassandra data center. * @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. + * @return the {@link SyncPoller} for polling of a managed Cassandra data center. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, - String dataCenterName, Context context) { - return this.beginDeleteAsync(resourceGroupName, clusterName, dataCenterName, context).getSyncPoller(); + public SyncPoller, DataCenterResourceInner> beginCreateUpdate( + String resourceGroupName, String clusterName, String dataCenterName, DataCenterResourceInner body, + Context context) { + return this.beginCreateUpdateAsync(resourceGroupName, clusterName, dataCenterName, body, context) + .getSyncPoller(); } /** - * Delete a managed Cassandra data center. + * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some + * properties, use PATCH. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. + * @param body Parameters specifying the managed Cassandra data center. * @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. + * @return a managed Cassandra data center on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String clusterName, String dataCenterName) { - return beginDeleteAsync(resourceGroupName, clusterName, dataCenterName).last() + public Mono createUpdateAsync(String resourceGroupName, String clusterName, + String dataCenterName, DataCenterResourceInner body) { + return beginCreateUpdateAsync(resourceGroupName, clusterName, dataCenterName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Delete a managed Cassandra data center. + * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some + * properties, use PATCH. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. + * @param body Parameters specifying the managed Cassandra data center. * @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. + * @return a managed Cassandra data center on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String clusterName, String dataCenterName, - Context context) { - return beginDeleteAsync(resourceGroupName, clusterName, dataCenterName, context).last() + private Mono createUpdateAsync(String resourceGroupName, String clusterName, + String dataCenterName, DataCenterResourceInner body, Context context) { + return beginCreateUpdateAsync(resourceGroupName, clusterName, dataCenterName, body, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Delete a managed Cassandra data center. + * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some + * properties, use PATCH. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. + * @param body Parameters specifying the managed Cassandra data center. * @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 managed Cassandra data center. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String clusterName, String dataCenterName) { - deleteAsync(resourceGroupName, clusterName, dataCenterName).block(); + public DataCenterResourceInner createUpdate(String resourceGroupName, String clusterName, String dataCenterName, + DataCenterResourceInner body) { + return createUpdateAsync(resourceGroupName, clusterName, dataCenterName, body).block(); } /** - * Delete a managed Cassandra data center. + * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some + * properties, use PATCH. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. + * @param body Parameters specifying the managed Cassandra data center. * @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 managed Cassandra data center. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String clusterName, String dataCenterName, Context context) { - deleteAsync(resourceGroupName, clusterName, dataCenterName, context).block(); + public DataCenterResourceInner createUpdate(String resourceGroupName, String clusterName, String dataCenterName, + DataCenterResourceInner body, Context context) { + return createUpdateAsync(resourceGroupName, clusterName, dataCenterName, body, context).block(); } /** - * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some - * properties, use PATCH. + * Update some of the properties of a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters specifying the managed Cassandra data center. + * @param body Parameters to provide for specifying the managed Cassandra data center. * @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 managed Cassandra data center along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createUpdateWithResponseAsync(String resourceGroupName, String clusterName, + public Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, String dataCenterName, DataCenterResourceInner body) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -656,21 +560,22 @@ public Mono>> createUpdateWithResponseAsync(String res } else { body.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, dataCenterName, this.client.getApiVersion(), body, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, dataCenterName, contentType, accept, + body, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some - * properties, use PATCH. + * Update some of the properties of a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters specifying the managed Cassandra data center. + * @param body Parameters to provide for specifying the managed Cassandra data center. * @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. @@ -678,7 +583,7 @@ public Mono>> createUpdateWithResponseAsync(String res * @return a managed Cassandra data center along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createUpdateWithResponseAsync(String resourceGroupName, String clusterName, + private Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, String dataCenterName, DataCenterResourceInner body, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -703,43 +608,42 @@ private Mono>> createUpdateWithResponseAsync(String re } else { body.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, dataCenterName, this.client.getApiVersion(), body, accept, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, dataCenterName, contentType, accept, body, context); } /** - * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some - * properties, use PATCH. + * Update some of the properties of a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters specifying the managed Cassandra data center. + * @param body Parameters to provide for specifying the managed Cassandra data center. * @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 a managed Cassandra data center. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, DataCenterResourceInner> beginCreateUpdateAsync( + public PollerFlux, DataCenterResourceInner> beginUpdateAsync( String resourceGroupName, String clusterName, String dataCenterName, DataCenterResourceInner body) { Mono>> mono - = createUpdateWithResponseAsync(resourceGroupName, clusterName, dataCenterName, body); + = updateWithResponseAsync(resourceGroupName, clusterName, dataCenterName, body); return this.client.getLroResult(mono, this.client.getHttpPipeline(), DataCenterResourceInner.class, DataCenterResourceInner.class, this.client.getContext()); } /** - * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some - * properties, use PATCH. + * Update some of the properties of a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters specifying the managed Cassandra data center. + * @param body Parameters to provide for specifying the managed Cassandra data center. * @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. @@ -747,43 +651,41 @@ public PollerFlux, DataCenterResourceInner> * @return the {@link PollerFlux} for polling of a managed Cassandra data center. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DataCenterResourceInner> beginCreateUpdateAsync( + private PollerFlux, DataCenterResourceInner> beginUpdateAsync( String resourceGroupName, String clusterName, String dataCenterName, DataCenterResourceInner body, Context context) { context = this.client.mergeContext(context); Mono>> mono - = createUpdateWithResponseAsync(resourceGroupName, clusterName, dataCenterName, body, context); + = updateWithResponseAsync(resourceGroupName, clusterName, dataCenterName, body, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), DataCenterResourceInner.class, DataCenterResourceInner.class, context); } /** - * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some - * properties, use PATCH. + * Update some of the properties of a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters specifying the managed Cassandra data center. + * @param body Parameters to provide for specifying the managed Cassandra data center. * @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 a managed Cassandra data center. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DataCenterResourceInner> beginCreateUpdate( - String resourceGroupName, String clusterName, String dataCenterName, DataCenterResourceInner body) { - return this.beginCreateUpdateAsync(resourceGroupName, clusterName, dataCenterName, body).getSyncPoller(); + public SyncPoller, DataCenterResourceInner> + beginUpdate(String resourceGroupName, String clusterName, String dataCenterName, DataCenterResourceInner body) { + return this.beginUpdateAsync(resourceGroupName, clusterName, dataCenterName, body).getSyncPoller(); } /** - * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some - * properties, use PATCH. + * Update some of the properties of a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters specifying the managed Cassandra data center. + * @param body Parameters to provide for specifying the managed Cassandra data center. * @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. @@ -791,41 +693,38 @@ public SyncPoller, DataCenterResourceInner> * @return the {@link SyncPoller} for polling of a managed Cassandra data center. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DataCenterResourceInner> beginCreateUpdate( + public SyncPoller, DataCenterResourceInner> beginUpdate( String resourceGroupName, String clusterName, String dataCenterName, DataCenterResourceInner body, Context context) { - return this.beginCreateUpdateAsync(resourceGroupName, clusterName, dataCenterName, body, context) - .getSyncPoller(); + return this.beginUpdateAsync(resourceGroupName, clusterName, dataCenterName, body, context).getSyncPoller(); } /** - * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some - * properties, use PATCH. + * Update some of the properties of a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters specifying the managed Cassandra data center. + * @param body Parameters to provide for specifying the managed Cassandra data center. * @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 managed Cassandra data center on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createUpdateAsync(String resourceGroupName, String clusterName, + public Mono updateAsync(String resourceGroupName, String clusterName, String dataCenterName, DataCenterResourceInner body) { - return beginCreateUpdateAsync(resourceGroupName, clusterName, dataCenterName, body).last() + return beginUpdateAsync(resourceGroupName, clusterName, dataCenterName, body).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some - * properties, use PATCH. + * Update some of the properties of a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters specifying the managed Cassandra data center. + * @param body Parameters to provide for specifying the managed Cassandra data center. * @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. @@ -833,39 +732,37 @@ public Mono createUpdateAsync(String resourceGroupName, * @return a managed Cassandra data center on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createUpdateAsync(String resourceGroupName, String clusterName, + private Mono updateAsync(String resourceGroupName, String clusterName, String dataCenterName, DataCenterResourceInner body, Context context) { - return beginCreateUpdateAsync(resourceGroupName, clusterName, dataCenterName, body, context).last() + return beginUpdateAsync(resourceGroupName, clusterName, dataCenterName, body, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some - * properties, use PATCH. + * Update some of the properties of a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters specifying the managed Cassandra data center. + * @param body Parameters to provide for specifying the managed Cassandra data center. * @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 managed Cassandra data center. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DataCenterResourceInner createUpdate(String resourceGroupName, String clusterName, String dataCenterName, + public DataCenterResourceInner update(String resourceGroupName, String clusterName, String dataCenterName, DataCenterResourceInner body) { - return createUpdateAsync(resourceGroupName, clusterName, dataCenterName, body).block(); + return updateAsync(resourceGroupName, clusterName, dataCenterName, body).block(); } /** - * Create or update a managed Cassandra data center. When updating, overwrite all properties. To update only some - * properties, use PATCH. + * Update some of the properties of a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters specifying the managed Cassandra data center. + * @param body Parameters to provide for specifying the managed Cassandra data center. * @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. @@ -873,26 +770,25 @@ public DataCenterResourceInner createUpdate(String resourceGroupName, String clu * @return a managed Cassandra data center. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DataCenterResourceInner createUpdate(String resourceGroupName, String clusterName, String dataCenterName, + public DataCenterResourceInner update(String resourceGroupName, String clusterName, String dataCenterName, DataCenterResourceInner body, Context context) { - return createUpdateAsync(resourceGroupName, clusterName, dataCenterName, body, context).block(); + return updateAsync(resourceGroupName, clusterName, dataCenterName, body, context).block(); } /** - * Update some of the properties of a managed Cassandra data center. + * Delete a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters to provide for specifying the managed Cassandra data center. * @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 managed Cassandra data center along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, - String dataCenterName, DataCenterResourceInner body) { + public Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, + String dataCenterName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -911,34 +807,27 @@ public Mono>> updateWithResponseAsync(String resourceG if (dataCenterName == null) { return Mono.error(new IllegalArgumentException("Parameter dataCenterName is required and cannot be null.")); } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, clusterName, dataCenterName, this.client.getApiVersion(), body, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, dataCenterName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update some of the properties of a managed Cassandra data center. + * Delete a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters to provide for specifying the managed Cassandra data center. * @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 managed Cassandra data center along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, - String dataCenterName, DataCenterResourceInner body, Context context) { + private Mono>> deleteWithResponseAsync(String resourceGroupName, String clusterName, + String dataCenterName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -957,174 +846,348 @@ private Mono>> updateWithResponseAsync(String resource if (dataCenterName == null) { return Mono.error(new IllegalArgumentException("Parameter dataCenterName is required and cannot be null.")); } - if (body == null) { - return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); - } else { - body.validate(); - } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - clusterName, dataCenterName, this.client.getApiVersion(), body, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, dataCenterName, context); } /** - * Update some of the properties of a managed Cassandra data center. + * Delete a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters to provide for specifying the managed Cassandra data center. * @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 a managed Cassandra data center. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, DataCenterResourceInner> beginUpdateAsync( - String resourceGroupName, String clusterName, String dataCenterName, DataCenterResourceInner body) { - Mono>> mono - = updateWithResponseAsync(resourceGroupName, clusterName, dataCenterName, body); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DataCenterResourceInner.class, DataCenterResourceInner.class, + public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, + String dataCenterName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, dataCenterName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** - * Update some of the properties of a managed Cassandra data center. + * Delete a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters to provide for specifying the managed Cassandra data center. * @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 a managed Cassandra data center. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DataCenterResourceInner> beginUpdateAsync( - String resourceGroupName, String clusterName, String dataCenterName, DataCenterResourceInner body, - Context context) { + private PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String clusterName, + String dataCenterName, Context context) { context = this.client.mergeContext(context); Mono>> mono - = updateWithResponseAsync(resourceGroupName, clusterName, dataCenterName, body, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), DataCenterResourceInner.class, DataCenterResourceInner.class, context); + = deleteWithResponseAsync(resourceGroupName, clusterName, dataCenterName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** - * Update some of the properties of a managed Cassandra data center. + * Delete a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters to provide for specifying the managed Cassandra data center. * @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 a managed Cassandra data center. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DataCenterResourceInner> - beginUpdate(String resourceGroupName, String clusterName, String dataCenterName, DataCenterResourceInner body) { - return this.beginUpdateAsync(resourceGroupName, clusterName, dataCenterName, body).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, + String dataCenterName) { + return this.beginDeleteAsync(resourceGroupName, clusterName, dataCenterName).getSyncPoller(); } /** - * Update some of the properties of a managed Cassandra data center. + * Delete a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters to provide for specifying the managed Cassandra data center. * @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 a managed Cassandra data center. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DataCenterResourceInner> beginUpdate( - String resourceGroupName, String clusterName, String dataCenterName, DataCenterResourceInner body, - Context context) { - return this.beginUpdateAsync(resourceGroupName, clusterName, dataCenterName, body, context).getSyncPoller(); + public SyncPoller, Void> beginDelete(String resourceGroupName, String clusterName, + String dataCenterName, Context context) { + return this.beginDeleteAsync(resourceGroupName, clusterName, dataCenterName, context).getSyncPoller(); } /** - * Update some of the properties of a managed Cassandra data center. + * Delete a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters to provide for specifying the managed Cassandra data center. * @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 managed Cassandra data center on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, String clusterName, - String dataCenterName, DataCenterResourceInner body) { - return beginUpdateAsync(resourceGroupName, clusterName, dataCenterName, body).last() + public Mono deleteAsync(String resourceGroupName, String clusterName, String dataCenterName) { + return beginDeleteAsync(resourceGroupName, clusterName, dataCenterName).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Update some of the properties of a managed Cassandra data center. + * Delete a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters to provide for specifying the managed Cassandra data center. * @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 managed Cassandra data center on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String clusterName, - String dataCenterName, DataCenterResourceInner body, Context context) { - return beginUpdateAsync(resourceGroupName, clusterName, dataCenterName, body, context).last() + private Mono deleteAsync(String resourceGroupName, String clusterName, String dataCenterName, + Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, dataCenterName, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Update some of the properties of a managed Cassandra data center. + * Delete a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters to provide for specifying the managed Cassandra data center. * @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 managed Cassandra data center. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DataCenterResourceInner update(String resourceGroupName, String clusterName, String dataCenterName, - DataCenterResourceInner body) { - return updateAsync(resourceGroupName, clusterName, dataCenterName, body).block(); + public void delete(String resourceGroupName, String clusterName, String dataCenterName) { + deleteAsync(resourceGroupName, clusterName, dataCenterName).block(); } /** - * Update some of the properties of a managed Cassandra data center. + * Delete a managed Cassandra data center. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param clusterName Managed Cassandra cluster name. * @param dataCenterName Data center name in a managed Cassandra cluster. - * @param body Parameters to provide for specifying the managed Cassandra data center. * @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 managed Cassandra data center. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DataCenterResourceInner update(String resourceGroupName, String clusterName, String dataCenterName, - DataCenterResourceInner body, Context context) { - return updateAsync(resourceGroupName, clusterName, dataCenterName, body, context).block(); + public void delete(String resourceGroupName, String clusterName, String dataCenterName, Context context) { + deleteAsync(resourceGroupName, clusterName, dataCenterName, context).block(); + } + + /** + * List all data centers in a particular managed Cassandra cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster 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 list of managed Cassandra data centers and their properties along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String clusterName) { + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all data centers in a particular managed Cassandra cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster 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 list of managed Cassandra data centers and their properties along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String clusterName, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List all data centers in a particular managed Cassandra cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster 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 list of managed Cassandra data centers and their properties as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String clusterName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List all data centers in a particular managed Cassandra cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster 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 list of managed Cassandra data centers and their properties as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String clusterName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, clusterName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List all data centers in a particular managed Cassandra cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster 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 list of managed Cassandra data centers and their properties as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterName)); + } + + /** + * List all data centers in a particular managed Cassandra cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName Managed Cassandra cluster 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 list of managed Cassandra data centers and their properties as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String clusterName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, clusterName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 list of managed Cassandra data centers and their properties along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 list of managed Cassandra data centers and their properties along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CassandraResourcesClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CassandraResourcesClientImpl.java index 1ee04c6ffb7d..6153a75af047 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CassandraResourcesClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CassandraResourcesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -34,12 +34,19 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.cosmos.fluent.CassandraResourcesClient; import com.azure.resourcemanager.cosmos.fluent.models.CassandraKeyspaceGetResultsInner; +import com.azure.resourcemanager.cosmos.fluent.models.CassandraRoleAssignmentResourceInner; +import com.azure.resourcemanager.cosmos.fluent.models.CassandraRoleDefinitionResourceInner; import com.azure.resourcemanager.cosmos.fluent.models.CassandraTableGetResultsInner; +import com.azure.resourcemanager.cosmos.fluent.models.CassandraViewGetResultsInner; import com.azure.resourcemanager.cosmos.fluent.models.ThroughputSettingsGetResultsInner; +import com.azure.resourcemanager.cosmos.implementation.models.CassandraKeyspaceListResult; +import com.azure.resourcemanager.cosmos.implementation.models.CassandraRoleAssignmentListResult; +import com.azure.resourcemanager.cosmos.implementation.models.CassandraRoleDefinitionListResult; +import com.azure.resourcemanager.cosmos.implementation.models.CassandraTableListResult; +import com.azure.resourcemanager.cosmos.implementation.models.CassandraViewListResult; import com.azure.resourcemanager.cosmos.models.CassandraKeyspaceCreateUpdateParameters; -import com.azure.resourcemanager.cosmos.models.CassandraKeyspaceListResult; import com.azure.resourcemanager.cosmos.models.CassandraTableCreateUpdateParameters; -import com.azure.resourcemanager.cosmos.models.CassandraTableListResult; +import com.azure.resourcemanager.cosmos.models.CassandraViewCreateUpdateParameters; import com.azure.resourcemanager.cosmos.models.ThroughputSettingsUpdateParameters; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -74,189 +81,388 @@ public final class CassandraResourcesClientImpl implements CassandraResourcesCli * The interface defining all the services for CosmosDBManagementClientCassandraResources to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientCassandraResources") public interface CassandraResourcesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listCassandraKeyspaces(@HostParam("$host") String endpoint, + Mono> getCassandraKeyspaceThroughput( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("keyspaceName") String keyspaceName, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateCassandraKeyspaceThroughput(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("keyspaceName") String keyspaceName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ThroughputSettingsUpdateParameters updateThroughputParameters, + Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}") - @ExpectedResponses({ 200 }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getCassandraKeyspace(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> migrateCassandraKeyspaceToAutoscale(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("keyspaceName") String keyspaceName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("keyspaceName") String keyspaceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createUpdateCassandraKeyspace(@HostParam("$host") String endpoint, + Mono>> migrateCassandraKeyspaceToManualThroughput( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("keyspaceName") String keyspaceName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, - @HeaderParam("Accept") String accept, Context context); + @PathParam("keyspaceName") String keyspaceName, @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}/cassandraKeyspaces/{keyspaceName}") - @ExpectedResponses({ 202, 204 }) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteCassandraKeyspace(@HostParam("$host") String endpoint, + Mono> getCassandraTableThroughput( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("keyspaceName") String keyspaceName, @QueryParam("api-version") String apiVersion, + @PathParam("keyspaceName") String keyspaceName, @PathParam("tableName") String tableName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateCassandraTableThroughput(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("keyspaceName") String keyspaceName, @PathParam("tableName") String tableName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ThroughputSettingsUpdateParameters updateThroughputParameters, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default") - @ExpectedResponses({ 200 }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getCassandraKeyspaceThroughput( - @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + Mono>> migrateCassandraTableToAutoscale(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("keyspaceName") String keyspaceName, @QueryParam("api-version") String apiVersion, + @PathParam("keyspaceName") String keyspaceName, @PathParam("tableName") String tableName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateCassandraKeyspaceThroughput(@HostParam("$host") String endpoint, + Mono>> migrateCassandraTableToManualThroughput(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("keyspaceName") String keyspaceName, @PathParam("tableName") String tableName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getCassandraViewThroughput( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("keyspaceName") String keyspaceName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ThroughputSettingsUpdateParameters updateThroughputParameters, + @PathParam("keyspaceName") String keyspaceName, @PathParam("viewName") String viewName, @HeaderParam("Accept") String accept, Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateCassandraViewThroughput(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("keyspaceName") String keyspaceName, @PathParam("viewName") String viewName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ThroughputSettingsUpdateParameters updateThroughputParameters, + Context context); + @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToAutoscale") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToAutoscale") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> migrateCassandraKeyspaceToAutoscale(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> migrateCassandraViewToAutoscale(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("keyspaceName") String keyspaceName, @QueryParam("api-version") String apiVersion, + @PathParam("keyspaceName") String keyspaceName, @PathParam("viewName") String viewName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/throughputSettings/default/migrateToManualThroughput") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}/throughputSettings/default/migrateToManualThroughput") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> migrateCassandraKeyspaceToManualThroughput(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> migrateCassandraViewToManualThroughput(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("keyspaceName") String keyspaceName, @QueryParam("api-version") String apiVersion, + @PathParam("keyspaceName") String keyspaceName, @PathParam("viewName") String viewName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listCassandraTables(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getCassandraKeyspace(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("keyspaceName") String keyspaceName, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createUpdateCassandraKeyspace(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("keyspaceName") String keyspaceName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteCassandraKeyspace(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("keyspaceName") String keyspaceName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCassandraKeyspaces(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("keyspaceName") String keyspaceName, @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}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getCassandraTable(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getCassandraTable(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("keyspaceName") String keyspaceName, @PathParam("tableName") String tableName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createUpdateCassandraTable(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createUpdateCassandraTable(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("keyspaceName") String keyspaceName, @PathParam("tableName") String tableName, - @QueryParam("api-version") String apiVersion, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, - @HeaderParam("Accept") String accept, Context context); + Context context); @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteCassandraTable(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> deleteCassandraTable(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("keyspaceName") String keyspaceName, @PathParam("tableName") String tableName, - @QueryParam("api-version") String apiVersion, Context context); + @PathParam("keyspaceName") String keyspaceName, @PathParam("tableName") String tableName, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getCassandraTableThroughput( - @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + Mono> listCassandraTables(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("keyspaceName") String keyspaceName, @PathParam("tableName") String tableName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("keyspaceName") String keyspaceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default") - @ExpectedResponses({ 200, 202 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateCassandraTableThroughput(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getCassandraView(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("keyspaceName") String keyspaceName, @PathParam("tableName") String tableName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ThroughputSettingsUpdateParameters updateThroughputParameters, + @PathParam("keyspaceName") String keyspaceName, @PathParam("viewName") String viewName, @HeaderParam("Accept") String accept, Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createUpdateCassandraView(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("keyspaceName") String keyspaceName, @PathParam("viewName") String viewName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views/{viewName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteCassandraView(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("keyspaceName") String keyspaceName, @PathParam("viewName") String viewName, Context context); + @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/views") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCassandraViews(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("keyspaceName") String keyspaceName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleDefinitions/{roleDefinitionId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getCassandraRoleDefinition( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("roleDefinitionId") String roleDefinitionId, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleDefinitions/{roleDefinitionId}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> migrateCassandraTableToAutoscale(@HostParam("$host") String endpoint, + Mono>> createUpdateCassandraRoleDefinition(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("roleDefinitionId") String roleDefinitionId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") CassandraRoleDefinitionResourceInner createUpdateCassandraRoleDefinitionParameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleDefinitions/{roleDefinitionId}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteCassandraRoleDefinition(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("roleDefinitionId") String roleDefinitionId, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleDefinitions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCassandraRoleDefinitions( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("keyspaceName") String keyspaceName, @PathParam("tableName") String tableName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraKeyspaces/{keyspaceName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleAssignments/{roleAssignmentId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getCassandraRoleAssignment( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("roleAssignmentId") String roleAssignmentId, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleAssignments/{roleAssignmentId}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> migrateCassandraTableToManualThroughput(@HostParam("$host") String endpoint, + Mono>> createUpdateCassandraRoleAssignment(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("roleAssignmentId") String roleAssignmentId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") CassandraRoleAssignmentResourceInner createUpdateCassandraRoleAssignmentParameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleAssignments/{roleAssignmentId}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteCassandraRoleAssignment(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("roleAssignmentId") String roleAssignmentId, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/cassandraRoleAssignments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCassandraRoleAssignments( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("keyspaceName") String keyspaceName, @PathParam("tableName") String tableName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCassandraKeyspacesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCassandraTablesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCassandraViewsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCassandraRoleDefinitionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listCassandraRoleAssignmentsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** - * Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. + * Gets the RUs per second of the Cassandra Keyspace 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 keyspaceName Cosmos DB keyspace 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 Cassandra keyspaces and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the RUs per second of the Cassandra Keyspace 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> - listCassandraKeyspacesSinglePageAsync(String resourceGroupName, String accountName) { + public Mono> getCassandraKeyspaceThroughputWithResponseAsync( + String resourceGroupName, String accountName, String keyspaceName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -272,31 +478,34 @@ Mono>> migrateCassandraTableToManualThroughput(@HostPa if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + if (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listCassandraKeyspaces(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)) + .withContext(context -> service.getCassandraKeyspaceThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + keyspaceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. + * Gets the RUs per second of the Cassandra Keyspace 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 keyspaceName Cosmos DB keyspace 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 Cassandra keyspaces and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the RUs per second of the Cassandra Keyspace 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> - listCassandraKeyspacesSinglePageAsync(String resourceGroupName, String accountName, Context context) { + private Mono> getCassandraKeyspaceThroughputWithResponseAsync( + String resourceGroupName, String accountName, String keyspaceName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -312,100 +521,93 @@ Mono>> migrateCassandraTableToManualThroughput(@HostPa if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + if (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listCassandraKeyspaces(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)); + return service.getCassandraKeyspaceThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, accept, context); } /** - * Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. + * Gets the RUs per second of the Cassandra Keyspace 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 keyspaceName Cosmos DB keyspace 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 Cassandra keyspaces and their properties as paginated - * response with {@link PagedFlux}. + * @return the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the + * provided name on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listCassandraKeyspacesAsync(String resourceGroupName, - String accountName) { - return new PagedFlux<>(() -> listCassandraKeyspacesSinglePageAsync(resourceGroupName, accountName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getCassandraKeyspaceThroughputAsync(String resourceGroupName, + String accountName, String keyspaceName) { + return getCassandraKeyspaceThroughputWithResponseAsync(resourceGroupName, accountName, keyspaceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. + * Gets the RUs per second of the Cassandra Keyspace 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 keyspaceName Cosmos DB keyspace 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 Cassandra keyspaces and their properties as paginated - * response with {@link PagedFlux}. + * @return the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the + * provided name along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listCassandraKeyspacesAsync(String resourceGroupName, - String accountName, Context context) { - return new PagedFlux<>(() -> listCassandraKeyspacesSinglePageAsync(resourceGroupName, accountName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getCassandraKeyspaceThroughputWithResponse( + String resourceGroupName, String accountName, String keyspaceName, Context context) { + return getCassandraKeyspaceThroughputWithResponseAsync(resourceGroupName, accountName, keyspaceName, context) + .block(); } /** - * Lists the Cassandra keyspaces under an existing Azure Cosmos DB database account. + * Gets the RUs per second of the Cassandra Keyspace 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 keyspaceName Cosmos DB keyspace 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 Cassandra keyspaces and their properties as paginated - * response with {@link PagedIterable}. + * @return the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the + * provided name. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listCassandraKeyspaces(String resourceGroupName, - String accountName) { - return new PagedIterable<>(listCassandraKeyspacesAsync(resourceGroupName, accountName)); - } - - /** - * Lists the Cassandra keyspaces 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 Cassandra keyspaces and their properties as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listCassandraKeyspaces(String resourceGroupName, - String accountName, Context context) { - return new PagedIterable<>(listCassandraKeyspacesAsync(resourceGroupName, accountName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputSettingsGetResultsInner getCassandraKeyspaceThroughput(String resourceGroupName, + String accountName, String keyspaceName) { + return getCassandraKeyspaceThroughputWithResponse(resourceGroupName, accountName, keyspaceName, Context.NONE) + .getValue(); } /** - * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra + * Keyspace. * @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 Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name along - * with {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - getCassandraKeyspaceWithResponseAsync(String resourceGroupName, String accountName, String keyspaceName) { + public Mono>> updateCassandraKeyspaceThroughputWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -424,30 +626,40 @@ public PagedIterable listCassandraKeyspaces(St if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName 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 contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.getCassandraKeyspace(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, keyspaceName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.updateCassandraKeyspaceThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + keyspaceName, contentType, accept, updateThroughputParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra + * Keyspace. * @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 Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name along - * with {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getCassandraKeyspaceWithResponseAsync( - String resourceGroupName, String accountName, String keyspaceName, Context context) { + private Mono>> updateCassandraKeyspaceThroughputWithResponseAsync( + String resourceGroupName, String accountName, String keyspaceName, + ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -466,84 +678,216 @@ private Mono> getCassandraKeyspaceWit if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName 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 contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getCassandraKeyspace(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, keyspaceName, this.client.getApiVersion(), accept, context); + return service.updateCassandraKeyspaceThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, contentType, accept, + updateThroughputParameters, context); } /** - * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra + * Keyspace. * @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 Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name on - * successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, ThroughputSettingsGetResultsInner> + beginUpdateCassandraKeyspaceThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, + ThroughputSettingsUpdateParameters updateThroughputParameters) { + Mono>> mono = updateCassandraKeyspaceThroughputWithResponseAsync(resourceGroupName, + accountName, keyspaceName, 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 Cassandra Keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra + * Keyspace. + * @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> + beginUpdateCassandraKeyspaceThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, + ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateCassandraKeyspaceThroughputWithResponseAsync(resourceGroupName, + accountName, keyspaceName, updateThroughputParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, context); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra + * Keyspace. + * @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> + beginUpdateCassandraKeyspaceThroughput(String resourceGroupName, String accountName, String keyspaceName, + ThroughputSettingsUpdateParameters updateThroughputParameters) { + return this + .beginUpdateCassandraKeyspaceThroughputAsync(resourceGroupName, accountName, keyspaceName, + updateThroughputParameters) + .getSyncPoller(); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra + * Keyspace. + * @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> + beginUpdateCassandraKeyspaceThroughput(String resourceGroupName, String accountName, String keyspaceName, + ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + return this + .beginUpdateCassandraKeyspaceThroughputAsync(resourceGroupName, accountName, keyspaceName, + updateThroughputParameters, context) + .getSyncPoller(); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra + * Keyspace. + * @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 getCassandraKeyspaceAsync(String resourceGroupName, - String accountName, String keyspaceName) { - return getCassandraKeyspaceWithResponseAsync(resourceGroupName, accountName, keyspaceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono updateCassandraKeyspaceThroughputAsync(String resourceGroupName, + String accountName, String keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return beginUpdateCassandraKeyspaceThroughputAsync(resourceGroupName, accountName, keyspaceName, + updateThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra + * Keyspace. * @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 Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name along - * with {@link Response}. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCassandraKeyspaceWithResponse(String resourceGroupName, - String accountName, String keyspaceName, Context context) { - return getCassandraKeyspaceWithResponseAsync(resourceGroupName, accountName, keyspaceName, context).block(); + private Mono updateCassandraKeyspaceThroughputAsync(String resourceGroupName, + String accountName, String keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters, + Context context) { + return beginUpdateCassandraKeyspaceThroughputAsync(resourceGroupName, accountName, keyspaceName, + updateThroughputParameters, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Gets the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra + * Keyspace. * @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 Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. + * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CassandraKeyspaceGetResultsInner getCassandraKeyspace(String resourceGroupName, String accountName, - String keyspaceName) { - return getCassandraKeyspaceWithResponse(resourceGroupName, accountName, keyspaceName, Context.NONE).getValue(); + public ThroughputSettingsGetResultsInner updateCassandraKeyspaceThroughput(String resourceGroupName, + String accountName, String keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return updateCassandraKeyspaceThroughputAsync(resourceGroupName, accountName, keyspaceName, + updateThroughputParameters).block(); } /** - * Create or update an Azure Cosmos DB Cassandra keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra + * Keyspace. + * @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 Cassandra keyspace along with {@link Response} on successful completion of + * @return an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputSettingsGetResultsInner updateCassandraKeyspaceThroughput(String resourceGroupName, + String accountName, String keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters, + Context context) { + return updateCassandraKeyspaceThroughputAsync(resourceGroupName, accountName, keyspaceName, + updateThroughputParameters, context).block(); + } + + /** + * Migrate an Azure Cosmos DB Cassandra Keyspace 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 keyspaceName Cosmos DB keyspace 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>> createUpdateCassandraKeyspaceWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName, - CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { + public Mono>> migrateCassandraKeyspaceToAutoscaleWithResponseAsync( + String resourceGroupName, String accountName, String keyspaceName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -562,38 +906,30 @@ public Mono>> createUpdateCassandraKeyspaceWithRespons if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } - if (createUpdateCassandraKeyspaceParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter createUpdateCassandraKeyspaceParameters is required and cannot be null.")); - } else { - createUpdateCassandraKeyspaceParameters.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createUpdateCassandraKeyspace(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, - this.client.getApiVersion(), createUpdateCassandraKeyspaceParameters, accept, context)) + .withContext(context -> service.migrateCassandraKeyspaceToAutoscale(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + keyspaceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or update an Azure Cosmos DB Cassandra keyspace. + * Migrate an Azure Cosmos DB Cassandra Keyspace 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 keyspaceName Cosmos DB keyspace name. - * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. * @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 Cassandra keyspace along with {@link Response} on successful completion of + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createUpdateCassandraKeyspaceWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName, - CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, Context context) { + private Mono>> migrateCassandraKeyspaceToAutoscaleWithResponseAsync( + String resourceGroupName, String accountName, String keyspaceName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -612,195 +948,171 @@ private Mono>> createUpdateCassandraKeyspaceWithRespon if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } - if (createUpdateCassandraKeyspaceParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter createUpdateCassandraKeyspaceParameters is required and cannot be null.")); - } else { - createUpdateCassandraKeyspaceParameters.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createUpdateCassandraKeyspace(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, keyspaceName, this.client.getApiVersion(), - createUpdateCassandraKeyspaceParameters, accept, context); + return service.migrateCassandraKeyspaceToAutoscale(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, accept, context); } /** - * Create or update an Azure Cosmos DB Cassandra keyspace. + * Migrate an Azure Cosmos DB Cassandra Keyspace 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 keyspaceName Cosmos DB keyspace name. - * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. * @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 Cassandra keyspace. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, CassandraKeyspaceGetResultsInner> - beginCreateUpdateCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName, - CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { - Mono>> mono = createUpdateCassandraKeyspaceWithResponseAsync(resourceGroupName, - accountName, keyspaceName, createUpdateCassandraKeyspaceParameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), CassandraKeyspaceGetResultsInner.class, - CassandraKeyspaceGetResultsInner.class, this.client.getContext()); + public PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateCassandraKeyspaceToAutoscaleAsync(String resourceGroupName, String accountName, + String keyspaceName) { + Mono>> mono + = migrateCassandraKeyspaceToAutoscaleWithResponseAsync(resourceGroupName, accountName, keyspaceName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, this.client.getContext()); } /** - * Create or update an Azure Cosmos DB Cassandra keyspace. + * Migrate an Azure Cosmos DB Cassandra Keyspace 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 keyspaceName Cosmos DB keyspace name. - * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. * @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 Cassandra keyspace. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CassandraKeyspaceGetResultsInner> - beginCreateUpdateCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName, - CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, Context context) { + private PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateCassandraKeyspaceToAutoscaleAsync(String resourceGroupName, String accountName, String keyspaceName, + Context context) { context = this.client.mergeContext(context); - Mono>> mono = createUpdateCassandraKeyspaceWithResponseAsync(resourceGroupName, - accountName, keyspaceName, createUpdateCassandraKeyspaceParameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), CassandraKeyspaceGetResultsInner.class, - CassandraKeyspaceGetResultsInner.class, context); + Mono>> mono = migrateCassandraKeyspaceToAutoscaleWithResponseAsync(resourceGroupName, + accountName, keyspaceName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, context); } /** - * Create or update an Azure Cosmos DB Cassandra keyspace. + * Migrate an Azure Cosmos DB Cassandra Keyspace 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 keyspaceName Cosmos DB keyspace name. - * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. * @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 Cassandra keyspace. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CassandraKeyspaceGetResultsInner> - beginCreateUpdateCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName, - CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { - return this - .beginCreateUpdateCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, - createUpdateCassandraKeyspaceParameters) + public SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateCassandraKeyspaceToAutoscale(String resourceGroupName, String accountName, String keyspaceName) { + return this.beginMigrateCassandraKeyspaceToAutoscaleAsync(resourceGroupName, accountName, keyspaceName) .getSyncPoller(); } /** - * Create or update an Azure Cosmos DB Cassandra keyspace. + * Migrate an Azure Cosmos DB Cassandra Keyspace 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 keyspaceName Cosmos DB keyspace name. - * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. * @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 Cassandra keyspace. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CassandraKeyspaceGetResultsInner> - beginCreateUpdateCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName, - CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, Context context) { - return this - .beginCreateUpdateCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, - createUpdateCassandraKeyspaceParameters, context) + public SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateCassandraKeyspaceToAutoscale(String resourceGroupName, String accountName, String keyspaceName, + Context context) { + return this.beginMigrateCassandraKeyspaceToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, context) .getSyncPoller(); } /** - * Create or update an Azure Cosmos DB Cassandra keyspace. + * Migrate an Azure Cosmos DB Cassandra Keyspace 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 keyspaceName Cosmos DB keyspace name. - * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. * @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 Cassandra keyspace on successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createUpdateCassandraKeyspaceAsync(String resourceGroupName, - String accountName, String keyspaceName, - CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { - return beginCreateUpdateCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, - createUpdateCassandraKeyspaceParameters).last().flatMap(this.client::getLroFinalResultOrError); + public Mono migrateCassandraKeyspaceToAutoscaleAsync(String resourceGroupName, + String accountName, String keyspaceName) { + return beginMigrateCassandraKeyspaceToAutoscaleAsync(resourceGroupName, accountName, keyspaceName).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Create or update an Azure Cosmos DB Cassandra keyspace. + * Migrate an Azure Cosmos DB Cassandra Keyspace 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 keyspaceName Cosmos DB keyspace name. - * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. * @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 Cassandra keyspace on successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createUpdateCassandraKeyspaceAsync(String resourceGroupName, - String accountName, String keyspaceName, - CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, Context context) { - return beginCreateUpdateCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, - createUpdateCassandraKeyspaceParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono migrateCassandraKeyspaceToAutoscaleAsync(String resourceGroupName, + String accountName, String keyspaceName, Context context) { + return beginMigrateCassandraKeyspaceToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Create or update an Azure Cosmos DB Cassandra keyspace. + * Migrate an Azure Cosmos DB Cassandra Keyspace 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 keyspaceName Cosmos DB keyspace name. - * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. * @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 Cassandra keyspace. + * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CassandraKeyspaceGetResultsInner createUpdateCassandraKeyspace(String resourceGroupName, String accountName, - String keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { - return createUpdateCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, - createUpdateCassandraKeyspaceParameters).block(); + public ThroughputSettingsGetResultsInner migrateCassandraKeyspaceToAutoscale(String resourceGroupName, + String accountName, String keyspaceName) { + return migrateCassandraKeyspaceToAutoscaleAsync(resourceGroupName, accountName, keyspaceName).block(); } /** - * Create or update an Azure Cosmos DB Cassandra keyspace. + * Migrate an Azure Cosmos DB Cassandra Keyspace 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 keyspaceName Cosmos DB keyspace name. - * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. * @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 Cassandra keyspace. + * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CassandraKeyspaceGetResultsInner createUpdateCassandraKeyspace(String resourceGroupName, String accountName, - String keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, - Context context) { - return createUpdateCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, - createUpdateCassandraKeyspaceParameters, context).block(); + public ThroughputSettingsGetResultsInner migrateCassandraKeyspaceToAutoscale(String resourceGroupName, + String accountName, String keyspaceName, Context context) { + return migrateCassandraKeyspaceToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, context).block(); } /** - * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * Migrate an Azure Cosmos DB Cassandra Keyspace 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. @@ -808,11 +1120,12 @@ public CassandraKeyspaceGetResultsInner createUpdateCassandraKeyspace(String res * @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}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteCassandraKeyspaceWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName) { + public Mono>> migrateCassandraKeyspaceToManualThroughputWithResponseAsync( + String resourceGroupName, String accountName, String keyspaceName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -831,15 +1144,16 @@ public Mono>> deleteCassandraKeyspaceWithResponseAsync if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } + final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.deleteCassandraKeyspace(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, keyspaceName, this.client.getApiVersion(), context)) + .withContext(context -> service.migrateCassandraKeyspaceToManualThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + keyspaceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * Migrate an Azure Cosmos DB Cassandra Keyspace 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. @@ -848,11 +1162,12 @@ public Mono>> deleteCassandraKeyspaceWithResponseAsync * @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}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteCassandraKeyspaceWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName, Context context) { + private Mono>> migrateCassandraKeyspaceToManualThroughputWithResponseAsync( + String resourceGroupName, String accountName, String keyspaceName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -871,13 +1186,15 @@ private Mono>> deleteCassandraKeyspaceWithResponseAsyn if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } + final String accept = "application/json"; context = this.client.mergeContext(context); - return service.deleteCassandraKeyspace(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, keyspaceName, this.client.getApiVersion(), context); + return service.migrateCassandraKeyspaceToManualThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, + accept, context); } /** - * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * Migrate an Azure Cosmos DB Cassandra Keyspace 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. @@ -885,19 +1202,21 @@ private Mono>> deleteCassandraKeyspaceWithResponseAsyn * @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. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteCassandraKeyspaceAsync(String resourceGroupName, - String accountName, String keyspaceName) { + public PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateCassandraKeyspaceToManualThroughputAsync(String resourceGroupName, String accountName, + String keyspaceName) { Mono>> mono - = deleteCassandraKeyspaceWithResponseAsync(resourceGroupName, accountName, keyspaceName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + = migrateCassandraKeyspaceToManualThroughputWithResponseAsync(resourceGroupName, accountName, keyspaceName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, this.client.getContext()); } /** - * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * Migrate an Azure Cosmos DB Cassandra Keyspace 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. @@ -906,20 +1225,22 @@ public PollerFlux, Void> beginDeleteCassandraKeyspaceAsync(Stri * @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. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteCassandraKeyspaceAsync(String resourceGroupName, - String accountName, String keyspaceName, Context context) { + private PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateCassandraKeyspaceToManualThroughputAsync(String resourceGroupName, String accountName, + String keyspaceName, Context context) { context = this.client.mergeContext(context); - Mono>> mono - = deleteCassandraKeyspaceWithResponseAsync(resourceGroupName, accountName, keyspaceName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + Mono>> mono = migrateCassandraKeyspaceToManualThroughputWithResponseAsync( + resourceGroupName, accountName, keyspaceName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, context); } /** - * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * Migrate an Azure Cosmos DB Cassandra Keyspace 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. @@ -927,16 +1248,18 @@ private PollerFlux, Void> beginDeleteCassandraKeyspaceAsync(Str * @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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteCassandraKeyspace(String resourceGroupName, String accountName, - String keyspaceName) { - return this.beginDeleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName).getSyncPoller(); + public SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateCassandraKeyspaceToManualThroughput(String resourceGroupName, String accountName, + String keyspaceName) { + return this.beginMigrateCassandraKeyspaceToManualThroughputAsync(resourceGroupName, accountName, keyspaceName) + .getSyncPoller(); } /** - * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * Migrate an Azure Cosmos DB Cassandra Keyspace 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. @@ -945,17 +1268,19 @@ public SyncPoller, Void> beginDeleteCassandraKeyspace(String re * @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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteCassandraKeyspace(String resourceGroupName, String accountName, - String keyspaceName, Context context) { - return this.beginDeleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, context) + public SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateCassandraKeyspaceToManualThroughput(String resourceGroupName, String accountName, + String keyspaceName, Context context) { + return this + .beginMigrateCassandraKeyspaceToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, context) .getSyncPoller(); } /** - * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * Migrate an Azure Cosmos DB Cassandra Keyspace 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. @@ -963,16 +1288,17 @@ public SyncPoller, Void> beginDeleteCassandraKeyspace(String re * @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. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName) { - return beginDeleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName).last() + public Mono migrateCassandraKeyspaceToManualThroughputAsync( + String resourceGroupName, String accountName, String keyspaceName) { + return beginMigrateCassandraKeyspaceToManualThroughputAsync(resourceGroupName, accountName, keyspaceName).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * Migrate an Azure Cosmos DB Cassandra Keyspace 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. @@ -981,17 +1307,17 @@ public Mono deleteCassandraKeyspaceAsync(String resourceGroupName, String * @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. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName, - Context context) { - return beginDeleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono migrateCassandraKeyspaceToManualThroughputAsync( + String resourceGroupName, String accountName, String keyspaceName, Context context) { + return beginMigrateCassandraKeyspaceToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, + context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * Migrate an Azure Cosmos DB Cassandra Keyspace 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. @@ -999,14 +1325,16 @@ private Mono deleteCassandraKeyspaceAsync(String resourceGroupName, String * @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 void deleteCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName) { - deleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName).block(); + public ThroughputSettingsGetResultsInner migrateCassandraKeyspaceToManualThroughput(String resourceGroupName, + String accountName, String keyspaceName) { + return migrateCassandraKeyspaceToManualThroughputAsync(resourceGroupName, accountName, keyspaceName).block(); } /** - * Deletes an existing Azure Cosmos DB Cassandra keyspace. + * Migrate an Azure Cosmos DB Cassandra Keyspace 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. @@ -1015,29 +1343,32 @@ public void deleteCassandraKeyspace(String resourceGroupName, String accountName * @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 void deleteCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName, - Context context) { - deleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, context).block(); + public ThroughputSettingsGetResultsInner migrateCassandraKeyspaceToManualThroughput(String resourceGroupName, + String accountName, String keyspaceName, Context context) { + return migrateCassandraKeyspaceToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, context) + .block(); } /** - * Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the + * Gets the RUs per second of the Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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 Cassandra Keyspace under an existing Azure Cosmos DB database account with the + * @return the RUs per second of the Cassandra table 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> getCassandraKeyspaceThroughputWithResponseAsync( - String resourceGroupName, String accountName, String keyspaceName) { + public Mono> getCassandraTableThroughputWithResponseAsync( + String resourceGroupName, String accountName, String keyspaceName, String tableName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1056,31 +1387,35 @@ public Mono> getCassandraKeyspaceThr if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getCassandraKeyspaceThroughput(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.getCassandraTableThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + keyspaceName, tableName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the + * Gets the RUs per second of the Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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 Cassandra Keyspace under an existing Azure Cosmos DB database account with the + * @return the RUs per second of the Cassandra table 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> getCassandraKeyspaceThroughputWithResponseAsync( - String resourceGroupName, String accountName, String keyspaceName, Context context) { + private Mono> getCassandraTableThroughputWithResponseAsync( + String resourceGroupName, String accountName, String keyspaceName, String tableName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1099,81 +1434,88 @@ private Mono> getCassandraKeyspaceTh if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getCassandraKeyspaceThroughput(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, keyspaceName, this.client.getApiVersion(), accept, context); + return service.getCassandraTableThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, accept, context); } /** - * Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the + * Gets the RUs per second of the Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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 Cassandra Keyspace under an existing Azure Cosmos DB database account with the + * @return the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the * provided name on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getCassandraKeyspaceThroughputAsync(String resourceGroupName, - String accountName, String keyspaceName) { - return getCassandraKeyspaceThroughputWithResponseAsync(resourceGroupName, accountName, keyspaceName) + public Mono getCassandraTableThroughputAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName) { + return getCassandraTableThroughputWithResponseAsync(resourceGroupName, accountName, keyspaceName, tableName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the + * Gets the RUs per second of the Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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 Cassandra Keyspace under an existing Azure Cosmos DB database account with the + * @return the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the * provided name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCassandraKeyspaceThroughputWithResponse( - String resourceGroupName, String accountName, String keyspaceName, Context context) { - return getCassandraKeyspaceThroughputWithResponseAsync(resourceGroupName, accountName, keyspaceName, context) - .block(); + public Response getCassandraTableThroughputWithResponse(String resourceGroupName, + String accountName, String keyspaceName, String tableName, Context context) { + return getCassandraTableThroughputWithResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, + context).block(); } /** - * Gets the RUs per second of the Cassandra Keyspace under an existing Azure Cosmos DB database account with the + * Gets the RUs per second of the Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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 Cassandra Keyspace under an existing Azure Cosmos DB database account with the + * @return the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the * provided name. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner getCassandraKeyspaceThroughput(String resourceGroupName, - String accountName, String keyspaceName) { - return getCassandraKeyspaceThroughputWithResponse(resourceGroupName, accountName, keyspaceName, Context.NONE) - .getValue(); + public ThroughputSettingsGetResultsInner getCassandraTableThroughput(String resourceGroupName, String accountName, + String keyspaceName, String tableName) { + return getCassandraTableThroughputWithResponse(resourceGroupName, accountName, keyspaceName, tableName, + Context.NONE).getValue(); } /** - * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * Keyspace. + * table. * @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. @@ -1181,8 +1523,9 @@ public ThroughputSettingsGetResultsInner getCassandraKeyspaceThroughput(String r * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateCassandraKeyspaceThroughputWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + public Mono>> updateCassandraTableThroughputWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName, + ThroughputSettingsUpdateParameters updateThroughputParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1201,28 +1544,33 @@ public Mono>> updateCassandraKeyspaceThroughputWithRes if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName 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 contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.updateCassandraKeyspaceThroughput(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, - this.client.getApiVersion(), updateThroughputParameters, accept, context)) + .withContext(context -> service.updateCassandraTableThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + keyspaceName, tableName, contentType, accept, updateThroughputParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * Keyspace. + * table. * @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. @@ -1231,8 +1579,8 @@ public Mono>> updateCassandraKeyspaceThroughputWithRes * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateCassandraKeyspaceThroughputWithResponseAsync( - String resourceGroupName, String accountName, String keyspaceName, + private Mono>> updateCassandraTableThroughputWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -1252,27 +1600,32 @@ private Mono>> updateCassandraKeyspaceThroughputWithRe if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName 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 contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.updateCassandraKeyspaceThroughput(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, keyspaceName, this.client.getApiVersion(), updateThroughputParameters, - accept, context); + return service.updateCassandraTableThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, contentType, + accept, updateThroughputParameters, context); } /** - * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * Keyspace. + * table. * @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. @@ -1280,23 +1633,24 @@ private Mono>> updateCassandraKeyspaceThroughputWithRe */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public PollerFlux, ThroughputSettingsGetResultsInner> - beginUpdateCassandraKeyspaceThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, - ThroughputSettingsUpdateParameters updateThroughputParameters) { - Mono>> mono = updateCassandraKeyspaceThroughputWithResponseAsync(resourceGroupName, - accountName, keyspaceName, updateThroughputParameters); + beginUpdateCassandraTableThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, + String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + Mono>> mono = updateCassandraTableThroughputWithResponseAsync(resourceGroupName, + accountName, keyspaceName, tableName, 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 Cassandra Keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * Keyspace. + * table. * @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. @@ -1305,24 +1659,25 @@ private Mono>> updateCassandraKeyspaceThroughputWithRe */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ThroughputSettingsGetResultsInner> - beginUpdateCassandraKeyspaceThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, - ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + beginUpdateCassandraTableThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, + String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { context = this.client.mergeContext(context); - Mono>> mono = updateCassandraKeyspaceThroughputWithResponseAsync(resourceGroupName, - accountName, keyspaceName, updateThroughputParameters, context); + Mono>> mono = updateCassandraTableThroughputWithResponseAsync(resourceGroupName, + accountName, keyspaceName, tableName, updateThroughputParameters, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, ThroughputSettingsGetResultsInner.class, context); } /** - * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * Keyspace. + * table. * @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. @@ -1330,22 +1685,23 @@ private Mono>> updateCassandraKeyspaceThroughputWithRe */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateCassandraKeyspaceThroughput(String resourceGroupName, String accountName, String keyspaceName, - ThroughputSettingsUpdateParameters updateThroughputParameters) { + beginUpdateCassandraTableThroughput(String resourceGroupName, String accountName, String keyspaceName, + String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters) { return this - .beginUpdateCassandraKeyspaceThroughputAsync(resourceGroupName, accountName, keyspaceName, + .beginUpdateCassandraTableThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters) .getSyncPoller(); } /** - * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * Keyspace. + * table. * @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. @@ -1354,42 +1710,45 @@ private Mono>> updateCassandraKeyspaceThroughputWithRe */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateCassandraKeyspaceThroughput(String resourceGroupName, String accountName, String keyspaceName, - ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + beginUpdateCassandraTableThroughput(String resourceGroupName, String accountName, String keyspaceName, + String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { return this - .beginUpdateCassandraKeyspaceThroughputAsync(resourceGroupName, accountName, keyspaceName, + .beginUpdateCassandraTableThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters, context) .getSyncPoller(); } /** - * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * Keyspace. + * table. * @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 updateCassandraKeyspaceThroughputAsync(String resourceGroupName, - String accountName, String keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return beginUpdateCassandraKeyspaceThroughputAsync(resourceGroupName, accountName, keyspaceName, + public Mono updateCassandraTableThroughputAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName, + ThroughputSettingsUpdateParameters updateThroughputParameters) { + return beginUpdateCassandraTableThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * Keyspace. + * table. * @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. @@ -1397,41 +1756,44 @@ public Mono updateCassandraKeyspaceThroughput * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateCassandraKeyspaceThroughputAsync(String resourceGroupName, - String accountName, String keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters, - Context context) { - return beginUpdateCassandraKeyspaceThroughputAsync(resourceGroupName, accountName, keyspaceName, + private Mono updateCassandraTableThroughputAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName, + ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + return beginUpdateCassandraTableThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * Keyspace. + * table. * @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 updateCassandraKeyspaceThroughput(String resourceGroupName, - String accountName, String keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return updateCassandraKeyspaceThroughputAsync(resourceGroupName, accountName, keyspaceName, + public ThroughputSettingsGetResultsInner updateCassandraTableThroughput(String resourceGroupName, + String accountName, String keyspaceName, String tableName, + ThroughputSettingsUpdateParameters updateThroughputParameters) { + return updateCassandraTableThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters).block(); } /** - * Update RUs per second of an Azure Cosmos DB Cassandra Keyspace. + * Update RUs per second of an Azure Cosmos DB Cassandra table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * Keyspace. + * table. * @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. @@ -1439,19 +1801,20 @@ public ThroughputSettingsGetResultsInner updateCassandraKeyspaceThroughput(Strin * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner updateCassandraKeyspaceThroughput(String resourceGroupName, - String accountName, String keyspaceName, ThroughputSettingsUpdateParameters updateThroughputParameters, - Context context) { - return updateCassandraKeyspaceThroughputAsync(resourceGroupName, accountName, keyspaceName, + public ThroughputSettingsGetResultsInner updateCassandraTableThroughput(String resourceGroupName, + String accountName, String keyspaceName, String tableName, + ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + return updateCassandraTableThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName, updateThroughputParameters, context).block(); } /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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. @@ -1459,8 +1822,8 @@ public ThroughputSettingsGetResultsInner updateCassandraKeyspaceThroughput(Strin * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> migrateCassandraKeyspaceToAutoscaleWithResponseAsync( - String resourceGroupName, String accountName, String keyspaceName) { + public Mono>> migrateCassandraTableToAutoscaleWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1479,20 +1842,24 @@ public Mono>> migrateCassandraKeyspaceToAutoscaleWithR if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.migrateCassandraKeyspaceToAutoscale(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.migrateCassandraTableToAutoscale(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + keyspaceName, tableName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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. @@ -1501,8 +1868,8 @@ public Mono>> migrateCassandraKeyspaceToAutoscaleWithR * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> migrateCassandraKeyspaceToAutoscaleWithResponseAsync( - String resourceGroupName, String accountName, String keyspaceName, Context context) { + private Mono>> migrateCassandraTableToAutoscaleWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1521,18 +1888,22 @@ private Mono>> migrateCassandraKeyspaceToAutoscaleWith if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.migrateCassandraKeyspaceToAutoscale(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, keyspaceName, this.client.getApiVersion(), accept, context); + return service.migrateCassandraTableToAutoscale(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, accept, context); } /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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. @@ -1540,21 +1911,22 @@ private Mono>> migrateCassandraKeyspaceToAutoscaleWith */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateCassandraKeyspaceToAutoscaleAsync(String resourceGroupName, String accountName, - String keyspaceName) { - Mono>> mono - = migrateCassandraKeyspaceToAutoscaleWithResponseAsync(resourceGroupName, accountName, keyspaceName); + beginMigrateCassandraTableToAutoscaleAsync(String resourceGroupName, String accountName, String keyspaceName, + String tableName) { + Mono>> mono = migrateCassandraTableToAutoscaleWithResponseAsync(resourceGroupName, + accountName, keyspaceName, tableName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, ThroughputSettingsGetResultsInner.class, this.client.getContext()); } /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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. @@ -1563,22 +1935,23 @@ private Mono>> migrateCassandraKeyspaceToAutoscaleWith */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateCassandraKeyspaceToAutoscaleAsync(String resourceGroupName, String accountName, String keyspaceName, - Context context) { + beginMigrateCassandraTableToAutoscaleAsync(String resourceGroupName, String accountName, String keyspaceName, + String tableName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = migrateCassandraKeyspaceToAutoscaleWithResponseAsync(resourceGroupName, - accountName, keyspaceName, context); + Mono>> mono = migrateCassandraTableToAutoscaleWithResponseAsync(resourceGroupName, + accountName, keyspaceName, tableName, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, ThroughputSettingsGetResultsInner.class, context); } /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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. @@ -1586,17 +1959,19 @@ private Mono>> migrateCassandraKeyspaceToAutoscaleWith */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateCassandraKeyspaceToAutoscale(String resourceGroupName, String accountName, String keyspaceName) { - return this.beginMigrateCassandraKeyspaceToAutoscaleAsync(resourceGroupName, accountName, keyspaceName) + beginMigrateCassandraTableToAutoscale(String resourceGroupName, String accountName, String keyspaceName, + String tableName) { + return this.beginMigrateCassandraTableToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, tableName) .getSyncPoller(); } /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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. @@ -1605,36 +1980,41 @@ private Mono>> migrateCassandraKeyspaceToAutoscaleWith */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateCassandraKeyspaceToAutoscale(String resourceGroupName, String accountName, String keyspaceName, - Context context) { - return this.beginMigrateCassandraKeyspaceToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, context) + beginMigrateCassandraTableToAutoscale(String resourceGroupName, String accountName, String keyspaceName, + String tableName, Context context) { + return this + .beginMigrateCassandraTableToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, tableName, + context) .getSyncPoller(); } /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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 migrateCassandraKeyspaceToAutoscaleAsync(String resourceGroupName, - String accountName, String keyspaceName) { - return beginMigrateCassandraKeyspaceToAutoscaleAsync(resourceGroupName, accountName, keyspaceName).last() + public Mono migrateCassandraTableToAutoscaleAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName) { + return beginMigrateCassandraTableToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, tableName) + .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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. @@ -1642,36 +2022,37 @@ public Mono migrateCassandraKeyspaceToAutosca * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono migrateCassandraKeyspaceToAutoscaleAsync(String resourceGroupName, - String accountName, String keyspaceName, Context context) { - return beginMigrateCassandraKeyspaceToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono migrateCassandraTableToAutoscaleAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName, Context context) { + return beginMigrateCassandraTableToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, tableName, + context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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 migrateCassandraKeyspaceToAutoscale(String resourceGroupName, - String accountName, String keyspaceName) { - return migrateCassandraKeyspaceToAutoscaleAsync(resourceGroupName, accountName, keyspaceName).block(); + public ThroughputSettingsGetResultsInner migrateCassandraTableToAutoscale(String resourceGroupName, + String accountName, String keyspaceName, String tableName) { + return migrateCassandraTableToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, tableName).block(); } /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from manual throughput to autoscale. + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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. @@ -1679,17 +2060,19 @@ public ThroughputSettingsGetResultsInner migrateCassandraKeyspaceToAutoscale(Str * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner migrateCassandraKeyspaceToAutoscale(String resourceGroupName, - String accountName, String keyspaceName, Context context) { - return migrateCassandraKeyspaceToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, context).block(); + public ThroughputSettingsGetResultsInner migrateCassandraTableToAutoscale(String resourceGroupName, + String accountName, String keyspaceName, String tableName, Context context) { + return migrateCassandraTableToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, tableName, context) + .block(); } /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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. @@ -1697,8 +2080,8 @@ public ThroughputSettingsGetResultsInner migrateCassandraKeyspaceToAutoscale(Str * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> migrateCassandraKeyspaceToManualThroughputWithResponseAsync( - String resourceGroupName, String accountName, String keyspaceName) { + public Mono>> migrateCassandraTableToManualThroughputWithResponseAsync( + String resourceGroupName, String accountName, String keyspaceName, String tableName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1717,20 +2100,24 @@ public Mono>> migrateCassandraKeyspaceToManualThroughp if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.migrateCassandraKeyspaceToManualThroughput(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.migrateCassandraTableToManualThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + keyspaceName, tableName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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. @@ -1739,8 +2126,8 @@ public Mono>> migrateCassandraKeyspaceToManualThroughp * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> migrateCassandraKeyspaceToManualThroughputWithResponseAsync( - String resourceGroupName, String accountName, String keyspaceName, Context context) { + private Mono>> migrateCassandraTableToManualThroughputWithResponseAsync( + String resourceGroupName, String accountName, String keyspaceName, String tableName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1759,19 +2146,22 @@ private Mono>> migrateCassandraKeyspaceToManualThrough if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.migrateCassandraKeyspaceToManualThroughput(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, this.client.getApiVersion(), - accept, context); + return service.migrateCassandraTableToManualThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, accept, context); } /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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. @@ -1779,21 +2169,22 @@ private Mono>> migrateCassandraKeyspaceToManualThrough */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateCassandraKeyspaceToManualThroughputAsync(String resourceGroupName, String accountName, - String keyspaceName) { - Mono>> mono - = migrateCassandraKeyspaceToManualThroughputWithResponseAsync(resourceGroupName, accountName, keyspaceName); + beginMigrateCassandraTableToManualThroughputAsync(String resourceGroupName, String accountName, + String keyspaceName, String tableName) { + Mono>> mono = migrateCassandraTableToManualThroughputWithResponseAsync( + resourceGroupName, accountName, keyspaceName, tableName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, ThroughputSettingsGetResultsInner.class, this.client.getContext()); } /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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. @@ -1802,22 +2193,23 @@ private Mono>> migrateCassandraKeyspaceToManualThrough */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateCassandraKeyspaceToManualThroughputAsync(String resourceGroupName, String accountName, - String keyspaceName, Context context) { + beginMigrateCassandraTableToManualThroughputAsync(String resourceGroupName, String accountName, + String keyspaceName, String tableName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = migrateCassandraKeyspaceToManualThroughputWithResponseAsync( - resourceGroupName, accountName, keyspaceName, context); + Mono>> mono = migrateCassandraTableToManualThroughputWithResponseAsync( + resourceGroupName, accountName, keyspaceName, tableName, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, ThroughputSettingsGetResultsInner.class, context); } /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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. @@ -1825,18 +2217,20 @@ private Mono>> migrateCassandraKeyspaceToManualThrough */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateCassandraKeyspaceToManualThroughput(String resourceGroupName, String accountName, - String keyspaceName) { - return this.beginMigrateCassandraKeyspaceToManualThroughputAsync(resourceGroupName, accountName, keyspaceName) + beginMigrateCassandraTableToManualThroughput(String resourceGroupName, String accountName, String keyspaceName, + String tableName) { + return this + .beginMigrateCassandraTableToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName) .getSyncPoller(); } /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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. @@ -1845,37 +2239,40 @@ private Mono>> migrateCassandraKeyspaceToManualThrough */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateCassandraKeyspaceToManualThroughput(String resourceGroupName, String accountName, - String keyspaceName, Context context) { + beginMigrateCassandraTableToManualThroughput(String resourceGroupName, String accountName, String keyspaceName, + String tableName, Context context) { return this - .beginMigrateCassandraKeyspaceToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, context) + .beginMigrateCassandraTableToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName, + context) .getSyncPoller(); } /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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 migrateCassandraKeyspaceToManualThroughputAsync( - String resourceGroupName, String accountName, String keyspaceName) { - return beginMigrateCassandraKeyspaceToManualThroughputAsync(resourceGroupName, accountName, keyspaceName).last() - .flatMap(this.client::getLroFinalResultOrError); + public Mono migrateCassandraTableToManualThroughputAsync( + String resourceGroupName, String accountName, String keyspaceName, String tableName) { + return beginMigrateCassandraTableToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, + tableName).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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. @@ -1883,35 +2280,38 @@ public Mono migrateCassandraKeyspaceToManualT * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono migrateCassandraKeyspaceToManualThroughputAsync( - String resourceGroupName, String accountName, String keyspaceName, Context context) { - return beginMigrateCassandraKeyspaceToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, - context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono migrateCassandraTableToManualThroughputAsync( + String resourceGroupName, String accountName, String keyspaceName, String tableName, Context context) { + return beginMigrateCassandraTableToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, + tableName, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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 migrateCassandraKeyspaceToManualThroughput(String resourceGroupName, - String accountName, String keyspaceName) { - return migrateCassandraKeyspaceToManualThroughputAsync(resourceGroupName, accountName, keyspaceName).block(); + public ThroughputSettingsGetResultsInner migrateCassandraTableToManualThroughput(String resourceGroupName, + String accountName, String keyspaceName, String tableName) { + return migrateCassandraTableToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName) + .block(); } /** - * Migrate an Azure Cosmos DB Cassandra Keyspace from autoscale to manual throughput. + * Migrate an Azure Cosmos DB Cassandra table 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 keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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. @@ -1919,27 +2319,29 @@ public ThroughputSettingsGetResultsInner migrateCassandraKeyspaceToManualThrough * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner migrateCassandraKeyspaceToManualThroughput(String resourceGroupName, - String accountName, String keyspaceName, Context context) { - return migrateCassandraKeyspaceToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, context) - .block(); + public ThroughputSettingsGetResultsInner migrateCassandraTableToManualThroughput(String resourceGroupName, + String accountName, String keyspaceName, String tableName, Context context) { + return migrateCassandraTableToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName, + context).block(); } /** - * Lists the Cassandra table under an existing Azure Cosmos DB database account. + * Gets the RUs per second of the Cassandra view 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 keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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 Cassandra tables and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the RUs per second of the Cassandra view 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> - listCassandraTablesSinglePageAsync(String resourceGroupName, String accountName, String keyspaceName) { + public Mono> getCassandraViewThroughputWithResponseAsync( + String resourceGroupName, String accountName, String keyspaceName, String viewName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1958,32 +2360,35 @@ public ThroughputSettingsGetResultsInner migrateCassandraKeyspaceToManualThrough if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } + if (viewName == null) { + return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listCassandraTables(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, keyspaceName, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .withContext(context -> service.getCassandraViewThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + keyspaceName, viewName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the Cassandra table under an existing Azure Cosmos DB database account. + * Gets the RUs per second of the Cassandra view 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 keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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 Cassandra tables and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the RUs per second of the Cassandra view 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> listCassandraTablesSinglePageAsync( - String resourceGroupName, String accountName, String keyspaceName, Context context) { + private Mono> getCassandraViewThroughputWithResponseAsync( + String resourceGroupName, String accountName, String keyspaceName, String viewName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2002,106 +2407,97 @@ private Mono> listCassandraTablesSi if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } + if (viewName == null) { + return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listCassandraTables(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, keyspaceName, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + return service.getCassandraViewThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, viewName, accept, context); } /** - * Lists the Cassandra table under an existing Azure Cosmos DB database account. + * Gets the RUs per second of the Cassandra view 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 keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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 Cassandra tables and their properties as paginated - * response with {@link PagedFlux}. + * @return the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the + * provided name on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listCassandraTablesAsync(String resourceGroupName, - String accountName, String keyspaceName) { - return new PagedFlux<>(() -> listCassandraTablesSinglePageAsync(resourceGroupName, accountName, keyspaceName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getCassandraViewThroughputAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName) { + return getCassandraViewThroughputWithResponseAsync(resourceGroupName, accountName, keyspaceName, viewName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Lists the Cassandra table under an existing Azure Cosmos DB database account. + * Gets the RUs per second of the Cassandra view 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 keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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 Cassandra tables and their properties as paginated - * response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listCassandraTablesAsync(String resourceGroupName, - String accountName, String keyspaceName, Context context) { - return new PagedFlux<>( - () -> listCassandraTablesSinglePageAsync(resourceGroupName, accountName, keyspaceName, context)); - } - - /** - * Lists the Cassandra table 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 keyspaceName Cosmos DB keyspace 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 Cassandra tables and their properties as paginated - * response with {@link PagedIterable}. + * @return the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the + * provided name along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listCassandraTables(String resourceGroupName, - String accountName, String keyspaceName) { - return new PagedIterable<>(listCassandraTablesAsync(resourceGroupName, accountName, keyspaceName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getCassandraViewThroughputWithResponse(String resourceGroupName, + String accountName, String keyspaceName, String viewName, Context context) { + return getCassandraViewThroughputWithResponseAsync(resourceGroupName, accountName, keyspaceName, viewName, + context).block(); } /** - * Lists the Cassandra table under an existing Azure Cosmos DB database account. + * Gets the RUs per second of the Cassandra view 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 keyspaceName Cosmos DB keyspace name. - * @param context The context to associate with this operation. + * @param viewName Cosmos DB view 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 Cassandra tables and their properties as paginated - * response with {@link PagedIterable}. + * @return the RUs per second of the Cassandra view under an existing Azure Cosmos DB database account with the + * provided name. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listCassandraTables(String resourceGroupName, - String accountName, String keyspaceName, Context context) { - return new PagedIterable<>(listCassandraTablesAsync(resourceGroupName, accountName, keyspaceName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputSettingsGetResultsInner getCassandraViewThroughput(String resourceGroupName, String accountName, + String keyspaceName, String viewName) { + return getCassandraViewThroughputWithResponse(resourceGroupName, accountName, keyspaceName, viewName, + Context.NONE).getValue(); } /** - * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * Update RUs per second of an Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. * @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 Cassandra table under an existing Azure Cosmos DB database account along with {@link Response} on - * successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getCassandraTableWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName) { + public Mono>> updateCassandraViewThroughputWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, + ThroughputSettingsUpdateParameters updateThroughputParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2120,34 +2516,43 @@ public Mono> getCassandraTableWithRespon if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + if (viewName == null) { + return Mono.error(new IllegalArgumentException("Parameter viewName 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 contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getCassandraTable(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.updateCassandraViewThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + keyspaceName, viewName, contentType, accept, updateThroughputParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * Update RUs per second of an Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. * @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 Cassandra table under an existing Azure Cosmos DB database account along with {@link Response} on - * successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getCassandraTableWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName, Context context) { + private Mono>> updateCassandraViewThroughputWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, + ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2166,91 +2571,221 @@ private Mono> getCassandraTableWithRespo if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + if (viewName == null) { + return Mono.error(new IllegalArgumentException("Parameter viewName 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 contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getCassandraTable(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, keyspaceName, tableName, this.client.getApiVersion(), accept, context); + return service.updateCassandraViewThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, viewName, contentType, + accept, updateThroughputParameters, context); } /** - * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * Update RUs per second of an Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. * @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 Cassandra table under an existing Azure Cosmos DB database account on successful completion of - * {@link Mono}. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getCassandraTableAsync(String resourceGroupName, String accountName, - String keyspaceName, String tableName) { - return getCassandraTableWithResponseAsync(resourceGroupName, accountName, keyspaceName, tableName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, ThroughputSettingsGetResultsInner> + beginUpdateCassandraViewThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, + String viewName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + Mono>> mono = updateCassandraViewThroughputWithResponseAsync(resourceGroupName, + accountName, keyspaceName, viewName, updateThroughputParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, this.client.getContext()); + } /** - * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * Update RUs per second of an Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. * @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 Cassandra table under an existing Azure Cosmos DB database account along with {@link Response}. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ThroughputSettingsGetResultsInner> + beginUpdateCassandraViewThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, + String viewName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateCassandraViewThroughputWithResponseAsync(resourceGroupName, + accountName, keyspaceName, viewName, updateThroughputParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, context); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. + * @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> + beginUpdateCassandraViewThroughput(String resourceGroupName, String accountName, String keyspaceName, + String viewName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return this + .beginUpdateCassandraViewThroughputAsync(resourceGroupName, accountName, keyspaceName, viewName, + updateThroughputParameters) + .getSyncPoller(); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. + * @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> + beginUpdateCassandraViewThroughput(String resourceGroupName, String accountName, String keyspaceName, + String viewName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + return this + .beginUpdateCassandraViewThroughputAsync(resourceGroupName, accountName, keyspaceName, viewName, + updateThroughputParameters, context) + .getSyncPoller(); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. + * @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 Response getCassandraTableWithResponse(String resourceGroupName, - String accountName, String keyspaceName, String tableName, Context context) { - return getCassandraTableWithResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, context) - .block(); + public Mono updateCassandraViewThroughputAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, + ThroughputSettingsUpdateParameters updateThroughputParameters) { + return beginUpdateCassandraViewThroughputAsync(resourceGroupName, accountName, keyspaceName, viewName, + updateThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Gets the Cassandra table under an existing Azure Cosmos DB database account. + * Update RUs per second of an Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. + * @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 Cassandra table under an existing Azure Cosmos DB database account. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CassandraTableGetResultsInner getCassandraTable(String resourceGroupName, String accountName, - String keyspaceName, String tableName) { - return getCassandraTableWithResponse(resourceGroupName, accountName, keyspaceName, tableName, Context.NONE) - .getValue(); + private Mono updateCassandraViewThroughputAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, + ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + return beginUpdateCassandraViewThroughputAsync(resourceGroupName, accountName, keyspaceName, viewName, + updateThroughputParameters, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Update RUs per second of an Azure Cosmos DB Cassandra view. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. * @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 Cassandra table along with {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createUpdateCassandraTableWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName, - CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { + public ThroughputSettingsGetResultsInner updateCassandraViewThroughput(String resourceGroupName, String accountName, + String keyspaceName, String viewName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return updateCassandraViewThroughputAsync(resourceGroupName, accountName, keyspaceName, viewName, + updateThroughputParameters).block(); + } + + /** + * Update RUs per second of an Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra view. + * @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 updateCassandraViewThroughput(String resourceGroupName, String accountName, + String keyspaceName, String viewName, ThroughputSettingsUpdateParameters updateThroughputParameters, + Context context) { + return updateCassandraViewThroughputAsync(resourceGroupName, accountName, keyspaceName, viewName, + updateThroughputParameters, context).block(); + } + + /** + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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>> migrateCassandraViewToAutoscaleWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2269,41 +2804,34 @@ public Mono>> createUpdateCassandraTableWithResponseAs if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); - } - if (createUpdateCassandraTableParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter createUpdateCassandraTableParameters is required and cannot be null.")); - } else { - createUpdateCassandraTableParameters.validate(); + if (viewName == null) { + return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createUpdateCassandraTable(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, - this.client.getApiVersion(), createUpdateCassandraTableParameters, accept, context)) + .withContext(context -> service.migrateCassandraViewToAutoscale(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + keyspaceName, viewName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param viewName Cosmos DB view 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 Cassandra table along with {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createUpdateCassandraTableWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName, - CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, Context context) { + private Mono>> migrateCassandraViewToAutoscaleWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2322,222 +2850,198 @@ private Mono>> createUpdateCassandraTableWithResponseA if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); - } - if (createUpdateCassandraTableParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter createUpdateCassandraTableParameters is required and cannot be null.")); - } else { - createUpdateCassandraTableParameters.validate(); + if (viewName == null) { + return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createUpdateCassandraTable(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, keyspaceName, tableName, this.client.getApiVersion(), - createUpdateCassandraTableParameters, accept, context); + return service.migrateCassandraViewToAutoscale(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, viewName, accept, context); } /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param viewName Cosmos DB view 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 Cassandra table. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, CassandraTableGetResultsInner> - beginCreateUpdateCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, - String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { - Mono>> mono = createUpdateCassandraTableWithResponseAsync(resourceGroupName, - accountName, keyspaceName, tableName, createUpdateCassandraTableParameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), CassandraTableGetResultsInner.class, CassandraTableGetResultsInner.class, - this.client.getContext()); + public PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateCassandraViewToAutoscaleAsync(String resourceGroupName, String accountName, String keyspaceName, + String viewName) { + Mono>> mono + = migrateCassandraViewToAutoscaleWithResponseAsync(resourceGroupName, accountName, keyspaceName, viewName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, this.client.getContext()); } /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param viewName Cosmos DB view 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 Cassandra table. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, CassandraTableGetResultsInner> - beginCreateUpdateCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, - String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, - Context context) { + private PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateCassandraViewToAutoscaleAsync(String resourceGroupName, String accountName, String keyspaceName, + String viewName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = createUpdateCassandraTableWithResponseAsync(resourceGroupName, - accountName, keyspaceName, tableName, createUpdateCassandraTableParameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), CassandraTableGetResultsInner.class, CassandraTableGetResultsInner.class, - context); + Mono>> mono = migrateCassandraViewToAutoscaleWithResponseAsync(resourceGroupName, + accountName, keyspaceName, viewName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, context); } /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param viewName Cosmos DB view 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 Cassandra table. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CassandraTableGetResultsInner> - beginCreateUpdateCassandraTable(String resourceGroupName, String accountName, String keyspaceName, - String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { - return this - .beginCreateUpdateCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, - createUpdateCassandraTableParameters) + public SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateCassandraViewToAutoscale(String resourceGroupName, String accountName, String keyspaceName, + String viewName) { + return this.beginMigrateCassandraViewToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, viewName) .getSyncPoller(); } /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param viewName Cosmos DB view 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 Cassandra table. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, CassandraTableGetResultsInner> - beginCreateUpdateCassandraTable(String resourceGroupName, String accountName, String keyspaceName, - String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, - Context context) { + public SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateCassandraViewToAutoscale(String resourceGroupName, String accountName, String keyspaceName, + String viewName, Context context) { return this - .beginCreateUpdateCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, - createUpdateCassandraTableParameters, context) + .beginMigrateCassandraViewToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, viewName, context) .getSyncPoller(); } /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param viewName Cosmos DB view 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 Cassandra table on successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createUpdateCassandraTableAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName, - CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { - return beginCreateUpdateCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, - createUpdateCassandraTableParameters).last().flatMap(this.client::getLroFinalResultOrError); + public Mono migrateCassandraViewToAutoscaleAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName) { + return beginMigrateCassandraViewToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, viewName).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param viewName Cosmos DB view 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 Cassandra table on successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createUpdateCassandraTableAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName, - CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, Context context) { - return beginCreateUpdateCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, - createUpdateCassandraTableParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono migrateCassandraViewToAutoscaleAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, Context context) { + return beginMigrateCassandraViewToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, viewName, + context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param viewName Cosmos DB view 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 Cassandra table. + * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CassandraTableGetResultsInner createUpdateCassandraTable(String resourceGroupName, String accountName, - String keyspaceName, String tableName, - CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { - return createUpdateCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, - createUpdateCassandraTableParameters).block(); + public ThroughputSettingsGetResultsInner migrateCassandraViewToAutoscale(String resourceGroupName, + String accountName, String keyspaceName, String viewName) { + return migrateCassandraViewToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, viewName).block(); } /** - * Create or update an Azure Cosmos DB Cassandra Table. + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @param viewName Cosmos DB view 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 Cassandra table. + * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - public CassandraTableGetResultsInner createUpdateCassandraTable(String resourceGroupName, String accountName, - String keyspaceName, String tableName, - CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, Context context) { - return createUpdateCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, - createUpdateCassandraTableParameters, context).block(); + public ThroughputSettingsGetResultsInner migrateCassandraViewToAutoscale(String resourceGroupName, + String accountName, String keyspaceName, String viewName, Context context) { + return migrateCassandraViewToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, viewName, context) + .block(); } /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param viewName Cosmos DB view 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}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteCassandraTableWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName) { + public Mono>> migrateCassandraViewToManualThroughputWithResponseAsync( + String resourceGroupName, String accountName, String keyspaceName, String viewName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2556,32 +3060,34 @@ public Mono>> deleteCassandraTableWithResponseAsync(St if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + if (viewName == null) { + return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); } + final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.deleteCassandraTable(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, keyspaceName, tableName, this.client.getApiVersion(), context)) + .withContext(context -> service.migrateCassandraViewToManualThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + keyspaceName, viewName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param viewName Cosmos DB view 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}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteCassandraTableWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName, Context context) { + private Mono>> migrateCassandraViewToManualThroughputWithResponseAsync( + String resourceGroupName, String accountName, String keyspaceName, String viewName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2600,188 +3106,201 @@ private Mono>> deleteCassandraTableWithResponseAsync(S if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + if (viewName == null) { + return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); } + final String accept = "application/json"; context = this.client.mergeContext(context); - return service.deleteCassandraTable(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, keyspaceName, tableName, this.client.getApiVersion(), context); + return service.migrateCassandraViewToManualThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, viewName, accept, context); } /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param viewName Cosmos DB view 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. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteCassandraTableAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName) { - Mono>> mono - = deleteCassandraTableWithResponseAsync(resourceGroupName, accountName, keyspaceName, tableName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + public PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateCassandraViewToManualThroughputAsync(String resourceGroupName, String accountName, + String keyspaceName, String viewName) { + Mono>> mono = migrateCassandraViewToManualThroughputWithResponseAsync( + resourceGroupName, accountName, keyspaceName, viewName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, this.client.getContext()); } /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param viewName Cosmos DB view 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. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteCassandraTableAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName, Context context) { + private PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateCassandraViewToManualThroughputAsync(String resourceGroupName, String accountName, + String keyspaceName, String viewName, Context context) { context = this.client.mergeContext(context); - Mono>> mono - = deleteCassandraTableWithResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + Mono>> mono = migrateCassandraViewToManualThroughputWithResponseAsync( + resourceGroupName, accountName, keyspaceName, viewName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, context); } /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param viewName Cosmos DB view 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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteCassandraTable(String resourceGroupName, String accountName, - String keyspaceName, String tableName) { - return this.beginDeleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName) + public SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateCassandraViewToManualThroughput(String resourceGroupName, String accountName, String keyspaceName, + String viewName) { + return this + .beginMigrateCassandraViewToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, viewName) .getSyncPoller(); } /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param viewName Cosmos DB view 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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteCassandraTable(String resourceGroupName, String accountName, - String keyspaceName, String tableName, Context context) { - return this.beginDeleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, context) + public SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateCassandraViewToManualThroughput(String resourceGroupName, String accountName, String keyspaceName, + String viewName, Context context) { + return this + .beginMigrateCassandraViewToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, viewName, + context) .getSyncPoller(); } /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param viewName Cosmos DB view 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. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, - String tableName) { - return beginDeleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName).last() + public Mono migrateCassandraViewToManualThroughputAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName) { + return beginMigrateCassandraViewToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, viewName) + .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param viewName Cosmos DB view 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. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, - String tableName, Context context) { - return beginDeleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono migrateCassandraViewToManualThroughputAsync( + String resourceGroupName, String accountName, String keyspaceName, String viewName, Context context) { + return beginMigrateCassandraViewToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, viewName, + context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param viewName Cosmos DB view 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 void deleteCassandraTable(String resourceGroupName, String accountName, String keyspaceName, - String tableName) { - deleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName).block(); + public ThroughputSettingsGetResultsInner migrateCassandraViewToManualThroughput(String resourceGroupName, + String accountName, String keyspaceName, String viewName) { + return migrateCassandraViewToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, viewName) + .block(); } /** - * Deletes an existing Azure Cosmos DB Cassandra table. + * Migrate an Azure Cosmos DB Cassandra view 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 keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. + * @param viewName Cosmos DB view 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 void deleteCassandraTable(String resourceGroupName, String accountName, String keyspaceName, - String tableName, Context context) { - deleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, context).block(); + public ThroughputSettingsGetResultsInner migrateCassandraViewToManualThroughput(String resourceGroupName, + String accountName, String keyspaceName, String viewName, Context context) { + return migrateCassandraViewToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, viewName, + context).block(); } /** - * Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the - * provided name. + * Gets the Cassandra keyspaces 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 keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table 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 Cassandra table under an existing Azure Cosmos DB database account with the - * provided name along with {@link Response} on successful completion of {@link Mono}. + * @return the Cassandra keyspaces 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> getCassandraTableThroughputWithResponseAsync( - String resourceGroupName, String accountName, String keyspaceName, String tableName) { + public Mono> + getCassandraKeyspaceWithResponseAsync(String resourceGroupName, String accountName, String keyspaceName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2800,35 +3319,29 @@ public Mono> getCassandraTableThroug if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getCassandraTableThroughput(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.getCassandraKeyspace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the - * provided name. + * Gets the Cassandra keyspaces 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 keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table 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 Cassandra table under an existing Azure Cosmos DB database account with the - * provided name along with {@link Response} on successful completion of {@link Mono}. + * @return the Cassandra keyspaces 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> getCassandraTableThroughputWithResponseAsync( - String resourceGroupName, String accountName, String keyspaceName, String tableName, Context context) { + private Mono> getCassandraKeyspaceWithResponseAsync( + String resourceGroupName, String accountName, String keyspaceName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2847,98 +3360,84 @@ private Mono> getCassandraTableThrou if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getCassandraTableThroughput(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, keyspaceName, tableName, this.client.getApiVersion(), accept, context); + return service.getCassandraKeyspace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, accept, context); } /** - * Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the - * provided name. + * Gets the Cassandra keyspaces 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 keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table 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 Cassandra table under an existing Azure Cosmos DB database account with the - * provided name on successful completion of {@link Mono}. + * @return the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getCassandraTableThroughputAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName) { - return getCassandraTableThroughputWithResponseAsync(resourceGroupName, accountName, keyspaceName, tableName) + public Mono getCassandraKeyspaceAsync(String resourceGroupName, + String accountName, String keyspaceName) { + return getCassandraKeyspaceWithResponseAsync(resourceGroupName, accountName, keyspaceName) .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the - * provided name. + * Gets the Cassandra keyspaces 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 keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table 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 Cassandra table under an existing Azure Cosmos DB database account with the - * provided name along with {@link Response}. + * @return the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name along + * with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getCassandraTableThroughputWithResponse(String resourceGroupName, - String accountName, String keyspaceName, String tableName, Context context) { - return getCassandraTableThroughputWithResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, - context).block(); + public Response getCassandraKeyspaceWithResponse(String resourceGroupName, + String accountName, String keyspaceName, Context context) { + return getCassandraKeyspaceWithResponseAsync(resourceGroupName, accountName, keyspaceName, context).block(); } /** - * Gets the RUs per second of the Cassandra table under an existing Azure Cosmos DB database account with the - * provided name. + * Gets the Cassandra keyspaces 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 keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table 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 Cassandra table under an existing Azure Cosmos DB database account with the - * provided name. + * @return the Cassandra keyspaces under an existing Azure Cosmos DB database account with the provided name. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner getCassandraTableThroughput(String resourceGroupName, String accountName, - String keyspaceName, String tableName) { - return getCassandraTableThroughputWithResponse(resourceGroupName, accountName, keyspaceName, tableName, - Context.NONE).getValue(); + public CassandraKeyspaceGetResultsInner getCassandraKeyspace(String resourceGroupName, String accountName, + String keyspaceName) { + return getCassandraKeyspaceWithResponse(resourceGroupName, accountName, keyspaceName, Context.NONE).getValue(); } /** - * Update RUs per second of an Azure Cosmos DB Cassandra table. + * Create or update an Azure Cosmos DB Cassandra keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * table. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. * @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 + * @return an Azure Cosmos DB Cassandra keyspace along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateCassandraTableThroughputWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName, - ThroughputSettingsUpdateParameters updateThroughputParameters) { + public Mono>> createUpdateCassandraKeyspaceWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, + CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2957,43 +3456,39 @@ public Mono>> updateCassandraTableThroughputWithRespon if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); - } - if (updateThroughputParameters == null) { - return Mono.error( - new IllegalArgumentException("Parameter updateThroughputParameters is required and cannot be null.")); + if (createUpdateCassandraKeyspaceParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateCassandraKeyspaceParameters is required and cannot be null.")); } else { - updateThroughputParameters.validate(); + createUpdateCassandraKeyspaceParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.updateCassandraTableThroughput(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, - this.client.getApiVersion(), updateThroughputParameters, accept, context)) + .withContext(context -> service.createUpdateCassandraKeyspace(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + keyspaceName, contentType, accept, createUpdateCassandraKeyspaceParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update RUs per second of an Azure Cosmos DB Cassandra table. + * Create or update an Azure Cosmos DB Cassandra keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * table. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. * @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 + * @return an Azure Cosmos DB Cassandra keyspace along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateCassandraTableThroughputWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName, - ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + private Mono>> createUpdateCassandraKeyspaceWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, + CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -3012,229 +3507,208 @@ private Mono>> updateCassandraTableThroughputWithRespo if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); - } - if (updateThroughputParameters == null) { - return Mono.error( - new IllegalArgumentException("Parameter updateThroughputParameters is required and cannot be null.")); + if (createUpdateCassandraKeyspaceParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateCassandraKeyspaceParameters is required and cannot be null.")); } else { - updateThroughputParameters.validate(); + createUpdateCassandraKeyspaceParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.updateCassandraTableThroughput(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, keyspaceName, tableName, this.client.getApiVersion(), - updateThroughputParameters, accept, context); + return service.createUpdateCassandraKeyspace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, contentType, accept, + createUpdateCassandraKeyspaceParameters, context); } /** - * Update RUs per second of an Azure Cosmos DB Cassandra table. + * Create or update an Azure Cosmos DB Cassandra keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * table. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. * @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. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB Cassandra keyspace. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, ThroughputSettingsGetResultsInner> - beginUpdateCassandraTableThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, - String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - Mono>> mono = updateCassandraTableThroughputWithResponseAsync(resourceGroupName, - accountName, keyspaceName, tableName, updateThroughputParameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, this.client.getContext()); + public PollerFlux, CassandraKeyspaceGetResultsInner> + beginCreateUpdateCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName, + CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { + Mono>> mono = createUpdateCassandraKeyspaceWithResponseAsync(resourceGroupName, + accountName, keyspaceName, createUpdateCassandraKeyspaceParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CassandraKeyspaceGetResultsInner.class, + CassandraKeyspaceGetResultsInner.class, this.client.getContext()); } /** - * Update RUs per second of an Azure Cosmos DB Cassandra table. + * Create or update an Azure Cosmos DB Cassandra keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * table. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. * @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. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB Cassandra keyspace. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ThroughputSettingsGetResultsInner> - beginUpdateCassandraTableThroughputAsync(String resourceGroupName, String accountName, String keyspaceName, - String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + private PollerFlux, CassandraKeyspaceGetResultsInner> + beginCreateUpdateCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName, + CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, Context context) { context = this.client.mergeContext(context); - Mono>> mono = updateCassandraTableThroughputWithResponseAsync(resourceGroupName, - accountName, keyspaceName, tableName, updateThroughputParameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, context); + Mono>> mono = createUpdateCassandraKeyspaceWithResponseAsync(resourceGroupName, + accountName, keyspaceName, createUpdateCassandraKeyspaceParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CassandraKeyspaceGetResultsInner.class, + CassandraKeyspaceGetResultsInner.class, context); } /** - * Update RUs per second of an Azure Cosmos DB Cassandra table. + * Create or update an Azure Cosmos DB Cassandra keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * table. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. * @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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB Cassandra keyspace. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateCassandraTableThroughput(String resourceGroupName, String accountName, String keyspaceName, - String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + public SyncPoller, CassandraKeyspaceGetResultsInner> + beginCreateUpdateCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName, + CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { return this - .beginUpdateCassandraTableThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName, - updateThroughputParameters) + .beginCreateUpdateCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, + createUpdateCassandraKeyspaceParameters) .getSyncPoller(); } /** - * Update RUs per second of an Azure Cosmos DB Cassandra table. + * Create or update an Azure Cosmos DB Cassandra keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * table. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. * @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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB Cassandra keyspace. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateCassandraTableThroughput(String resourceGroupName, String accountName, String keyspaceName, - String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + public SyncPoller, CassandraKeyspaceGetResultsInner> + beginCreateUpdateCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName, + CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, Context context) { return this - .beginUpdateCassandraTableThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName, - updateThroughputParameters, context) + .beginCreateUpdateCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, + createUpdateCassandraKeyspaceParameters, context) .getSyncPoller(); } /** - * Update RUs per second of an Azure Cosmos DB Cassandra table. + * Create or update an Azure Cosmos DB Cassandra keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * table. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. * @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}. + * @return an Azure Cosmos DB Cassandra keyspace on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateCassandraTableThroughputAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName, - ThroughputSettingsUpdateParameters updateThroughputParameters) { - return beginUpdateCassandraTableThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName, - updateThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); + public Mono createUpdateCassandraKeyspaceAsync(String resourceGroupName, + String accountName, String keyspaceName, + CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { + return beginCreateUpdateCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, + createUpdateCassandraKeyspaceParameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Update RUs per second of an Azure Cosmos DB Cassandra table. + * Create or update an Azure Cosmos DB Cassandra keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * table. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. * @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}. + * @return an Azure Cosmos DB Cassandra keyspace on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateCassandraTableThroughputAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName, - ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { - return beginUpdateCassandraTableThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName, - updateThroughputParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono createUpdateCassandraKeyspaceAsync(String resourceGroupName, + String accountName, String keyspaceName, + CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, Context context) { + return beginCreateUpdateCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, + createUpdateCassandraKeyspaceParameters, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Update RUs per second of an Azure Cosmos DB Cassandra table. + * Create or update an Azure Cosmos DB Cassandra keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * table. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. * @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. + * @return an Azure Cosmos DB Cassandra keyspace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner updateCassandraTableThroughput(String resourceGroupName, - String accountName, String keyspaceName, String tableName, - ThroughputSettingsUpdateParameters updateThroughputParameters) { - return updateCassandraTableThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName, - updateThroughputParameters).block(); + public CassandraKeyspaceGetResultsInner createUpdateCassandraKeyspace(String resourceGroupName, String accountName, + String keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters) { + return createUpdateCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, + createUpdateCassandraKeyspaceParameters).block(); } /** - * Update RUs per second of an Azure Cosmos DB Cassandra table. + * Create or update an Azure Cosmos DB Cassandra keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Cassandra - * table. + * @param createUpdateCassandraKeyspaceParameters The parameters to provide for the current Cassandra keyspace. * @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. + * @return an Azure Cosmos DB Cassandra keyspace. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner updateCassandraTableThroughput(String resourceGroupName, - String accountName, String keyspaceName, String tableName, - ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { - return updateCassandraTableThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName, - updateThroughputParameters, context).block(); + public CassandraKeyspaceGetResultsInner createUpdateCassandraKeyspace(String resourceGroupName, String accountName, + String keyspaceName, CassandraKeyspaceCreateUpdateParameters createUpdateCassandraKeyspaceParameters, + Context context) { + return createUpdateCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, + createUpdateCassandraKeyspaceParameters, context).block(); } /** - * Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. + * Deletes an existing Azure Cosmos DB Cassandra keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table 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}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> migrateCassandraTableToAutoscaleWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName) { + public Mono>> deleteCassandraKeyspaceWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -3253,34 +3727,28 @@ public Mono>> migrateCassandraTableToAutoscaleWithResp if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.migrateCassandraTableToAutoscale(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, - this.client.getApiVersion(), accept, context)) + .withContext( + context -> service.deleteCassandraKeyspace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. + * Deletes an existing Azure Cosmos DB Cassandra keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table 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}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> migrateCassandraTableToAutoscaleWithResponseAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName, Context context) { + private Mono>> deleteCassandraKeyspaceWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -3299,200 +3767,171 @@ private Mono>> migrateCassandraTableToAutoscaleWithRes if (keyspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); - } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.migrateCassandraTableToAutoscale(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, keyspaceName, tableName, this.client.getApiVersion(), accept, context); + return service.deleteCassandraKeyspace(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, context); } /** - * Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. + * Deletes an existing Azure Cosmos DB Cassandra keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table 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. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateCassandraTableToAutoscaleAsync(String resourceGroupName, String accountName, String keyspaceName, - String tableName) { - Mono>> mono = migrateCassandraTableToAutoscaleWithResponseAsync(resourceGroupName, - accountName, keyspaceName, tableName); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, this.client.getContext()); + public PollerFlux, Void> beginDeleteCassandraKeyspaceAsync(String resourceGroupName, + String accountName, String keyspaceName) { + Mono>> mono + = deleteCassandraKeyspaceWithResponseAsync(resourceGroupName, accountName, keyspaceName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. + * Deletes an existing Azure Cosmos DB Cassandra keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table 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. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateCassandraTableToAutoscaleAsync(String resourceGroupName, String accountName, String keyspaceName, - String tableName, Context context) { + private PollerFlux, Void> beginDeleteCassandraKeyspaceAsync(String resourceGroupName, + String accountName, String keyspaceName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = migrateCassandraTableToAutoscaleWithResponseAsync(resourceGroupName, - accountName, keyspaceName, tableName, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, context); + Mono>> mono + = deleteCassandraKeyspaceWithResponseAsync(resourceGroupName, accountName, keyspaceName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** - * Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. + * Deletes an existing Azure Cosmos DB Cassandra keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table 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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateCassandraTableToAutoscale(String resourceGroupName, String accountName, String keyspaceName, - String tableName) { - return this.beginMigrateCassandraTableToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, tableName) - .getSyncPoller(); + public SyncPoller, Void> beginDeleteCassandraKeyspace(String resourceGroupName, String accountName, + String keyspaceName) { + return this.beginDeleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName).getSyncPoller(); } /** - * Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. + * Deletes an existing Azure Cosmos DB Cassandra keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table 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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateCassandraTableToAutoscale(String resourceGroupName, String accountName, String keyspaceName, - String tableName, Context context) { - return this - .beginMigrateCassandraTableToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, tableName, - context) + public SyncPoller, Void> beginDeleteCassandraKeyspace(String resourceGroupName, String accountName, + String keyspaceName, Context context) { + return this.beginDeleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, context) .getSyncPoller(); } /** - * Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. + * Deletes an existing Azure Cosmos DB Cassandra keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table 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}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono migrateCassandraTableToAutoscaleAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName) { - return beginMigrateCassandraTableToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, tableName) - .last() + public Mono deleteCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName) { + return beginDeleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. + * Deletes an existing Azure Cosmos DB Cassandra keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table 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}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono migrateCassandraTableToAutoscaleAsync(String resourceGroupName, - String accountName, String keyspaceName, String tableName, Context context) { - return beginMigrateCassandraTableToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, tableName, - context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono deleteCassandraKeyspaceAsync(String resourceGroupName, String accountName, String keyspaceName, + Context context) { + return beginDeleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. + * Deletes an existing Azure Cosmos DB Cassandra keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table 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 migrateCassandraTableToAutoscale(String resourceGroupName, - String accountName, String keyspaceName, String tableName) { - return migrateCassandraTableToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, tableName).block(); + public void deleteCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName) { + deleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName).block(); } /** - * Migrate an Azure Cosmos DB Cassandra table from manual throughput to autoscale. + * Deletes an existing Azure Cosmos DB Cassandra keyspace. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table 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 migrateCassandraTableToAutoscale(String resourceGroupName, - String accountName, String keyspaceName, String tableName, Context context) { - return migrateCassandraTableToAutoscaleAsync(resourceGroupName, accountName, keyspaceName, tableName, context) - .block(); + public void deleteCassandraKeyspace(String resourceGroupName, String accountName, String keyspaceName, + Context context) { + deleteCassandraKeyspaceAsync(resourceGroupName, accountName, keyspaceName, context).block(); } /** - * Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. + * Lists the Cassandra keyspaces 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 keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table 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}. + * @return the List operation response, that contains the Cassandra keyspaces and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> migrateCassandraTableToManualThroughputWithResponseAsync( - String resourceGroupName, String accountName, String keyspaceName, String tableName) { + private Mono> + listCassandraKeyspacesSinglePageAsync(String resourceGroupName, String accountName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -3508,37 +3947,31 @@ public Mono>> migrateCassandraTableToManualThroughputW if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } - if (keyspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); - } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.migrateCassandraTableToManualThroughput(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, - this.client.getApiVersion(), accept, context)) + .withContext( + context -> service.listCassandraKeyspaces(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. + * Lists the Cassandra keyspaces 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 keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table 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}. + * @return the List operation response, that contains the Cassandra keyspaces and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> migrateCassandraTableToManualThroughputWithResponseAsync( - String resourceGroupName, String accountName, String keyspaceName, String tableName, Context context) { + private Mono> + listCassandraKeyspacesSinglePageAsync(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.")); @@ -3554,69 +3987,89 @@ private Mono>> migrateCassandraTableToManualThroughput if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } - if (keyspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); - } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.migrateCassandraTableToManualThroughput(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, - this.client.getApiVersion(), accept, context); + return service + .listCassandraKeyspaces(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. + * Lists the Cassandra keyspaces 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 keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table 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. + * @return the List operation response, that contains the Cassandra keyspaces and their properties as paginated + * response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateCassandraTableToManualThroughputAsync(String resourceGroupName, String accountName, - String keyspaceName, String tableName) { - Mono>> mono = migrateCassandraTableToManualThroughputWithResponseAsync( - resourceGroupName, accountName, keyspaceName, tableName); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listCassandraKeyspacesAsync(String resourceGroupName, + String accountName) { + return new PagedFlux<>(() -> listCassandraKeyspacesSinglePageAsync(resourceGroupName, accountName), + nextLink -> listCassandraKeyspacesNextSinglePageAsync(nextLink)); } /** - * Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. + * Lists the Cassandra keyspaces 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 keyspaceName Cosmos DB keyspace name. - * @param tableName Cosmos DB table 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. + * @return the List operation response, that contains the Cassandra keyspaces and their properties as paginated + * response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateCassandraTableToManualThroughputAsync(String resourceGroupName, String accountName, - String keyspaceName, String tableName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = migrateCassandraTableToManualThroughputWithResponseAsync( - resourceGroupName, accountName, keyspaceName, tableName, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCassandraKeyspacesAsync(String resourceGroupName, + String accountName, Context context) { + return new PagedFlux<>(() -> listCassandraKeyspacesSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listCassandraKeyspacesNextSinglePageAsync(nextLink, context)); } /** - * Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. + * Lists the Cassandra keyspaces 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 Cassandra keyspaces and their properties as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCassandraKeyspaces(String resourceGroupName, + String accountName) { + return new PagedIterable<>(listCassandraKeyspacesAsync(resourceGroupName, accountName)); + } + + /** + * Lists the Cassandra keyspaces 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 Cassandra keyspaces and their properties as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCassandraKeyspaces(String resourceGroupName, + String accountName, Context context) { + return new PagedIterable<>(listCassandraKeyspacesAsync(resourceGroupName, accountName, context)); + } + + /** + * Gets the Cassandra table 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. @@ -3625,19 +4078,43 @@ private Mono>> migrateCassandraTableToManualThroughput * @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. + * @return the Cassandra table under an existing Azure Cosmos DB database account along with {@link Response} on + * successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateCassandraTableToManualThroughput(String resourceGroupName, String accountName, String keyspaceName, - String tableName) { - return this - .beginMigrateCassandraTableToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getCassandraTableWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName) { + 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 (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getCassandraTable(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. + * Gets the Cassandra table 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. @@ -3647,20 +4124,41 @@ private Mono>> migrateCassandraTableToManualThroughput * @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. + * @return the Cassandra table under an existing Azure Cosmos DB database account along with {@link Response} on + * successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateCassandraTableToManualThroughput(String resourceGroupName, String accountName, String keyspaceName, - String tableName, Context context) { - return this - .beginMigrateCassandraTableToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName, - context) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getCassandraTableWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName, 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 (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getCassandraTable(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, accept, context); } /** - * Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. + * Gets the Cassandra table 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. @@ -3669,17 +4167,18 @@ private Mono>> migrateCassandraTableToManualThroughput * @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}. + * @return the Cassandra table under an existing Azure Cosmos DB database account on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono migrateCassandraTableToManualThroughputAsync( - String resourceGroupName, String accountName, String keyspaceName, String tableName) { - return beginMigrateCassandraTableToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, - tableName).last().flatMap(this.client::getLroFinalResultOrError); + public Mono getCassandraTableAsync(String resourceGroupName, String accountName, + String keyspaceName, String tableName) { + return getCassandraTableWithResponseAsync(resourceGroupName, accountName, keyspaceName, tableName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. + * Gets the Cassandra table 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. @@ -3689,17 +4188,17 @@ public Mono migrateCassandraTableToManualThro * @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}. + * @return the Cassandra table under an existing Azure Cosmos DB database account along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono migrateCassandraTableToManualThroughputAsync( - String resourceGroupName, String accountName, String keyspaceName, String tableName, Context context) { - return beginMigrateCassandraTableToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, - tableName, context).last().flatMap(this.client::getLroFinalResultOrError); + public Response getCassandraTableWithResponse(String resourceGroupName, + String accountName, String keyspaceName, String tableName, Context context) { + return getCassandraTableWithResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, context) + .block(); } /** - * Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. + * Gets the Cassandra table 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. @@ -3708,32 +4207,3452 @@ private Mono migrateCassandraTableToManualThr * @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. + * @return the Cassandra table under an existing Azure Cosmos DB database account. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner migrateCassandraTableToManualThroughput(String resourceGroupName, - String accountName, String keyspaceName, String tableName) { - return migrateCassandraTableToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName) - .block(); + public CassandraTableGetResultsInner getCassandraTable(String resourceGroupName, String accountName, + String keyspaceName, String tableName) { + return getCassandraTableWithResponse(resourceGroupName, accountName, keyspaceName, tableName, Context.NONE) + .getValue(); } /** - * Migrate an Azure Cosmos DB Cassandra table from autoscale to manual throughput. + * Create or update an Azure Cosmos DB Cassandra Table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param keyspaceName Cosmos DB keyspace name. * @param tableName Cosmos DB table name. - * @param context The context to associate with this operation. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. * @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. + * @return an Azure Cosmos DB Cassandra table along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner migrateCassandraTableToManualThroughput(String resourceGroupName, - String accountName, String keyspaceName, String tableName, Context context) { - return migrateCassandraTableToManualThroughputAsync(resourceGroupName, accountName, keyspaceName, tableName, - context).block(); + public Mono>> createUpdateCassandraTableWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName, + CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { + 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 (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (createUpdateCassandraTableParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateCassandraTableParameters is required and cannot be null.")); + } else { + createUpdateCassandraTableParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createUpdateCassandraTable(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + keyspaceName, tableName, contentType, accept, createUpdateCassandraTableParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @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 Cassandra table along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createUpdateCassandraTableWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName, + CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, 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 (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (createUpdateCassandraTableParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateCassandraTableParameters is required and cannot be null.")); + } else { + createUpdateCassandraTableParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createUpdateCassandraTable(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, contentType, + accept, createUpdateCassandraTableParameters, context); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @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 Cassandra table. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, CassandraTableGetResultsInner> + beginCreateUpdateCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, + String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { + Mono>> mono = createUpdateCassandraTableWithResponseAsync(resourceGroupName, + accountName, keyspaceName, tableName, createUpdateCassandraTableParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CassandraTableGetResultsInner.class, CassandraTableGetResultsInner.class, + this.client.getContext()); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @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 Cassandra table. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CassandraTableGetResultsInner> + beginCreateUpdateCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, + String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createUpdateCassandraTableWithResponseAsync(resourceGroupName, + accountName, keyspaceName, tableName, createUpdateCassandraTableParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CassandraTableGetResultsInner.class, CassandraTableGetResultsInner.class, + context); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @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 Cassandra table. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CassandraTableGetResultsInner> + beginCreateUpdateCassandraTable(String resourceGroupName, String accountName, String keyspaceName, + String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { + return this + .beginCreateUpdateCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, + createUpdateCassandraTableParameters) + .getSyncPoller(); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @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 Cassandra table. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CassandraTableGetResultsInner> + beginCreateUpdateCassandraTable(String resourceGroupName, String accountName, String keyspaceName, + String tableName, CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, + Context context) { + return this + .beginCreateUpdateCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, + createUpdateCassandraTableParameters, context) + .getSyncPoller(); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @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 Cassandra table on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createUpdateCassandraTableAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName, + CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { + return beginCreateUpdateCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, + createUpdateCassandraTableParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @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 Cassandra table on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createUpdateCassandraTableAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName, + CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, Context context) { + return beginCreateUpdateCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, + createUpdateCassandraTableParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @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 Cassandra table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CassandraTableGetResultsInner createUpdateCassandraTable(String resourceGroupName, String accountName, + String keyspaceName, String tableName, + CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters) { + return createUpdateCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, + createUpdateCassandraTableParameters).block(); + } + + /** + * Create or update an Azure Cosmos DB Cassandra Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table name. + * @param createUpdateCassandraTableParameters The parameters to provide for the current Cassandra Table. + * @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 Cassandra table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CassandraTableGetResultsInner createUpdateCassandraTable(String resourceGroupName, String accountName, + String keyspaceName, String tableName, + CassandraTableCreateUpdateParameters createUpdateCassandraTableParameters, Context context) { + return createUpdateCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, + createUpdateCassandraTableParameters, context).block(); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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>> deleteCassandraTableWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName) { + 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 (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.deleteCassandraTable(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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>> deleteCassandraTableWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName, 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 (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.deleteCassandraTable(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, tableName, context); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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> beginDeleteCassandraTableAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName) { + Mono>> mono + = deleteCassandraTableWithResponseAsync(resourceGroupName, accountName, keyspaceName, tableName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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> beginDeleteCassandraTableAsync(String resourceGroupName, + String accountName, String keyspaceName, String tableName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteCassandraTableWithResponseAsync(resourceGroupName, accountName, keyspaceName, tableName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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> beginDeleteCassandraTable(String resourceGroupName, String accountName, + String keyspaceName, String tableName) { + return this.beginDeleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName) + .getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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> beginDeleteCassandraTable(String resourceGroupName, String accountName, + String keyspaceName, String tableName, Context context) { + return this.beginDeleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, context) + .getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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 deleteCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, + String tableName) { + return beginDeleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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 deleteCassandraTableAsync(String resourceGroupName, String accountName, String keyspaceName, + String tableName, Context context) { + return beginDeleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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 deleteCassandraTable(String resourceGroupName, String accountName, String keyspaceName, + String tableName) { + deleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName).block(); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param tableName Cosmos DB table 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 deleteCassandraTable(String resourceGroupName, String accountName, String keyspaceName, + String tableName, Context context) { + deleteCassandraTableAsync(resourceGroupName, accountName, keyspaceName, tableName, context).block(); + } + + /** + * Lists the Cassandra table 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 keyspaceName Cosmos DB keyspace 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 Cassandra tables and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listCassandraTablesSinglePageAsync(String resourceGroupName, String accountName, String keyspaceName) { + 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 (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listCassandraTables(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the Cassandra table 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 keyspaceName Cosmos DB keyspace 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 Cassandra tables and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCassandraTablesSinglePageAsync( + String resourceGroupName, String accountName, String keyspaceName, 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 (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listCassandraTables(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists the Cassandra table 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 keyspaceName Cosmos DB keyspace 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 Cassandra tables and their properties as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listCassandraTablesAsync(String resourceGroupName, + String accountName, String keyspaceName) { + return new PagedFlux<>(() -> listCassandraTablesSinglePageAsync(resourceGroupName, accountName, keyspaceName), + nextLink -> listCassandraTablesNextSinglePageAsync(nextLink)); + } + + /** + * Lists the Cassandra table 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 keyspaceName Cosmos DB keyspace 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 Cassandra tables and their properties as paginated + * response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCassandraTablesAsync(String resourceGroupName, + String accountName, String keyspaceName, Context context) { + return new PagedFlux<>( + () -> listCassandraTablesSinglePageAsync(resourceGroupName, accountName, keyspaceName, context), + nextLink -> listCassandraTablesNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the Cassandra table 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 keyspaceName Cosmos DB keyspace 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 Cassandra tables and their properties as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCassandraTables(String resourceGroupName, + String accountName, String keyspaceName) { + return new PagedIterable<>(listCassandraTablesAsync(resourceGroupName, accountName, keyspaceName)); + } + + /** + * Lists the Cassandra table 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 keyspaceName Cosmos DB keyspace 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 Cassandra tables and their properties as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCassandraTables(String resourceGroupName, + String accountName, String keyspaceName, Context context) { + return new PagedIterable<>(listCassandraTablesAsync(resourceGroupName, accountName, keyspaceName, context)); + } + + /** + * Gets the Cassandra view 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 keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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 Cassandra view under an existing Azure Cosmos DB database account along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getCassandraViewWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName) { + 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 (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } + if (viewName == null) { + return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getCassandraView(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, viewName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the Cassandra view 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 keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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 Cassandra view under an existing Azure Cosmos DB database account along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getCassandraViewWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, 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 (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } + if (viewName == null) { + return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getCassandraView(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, viewName, accept, context); + } + + /** + * Gets the Cassandra view 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 keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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 Cassandra view under an existing Azure Cosmos DB database account on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getCassandraViewAsync(String resourceGroupName, String accountName, + String keyspaceName, String viewName) { + return getCassandraViewWithResponseAsync(resourceGroupName, accountName, keyspaceName, viewName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the Cassandra view 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 keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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 Cassandra view under an existing Azure Cosmos DB database account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getCassandraViewWithResponse(String resourceGroupName, + String accountName, String keyspaceName, String viewName, Context context) { + return getCassandraViewWithResponseAsync(resourceGroupName, accountName, keyspaceName, viewName, context) + .block(); + } + + /** + * Gets the Cassandra view 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 keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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 Cassandra view under an existing Azure Cosmos DB database account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CassandraViewGetResultsInner getCassandraView(String resourceGroupName, String accountName, + String keyspaceName, String viewName) { + return getCassandraViewWithResponse(resourceGroupName, accountName, keyspaceName, viewName, Context.NONE) + .getValue(); + } + + /** + * Create or update an Azure Cosmos DB Cassandra View. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. + * @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 Cassandra view along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createUpdateCassandraViewWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, + CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters) { + 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 (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } + if (viewName == null) { + return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); + } + if (createUpdateCassandraViewParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateCassandraViewParameters is required and cannot be null.")); + } else { + createUpdateCassandraViewParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createUpdateCassandraView(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + keyspaceName, viewName, contentType, accept, createUpdateCassandraViewParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update an Azure Cosmos DB Cassandra View. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. + * @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 Cassandra view along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createUpdateCassandraViewWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, + CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters, 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 (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } + if (viewName == null) { + return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); + } + if (createUpdateCassandraViewParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateCassandraViewParameters is required and cannot be null.")); + } else { + createUpdateCassandraViewParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createUpdateCassandraView(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, viewName, contentType, + accept, createUpdateCassandraViewParameters, context); + } + + /** + * Create or update an Azure Cosmos DB Cassandra View. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. + * @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 Cassandra view. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, CassandraViewGetResultsInner> + beginCreateUpdateCassandraViewAsync(String resourceGroupName, String accountName, String keyspaceName, + String viewName, CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters) { + Mono>> mono = createUpdateCassandraViewWithResponseAsync(resourceGroupName, + accountName, keyspaceName, viewName, createUpdateCassandraViewParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CassandraViewGetResultsInner.class, CassandraViewGetResultsInner.class, + this.client.getContext()); + } + + /** + * Create or update an Azure Cosmos DB Cassandra View. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. + * @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 Cassandra view. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CassandraViewGetResultsInner> + beginCreateUpdateCassandraViewAsync(String resourceGroupName, String accountName, String keyspaceName, + String viewName, CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createUpdateCassandraViewWithResponseAsync(resourceGroupName, + accountName, keyspaceName, viewName, createUpdateCassandraViewParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), CassandraViewGetResultsInner.class, CassandraViewGetResultsInner.class, + context); + } + + /** + * Create or update an Azure Cosmos DB Cassandra View. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. + * @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 Cassandra view. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CassandraViewGetResultsInner> + beginCreateUpdateCassandraView(String resourceGroupName, String accountName, String keyspaceName, + String viewName, CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters) { + return this + .beginCreateUpdateCassandraViewAsync(resourceGroupName, accountName, keyspaceName, viewName, + createUpdateCassandraViewParameters) + .getSyncPoller(); + } + + /** + * Create or update an Azure Cosmos DB Cassandra View. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. + * @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 Cassandra view. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CassandraViewGetResultsInner> + beginCreateUpdateCassandraView(String resourceGroupName, String accountName, String keyspaceName, + String viewName, CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters, Context context) { + return this + .beginCreateUpdateCassandraViewAsync(resourceGroupName, accountName, keyspaceName, viewName, + createUpdateCassandraViewParameters, context) + .getSyncPoller(); + } + + /** + * Create or update an Azure Cosmos DB Cassandra View. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. + * @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 Cassandra view on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createUpdateCassandraViewAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, + CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters) { + return beginCreateUpdateCassandraViewAsync(resourceGroupName, accountName, keyspaceName, viewName, + createUpdateCassandraViewParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update an Azure Cosmos DB Cassandra View. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. + * @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 Cassandra view on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createUpdateCassandraViewAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, + CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters, Context context) { + return beginCreateUpdateCassandraViewAsync(resourceGroupName, accountName, keyspaceName, viewName, + createUpdateCassandraViewParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update an Azure Cosmos DB Cassandra View. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. + * @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 Cassandra view. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CassandraViewGetResultsInner createUpdateCassandraView(String resourceGroupName, String accountName, + String keyspaceName, String viewName, CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters) { + return createUpdateCassandraViewAsync(resourceGroupName, accountName, keyspaceName, viewName, + createUpdateCassandraViewParameters).block(); + } + + /** + * Create or update an Azure Cosmos DB Cassandra View. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view name. + * @param createUpdateCassandraViewParameters The parameters to provide for the current Cassandra View. + * @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 Cassandra view. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CassandraViewGetResultsInner createUpdateCassandraView(String resourceGroupName, String accountName, + String keyspaceName, String viewName, CassandraViewCreateUpdateParameters createUpdateCassandraViewParameters, + Context context) { + return createUpdateCassandraViewAsync(resourceGroupName, accountName, keyspaceName, viewName, + createUpdateCassandraViewParameters, context).block(); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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>> deleteCassandraViewWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName) { + 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 (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } + if (viewName == null) { + return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.deleteCassandraView(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, viewName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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>> deleteCassandraViewWithResponseAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, 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 (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } + if (viewName == null) { + return Mono.error(new IllegalArgumentException("Parameter viewName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.deleteCassandraView(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, viewName, context); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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> beginDeleteCassandraViewAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName) { + Mono>> mono + = deleteCassandraViewWithResponseAsync(resourceGroupName, accountName, keyspaceName, viewName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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> beginDeleteCassandraViewAsync(String resourceGroupName, + String accountName, String keyspaceName, String viewName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteCassandraViewWithResponseAsync(resourceGroupName, accountName, keyspaceName, viewName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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> beginDeleteCassandraView(String resourceGroupName, String accountName, + String keyspaceName, String viewName) { + return this.beginDeleteCassandraViewAsync(resourceGroupName, accountName, keyspaceName, viewName) + .getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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> beginDeleteCassandraView(String resourceGroupName, String accountName, + String keyspaceName, String viewName, Context context) { + return this.beginDeleteCassandraViewAsync(resourceGroupName, accountName, keyspaceName, viewName, context) + .getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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 deleteCassandraViewAsync(String resourceGroupName, String accountName, String keyspaceName, + String viewName) { + return beginDeleteCassandraViewAsync(resourceGroupName, accountName, keyspaceName, viewName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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 deleteCassandraViewAsync(String resourceGroupName, String accountName, String keyspaceName, + String viewName, Context context) { + return beginDeleteCassandraViewAsync(resourceGroupName, accountName, keyspaceName, viewName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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 deleteCassandraView(String resourceGroupName, String accountName, String keyspaceName, + String viewName) { + deleteCassandraViewAsync(resourceGroupName, accountName, keyspaceName, viewName).block(); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra view. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param keyspaceName Cosmos DB keyspace name. + * @param viewName Cosmos DB view 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 deleteCassandraView(String resourceGroupName, String accountName, String keyspaceName, String viewName, + Context context) { + deleteCassandraViewAsync(resourceGroupName, accountName, keyspaceName, viewName, context).block(); + } + + /** + * Lists the Cassandra materialized views 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 keyspaceName Cosmos DB keyspace 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 Cassandra views and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listCassandraViewsSinglePageAsync(String resourceGroupName, String accountName, String keyspaceName) { + 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 (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listCassandraViews(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, keyspaceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the Cassandra materialized views 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 keyspaceName Cosmos DB keyspace 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 Cassandra views and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCassandraViewsSinglePageAsync( + String resourceGroupName, String accountName, String keyspaceName, 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 (keyspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter keyspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listCassandraViews(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, keyspaceName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists the Cassandra materialized views 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 keyspaceName Cosmos DB keyspace 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 Cassandra views and their properties as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listCassandraViewsAsync(String resourceGroupName, String accountName, + String keyspaceName) { + return new PagedFlux<>(() -> listCassandraViewsSinglePageAsync(resourceGroupName, accountName, keyspaceName), + nextLink -> listCassandraViewsNextSinglePageAsync(nextLink)); + } + + /** + * Lists the Cassandra materialized views 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 keyspaceName Cosmos DB keyspace 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 Cassandra views and their properties as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCassandraViewsAsync(String resourceGroupName, + String accountName, String keyspaceName, Context context) { + return new PagedFlux<>( + () -> listCassandraViewsSinglePageAsync(resourceGroupName, accountName, keyspaceName, context), + nextLink -> listCassandraViewsNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the Cassandra materialized views 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 keyspaceName Cosmos DB keyspace 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 Cassandra views and their properties as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCassandraViews(String resourceGroupName, String accountName, + String keyspaceName) { + return new PagedIterable<>(listCassandraViewsAsync(resourceGroupName, accountName, keyspaceName)); + } + + /** + * Lists the Cassandra materialized views 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 keyspaceName Cosmos DB keyspace 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 Cassandra views and their properties as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCassandraViews(String resourceGroupName, String accountName, + String keyspaceName, Context context) { + return new PagedIterable<>(listCassandraViewsAsync(resourceGroupName, accountName, keyspaceName, context)); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Definition with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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 parameters to create and update an Azure Cosmos DB Cassandra Role Definition along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getCassandraRoleDefinitionWithResponseAsync( + String resourceGroupName, String accountName, String roleDefinitionId) { + 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 (roleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getCassandraRoleDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleDefinitionId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Definition with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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 parameters to create and update an Azure Cosmos DB Cassandra Role Definition along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getCassandraRoleDefinitionWithResponseAsync( + String resourceGroupName, String accountName, String roleDefinitionId, 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 (roleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getCassandraRoleDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleDefinitionId, accept, context); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Definition with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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 parameters to create and update an Azure Cosmos DB Cassandra Role Definition on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getCassandraRoleDefinitionAsync(String resourceGroupName, + String accountName, String roleDefinitionId) { + return getCassandraRoleDefinitionWithResponseAsync(resourceGroupName, accountName, roleDefinitionId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Definition with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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 parameters to create and update an Azure Cosmos DB Cassandra Role Definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getCassandraRoleDefinitionWithResponse( + String resourceGroupName, String accountName, String roleDefinitionId, Context context) { + return getCassandraRoleDefinitionWithResponseAsync(resourceGroupName, accountName, roleDefinitionId, context) + .block(); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Definition with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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 parameters to create and update an Azure Cosmos DB Cassandra Role Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CassandraRoleDefinitionResourceInner getCassandraRoleDefinition(String resourceGroupName, String accountName, + String roleDefinitionId) { + return getCassandraRoleDefinitionWithResponse(resourceGroupName, accountName, roleDefinitionId, Context.NONE) + .getValue(); + } + + /** + * Creates or updates an Azure Cosmos DB Cassandra Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateCassandraRoleDefinitionParameters The properties required to create or update a Role + * Definition. + * @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 parameters to create and update an Azure Cosmos DB Cassandra Role Definition along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createUpdateCassandraRoleDefinitionWithResponseAsync( + String resourceGroupName, String accountName, String roleDefinitionId, + CassandraRoleDefinitionResourceInner createUpdateCassandraRoleDefinitionParameters) { + 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 (roleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); + } + if (createUpdateCassandraRoleDefinitionParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateCassandraRoleDefinitionParameters is required and cannot be null.")); + } else { + createUpdateCassandraRoleDefinitionParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createUpdateCassandraRoleDefinition(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + roleDefinitionId, contentType, accept, createUpdateCassandraRoleDefinitionParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an Azure Cosmos DB Cassandra Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateCassandraRoleDefinitionParameters The properties required to create or update a Role + * Definition. + * @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 parameters to create and update an Azure Cosmos DB Cassandra Role Definition along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createUpdateCassandraRoleDefinitionWithResponseAsync( + String resourceGroupName, String accountName, String roleDefinitionId, + CassandraRoleDefinitionResourceInner createUpdateCassandraRoleDefinitionParameters, 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 (roleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); + } + if (createUpdateCassandraRoleDefinitionParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateCassandraRoleDefinitionParameters is required and cannot be null.")); + } else { + createUpdateCassandraRoleDefinitionParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createUpdateCassandraRoleDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleDefinitionId, contentType, accept, + createUpdateCassandraRoleDefinitionParameters, context); + } + + /** + * Creates or updates an Azure Cosmos DB Cassandra Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateCassandraRoleDefinitionParameters The properties required to create or update a Role + * Definition. + * @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 parameters to create and update an Azure Cosmos DB Cassandra Role + * Definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, CassandraRoleDefinitionResourceInner> + beginCreateUpdateCassandraRoleDefinitionAsync(String resourceGroupName, String accountName, + String roleDefinitionId, + CassandraRoleDefinitionResourceInner createUpdateCassandraRoleDefinitionParameters) { + Mono>> mono = createUpdateCassandraRoleDefinitionWithResponseAsync(resourceGroupName, + accountName, roleDefinitionId, createUpdateCassandraRoleDefinitionParameters); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), CassandraRoleDefinitionResourceInner.class, + CassandraRoleDefinitionResourceInner.class, this.client.getContext()); + } + + /** + * Creates or updates an Azure Cosmos DB Cassandra Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateCassandraRoleDefinitionParameters The properties required to create or update a Role + * Definition. + * @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 parameters to create and update an Azure Cosmos DB Cassandra Role + * Definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CassandraRoleDefinitionResourceInner> + beginCreateUpdateCassandraRoleDefinitionAsync(String resourceGroupName, String accountName, + String roleDefinitionId, CassandraRoleDefinitionResourceInner createUpdateCassandraRoleDefinitionParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createUpdateCassandraRoleDefinitionWithResponseAsync(resourceGroupName, + accountName, roleDefinitionId, createUpdateCassandraRoleDefinitionParameters, context); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), CassandraRoleDefinitionResourceInner.class, + CassandraRoleDefinitionResourceInner.class, context); + } + + /** + * Creates or updates an Azure Cosmos DB Cassandra Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateCassandraRoleDefinitionParameters The properties required to create or update a Role + * Definition. + * @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 parameters to create and update an Azure Cosmos DB Cassandra Role + * Definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CassandraRoleDefinitionResourceInner> + beginCreateUpdateCassandraRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId, + CassandraRoleDefinitionResourceInner createUpdateCassandraRoleDefinitionParameters) { + return this + .beginCreateUpdateCassandraRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, + createUpdateCassandraRoleDefinitionParameters) + .getSyncPoller(); + } + + /** + * Creates or updates an Azure Cosmos DB Cassandra Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateCassandraRoleDefinitionParameters The properties required to create or update a Role + * Definition. + * @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 parameters to create and update an Azure Cosmos DB Cassandra Role + * Definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CassandraRoleDefinitionResourceInner> + beginCreateUpdateCassandraRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId, + CassandraRoleDefinitionResourceInner createUpdateCassandraRoleDefinitionParameters, Context context) { + return this + .beginCreateUpdateCassandraRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, + createUpdateCassandraRoleDefinitionParameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates an Azure Cosmos DB Cassandra Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateCassandraRoleDefinitionParameters The properties required to create or update a Role + * Definition. + * @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 parameters to create and update an Azure Cosmos DB Cassandra Role Definition on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createUpdateCassandraRoleDefinitionAsync(String resourceGroupName, + String accountName, String roleDefinitionId, + CassandraRoleDefinitionResourceInner createUpdateCassandraRoleDefinitionParameters) { + return beginCreateUpdateCassandraRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, + createUpdateCassandraRoleDefinitionParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an Azure Cosmos DB Cassandra Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateCassandraRoleDefinitionParameters The properties required to create or update a Role + * Definition. + * @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 parameters to create and update an Azure Cosmos DB Cassandra Role Definition on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createUpdateCassandraRoleDefinitionAsync( + String resourceGroupName, String accountName, String roleDefinitionId, + CassandraRoleDefinitionResourceInner createUpdateCassandraRoleDefinitionParameters, Context context) { + return beginCreateUpdateCassandraRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, + createUpdateCassandraRoleDefinitionParameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an Azure Cosmos DB Cassandra Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateCassandraRoleDefinitionParameters The properties required to create or update a Role + * Definition. + * @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 parameters to create and update an Azure Cosmos DB Cassandra Role Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CassandraRoleDefinitionResourceInner createUpdateCassandraRoleDefinition(String resourceGroupName, + String accountName, String roleDefinitionId, + CassandraRoleDefinitionResourceInner createUpdateCassandraRoleDefinitionParameters) { + return createUpdateCassandraRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, + createUpdateCassandraRoleDefinitionParameters).block(); + } + + /** + * Creates or updates an Azure Cosmos DB Cassandra Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateCassandraRoleDefinitionParameters The properties required to create or update a Role + * Definition. + * @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 parameters to create and update an Azure Cosmos DB Cassandra Role Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CassandraRoleDefinitionResourceInner createUpdateCassandraRoleDefinition(String resourceGroupName, + String accountName, String roleDefinitionId, + CassandraRoleDefinitionResourceInner createUpdateCassandraRoleDefinitionParameters, Context context) { + return createUpdateCassandraRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, + createUpdateCassandraRoleDefinitionParameters, context).block(); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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>> deleteCassandraRoleDefinitionWithResponseAsync(String resourceGroupName, + String accountName, String roleDefinitionId) { + 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 (roleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> service.deleteCassandraRoleDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleDefinitionId, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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>> deleteCassandraRoleDefinitionWithResponseAsync(String resourceGroupName, + String accountName, String roleDefinitionId, 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 (roleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.deleteCassandraRoleDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleDefinitionId, context); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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> beginDeleteCassandraRoleDefinitionAsync(String resourceGroupName, + String accountName, String roleDefinitionId) { + Mono>> mono + = deleteCassandraRoleDefinitionWithResponseAsync(resourceGroupName, accountName, roleDefinitionId); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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> beginDeleteCassandraRoleDefinitionAsync(String resourceGroupName, + String accountName, String roleDefinitionId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteCassandraRoleDefinitionWithResponseAsync(resourceGroupName, accountName, roleDefinitionId, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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> beginDeleteCassandraRoleDefinition(String resourceGroupName, + String accountName, String roleDefinitionId) { + return this.beginDeleteCassandraRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId) + .getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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> beginDeleteCassandraRoleDefinition(String resourceGroupName, + String accountName, String roleDefinitionId, Context context) { + return this.beginDeleteCassandraRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, context) + .getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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 deleteCassandraRoleDefinitionAsync(String resourceGroupName, String accountName, + String roleDefinitionId) { + return beginDeleteCassandraRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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 deleteCassandraRoleDefinitionAsync(String resourceGroupName, String accountName, + String roleDefinitionId, Context context) { + return beginDeleteCassandraRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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 deleteCassandraRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId) { + deleteCassandraRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId).block(); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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 deleteCassandraRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId, + Context context) { + deleteCassandraRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, context).block(); + } + + /** + * Retrieves the list of all Azure Cosmos DB Cassandra Role Definitions. + * + * @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 response of a CassandraRoleDefinitionResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listCassandraRoleDefinitionsSinglePageAsync(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.listCassandraRoleDefinitions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the list of all Azure Cosmos DB Cassandra Role Definitions. + * + * @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 response of a CassandraRoleDefinitionResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listCassandraRoleDefinitionsSinglePageAsync(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 + .listCassandraRoleDefinitions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Retrieves the list of all Azure Cosmos DB Cassandra Role Definitions. + * + * @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 response of a CassandraRoleDefinitionResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listCassandraRoleDefinitionsAsync(String resourceGroupName, + String accountName) { + return new PagedFlux<>(() -> listCassandraRoleDefinitionsSinglePageAsync(resourceGroupName, accountName), + nextLink -> listCassandraRoleDefinitionsNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves the list of all Azure Cosmos DB Cassandra Role Definitions. + * + * @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 response of a CassandraRoleDefinitionResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCassandraRoleDefinitionsAsync(String resourceGroupName, + String accountName, Context context) { + return new PagedFlux<>( + () -> listCassandraRoleDefinitionsSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listCassandraRoleDefinitionsNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves the list of all Azure Cosmos DB Cassandra Role Definitions. + * + * @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 response of a CassandraRoleDefinitionResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCassandraRoleDefinitions(String resourceGroupName, + String accountName) { + return new PagedIterable<>(listCassandraRoleDefinitionsAsync(resourceGroupName, accountName)); + } + + /** + * Retrieves the list of all Azure Cosmos DB Cassandra Role Definitions. + * + * @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 response of a CassandraRoleDefinitionResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCassandraRoleDefinitions(String resourceGroupName, + String accountName, Context context) { + return new PagedIterable<>(listCassandraRoleDefinitionsAsync(resourceGroupName, accountName, context)); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Assignment with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB Cassandra Role Assignment along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getCassandraRoleAssignmentWithResponseAsync( + String resourceGroupName, String accountName, String roleAssignmentId) { + 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 (roleAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getCassandraRoleAssignment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleAssignmentId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Assignment with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB Cassandra Role Assignment along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getCassandraRoleAssignmentWithResponseAsync( + String resourceGroupName, String accountName, String roleAssignmentId, 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 (roleAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getCassandraRoleAssignment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleAssignmentId, accept, context); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Assignment with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB Cassandra Role Assignment on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getCassandraRoleAssignmentAsync(String resourceGroupName, + String accountName, String roleAssignmentId) { + return getCassandraRoleAssignmentWithResponseAsync(resourceGroupName, accountName, roleAssignmentId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Assignment with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB Cassandra Role Assignment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getCassandraRoleAssignmentWithResponse( + String resourceGroupName, String accountName, String roleAssignmentId, Context context) { + return getCassandraRoleAssignmentWithResponseAsync(resourceGroupName, accountName, roleAssignmentId, context) + .block(); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Cassandra Role Assignment with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB Cassandra Role Assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CassandraRoleAssignmentResourceInner getCassandraRoleAssignment(String resourceGroupName, String accountName, + String roleAssignmentId) { + return getCassandraRoleAssignmentWithResponse(resourceGroupName, accountName, roleAssignmentId, Context.NONE) + .getValue(); + } + + /** + * Creates or updates an Azure Cosmos DB Cassandra Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateCassandraRoleAssignmentParameters The properties required to create or update a Role + * Assignment. + * @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 parameters to create and update an Azure Cosmos DB Cassandra Role Assignment along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createUpdateCassandraRoleAssignmentWithResponseAsync( + String resourceGroupName, String accountName, String roleAssignmentId, + CassandraRoleAssignmentResourceInner createUpdateCassandraRoleAssignmentParameters) { + 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 (roleAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); + } + if (createUpdateCassandraRoleAssignmentParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateCassandraRoleAssignmentParameters is required and cannot be null.")); + } else { + createUpdateCassandraRoleAssignmentParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createUpdateCassandraRoleAssignment(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + roleAssignmentId, contentType, accept, createUpdateCassandraRoleAssignmentParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an Azure Cosmos DB Cassandra Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateCassandraRoleAssignmentParameters The properties required to create or update a Role + * Assignment. + * @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 parameters to create and update an Azure Cosmos DB Cassandra Role Assignment along with {@link Response} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createUpdateCassandraRoleAssignmentWithResponseAsync( + String resourceGroupName, String accountName, String roleAssignmentId, + CassandraRoleAssignmentResourceInner createUpdateCassandraRoleAssignmentParameters, 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 (roleAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); + } + if (createUpdateCassandraRoleAssignmentParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateCassandraRoleAssignmentParameters is required and cannot be null.")); + } else { + createUpdateCassandraRoleAssignmentParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createUpdateCassandraRoleAssignment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleAssignmentId, contentType, accept, + createUpdateCassandraRoleAssignmentParameters, context); + } + + /** + * Creates or updates an Azure Cosmos DB Cassandra Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateCassandraRoleAssignmentParameters The properties required to create or update a Role + * Assignment. + * @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 parameters to create and update an Azure Cosmos DB Cassandra Role + * Assignment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, CassandraRoleAssignmentResourceInner> + beginCreateUpdateCassandraRoleAssignmentAsync(String resourceGroupName, String accountName, + String roleAssignmentId, + CassandraRoleAssignmentResourceInner createUpdateCassandraRoleAssignmentParameters) { + Mono>> mono = createUpdateCassandraRoleAssignmentWithResponseAsync(resourceGroupName, + accountName, roleAssignmentId, createUpdateCassandraRoleAssignmentParameters); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), CassandraRoleAssignmentResourceInner.class, + CassandraRoleAssignmentResourceInner.class, this.client.getContext()); + } + + /** + * Creates or updates an Azure Cosmos DB Cassandra Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateCassandraRoleAssignmentParameters The properties required to create or update a Role + * Assignment. + * @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 parameters to create and update an Azure Cosmos DB Cassandra Role + * Assignment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, CassandraRoleAssignmentResourceInner> + beginCreateUpdateCassandraRoleAssignmentAsync(String resourceGroupName, String accountName, + String roleAssignmentId, CassandraRoleAssignmentResourceInner createUpdateCassandraRoleAssignmentParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createUpdateCassandraRoleAssignmentWithResponseAsync(resourceGroupName, + accountName, roleAssignmentId, createUpdateCassandraRoleAssignmentParameters, context); + return this.client.getLroResult( + mono, this.client.getHttpPipeline(), CassandraRoleAssignmentResourceInner.class, + CassandraRoleAssignmentResourceInner.class, context); + } + + /** + * Creates or updates an Azure Cosmos DB Cassandra Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateCassandraRoleAssignmentParameters The properties required to create or update a Role + * Assignment. + * @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 parameters to create and update an Azure Cosmos DB Cassandra Role + * Assignment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CassandraRoleAssignmentResourceInner> + beginCreateUpdateCassandraRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId, + CassandraRoleAssignmentResourceInner createUpdateCassandraRoleAssignmentParameters) { + return this + .beginCreateUpdateCassandraRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, + createUpdateCassandraRoleAssignmentParameters) + .getSyncPoller(); + } + + /** + * Creates or updates an Azure Cosmos DB Cassandra Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateCassandraRoleAssignmentParameters The properties required to create or update a Role + * Assignment. + * @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 parameters to create and update an Azure Cosmos DB Cassandra Role + * Assignment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, CassandraRoleAssignmentResourceInner> + beginCreateUpdateCassandraRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId, + CassandraRoleAssignmentResourceInner createUpdateCassandraRoleAssignmentParameters, Context context) { + return this + .beginCreateUpdateCassandraRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, + createUpdateCassandraRoleAssignmentParameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates an Azure Cosmos DB Cassandra Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateCassandraRoleAssignmentParameters The properties required to create or update a Role + * Assignment. + * @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 parameters to create and update an Azure Cosmos DB Cassandra Role Assignment on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createUpdateCassandraRoleAssignmentAsync(String resourceGroupName, + String accountName, String roleAssignmentId, + CassandraRoleAssignmentResourceInner createUpdateCassandraRoleAssignmentParameters) { + return beginCreateUpdateCassandraRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, + createUpdateCassandraRoleAssignmentParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an Azure Cosmos DB Cassandra Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateCassandraRoleAssignmentParameters The properties required to create or update a Role + * Assignment. + * @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 parameters to create and update an Azure Cosmos DB Cassandra Role Assignment on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createUpdateCassandraRoleAssignmentAsync( + String resourceGroupName, String accountName, String roleAssignmentId, + CassandraRoleAssignmentResourceInner createUpdateCassandraRoleAssignmentParameters, Context context) { + return beginCreateUpdateCassandraRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, + createUpdateCassandraRoleAssignmentParameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an Azure Cosmos DB Cassandra Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateCassandraRoleAssignmentParameters The properties required to create or update a Role + * Assignment. + * @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 parameters to create and update an Azure Cosmos DB Cassandra Role Assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CassandraRoleAssignmentResourceInner createUpdateCassandraRoleAssignment(String resourceGroupName, + String accountName, String roleAssignmentId, + CassandraRoleAssignmentResourceInner createUpdateCassandraRoleAssignmentParameters) { + return createUpdateCassandraRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, + createUpdateCassandraRoleAssignmentParameters).block(); + } + + /** + * Creates or updates an Azure Cosmos DB Cassandra Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateCassandraRoleAssignmentParameters The properties required to create or update a Role + * Assignment. + * @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 parameters to create and update an Azure Cosmos DB Cassandra Role Assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CassandraRoleAssignmentResourceInner createUpdateCassandraRoleAssignment(String resourceGroupName, + String accountName, String roleAssignmentId, + CassandraRoleAssignmentResourceInner createUpdateCassandraRoleAssignmentParameters, Context context) { + return createUpdateCassandraRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, + createUpdateCassandraRoleAssignmentParameters, context).block(); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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>> deleteCassandraRoleAssignmentWithResponseAsync(String resourceGroupName, + String accountName, String roleAssignmentId) { + 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 (roleAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> service.deleteCassandraRoleAssignment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleAssignmentId, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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>> deleteCassandraRoleAssignmentWithResponseAsync(String resourceGroupName, + String accountName, String roleAssignmentId, 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 (roleAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.deleteCassandraRoleAssignment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleAssignmentId, context); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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> beginDeleteCassandraRoleAssignmentAsync(String resourceGroupName, + String accountName, String roleAssignmentId) { + Mono>> mono + = deleteCassandraRoleAssignmentWithResponseAsync(resourceGroupName, accountName, roleAssignmentId); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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> beginDeleteCassandraRoleAssignmentAsync(String resourceGroupName, + String accountName, String roleAssignmentId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteCassandraRoleAssignmentWithResponseAsync(resourceGroupName, accountName, roleAssignmentId, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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> beginDeleteCassandraRoleAssignment(String resourceGroupName, + String accountName, String roleAssignmentId) { + return this.beginDeleteCassandraRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId) + .getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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> beginDeleteCassandraRoleAssignment(String resourceGroupName, + String accountName, String roleAssignmentId, Context context) { + return this.beginDeleteCassandraRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, context) + .getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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 deleteCassandraRoleAssignmentAsync(String resourceGroupName, String accountName, + String roleAssignmentId) { + return beginDeleteCassandraRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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 deleteCassandraRoleAssignmentAsync(String resourceGroupName, String accountName, + String roleAssignmentId, Context context) { + return beginDeleteCassandraRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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 deleteCassandraRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId) { + deleteCassandraRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId).block(); + } + + /** + * Deletes an existing Azure Cosmos DB Cassandra Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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 deleteCassandraRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId, + Context context) { + deleteCassandraRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, context).block(); + } + + /** + * Retrieves the list of all Azure Cosmos DB Cassandra Role Assignments. + * + * @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 response of a CassandraRoleAssignmentResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listCassandraRoleAssignmentsSinglePageAsync(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.listCassandraRoleAssignments(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the list of all Azure Cosmos DB Cassandra Role Assignments. + * + * @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 response of a CassandraRoleAssignmentResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listCassandraRoleAssignmentsSinglePageAsync(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 + .listCassandraRoleAssignments(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Retrieves the list of all Azure Cosmos DB Cassandra Role Assignments. + * + * @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 response of a CassandraRoleAssignmentResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listCassandraRoleAssignmentsAsync(String resourceGroupName, + String accountName) { + return new PagedFlux<>(() -> listCassandraRoleAssignmentsSinglePageAsync(resourceGroupName, accountName), + nextLink -> listCassandraRoleAssignmentsNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves the list of all Azure Cosmos DB Cassandra Role Assignments. + * + * @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 response of a CassandraRoleAssignmentResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listCassandraRoleAssignmentsAsync(String resourceGroupName, + String accountName, Context context) { + return new PagedFlux<>( + () -> listCassandraRoleAssignmentsSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listCassandraRoleAssignmentsNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves the list of all Azure Cosmos DB Cassandra Role Assignments. + * + * @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 response of a CassandraRoleAssignmentResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCassandraRoleAssignments(String resourceGroupName, + String accountName) { + return new PagedIterable<>(listCassandraRoleAssignmentsAsync(resourceGroupName, accountName)); + } + + /** + * Retrieves the list of all Azure Cosmos DB Cassandra Role Assignments. + * + * @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 response of a CassandraRoleAssignmentResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listCassandraRoleAssignments(String resourceGroupName, + String accountName, Context context) { + return new PagedIterable<>(listCassandraRoleAssignmentsAsync(resourceGroupName, accountName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 Cassandra keyspaces and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listCassandraKeyspacesNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listCassandraKeyspacesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 Cassandra keyspaces and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listCassandraKeyspacesNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listCassandraKeyspacesNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 Cassandra tables and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCassandraTablesNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listCassandraTablesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 Cassandra tables and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCassandraTablesNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listCassandraTablesNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 Cassandra views and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCassandraViewsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listCassandraViewsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 Cassandra views and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listCassandraViewsNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listCassandraViewsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a CassandraRoleDefinitionResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listCassandraRoleDefinitionsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.listCassandraRoleDefinitionsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a CassandraRoleDefinitionResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listCassandraRoleDefinitionsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listCassandraRoleDefinitionsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a CassandraRoleAssignmentResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listCassandraRoleAssignmentsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.listCassandraRoleAssignmentsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a CassandraRoleAssignmentResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listCassandraRoleAssignmentsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listCassandraRoleAssignmentsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ChaosFaultsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ChaosFaultsClientImpl.java new file mode 100644 index 000000000000..52e408982a0f --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ChaosFaultsClientImpl.java @@ -0,0 +1,689 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation; + +import com.azure.core.annotation.BodyParam; +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.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.ChaosFaultsClient; +import com.azure.resourcemanager.cosmos.fluent.models.ChaosFaultResourceInner; +import com.azure.resourcemanager.cosmos.implementation.models.ChaosFaultListResponse; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ChaosFaultsClient. + */ +public final class ChaosFaultsClientImpl implements ChaosFaultsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ChaosFaultsService service; + + /** + * The service client containing this operation class. + */ + private final CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of ChaosFaultsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ChaosFaultsClientImpl(CosmosDBManagementClientImpl client) { + this.service + = RestProxy.create(ChaosFaultsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CosmosDBManagementClientChaosFaults to be used by the proxy service + * to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CosmosDBManagementClientChaosFaults") + public interface ChaosFaultsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults/{chaosFault}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("chaosFault") String chaosFault, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults/{chaosFault}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> enableDisable(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("chaosFault") String chaosFault, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ChaosFaultResourceInner chaosFaultRequest, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/chaosFaults") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @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 chaos Fault for a CosmosdB account for a particular Chaos Fault along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String chaosFault) { + 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 (chaosFault == null) { + return Mono.error(new IllegalArgumentException("Parameter chaosFault is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, chaosFault, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @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 chaos Fault for a CosmosdB account for a particular Chaos Fault along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String chaosFault, 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 (chaosFault == null) { + return Mono.error(new IllegalArgumentException("Parameter chaosFault is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, chaosFault, accept, context); + } + + /** + * Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @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 chaos Fault for a CosmosdB account for a particular Chaos Fault on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String accountName, String chaosFault) { + return getWithResponseAsync(resourceGroupName, accountName, chaosFault) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @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 chaos Fault for a CosmosdB account for a particular Chaos Fault along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, + String chaosFault, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, chaosFault, context).block(); + } + + /** + * Get Chaos Fault for a CosmosdB account for a particular Chaos Fault. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @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 chaos Fault for a CosmosdB account for a particular Chaos Fault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ChaosFaultResourceInner get(String resourceGroupName, String accountName, String chaosFault) { + return getWithResponse(resourceGroupName, accountName, chaosFault, Context.NONE).getValue(); + } + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @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 request object to enable/disable the chaos fault along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> enableDisableWithResponseAsync(String resourceGroupName, String accountName, + String chaosFault, ChaosFaultResourceInner chaosFaultRequest) { + 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 (chaosFault == null) { + return Mono.error(new IllegalArgumentException("Parameter chaosFault is required and cannot be null.")); + } + if (chaosFaultRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter chaosFaultRequest is required and cannot be null.")); + } else { + chaosFaultRequest.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.enableDisable(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, chaosFault, contentType, accept, + chaosFaultRequest, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @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 request object to enable/disable the chaos fault along with {@link Response} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> enableDisableWithResponseAsync(String resourceGroupName, + String accountName, String chaosFault, ChaosFaultResourceInner chaosFaultRequest, 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 (chaosFault == null) { + return Mono.error(new IllegalArgumentException("Parameter chaosFault is required and cannot be null.")); + } + if (chaosFaultRequest == null) { + return Mono + .error(new IllegalArgumentException("Parameter chaosFaultRequest is required and cannot be null.")); + } else { + chaosFaultRequest.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.enableDisable(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, chaosFault, contentType, accept, + chaosFaultRequest, context); + } + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @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 a request object to enable/disable the chaos fault. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, ChaosFaultResourceInner> beginEnableDisableAsync( + String resourceGroupName, String accountName, String chaosFault, ChaosFaultResourceInner chaosFaultRequest) { + Mono>> mono + = enableDisableWithResponseAsync(resourceGroupName, accountName, chaosFault, chaosFaultRequest); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ChaosFaultResourceInner.class, ChaosFaultResourceInner.class, + this.client.getContext()); + } + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @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 a request object to enable/disable the chaos fault. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ChaosFaultResourceInner> beginEnableDisableAsync( + String resourceGroupName, String accountName, String chaosFault, ChaosFaultResourceInner chaosFaultRequest, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = enableDisableWithResponseAsync(resourceGroupName, accountName, chaosFault, chaosFaultRequest, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ChaosFaultResourceInner.class, ChaosFaultResourceInner.class, context); + } + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @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 a request object to enable/disable the chaos fault. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ChaosFaultResourceInner> beginEnableDisable( + String resourceGroupName, String accountName, String chaosFault, ChaosFaultResourceInner chaosFaultRequest) { + return this.beginEnableDisableAsync(resourceGroupName, accountName, chaosFault, chaosFaultRequest) + .getSyncPoller(); + } + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @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 a request object to enable/disable the chaos fault. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ChaosFaultResourceInner> beginEnableDisable( + String resourceGroupName, String accountName, String chaosFault, ChaosFaultResourceInner chaosFaultRequest, + Context context) { + return this.beginEnableDisableAsync(resourceGroupName, accountName, chaosFault, chaosFaultRequest, context) + .getSyncPoller(); + } + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @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 request object to enable/disable the chaos fault on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono enableDisableAsync(String resourceGroupName, String accountName, + String chaosFault, ChaosFaultResourceInner chaosFaultRequest) { + return beginEnableDisableAsync(resourceGroupName, accountName, chaosFault, chaosFaultRequest).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @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 request object to enable/disable the chaos fault on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono enableDisableAsync(String resourceGroupName, String accountName, + String chaosFault, ChaosFaultResourceInner chaosFaultRequest, Context context) { + return beginEnableDisableAsync(resourceGroupName, accountName, chaosFault, chaosFaultRequest, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @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 request object to enable/disable the chaos fault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ChaosFaultResourceInner enableDisable(String resourceGroupName, String accountName, String chaosFault, + ChaosFaultResourceInner chaosFaultRequest) { + return enableDisableAsync(resourceGroupName, accountName, chaosFault, chaosFaultRequest).block(); + } + + /** + * Enable, disable Chaos Fault in a CosmosDB account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param chaosFault The name of the ChaosFault. + * @param chaosFaultRequest A request object to enable/disable the chaos fault. + * @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 request object to enable/disable the chaos fault. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ChaosFaultResourceInner enableDisable(String resourceGroupName, String accountName, String chaosFault, + ChaosFaultResourceInner chaosFaultRequest, Context context) { + return enableDisableAsync(resourceGroupName, accountName, chaosFault, chaosFaultRequest, context).block(); + } + + /** + * List Chaos Faults for CosmosDB 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 chaos Fault List Response along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List Chaos Faults for CosmosDB 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 chaos Fault List Response along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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 + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List Chaos Faults for CosmosDB 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 chaos Fault List Response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * List Chaos Faults for CosmosDB 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 chaos Fault List Response as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * List Chaos Faults for CosmosDB 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 chaos Fault List Response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName)); + } + + /** + * List Chaos Faults for CosmosDB 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 chaos Fault List Response as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 chaos Fault List Response along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 chaos Fault List Response along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CollectionPartitionRegionsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CollectionPartitionRegionsClientImpl.java index 1a79f9e0e327..6c8a8d273f6b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CollectionPartitionRegionsClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CollectionPartitionRegionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.cosmos.fluent.CollectionPartitionRegionsClient; import com.azure.resourcemanager.cosmos.fluent.models.PartitionMetricInner; -import com.azure.resourcemanager.cosmos.models.PartitionMetricListResult; +import com.azure.resourcemanager.cosmos.implementation.models.PartitionMetricListResult; import reactor.core.publisher.Mono; /** @@ -59,19 +59,27 @@ public final class CollectionPartitionRegionsClientImpl implements CollectionPar * The interface defining all the services for CosmosDBManagementClientCollectionPartitionRegions to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientCollectionPartitionRegions") public interface CollectionPartitionRegionsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listMetrics(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listMetrics(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("region") String region, @PathParam("databaseRid") String databaseRid, - @PathParam("collectionRid") String collectionRid, @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + @PathParam("collectionRid") String collectionRid, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMetricsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -123,11 +131,11 @@ private Mono> listMetricsSinglePageAsync(Str } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listMetrics(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, region, databaseRid, collectionRid, this.client.getApiVersion(), filter, - accept, context)) + .withContext(context -> service.listMetrics(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, region, databaseRid, collectionRid, + filter, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -182,10 +190,10 @@ private Mono> listMetricsSinglePageAsync(Str final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listMetrics(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, - region, databaseRid, collectionRid, this.client.getApiVersion(), filter, accept, context) + .listMetrics(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, region, databaseRid, collectionRid, filter, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -208,7 +216,7 @@ private Mono> listMetricsSinglePageAsync(Str public PagedFlux listMetricsAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String filter) { return new PagedFlux<>(() -> listMetricsSinglePageAsync(resourceGroupName, accountName, region, databaseRid, - collectionRid, filter)); + collectionRid, filter), nextLink -> listMetricsNextSinglePageAsync(nextLink)); } /** @@ -232,7 +240,7 @@ public PagedFlux listMetricsAsync(String resourceGroupName private PagedFlux listMetricsAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String filter, Context context) { return new PagedFlux<>(() -> listMetricsSinglePageAsync(resourceGroupName, accountName, region, databaseRid, - collectionRid, filter, context)); + collectionRid, filter, context), nextLink -> listMetricsNextSinglePageAsync(nextLink, context)); } /** @@ -281,4 +289,58 @@ public PagedIterable listMetrics(String resourceGroupName, return new PagedIterable<>( listMetricsAsync(resourceGroupName, accountName, region, databaseRid, collectionRid, filter, context)); } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list partition metrics request along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listMetricsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list partition metrics request along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listMetricsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CollectionPartitionsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CollectionPartitionsClientImpl.java index 818bf36e5aa9..6aef2c9e3407 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CollectionPartitionsClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CollectionPartitionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -28,8 +28,8 @@ import com.azure.resourcemanager.cosmos.fluent.CollectionPartitionsClient; import com.azure.resourcemanager.cosmos.fluent.models.PartitionMetricInner; import com.azure.resourcemanager.cosmos.fluent.models.PartitionUsageInner; -import com.azure.resourcemanager.cosmos.models.PartitionMetricListResult; -import com.azure.resourcemanager.cosmos.models.PartitionUsagesResult; +import com.azure.resourcemanager.cosmos.implementation.models.PartitionMetricListResult; +import com.azure.resourcemanager.cosmos.implementation.models.PartitionUsagesResult; import reactor.core.publisher.Mono; /** @@ -61,29 +61,43 @@ public final class CollectionPartitionsClientImpl implements CollectionPartition * The interface defining all the services for CosmosDBManagementClientCollectionPartitions to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientCollectionPartitions") public interface CollectionPartitionsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/metrics") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listMetrics(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listMetrics(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("databaseRid") String databaseRid, @PathParam("collectionRid") String collectionRid, - @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, Context context); + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitions/usages") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listUsages(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listUsages(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("databaseRid") String databaseRid, @PathParam("collectionRid") String collectionRid, - @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMetricsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listUsagesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -132,11 +146,11 @@ private Mono> listMetricsSinglePageAsync(Str } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listMetrics(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseRid, collectionRid, this.client.getApiVersion(), filter, accept, - context)) + .withContext(context -> service.listMetrics(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseRid, collectionRid, filter, + accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -187,10 +201,10 @@ private Mono> listMetricsSinglePageAsync(Str final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listMetrics(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, - databaseRid, collectionRid, this.client.getApiVersion(), filter, accept, context) + .listMetrics(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, databaseRid, collectionRid, filter, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -212,7 +226,8 @@ private Mono> listMetricsSinglePageAsync(Str public PagedFlux listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter) { return new PagedFlux<>( - () -> listMetricsSinglePageAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter)); + () -> listMetricsSinglePageAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter), + nextLink -> listMetricsNextSinglePageAsync(nextLink)); } /** @@ -235,7 +250,7 @@ public PagedFlux listMetricsAsync(String resourceGroupName private PagedFlux listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter, Context context) { return new PagedFlux<>(() -> listMetricsSinglePageAsync(resourceGroupName, accountName, databaseRid, - collectionRid, filter, context)); + collectionRid, filter, context), nextLink -> listMetricsNextSinglePageAsync(nextLink, context)); } /** @@ -324,11 +339,11 @@ private Mono> listUsagesSinglePageAsync(Strin } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listUsages(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseRid, collectionRid, this.client.getApiVersion(), filter, accept, - context)) + .withContext(context -> service.listUsages(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseRid, collectionRid, filter, + accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -375,10 +390,10 @@ private Mono> listUsagesSinglePageAsync(Strin final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listUsages(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, - databaseRid, collectionRid, this.client.getApiVersion(), filter, accept, context) + .listUsages(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, databaseRid, collectionRid, filter, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -399,7 +414,8 @@ private Mono> listUsagesSinglePageAsync(Strin public PagedFlux listUsagesAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter) { return new PagedFlux<>( - () -> listUsagesSinglePageAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter)); + () -> listUsagesSinglePageAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter), + nextLink -> listUsagesNextSinglePageAsync(nextLink)); } /** @@ -419,7 +435,8 @@ public PagedFlux listUsagesAsync(String resourceGroupName, String databaseRid, String collectionRid) { final String filter = null; return new PagedFlux<>( - () -> listUsagesSinglePageAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter)); + () -> listUsagesSinglePageAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter), + nextLink -> listUsagesNextSinglePageAsync(nextLink)); } /** @@ -441,7 +458,7 @@ public PagedFlux listUsagesAsync(String resourceGroupName, private PagedFlux listUsagesAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter, Context context) { return new PagedFlux<>(() -> listUsagesSinglePageAsync(resourceGroupName, accountName, databaseRid, - collectionRid, filter, context)); + collectionRid, filter, context), nextLink -> listUsagesNextSinglePageAsync(nextLink, context)); } /** @@ -484,4 +501,112 @@ public PagedIterable listUsages(String resourceGroupName, S return new PagedIterable<>( listUsagesAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter, context)); } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list partition metrics request along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listMetricsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list partition metrics request along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listMetricsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list partition level usage request along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUsagesNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listUsagesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list partition level usage request along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUsagesNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listUsagesNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CollectionRegionsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CollectionRegionsClientImpl.java index 48d12f2d73a3..bd6258315ec2 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CollectionRegionsClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CollectionRegionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.cosmos.fluent.CollectionRegionsClient; import com.azure.resourcemanager.cosmos.fluent.models.MetricInner; -import com.azure.resourcemanager.cosmos.models.MetricListResult; +import com.azure.resourcemanager.cosmos.implementation.models.MetricListResult; import reactor.core.publisher.Mono; /** @@ -59,19 +59,26 @@ public final class CollectionRegionsClientImpl implements CollectionRegionsClien * The interface defining all the services for CosmosDBManagementClientCollectionRegions to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientCollectionRegions") public interface CollectionRegionsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/metrics") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listMetrics(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listMetrics(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("region") String region, @PathParam("databaseRid") String databaseRid, - @PathParam("collectionRid") String collectionRid, @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + @PathParam("collectionRid") String collectionRid, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMetricsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -123,11 +130,11 @@ private Mono> listMetricsSinglePageAsync(String resou } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listMetrics(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, region, databaseRid, collectionRid, this.client.getApiVersion(), filter, - accept, context)) + .withContext(context -> service.listMetrics(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, region, databaseRid, collectionRid, + filter, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), null, null)) + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -182,10 +189,10 @@ private Mono> listMetricsSinglePageAsync(String resou final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listMetrics(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, - region, databaseRid, collectionRid, this.client.getApiVersion(), filter, accept, context) + .listMetrics(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, region, databaseRid, collectionRid, filter, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -208,7 +215,7 @@ private Mono> listMetricsSinglePageAsync(String resou public PagedFlux listMetricsAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String filter) { return new PagedFlux<>(() -> listMetricsSinglePageAsync(resourceGroupName, accountName, region, databaseRid, - collectionRid, filter)); + collectionRid, filter), nextLink -> listMetricsNextSinglePageAsync(nextLink)); } /** @@ -232,7 +239,7 @@ public PagedFlux listMetricsAsync(String resourceGroupName, String private PagedFlux listMetricsAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String filter, Context context) { return new PagedFlux<>(() -> listMetricsSinglePageAsync(resourceGroupName, accountName, region, databaseRid, - collectionRid, filter, context)); + collectionRid, filter, context), nextLink -> listMetricsNextSinglePageAsync(nextLink, context)); } /** @@ -281,4 +288,58 @@ public PagedIterable listMetrics(String resourceGroupName, String a return new PagedIterable<>( listMetricsAsync(resourceGroupName, accountName, region, databaseRid, collectionRid, filter, context)); } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list metrics request along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listMetricsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list metrics request along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listMetricsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CollectionsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CollectionsClientImpl.java index 19902b60aa1f..6458d44fd631 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CollectionsClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CollectionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -29,9 +29,9 @@ import com.azure.resourcemanager.cosmos.fluent.models.MetricDefinitionInner; import com.azure.resourcemanager.cosmos.fluent.models.MetricInner; import com.azure.resourcemanager.cosmos.fluent.models.UsageInner; -import com.azure.resourcemanager.cosmos.models.MetricDefinitionsListResult; -import com.azure.resourcemanager.cosmos.models.MetricListResult; -import com.azure.resourcemanager.cosmos.models.UsagesResult; +import com.azure.resourcemanager.cosmos.implementation.models.MetricDefinitionsListResult; +import com.azure.resourcemanager.cosmos.implementation.models.MetricListResult; +import com.azure.resourcemanager.cosmos.implementation.models.UsagesResult; import reactor.core.publisher.Mono; /** @@ -63,40 +63,60 @@ public final class CollectionsClientImpl implements CollectionsClient { * The interface defining all the services for CosmosDBManagementClientCollections to be used by the proxy service * to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientCollections") public interface CollectionsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metrics") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listMetrics(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listMetrics(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("databaseRid") String databaseRid, @PathParam("collectionRid") String collectionRid, - @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, Context context); + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/usages") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listUsages(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listUsages(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("databaseRid") String databaseRid, @PathParam("collectionRid") String collectionRid, - @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, - @HeaderParam("Accept") String accept, Context context); + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/metricDefinitions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listMetricDefinitions(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listMetricDefinitions(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("databaseRid") String databaseRid, @PathParam("collectionRid") String collectionRid, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMetricsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listUsagesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMetricDefinitionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -144,11 +164,11 @@ private Mono> listMetricsSinglePageAsync(String resou } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listMetrics(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseRid, collectionRid, this.client.getApiVersion(), filter, accept, - context)) + .withContext(context -> service.listMetrics(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseRid, collectionRid, filter, + accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), null, null)) + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -199,10 +219,10 @@ private Mono> listMetricsSinglePageAsync(String resou final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listMetrics(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, - databaseRid, collectionRid, this.client.getApiVersion(), filter, accept, context) + .listMetrics(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, databaseRid, collectionRid, filter, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -224,7 +244,8 @@ private Mono> listMetricsSinglePageAsync(String resou public PagedFlux listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter) { return new PagedFlux<>( - () -> listMetricsSinglePageAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter)); + () -> listMetricsSinglePageAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter), + nextLink -> listMetricsNextSinglePageAsync(nextLink)); } /** @@ -247,7 +268,7 @@ public PagedFlux listMetricsAsync(String resourceGroupName, String private PagedFlux listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter, Context context) { return new PagedFlux<>(() -> listMetricsSinglePageAsync(resourceGroupName, accountName, databaseRid, - collectionRid, filter, context)); + collectionRid, filter, context), nextLink -> listMetricsNextSinglePageAsync(nextLink, context)); } /** @@ -336,11 +357,11 @@ private Mono> listUsagesSinglePageAsync(String resourc } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listUsages(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseRid, collectionRid, this.client.getApiVersion(), filter, accept, - context)) + .withContext(context -> service.listUsages(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseRid, collectionRid, filter, + accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), null, null)) + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -387,10 +408,10 @@ private Mono> listUsagesSinglePageAsync(String resourc final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listUsages(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, - databaseRid, collectionRid, this.client.getApiVersion(), filter, accept, context) + .listUsages(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, databaseRid, collectionRid, filter, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -411,7 +432,8 @@ private Mono> listUsagesSinglePageAsync(String resourc public PagedFlux listUsagesAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter) { return new PagedFlux<>( - () -> listUsagesSinglePageAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter)); + () -> listUsagesSinglePageAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter), + nextLink -> listUsagesNextSinglePageAsync(nextLink)); } /** @@ -431,7 +453,8 @@ public PagedFlux listUsagesAsync(String resourceGroupName, String ac String collectionRid) { final String filter = null; return new PagedFlux<>( - () -> listUsagesSinglePageAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter)); + () -> listUsagesSinglePageAsync(resourceGroupName, accountName, databaseRid, collectionRid, filter), + nextLink -> listUsagesNextSinglePageAsync(nextLink)); } /** @@ -453,7 +476,7 @@ public PagedFlux listUsagesAsync(String resourceGroupName, String ac private PagedFlux listUsagesAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String filter, Context context) { return new PagedFlux<>(() -> listUsagesSinglePageAsync(resourceGroupName, accountName, databaseRid, - collectionRid, filter, context)); + collectionRid, filter, context), nextLink -> listUsagesNextSinglePageAsync(nextLink, context)); } /** @@ -537,10 +560,10 @@ private Mono> listMetricDefinitionsSinglePa final String accept = "application/json"; return FluxUtil .withContext(context -> service.listMetricDefinitions(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseRid, collectionRid, - this.client.getApiVersion(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseRid, collectionRid, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -585,10 +608,11 @@ private Mono> listMetricDefinitionsSinglePa final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listMetricDefinitions(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, databaseRid, collectionRid, this.client.getApiVersion(), accept, context) + .listMetricDefinitions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseRid, collectionRid, accept, + context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -607,7 +631,8 @@ private Mono> listMetricDefinitionsSinglePa public PagedFlux listMetricDefinitionsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid) { return new PagedFlux<>( - () -> listMetricDefinitionsSinglePageAsync(resourceGroupName, accountName, databaseRid, collectionRid)); + () -> listMetricDefinitionsSinglePageAsync(resourceGroupName, accountName, databaseRid, collectionRid), + nextLink -> listMetricDefinitionsNextSinglePageAsync(nextLink)); } /** @@ -627,7 +652,7 @@ public PagedFlux listMetricDefinitionsAsync(String resour private PagedFlux listMetricDefinitionsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, Context context) { return new PagedFlux<>(() -> listMetricDefinitionsSinglePageAsync(resourceGroupName, accountName, databaseRid, - collectionRid, context)); + collectionRid, context), nextLink -> listMetricDefinitionsNextSinglePageAsync(nextLink, context)); } /** @@ -668,4 +693,168 @@ public PagedIterable listMetricDefinitions(String resourc return new PagedIterable<>( listMetricDefinitionsAsync(resourceGroupName, accountName, databaseRid, collectionRid, context)); } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list metrics request along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listMetricsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list metrics request along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listMetricsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list usage request along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUsagesNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listUsagesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list usage request along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUsagesNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listUsagesNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list metric definitions request along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricDefinitionsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listMetricDefinitionsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list metric definitions request along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricDefinitionsNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listMetricDefinitionsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CopyJobsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CopyJobsClientImpl.java new file mode 100644 index 000000000000..35f7e347f3d3 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CopyJobsClientImpl.java @@ -0,0 +1,1132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation; + +import com.azure.core.annotation.BodyParam; +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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.cosmos.fluent.CopyJobsClient; +import com.azure.resourcemanager.cosmos.fluent.models.CopyJobGetResultsInner; +import com.azure.resourcemanager.cosmos.implementation.models.CopyJobFeedResults; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in CopyJobsClient. + */ +public final class CopyJobsClientImpl implements CopyJobsClient { + /** + * The proxy service used to perform REST calls. + */ + private final CopyJobsService service; + + /** + * The service client containing this operation class. + */ + private final CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of CopyJobsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + CopyJobsClientImpl(CosmosDBManagementClientImpl client) { + this.service = RestProxy.create(CopyJobsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CosmosDBManagementClientCopyJobs to be used by the proxy service to + * perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CosmosDBManagementClientCopyJobs") + public interface CopyJobsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("jobName") String jobName, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("jobName") String jobName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") CopyJobGetResultsInner jobCreateParameters, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDatabaseAccount(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName}/pause") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> pause(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("jobName") String jobName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName}/resume") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> resume(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("jobName") String jobName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName}/cancel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> cancel(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("jobName") String jobName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/copyJobs/{jobName}/complete") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> complete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("jobName") String jobName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDatabaseAccountNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @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 Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String jobName) { + 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 (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, jobName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @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 Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String jobName, 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 (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, jobName, accept, context); + } + + /** + * Get a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @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 Copy Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String accountName, String jobName) { + return getWithResponseAsync(resourceGroupName, accountName, jobName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @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 Copy Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, + String jobName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, jobName, context).block(); + } + + /** + * Get a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @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 Copy Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CopyJobGetResultsInner get(String resourceGroupName, String accountName, String jobName) { + return getWithResponse(resourceGroupName, accountName, jobName, Context.NONE).getValue(); + } + + /** + * Creates a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @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 Cosmos DB Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createWithResponseAsync(String resourceGroupName, String accountName, + String jobName, CopyJobGetResultsInner jobCreateParameters) { + 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 (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + if (jobCreateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter jobCreateParameters is required and cannot be null.")); + } else { + jobCreateParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, jobName, contentType, accept, + jobCreateParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @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 Cosmos DB Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync(String resourceGroupName, String accountName, + String jobName, CopyJobGetResultsInner jobCreateParameters, 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 (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + if (jobCreateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter jobCreateParameters is required and cannot be null.")); + } else { + jobCreateParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, jobName, contentType, accept, jobCreateParameters, context); + } + + /** + * Creates a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @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 Cosmos DB Copy Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createAsync(String resourceGroupName, String accountName, String jobName, + CopyJobGetResultsInner jobCreateParameters) { + return createWithResponseAsync(resourceGroupName, accountName, jobName, jobCreateParameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @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 Cosmos DB Copy Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse(String resourceGroupName, String accountName, + String jobName, CopyJobGetResultsInner jobCreateParameters, Context context) { + return createWithResponseAsync(resourceGroupName, accountName, jobName, jobCreateParameters, context).block(); + } + + /** + * Creates a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @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 Cosmos DB Copy Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CopyJobGetResultsInner create(String resourceGroupName, String accountName, String jobName, + CopyJobGetResultsInner jobCreateParameters) { + return createWithResponse(resourceGroupName, accountName, jobName, jobCreateParameters, Context.NONE) + .getValue(); + } + + /** + * Get a list of Copy jobs. + * + * @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 a list of Copy jobs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDatabaseAccountSinglePageAsync(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.listByDatabaseAccount(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a list of Copy jobs. + * + * @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 a list of Copy jobs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDatabaseAccountSinglePageAsync(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 + .listByDatabaseAccount(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get a list of Copy jobs. + * + * @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 a list of Copy jobs as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByDatabaseAccountAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listByDatabaseAccountSinglePageAsync(resourceGroupName, accountName), + nextLink -> listByDatabaseAccountNextSinglePageAsync(nextLink)); + } + + /** + * Get a list of Copy jobs. + * + * @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 a list of Copy jobs as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDatabaseAccountAsync(String resourceGroupName, String accountName, + Context context) { + return new PagedFlux<>(() -> listByDatabaseAccountSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listByDatabaseAccountNextSinglePageAsync(nextLink, context)); + } + + /** + * Get a list of Copy jobs. + * + * @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 a list of Copy jobs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName) { + return new PagedIterable<>(listByDatabaseAccountAsync(resourceGroupName, accountName)); + } + + /** + * Get a list of Copy jobs. + * + * @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 a list of Copy jobs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName, + Context context) { + return new PagedIterable<>(listByDatabaseAccountAsync(resourceGroupName, accountName, context)); + } + + /** + * Pause a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @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 Cosmos DB Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> pauseWithResponseAsync(String resourceGroupName, String accountName, + String jobName) { + 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 (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.pause(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, jobName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Pause a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @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 Cosmos DB Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> pauseWithResponseAsync(String resourceGroupName, String accountName, + String jobName, 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 (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.pause(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, jobName, accept, context); + } + + /** + * Pause a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @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 Cosmos DB Copy Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono pauseAsync(String resourceGroupName, String accountName, String jobName) { + return pauseWithResponseAsync(resourceGroupName, accountName, jobName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Pause a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @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 Cosmos DB Copy Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response pauseWithResponse(String resourceGroupName, String accountName, + String jobName, Context context) { + return pauseWithResponseAsync(resourceGroupName, accountName, jobName, context).block(); + } + + /** + * Pause a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @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 Cosmos DB Copy Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CopyJobGetResultsInner pause(String resourceGroupName, String accountName, String jobName) { + return pauseWithResponse(resourceGroupName, accountName, jobName, Context.NONE).getValue(); + } + + /** + * Resumes a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @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 Cosmos DB Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> resumeWithResponseAsync(String resourceGroupName, String accountName, + String jobName) { + 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 (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.resume(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, jobName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Resumes a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @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 Cosmos DB Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> resumeWithResponseAsync(String resourceGroupName, String accountName, + String jobName, 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 (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.resume(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, jobName, accept, context); + } + + /** + * Resumes a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @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 Cosmos DB Copy Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono resumeAsync(String resourceGroupName, String accountName, String jobName) { + return resumeWithResponseAsync(resourceGroupName, accountName, jobName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Resumes a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @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 Cosmos DB Copy Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response resumeWithResponse(String resourceGroupName, String accountName, + String jobName, Context context) { + return resumeWithResponseAsync(resourceGroupName, accountName, jobName, context).block(); + } + + /** + * Resumes a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @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 Cosmos DB Copy Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CopyJobGetResultsInner resume(String resourceGroupName, String accountName, String jobName) { + return resumeWithResponse(resourceGroupName, accountName, jobName, Context.NONE).getValue(); + } + + /** + * Cancels a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @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 Cosmos DB Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> cancelWithResponseAsync(String resourceGroupName, String accountName, + String jobName) { + 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 (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.cancel(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, jobName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Cancels a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @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 Cosmos DB Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> cancelWithResponseAsync(String resourceGroupName, String accountName, + String jobName, 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 (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.cancel(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, jobName, accept, context); + } + + /** + * Cancels a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @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 Cosmos DB Copy Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono cancelAsync(String resourceGroupName, String accountName, String jobName) { + return cancelWithResponseAsync(resourceGroupName, accountName, jobName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Cancels a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @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 Cosmos DB Copy Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response cancelWithResponse(String resourceGroupName, String accountName, + String jobName, Context context) { + return cancelWithResponseAsync(resourceGroupName, accountName, jobName, context).block(); + } + + /** + * Cancels a Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @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 Cosmos DB Copy Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CopyJobGetResultsInner cancel(String resourceGroupName, String accountName, String jobName) { + return cancelWithResponse(resourceGroupName, accountName, jobName, Context.NONE).getValue(); + } + + /** + * Completes an Online Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @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 Cosmos DB Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> completeWithResponseAsync(String resourceGroupName, + String accountName, String jobName) { + 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 (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.complete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, jobName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Completes an Online Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @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 Cosmos DB Copy Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> completeWithResponseAsync(String resourceGroupName, + String accountName, String jobName, 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 (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.complete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, jobName, accept, context); + } + + /** + * Completes an Online Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @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 Cosmos DB Copy Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono completeAsync(String resourceGroupName, String accountName, String jobName) { + return completeWithResponseAsync(resourceGroupName, accountName, jobName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Completes an Online Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @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 Cosmos DB Copy Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response completeWithResponse(String resourceGroupName, String accountName, + String jobName, Context context) { + return completeWithResponseAsync(resourceGroupName, accountName, jobName, context).block(); + } + + /** + * Completes an Online Copy Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Copy Job. + * @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 Cosmos DB Copy Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public CopyJobGetResultsInner complete(String resourceGroupName, String accountName, String jobName) { + return completeWithResponse(resourceGroupName, accountName, jobName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 list of Copy jobs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDatabaseAccountNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByDatabaseAccountNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 list of Copy jobs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDatabaseAccountNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByDatabaseAccountNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CosmosDBManagementClientBuilder.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CosmosDBManagementClientBuilder.java index 640f0f49881b..9ee84dc5654e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CosmosDBManagementClientBuilder.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CosmosDBManagementClientBuilder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -20,34 +20,34 @@ @ServiceClientBuilder(serviceClients = { CosmosDBManagementClientImpl.class }) public final class CosmosDBManagementClientBuilder { /* - * The ID of the target subscription. + * Service host */ - private String subscriptionId; + private String endpoint; /** - * Sets The ID of the target subscription. + * Sets Service host. * - * @param subscriptionId the subscriptionId value. + * @param endpoint the endpoint value. * @return the CosmosDBManagementClientBuilder. */ - public CosmosDBManagementClientBuilder subscriptionId(String subscriptionId) { - this.subscriptionId = subscriptionId; + public CosmosDBManagementClientBuilder endpoint(String endpoint) { + this.endpoint = endpoint; return this; } /* - * server parameter + * The ID of the target subscription. The value must be an UUID. */ - private String endpoint; + private String subscriptionId; /** - * Sets server parameter. + * Sets The ID of the target subscription. The value must be an UUID. * - * @param endpoint the endpoint value. + * @param subscriptionId the subscriptionId value. * @return the CosmosDBManagementClientBuilder. */ - public CosmosDBManagementClientBuilder endpoint(String endpoint) { - this.endpoint = endpoint; + public CosmosDBManagementClientBuilder subscriptionId(String subscriptionId) { + this.subscriptionId = subscriptionId; return this; } @@ -132,7 +132,7 @@ public CosmosDBManagementClientImpl buildClient() { ? serializerAdapter : SerializerFactory.createDefaultManagementSerializerAdapter(); CosmosDBManagementClientImpl client = new CosmosDBManagementClientImpl(localPipeline, localSerializerAdapter, - localDefaultPollInterval, localEnvironment, this.subscriptionId, localEndpoint); + localDefaultPollInterval, localEnvironment, localEndpoint, this.subscriptionId); return client; } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CosmosDBManagementClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CosmosDBManagementClientImpl.java index 6e416ddf3a0c..8d8e2f4518f3 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CosmosDBManagementClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/CosmosDBManagementClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -11,20 +11,28 @@ import com.azure.resourcemanager.cosmos.fluent.CassandraClustersClient; import com.azure.resourcemanager.cosmos.fluent.CassandraDataCentersClient; import com.azure.resourcemanager.cosmos.fluent.CassandraResourcesClient; +import com.azure.resourcemanager.cosmos.fluent.ChaosFaultsClient; import com.azure.resourcemanager.cosmos.fluent.CollectionPartitionRegionsClient; import com.azure.resourcemanager.cosmos.fluent.CollectionPartitionsClient; import com.azure.resourcemanager.cosmos.fluent.CollectionRegionsClient; import com.azure.resourcemanager.cosmos.fluent.CollectionsClient; +import com.azure.resourcemanager.cosmos.fluent.CopyJobsClient; import com.azure.resourcemanager.cosmos.fluent.CosmosDBManagementClient; +import com.azure.resourcemanager.cosmos.fluent.DataTransferJobsClient; import com.azure.resourcemanager.cosmos.fluent.DatabaseAccountRegionsClient; import com.azure.resourcemanager.cosmos.fluent.DatabaseAccountsClient; import com.azure.resourcemanager.cosmos.fluent.DatabasesClient; +import com.azure.resourcemanager.cosmos.fluent.FleetAnalyticsClient; import com.azure.resourcemanager.cosmos.fluent.FleetsClient; import com.azure.resourcemanager.cosmos.fluent.FleetspaceAccountsClient; import com.azure.resourcemanager.cosmos.fluent.FleetspacesClient; +import com.azure.resourcemanager.cosmos.fluent.GarnetClustersClient; +import com.azure.resourcemanager.cosmos.fluent.GraphResourcesClient; import com.azure.resourcemanager.cosmos.fluent.GremlinResourcesClient; import com.azure.resourcemanager.cosmos.fluent.LocationsClient; import com.azure.resourcemanager.cosmos.fluent.MongoDBResourcesClient; +import com.azure.resourcemanager.cosmos.fluent.MongoMIResourcesClient; +import com.azure.resourcemanager.cosmos.fluent.NetworkSecurityPerimeterConfigurationsClient; import com.azure.resourcemanager.cosmos.fluent.NotebookWorkspacesClient; import com.azure.resourcemanager.cosmos.fluent.OperationsClient; import com.azure.resourcemanager.cosmos.fluent.PartitionKeyRangeIdRegionsClient; @@ -49,6 +57,10 @@ import com.azure.resourcemanager.cosmos.fluent.ServicesClient; import com.azure.resourcemanager.cosmos.fluent.SqlResourcesClient; import com.azure.resourcemanager.cosmos.fluent.TableResourcesClient; +import com.azure.resourcemanager.cosmos.fluent.ThroughputPoolAccountsClient; +import com.azure.resourcemanager.cosmos.fluent.ThroughputPoolAccountsOperationsClient; +import com.azure.resourcemanager.cosmos.fluent.ThroughputPoolsClient; +import com.azure.resourcemanager.cosmos.fluent.ThroughputPoolsOperationsClient; import com.azure.resourcemanager.resources.fluentcore.AzureServiceClient; import java.time.Duration; @@ -58,26 +70,12 @@ @ServiceClient(builder = CosmosDBManagementClientBuilder.class) public final class CosmosDBManagementClientImpl extends AzureServiceClient implements CosmosDBManagementClient { /** - * The ID of the target subscription. - */ - private final String subscriptionId; - - /** - * Gets The ID of the target subscription. - * - * @return the subscriptionId value. - */ - public String getSubscriptionId() { - return this.subscriptionId; - } - - /** - * server parameter. + * Service host. */ private final String endpoint; /** - * Gets server parameter. + * Gets Service host. * * @return the endpoint value. */ @@ -86,12 +84,12 @@ public String getEndpoint() { } /** - * Api Version. + * Version parameter. */ private final String apiVersion; /** - * Gets Api Version. + * Gets Version parameter. * * @return the apiVersion value. */ @@ -99,6 +97,20 @@ public String getApiVersion() { return this.apiVersion; } + /** + * The ID of the target subscription. The value must be an UUID. + */ + private final String subscriptionId; + + /** + * Gets The ID of the target subscription. The value must be an UUID. + * + * @return the subscriptionId value. + */ + public String getSubscriptionId() { + return this.subscriptionId; + } + /** * The HTTP pipeline to send requests through. */ @@ -141,6 +153,20 @@ public Duration getDefaultPollInterval() { return this.defaultPollInterval; } + /** + * The OperationsClient object to access its operations. + */ + private final OperationsClient operations; + + /** + * Gets the OperationsClient object to access its operations. + * + * @return the OperationsClient object. + */ + public OperationsClient getOperations() { + return this.operations; + } + /** * The DatabaseAccountsClient object to access its operations. */ @@ -156,17 +182,199 @@ public DatabaseAccountsClient getDatabaseAccounts() { } /** - * The OperationsClient object to access its operations. + * The CopyJobsClient object to access its operations. */ - private final OperationsClient operations; + private final CopyJobsClient copyJobs; /** - * Gets the OperationsClient object to access its operations. + * Gets the CopyJobsClient object to access its operations. * - * @return the OperationsClient object. + * @return the CopyJobsClient object. */ - public OperationsClient getOperations() { - return this.operations; + public CopyJobsClient getCopyJobs() { + return this.copyJobs; + } + + /** + * The GraphResourcesClient object to access its operations. + */ + private final GraphResourcesClient graphResources; + + /** + * Gets the GraphResourcesClient object to access its operations. + * + * @return the GraphResourcesClient object. + */ + public GraphResourcesClient getGraphResources() { + return this.graphResources; + } + + /** + * The SqlResourcesClient object to access its operations. + */ + private final SqlResourcesClient sqlResources; + + /** + * Gets the SqlResourcesClient object to access its operations. + * + * @return the SqlResourcesClient object. + */ + public SqlResourcesClient getSqlResources() { + return this.sqlResources; + } + + /** + * The MongoDBResourcesClient object to access its operations. + */ + private final MongoDBResourcesClient mongoDBResources; + + /** + * Gets the MongoDBResourcesClient object to access its operations. + * + * @return the MongoDBResourcesClient object. + */ + public MongoDBResourcesClient getMongoDBResources() { + return this.mongoDBResources; + } + + /** + * The TableResourcesClient object to access its operations. + */ + private final TableResourcesClient tableResources; + + /** + * Gets the TableResourcesClient object to access its operations. + * + * @return the TableResourcesClient object. + */ + public TableResourcesClient getTableResources() { + return this.tableResources; + } + + /** + * The CassandraResourcesClient object to access its operations. + */ + private final CassandraResourcesClient cassandraResources; + + /** + * Gets the CassandraResourcesClient object to access its operations. + * + * @return the CassandraResourcesClient object. + */ + public CassandraResourcesClient getCassandraResources() { + return this.cassandraResources; + } + + /** + * The GremlinResourcesClient object to access its operations. + */ + private final GremlinResourcesClient gremlinResources; + + /** + * Gets the GremlinResourcesClient object to access its operations. + * + * @return the GremlinResourcesClient object. + */ + public GremlinResourcesClient getGremlinResources() { + return this.gremlinResources; + } + + /** + * The DataTransferJobsClient object to access its operations. + */ + private final DataTransferJobsClient dataTransferJobs; + + /** + * Gets the DataTransferJobsClient object to access its operations. + * + * @return the DataTransferJobsClient object. + */ + public DataTransferJobsClient getDataTransferJobs() { + return this.dataTransferJobs; + } + + /** + * The GarnetClustersClient object to access its operations. + */ + private final GarnetClustersClient garnetClusters; + + /** + * Gets the GarnetClustersClient object to access its operations. + * + * @return the GarnetClustersClient object. + */ + public GarnetClustersClient getGarnetClusters() { + return this.garnetClusters; + } + + /** + * The NetworkSecurityPerimeterConfigurationsClient object to access its operations. + */ + private final NetworkSecurityPerimeterConfigurationsClient networkSecurityPerimeterConfigurations; + + /** + * Gets the NetworkSecurityPerimeterConfigurationsClient object to access its operations. + * + * @return the NetworkSecurityPerimeterConfigurationsClient object. + */ + public NetworkSecurityPerimeterConfigurationsClient getNetworkSecurityPerimeterConfigurations() { + return this.networkSecurityPerimeterConfigurations; + } + + /** + * The NotebookWorkspacesClient object to access its operations. + */ + private final NotebookWorkspacesClient notebookWorkspaces; + + /** + * Gets the NotebookWorkspacesClient object to access its operations. + * + * @return the NotebookWorkspacesClient object. + */ + public NotebookWorkspacesClient getNotebookWorkspaces() { + return this.notebookWorkspaces; + } + + /** + * The PrivateEndpointConnectionsClient object to access its operations. + */ + private final PrivateEndpointConnectionsClient privateEndpointConnections; + + /** + * Gets the PrivateEndpointConnectionsClient object to access its operations. + * + * @return the PrivateEndpointConnectionsClient object. + */ + public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { + return this.privateEndpointConnections; + } + + /** + * The PrivateLinkResourcesClient object to access its operations. + */ + private final PrivateLinkResourcesClient privateLinkResources; + + /** + * Gets the PrivateLinkResourcesClient object to access its operations. + * + * @return the PrivateLinkResourcesClient object. + */ + public PrivateLinkResourcesClient getPrivateLinkResources() { + return this.privateLinkResources; + } + + /** + * The ChaosFaultsClient object to access its operations. + */ + private final ChaosFaultsClient chaosFaults; + + /** + * Gets the ChaosFaultsClient object to access its operations. + * + * @return the ChaosFaultsClient object. + */ + public ChaosFaultsClient getChaosFaults() { + return this.chaosFaults; } /** @@ -323,76 +531,6 @@ public PartitionKeyRangeIdRegionsClient getPartitionKeyRangeIdRegions() { return this.partitionKeyRangeIdRegions; } - /** - * The SqlResourcesClient object to access its operations. - */ - private final SqlResourcesClient sqlResources; - - /** - * Gets the SqlResourcesClient object to access its operations. - * - * @return the SqlResourcesClient object. - */ - public SqlResourcesClient getSqlResources() { - return this.sqlResources; - } - - /** - * The MongoDBResourcesClient object to access its operations. - */ - private final MongoDBResourcesClient mongoDBResources; - - /** - * Gets the MongoDBResourcesClient object to access its operations. - * - * @return the MongoDBResourcesClient object. - */ - public MongoDBResourcesClient getMongoDBResources() { - return this.mongoDBResources; - } - - /** - * The TableResourcesClient object to access its operations. - */ - private final TableResourcesClient tableResources; - - /** - * Gets the TableResourcesClient object to access its operations. - * - * @return the TableResourcesClient object. - */ - public TableResourcesClient getTableResources() { - return this.tableResources; - } - - /** - * The CassandraResourcesClient object to access its operations. - */ - private final CassandraResourcesClient cassandraResources; - - /** - * Gets the CassandraResourcesClient object to access its operations. - * - * @return the CassandraResourcesClient object. - */ - public CassandraResourcesClient getCassandraResources() { - return this.cassandraResources; - } - - /** - * The GremlinResourcesClient object to access its operations. - */ - private final GremlinResourcesClient gremlinResources; - - /** - * Gets the GremlinResourcesClient object to access its operations. - * - * @return the GremlinResourcesClient object. - */ - public GremlinResourcesClient getGremlinResources() { - return this.gremlinResources; - } - /** * The LocationsClient object to access its operations. */ @@ -435,48 +573,6 @@ public CassandraDataCentersClient getCassandraDataCenters() { return this.cassandraDataCenters; } - /** - * The NotebookWorkspacesClient object to access its operations. - */ - private final NotebookWorkspacesClient notebookWorkspaces; - - /** - * Gets the NotebookWorkspacesClient object to access its operations. - * - * @return the NotebookWorkspacesClient object. - */ - public NotebookWorkspacesClient getNotebookWorkspaces() { - return this.notebookWorkspaces; - } - - /** - * The PrivateEndpointConnectionsClient object to access its operations. - */ - private final PrivateEndpointConnectionsClient privateEndpointConnections; - - /** - * Gets the PrivateEndpointConnectionsClient object to access its operations. - * - * @return the PrivateEndpointConnectionsClient object. - */ - public PrivateEndpointConnectionsClient getPrivateEndpointConnections() { - return this.privateEndpointConnections; - } - - /** - * The PrivateLinkResourcesClient object to access its operations. - */ - private final PrivateLinkResourcesClient privateLinkResources; - - /** - * Gets the PrivateLinkResourcesClient object to access its operations. - * - * @return the PrivateLinkResourcesClient object. - */ - public PrivateLinkResourcesClient getPrivateLinkResources() { - return this.privateLinkResources; - } - /** * The RestorableDatabaseAccountsClient object to access its operations. */ @@ -659,6 +755,76 @@ public ServicesClient getServices() { return this.services; } + /** + * The ThroughputPoolsClient object to access its operations. + */ + private final ThroughputPoolsClient throughputPools; + + /** + * Gets the ThroughputPoolsClient object to access its operations. + * + * @return the ThroughputPoolsClient object. + */ + public ThroughputPoolsClient getThroughputPools() { + return this.throughputPools; + } + + /** + * The ThroughputPoolsOperationsClient object to access its operations. + */ + private final ThroughputPoolsOperationsClient throughputPoolsOperations; + + /** + * Gets the ThroughputPoolsOperationsClient object to access its operations. + * + * @return the ThroughputPoolsOperationsClient object. + */ + public ThroughputPoolsOperationsClient getThroughputPoolsOperations() { + return this.throughputPoolsOperations; + } + + /** + * The ThroughputPoolAccountsClient object to access its operations. + */ + private final ThroughputPoolAccountsClient throughputPoolAccounts; + + /** + * Gets the ThroughputPoolAccountsClient object to access its operations. + * + * @return the ThroughputPoolAccountsClient object. + */ + public ThroughputPoolAccountsClient getThroughputPoolAccounts() { + return this.throughputPoolAccounts; + } + + /** + * The ThroughputPoolAccountsOperationsClient object to access its operations. + */ + private final ThroughputPoolAccountsOperationsClient throughputPoolAccountsOperations; + + /** + * Gets the ThroughputPoolAccountsOperationsClient object to access its operations. + * + * @return the ThroughputPoolAccountsOperationsClient object. + */ + public ThroughputPoolAccountsOperationsClient getThroughputPoolAccountsOperations() { + return this.throughputPoolAccountsOperations; + } + + /** + * The MongoMIResourcesClient object to access its operations. + */ + private final MongoMIResourcesClient mongoMIResources; + + /** + * Gets the MongoMIResourcesClient object to access its operations. + * + * @return the MongoMIResourcesClient object. + */ + public MongoMIResourcesClient getMongoMIResources() { + return this.mongoMIResources; + } + /** * The FleetsClient object to access its operations. */ @@ -673,6 +839,20 @@ public FleetsClient getFleets() { return this.fleets; } + /** + * The FleetAnalyticsClient object to access its operations. + */ + private final FleetAnalyticsClient fleetAnalytics; + + /** + * Gets the FleetAnalyticsClient object to access its operations. + * + * @return the FleetAnalyticsClient object. + */ + public FleetAnalyticsClient getFleetAnalytics() { + return this.fleetAnalytics; + } + /** * The FleetspacesClient object to access its operations. */ @@ -708,20 +888,34 @@ public FleetspaceAccountsClient getFleetspaceAccounts() { * @param serializerAdapter The serializer to serialize an object into a string. * @param defaultPollInterval The default poll interval for long-running operation. * @param environment The Azure environment. - * @param subscriptionId The ID of the target subscription. - * @param endpoint server parameter. + * @param endpoint Service host. + * @param subscriptionId The ID of the target subscription. The value must be an UUID. */ CosmosDBManagementClientImpl(HttpPipeline httpPipeline, SerializerAdapter serializerAdapter, - Duration defaultPollInterval, AzureEnvironment environment, String subscriptionId, String endpoint) { + Duration defaultPollInterval, AzureEnvironment environment, String endpoint, String subscriptionId) { super(httpPipeline, serializerAdapter, environment); this.httpPipeline = httpPipeline; this.serializerAdapter = serializerAdapter; this.defaultPollInterval = defaultPollInterval; - this.subscriptionId = subscriptionId; this.endpoint = endpoint; - this.apiVersion = "2025-10-15"; - this.databaseAccounts = new DatabaseAccountsClientImpl(this); + this.subscriptionId = subscriptionId; + this.apiVersion = "2025-11-01-preview"; this.operations = new OperationsClientImpl(this); + this.databaseAccounts = new DatabaseAccountsClientImpl(this); + this.copyJobs = new CopyJobsClientImpl(this); + this.graphResources = new GraphResourcesClientImpl(this); + this.sqlResources = new SqlResourcesClientImpl(this); + this.mongoDBResources = new MongoDBResourcesClientImpl(this); + this.tableResources = new TableResourcesClientImpl(this); + this.cassandraResources = new CassandraResourcesClientImpl(this); + this.gremlinResources = new GremlinResourcesClientImpl(this); + this.dataTransferJobs = new DataTransferJobsClientImpl(this); + this.garnetClusters = new GarnetClustersClientImpl(this); + this.networkSecurityPerimeterConfigurations = new NetworkSecurityPerimeterConfigurationsClientImpl(this); + this.notebookWorkspaces = new NotebookWorkspacesClientImpl(this); + this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); + this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); + this.chaosFaults = new ChaosFaultsClientImpl(this); this.databases = new DatabasesClientImpl(this); this.collections = new CollectionsClientImpl(this); this.collectionRegions = new CollectionRegionsClientImpl(this); @@ -733,17 +927,9 @@ public FleetspaceAccountsClient getFleetspaceAccounts() { this.collectionPartitions = new CollectionPartitionsClientImpl(this); this.partitionKeyRangeIds = new PartitionKeyRangeIdsClientImpl(this); this.partitionKeyRangeIdRegions = new PartitionKeyRangeIdRegionsClientImpl(this); - this.sqlResources = new SqlResourcesClientImpl(this); - this.mongoDBResources = new MongoDBResourcesClientImpl(this); - this.tableResources = new TableResourcesClientImpl(this); - this.cassandraResources = new CassandraResourcesClientImpl(this); - this.gremlinResources = new GremlinResourcesClientImpl(this); this.locations = new LocationsClientImpl(this); this.cassandraClusters = new CassandraClustersClientImpl(this); this.cassandraDataCenters = new CassandraDataCentersClientImpl(this); - this.notebookWorkspaces = new NotebookWorkspacesClientImpl(this); - this.privateEndpointConnections = new PrivateEndpointConnectionsClientImpl(this); - this.privateLinkResources = new PrivateLinkResourcesClientImpl(this); this.restorableDatabaseAccounts = new RestorableDatabaseAccountsClientImpl(this); this.restorableSqlDatabases = new RestorableSqlDatabasesClientImpl(this); this.restorableSqlContainers = new RestorableSqlContainersClientImpl(this); @@ -757,7 +943,13 @@ public FleetspaceAccountsClient getFleetspaceAccounts() { this.restorableTables = new RestorableTablesClientImpl(this); this.restorableTableResources = new RestorableTableResourcesClientImpl(this); this.services = new ServicesClientImpl(this); + this.throughputPools = new ThroughputPoolsClientImpl(this); + this.throughputPoolsOperations = new ThroughputPoolsOperationsClientImpl(this); + this.throughputPoolAccounts = new ThroughputPoolAccountsClientImpl(this); + this.throughputPoolAccountsOperations = new ThroughputPoolAccountsOperationsClientImpl(this); + this.mongoMIResources = new MongoMIResourcesClientImpl(this); this.fleets = new FleetsClientImpl(this); + this.fleetAnalytics = new FleetAnalyticsClientImpl(this); this.fleetspaces = new FleetspacesClientImpl(this); this.fleetspaceAccounts = new FleetspaceAccountsClientImpl(this); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/DataTransferJobsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/DataTransferJobsClientImpl.java new file mode 100644 index 000000000000..280c78fe6a2e --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/DataTransferJobsClientImpl.java @@ -0,0 +1,1141 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation; + +import com.azure.core.annotation.BodyParam; +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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.cosmos.fluent.DataTransferJobsClient; +import com.azure.resourcemanager.cosmos.fluent.models.DataTransferJobGetResultsInner; +import com.azure.resourcemanager.cosmos.implementation.models.DataTransferJobFeedResults; +import com.azure.resourcemanager.cosmos.models.CreateJobRequest; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in DataTransferJobsClient. + */ +public final class DataTransferJobsClientImpl implements DataTransferJobsClient { + /** + * The proxy service used to perform REST calls. + */ + private final DataTransferJobsService service; + + /** + * The service client containing this operation class. + */ + private final CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of DataTransferJobsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + DataTransferJobsClientImpl(CosmosDBManagementClientImpl client) { + this.service + = RestProxy.create(DataTransferJobsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CosmosDBManagementClientDataTransferJobs to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CosmosDBManagementClientDataTransferJobs") + public interface DataTransferJobsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("jobName") String jobName, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("jobName") String jobName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") CreateJobRequest jobCreateParameters, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDatabaseAccount(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/pause") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> pause(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("jobName") String jobName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/resume") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> resume(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("jobName") String jobName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/cancel") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> cancel(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("jobName") String jobName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/dataTransferJobs/{jobName}/complete") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> complete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("jobName") String jobName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDatabaseAccountNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @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 Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, + String accountName, String jobName) { + 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 (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, jobName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @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 Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String accountName, String jobName, 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 (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, jobName, accept, context); + } + + /** + * Get a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @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 Data Transfer Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String accountName, String jobName) { + return getWithResponseAsync(resourceGroupName, accountName, jobName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @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 Data Transfer Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, + String jobName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, jobName, context).block(); + } + + /** + * Get a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @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 Data Transfer Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataTransferJobGetResultsInner get(String resourceGroupName, String accountName, String jobName) { + return getWithResponse(resourceGroupName, accountName, jobName, Context.NONE).getValue(); + } + + /** + * Creates a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @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 Cosmos DB Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createWithResponseAsync(String resourceGroupName, + String accountName, String jobName, CreateJobRequest jobCreateParameters) { + 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 (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + if (jobCreateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter jobCreateParameters is required and cannot be null.")); + } else { + jobCreateParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, jobName, contentType, accept, + jobCreateParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @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 Cosmos DB Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync(String resourceGroupName, + String accountName, String jobName, CreateJobRequest jobCreateParameters, 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 (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + if (jobCreateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter jobCreateParameters is required and cannot be null.")); + } else { + jobCreateParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, jobName, contentType, accept, jobCreateParameters, context); + } + + /** + * Creates a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @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 Cosmos DB Data Transfer Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createAsync(String resourceGroupName, String accountName, + String jobName, CreateJobRequest jobCreateParameters) { + return createWithResponseAsync(resourceGroupName, accountName, jobName, jobCreateParameters) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @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 Cosmos DB Data Transfer Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse(String resourceGroupName, String accountName, + String jobName, CreateJobRequest jobCreateParameters, Context context) { + return createWithResponseAsync(resourceGroupName, accountName, jobName, jobCreateParameters, context).block(); + } + + /** + * Creates a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @param jobCreateParameters The jobCreateParameters parameter. + * @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 Cosmos DB Data Transfer Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataTransferJobGetResultsInner create(String resourceGroupName, String accountName, String jobName, + CreateJobRequest jobCreateParameters) { + return createWithResponse(resourceGroupName, accountName, jobName, jobCreateParameters, Context.NONE) + .getValue(); + } + + /** + * Get a list of Data Transfer jobs. + * + * @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 a list of Data Transfer jobs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByDatabaseAccountSinglePageAsync(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.listByDatabaseAccount(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get a list of Data Transfer jobs. + * + * @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 a list of Data Transfer jobs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByDatabaseAccountSinglePageAsync(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 + .listByDatabaseAccount(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get a list of Data Transfer jobs. + * + * @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 a list of Data Transfer jobs as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByDatabaseAccountAsync(String resourceGroupName, + String accountName) { + return new PagedFlux<>(() -> listByDatabaseAccountSinglePageAsync(resourceGroupName, accountName), + nextLink -> listByDatabaseAccountNextSinglePageAsync(nextLink)); + } + + /** + * Get a list of Data Transfer jobs. + * + * @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 a list of Data Transfer jobs as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDatabaseAccountAsync(String resourceGroupName, + String accountName, Context context) { + return new PagedFlux<>(() -> listByDatabaseAccountSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listByDatabaseAccountNextSinglePageAsync(nextLink, context)); + } + + /** + * Get a list of Data Transfer jobs. + * + * @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 a list of Data Transfer jobs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDatabaseAccount(String resourceGroupName, + String accountName) { + return new PagedIterable<>(listByDatabaseAccountAsync(resourceGroupName, accountName)); + } + + /** + * Get a list of Data Transfer jobs. + * + * @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 a list of Data Transfer jobs as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDatabaseAccount(String resourceGroupName, + String accountName, Context context) { + return new PagedIterable<>(listByDatabaseAccountAsync(resourceGroupName, accountName, context)); + } + + /** + * Pause a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @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 Cosmos DB Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> pauseWithResponseAsync(String resourceGroupName, + String accountName, String jobName) { + 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 (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.pause(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, jobName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Pause a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @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 Cosmos DB Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> pauseWithResponseAsync(String resourceGroupName, + String accountName, String jobName, 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 (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.pause(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, jobName, accept, context); + } + + /** + * Pause a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @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 Cosmos DB Data Transfer Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono pauseAsync(String resourceGroupName, String accountName, + String jobName) { + return pauseWithResponseAsync(resourceGroupName, accountName, jobName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Pause a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @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 Cosmos DB Data Transfer Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response pauseWithResponse(String resourceGroupName, String accountName, + String jobName, Context context) { + return pauseWithResponseAsync(resourceGroupName, accountName, jobName, context).block(); + } + + /** + * Pause a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @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 Cosmos DB Data Transfer Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataTransferJobGetResultsInner pause(String resourceGroupName, String accountName, String jobName) { + return pauseWithResponse(resourceGroupName, accountName, jobName, Context.NONE).getValue(); + } + + /** + * Resumes a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @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 Cosmos DB Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> resumeWithResponseAsync(String resourceGroupName, + String accountName, String jobName) { + 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 (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.resume(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, jobName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Resumes a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @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 Cosmos DB Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> resumeWithResponseAsync(String resourceGroupName, + String accountName, String jobName, 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 (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.resume(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, jobName, accept, context); + } + + /** + * Resumes a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @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 Cosmos DB Data Transfer Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono resumeAsync(String resourceGroupName, String accountName, + String jobName) { + return resumeWithResponseAsync(resourceGroupName, accountName, jobName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Resumes a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @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 Cosmos DB Data Transfer Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response resumeWithResponse(String resourceGroupName, String accountName, + String jobName, Context context) { + return resumeWithResponseAsync(resourceGroupName, accountName, jobName, context).block(); + } + + /** + * Resumes a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @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 Cosmos DB Data Transfer Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataTransferJobGetResultsInner resume(String resourceGroupName, String accountName, String jobName) { + return resumeWithResponse(resourceGroupName, accountName, jobName, Context.NONE).getValue(); + } + + /** + * Cancels a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @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 Cosmos DB Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> cancelWithResponseAsync(String resourceGroupName, + String accountName, String jobName) { + 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 (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.cancel(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, jobName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Cancels a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @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 Cosmos DB Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> cancelWithResponseAsync(String resourceGroupName, + String accountName, String jobName, 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 (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.cancel(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, jobName, accept, context); + } + + /** + * Cancels a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @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 Cosmos DB Data Transfer Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono cancelAsync(String resourceGroupName, String accountName, + String jobName) { + return cancelWithResponseAsync(resourceGroupName, accountName, jobName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Cancels a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @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 Cosmos DB Data Transfer Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response cancelWithResponse(String resourceGroupName, String accountName, + String jobName, Context context) { + return cancelWithResponseAsync(resourceGroupName, accountName, jobName, context).block(); + } + + /** + * Cancels a Data Transfer Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @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 Cosmos DB Data Transfer Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataTransferJobGetResultsInner cancel(String resourceGroupName, String accountName, String jobName) { + return cancelWithResponse(resourceGroupName, accountName, jobName, Context.NONE).getValue(); + } + + /** + * Completes a Data Transfer Online Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @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 Cosmos DB Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> completeWithResponseAsync(String resourceGroupName, + String accountName, String jobName) { + 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 (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.complete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, jobName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Completes a Data Transfer Online Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @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 Cosmos DB Data Transfer Job along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> completeWithResponseAsync(String resourceGroupName, + String accountName, String jobName, 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 (jobName == null) { + return Mono.error(new IllegalArgumentException("Parameter jobName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.complete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, jobName, accept, context); + } + + /** + * Completes a Data Transfer Online Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @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 Cosmos DB Data Transfer Job on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono completeAsync(String resourceGroupName, String accountName, + String jobName) { + return completeWithResponseAsync(resourceGroupName, accountName, jobName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Completes a Data Transfer Online Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @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 Cosmos DB Data Transfer Job along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response completeWithResponse(String resourceGroupName, String accountName, + String jobName, Context context) { + return completeWithResponseAsync(resourceGroupName, accountName, jobName, context).block(); + } + + /** + * Completes a Data Transfer Online Job. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param jobName Name of the Data Transfer Job. + * @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 Cosmos DB Data Transfer Job. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public DataTransferJobGetResultsInner complete(String resourceGroupName, String accountName, String jobName) { + return completeWithResponse(resourceGroupName, accountName, jobName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 list of Data Transfer jobs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByDatabaseAccountNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByDatabaseAccountNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 list of Data Transfer jobs along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByDatabaseAccountNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByDatabaseAccountNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/DatabaseAccountRegionsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/DatabaseAccountRegionsClientImpl.java index 92a472b48257..c0445d233db8 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/DatabaseAccountRegionsClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/DatabaseAccountRegionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.cosmos.fluent.DatabaseAccountRegionsClient; import com.azure.resourcemanager.cosmos.fluent.models.MetricInner; -import com.azure.resourcemanager.cosmos.models.MetricListResult; +import com.azure.resourcemanager.cosmos.implementation.models.MetricListResult; import reactor.core.publisher.Mono; /** @@ -59,18 +59,25 @@ public final class DatabaseAccountRegionsClientImpl implements DatabaseAccountRe * The interface defining all the services for CosmosDBManagementClientDatabaseAccountRegions to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientDatabaseAccountRegions") public interface DatabaseAccountRegionsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/metrics") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listMetrics(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listMetrics(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("region") String region, @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + @PathParam("region") String region, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMetricsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -114,10 +121,10 @@ private Mono> listMetricsSinglePageAsync(String resou } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listMetrics(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, region, this.client.getApiVersion(), filter, accept, context)) + .withContext(context -> service.listMetrics(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, region, filter, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), null, null)) + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -164,10 +171,10 @@ private Mono> listMetricsSinglePageAsync(String resou final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listMetrics(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, - region, this.client.getApiVersion(), filter, accept, context) + .listMetrics(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, region, filter, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -187,7 +194,8 @@ private Mono> listMetricsSinglePageAsync(String resou @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listMetricsAsync(String resourceGroupName, String accountName, String region, String filter) { - return new PagedFlux<>(() -> listMetricsSinglePageAsync(resourceGroupName, accountName, region, filter)); + return new PagedFlux<>(() -> listMetricsSinglePageAsync(resourceGroupName, accountName, region, filter), + nextLink -> listMetricsNextSinglePageAsync(nextLink)); } /** @@ -209,7 +217,8 @@ public PagedFlux listMetricsAsync(String resourceGroupName, String private PagedFlux listMetricsAsync(String resourceGroupName, String accountName, String region, String filter, Context context) { return new PagedFlux<>( - () -> listMetricsSinglePageAsync(resourceGroupName, accountName, region, filter, context)); + () -> listMetricsSinglePageAsync(resourceGroupName, accountName, region, filter, context), + nextLink -> listMetricsNextSinglePageAsync(nextLink, context)); } /** @@ -252,4 +261,58 @@ public PagedIterable listMetrics(String resourceGroupName, String a String filter, Context context) { return new PagedIterable<>(listMetricsAsync(resourceGroupName, accountName, region, filter, context)); } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list metrics request along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listMetricsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list metrics request along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listMetricsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/DatabaseAccountsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/DatabaseAccountsClientImpl.java index a1a8fbaa56d7..8b1789c62d4a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/DatabaseAccountsClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/DatabaseAccountsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -42,15 +42,15 @@ import com.azure.resourcemanager.cosmos.fluent.models.MetricDefinitionInner; import com.azure.resourcemanager.cosmos.fluent.models.MetricInner; import com.azure.resourcemanager.cosmos.fluent.models.UsageInner; +import com.azure.resourcemanager.cosmos.implementation.models.DatabaseAccountsListResult; +import com.azure.resourcemanager.cosmos.implementation.models.MetricDefinitionsListResult; +import com.azure.resourcemanager.cosmos.implementation.models.MetricListResult; +import com.azure.resourcemanager.cosmos.implementation.models.UsagesResult; import com.azure.resourcemanager.cosmos.models.DatabaseAccountCreateUpdateParameters; import com.azure.resourcemanager.cosmos.models.DatabaseAccountRegenerateKeyParameters; import com.azure.resourcemanager.cosmos.models.DatabaseAccountUpdateParameters; -import com.azure.resourcemanager.cosmos.models.DatabaseAccountsListResult; import com.azure.resourcemanager.cosmos.models.FailoverPolicies; -import com.azure.resourcemanager.cosmos.models.MetricDefinitionsListResult; -import com.azure.resourcemanager.cosmos.models.MetricListResult; import com.azure.resourcemanager.cosmos.models.RegionForOnlineOffline; -import com.azure.resourcemanager.cosmos.models.UsagesResult; import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; @@ -88,179 +88,214 @@ public final class DatabaseAccountsClientImpl implements InnerSupportsGet> getByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}") + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DatabaseAccountUpdateParameters updateParameters, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DatabaseAccountCreateUpdateParameters createUpdateParameters, + Context context); - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}") + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") DatabaseAccountCreateUpdateParameters createUpdateParameters, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") DatabaseAccountUpdateParameters updateParameters, Context context); @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, Context context); + Context context); - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange") - @ExpectedResponses({ 202, 204 }) + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> failoverPriorityChange(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") FailoverPolicies failoverParameters, Context context); + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/databaseAccounts") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts") - @ExpectedResponses({ 200 }) + @Headers({ "Accept: application/json;q=0.9" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/failoverPriorityChange") + @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); + Mono>> failoverPriorityChange(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") FailoverPolicies failoverParameters, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listKeys") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listKeys(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listKeys(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/listConnectionStrings") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listConnectionStrings( - @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/offlineRegion") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> offlineRegion(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> offlineRegion(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RegionForOnlineOffline regionParameterForOffline, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") RegionForOnlineOffline regionParameterForOffline, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/onlineRegion") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> onlineRegion(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> onlineRegion(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") RegionForOnlineOffline regionParameterForOnline, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, + @BodyParam("application/json") RegionForOnlineOffline regionParameterForOnline, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getReadOnlyKeys(@HostParam("$host") String endpoint, + Mono> getReadOnlyKeys( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/readonlykeys") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listReadOnlyKeys(@HostParam("$host") String endpoint, + Mono> listReadOnlyKeys( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/regenerateKey") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> regenerateKey(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> regenerateKey(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, + @HeaderParam("Content-Type") String contentType, @BodyParam("application/json") DatabaseAccountRegenerateKeyParameters keyToRegenerate, Context context); + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metrics") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMetrics(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/usages") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listUsages(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metricDefinitions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMetricDefinitions(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Head("/providers/Microsoft.DocumentDB/databaseAccountNames/{accountName}") @ExpectedResponses({ 200, 404 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> checkNameExists(@HostParam("$host") String endpoint, - @PathParam("accountName") String accountName, @QueryParam("api-version") String apiVersion, + Mono> checkNameExists(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("accountName") String accountName, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metrics") + @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listMetrics(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/usages") + @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listUsages(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/metricDefinitions") + @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listMetricDefinitions(@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); + Mono> listMetricsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listUsagesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMetricDefinitionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -293,9 +328,8 @@ public Mono> getByResourceGroupWithResp } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -330,8 +364,8 @@ private Mono> getByResourceGroupWithRes } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, this.client.getApiVersion(), accept, context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context); } /** @@ -383,19 +417,20 @@ public DatabaseAccountGetResultsInner getByResourceGroup(String resourceGroupNam } /** - * Updates the properties of an existing Azure Cosmos DB database account. + * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates + * on an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param updateParameters The parameters to provide for the current database account. + * @param createUpdateParameters The parameters to provide for the current database account. * @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 database account along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateWithResponseAsync(String resourceGroupName, String accountName, - DatabaseAccountUpdateParameters updateParameters) { + public Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -411,25 +446,28 @@ public Mono>> updateWithResponseAsync(String resourceG if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } - if (updateParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter updateParameters is required and cannot be null.")); + if (createUpdateParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter createUpdateParameters is required and cannot be null.")); } else { - updateParameters.validate(); + createUpdateParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), updateParameters, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, contentType, accept, + createUpdateParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Updates the properties of an existing Azure Cosmos DB database account. + * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates + * on an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param updateParameters The parameters to provide for the current database account. + * @param createUpdateParameters The parameters to provide for the current database account. * @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. @@ -437,8 +475,8 @@ public Mono>> updateWithResponseAsync(String resourceG * @return an Azure Cosmos DB database account along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateWithResponseAsync(String resourceGroupName, String accountName, - DatabaseAccountUpdateParameters updateParameters, Context context) { + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -454,45 +492,50 @@ private Mono>> updateWithResponseAsync(String resource if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } - if (updateParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter updateParameters is required and cannot be null.")); + if (createUpdateParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter createUpdateParameters is required and cannot be null.")); } else { - updateParameters.validate(); + createUpdateParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, this.client.getApiVersion(), updateParameters, accept, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, contentType, accept, + createUpdateParameters, context); } /** - * Updates the properties of an existing Azure Cosmos DB database account. + * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates + * on an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param updateParameters The parameters to provide for the current database account. + * @param createUpdateParameters The parameters to provide for the current database account. * @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 database account. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, DatabaseAccountGetResultsInner> beginUpdateAsync( - String resourceGroupName, String accountName, DatabaseAccountUpdateParameters updateParameters) { + public PollerFlux, DatabaseAccountGetResultsInner> + beginCreateOrUpdateAsync(String resourceGroupName, String accountName, + DatabaseAccountCreateUpdateParameters createUpdateParameters) { Mono>> mono - = updateWithResponseAsync(resourceGroupName, accountName, updateParameters); + = createOrUpdateWithResponseAsync(resourceGroupName, accountName, createUpdateParameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), DatabaseAccountGetResultsInner.class, DatabaseAccountGetResultsInner.class, this.client.getContext()); } /** - * Updates the properties of an existing Azure Cosmos DB database account. + * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates + * on an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param updateParameters The parameters to provide for the current database account. + * @param createUpdateParameters The parameters to provide for the current database account. * @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. @@ -500,40 +543,42 @@ public PollerFlux, DatabaseAccountGet * @return the {@link PollerFlux} for polling of an Azure Cosmos DB database account. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DatabaseAccountGetResultsInner> beginUpdateAsync( - String resourceGroupName, String accountName, DatabaseAccountUpdateParameters updateParameters, - Context context) { + private PollerFlux, DatabaseAccountGetResultsInner> + beginCreateOrUpdateAsync(String resourceGroupName, String accountName, + DatabaseAccountCreateUpdateParameters createUpdateParameters, Context context) { context = this.client.mergeContext(context); Mono>> mono - = updateWithResponseAsync(resourceGroupName, accountName, updateParameters, context); + = createOrUpdateWithResponseAsync(resourceGroupName, accountName, createUpdateParameters, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), DatabaseAccountGetResultsInner.class, DatabaseAccountGetResultsInner.class, context); } /** - * Updates the properties of an existing Azure Cosmos DB database account. + * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates + * on an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param updateParameters The parameters to provide for the current database account. + * @param createUpdateParameters The parameters to provide for the current database account. * @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 database account. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DatabaseAccountGetResultsInner> - beginUpdate(String resourceGroupName, String accountName, DatabaseAccountUpdateParameters updateParameters) { - return this.beginUpdateAsync(resourceGroupName, accountName, updateParameters).getSyncPoller(); + public SyncPoller, DatabaseAccountGetResultsInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters) { + return this.beginCreateOrUpdateAsync(resourceGroupName, accountName, createUpdateParameters).getSyncPoller(); } /** - * Updates the properties of an existing Azure Cosmos DB database account. + * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates + * on an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param updateParameters The parameters to provide for the current database account. + * @param createUpdateParameters The parameters to provide for the current database account. * @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. @@ -541,36 +586,39 @@ private PollerFlux, DatabaseAccountGe * @return the {@link SyncPoller} for polling of an Azure Cosmos DB database account. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DatabaseAccountGetResultsInner> beginUpdate( - String resourceGroupName, String accountName, DatabaseAccountUpdateParameters updateParameters, + public SyncPoller, DatabaseAccountGetResultsInner> beginCreateOrUpdate( + String resourceGroupName, String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters, Context context) { - return this.beginUpdateAsync(resourceGroupName, accountName, updateParameters, context).getSyncPoller(); + return this.beginCreateOrUpdateAsync(resourceGroupName, accountName, createUpdateParameters, context) + .getSyncPoller(); } /** - * Updates the properties of an existing Azure Cosmos DB database account. + * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates + * on an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param updateParameters The parameters to provide for the current database account. + * @param createUpdateParameters The parameters to provide for the current database account. * @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 database account on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateAsync(String resourceGroupName, String accountName, - DatabaseAccountUpdateParameters updateParameters) { - return beginUpdateAsync(resourceGroupName, accountName, updateParameters).last() + public Mono createOrUpdateAsync(String resourceGroupName, String accountName, + DatabaseAccountCreateUpdateParameters createUpdateParameters) { + return beginCreateOrUpdateAsync(resourceGroupName, accountName, createUpdateParameters).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Updates the properties of an existing Azure Cosmos DB database account. + * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates + * on an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param updateParameters The parameters to provide for the current database account. + * @param createUpdateParameters The parameters to provide for the current database account. * @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. @@ -578,35 +626,37 @@ public Mono updateAsync(String resourceGroupName * @return an Azure Cosmos DB database account on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateAsync(String resourceGroupName, String accountName, - DatabaseAccountUpdateParameters updateParameters, Context context) { - return beginUpdateAsync(resourceGroupName, accountName, updateParameters, context).last() + private Mono createOrUpdateAsync(String resourceGroupName, String accountName, + DatabaseAccountCreateUpdateParameters createUpdateParameters, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, accountName, createUpdateParameters, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Updates the properties of an existing Azure Cosmos DB database account. + * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates + * on an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param updateParameters The parameters to provide for the current database account. + * @param createUpdateParameters The parameters to provide for the current database account. * @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 database account. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DatabaseAccountGetResultsInner update(String resourceGroupName, String accountName, - DatabaseAccountUpdateParameters updateParameters) { - return updateAsync(resourceGroupName, accountName, updateParameters).block(); + public DatabaseAccountGetResultsInner createOrUpdate(String resourceGroupName, String accountName, + DatabaseAccountCreateUpdateParameters createUpdateParameters) { + return createOrUpdateAsync(resourceGroupName, accountName, createUpdateParameters).block(); } /** - * Updates the properties of an existing Azure Cosmos DB database account. + * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates + * on an account. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param updateParameters The parameters to provide for the current database account. + * @param createUpdateParameters The parameters to provide for the current database account. * @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. @@ -614,26 +664,25 @@ public DatabaseAccountGetResultsInner update(String resourceGroupName, String ac * @return an Azure Cosmos DB database account. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DatabaseAccountGetResultsInner update(String resourceGroupName, String accountName, - DatabaseAccountUpdateParameters updateParameters, Context context) { - return updateAsync(resourceGroupName, accountName, updateParameters, context).block(); + public DatabaseAccountGetResultsInner createOrUpdate(String resourceGroupName, String accountName, + DatabaseAccountCreateUpdateParameters createUpdateParameters, Context context) { + return createOrUpdateAsync(resourceGroupName, accountName, createUpdateParameters, context).block(); } /** - * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates - * on an account. + * Updates the properties of 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 createUpdateParameters The parameters to provide for the current database account. + * @param updateParameters The parameters to provide for the current database account. * @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 database account along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters) { + public Mono>> updateWithResponseAsync(String resourceGroupName, String accountName, + DatabaseAccountUpdateParameters updateParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -649,26 +698,27 @@ public Mono>> createOrUpdateWithResponseAsync(String r if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } - if (createUpdateParameters == null) { - return Mono.error( - new IllegalArgumentException("Parameter createUpdateParameters is required and cannot be null.")); + if (updateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter updateParameters is required and cannot be null.")); } else { - createUpdateParameters.validate(); + updateParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), createUpdateParameters, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, contentType, accept, updateParameters, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates - * on an account. + * Updates the properties of 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 createUpdateParameters The parameters to provide for the current database account. + * @param updateParameters The parameters to provide for the current database account. * @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. @@ -676,8 +726,8 @@ public Mono>> createOrUpdateWithResponseAsync(String r * @return an Azure Cosmos DB database account along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, - String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters, Context context) { + private Mono>> updateWithResponseAsync(String resourceGroupName, String accountName, + DatabaseAccountUpdateParameters updateParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -693,48 +743,46 @@ private Mono>> createOrUpdateWithResponseAsync(String if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } - if (createUpdateParameters == null) { - return Mono.error( - new IllegalArgumentException("Parameter createUpdateParameters is required and cannot be null.")); - } else { - createUpdateParameters.validate(); + if (updateParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter updateParameters is required and cannot be null.")); + } else { + updateParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, this.client.getApiVersion(), createUpdateParameters, accept, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, contentType, accept, updateParameters, context); } /** - * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates - * on an account. + * Updates the properties of 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 createUpdateParameters The parameters to provide for the current database account. + * @param updateParameters The parameters to provide for the current database account. * @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 database account. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, DatabaseAccountGetResultsInner> - beginCreateOrUpdateAsync(String resourceGroupName, String accountName, - DatabaseAccountCreateUpdateParameters createUpdateParameters) { + public PollerFlux, DatabaseAccountGetResultsInner> beginUpdateAsync( + String resourceGroupName, String accountName, DatabaseAccountUpdateParameters updateParameters) { Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, accountName, createUpdateParameters); + = updateWithResponseAsync(resourceGroupName, accountName, updateParameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), DatabaseAccountGetResultsInner.class, DatabaseAccountGetResultsInner.class, this.client.getContext()); } /** - * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates - * on an account. + * Updates the properties of 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 createUpdateParameters The parameters to provide for the current database account. + * @param updateParameters The parameters to provide for the current database account. * @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. @@ -742,42 +790,40 @@ private Mono>> createOrUpdateWithResponseAsync(String * @return the {@link PollerFlux} for polling of an Azure Cosmos DB database account. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, DatabaseAccountGetResultsInner> - beginCreateOrUpdateAsync(String resourceGroupName, String accountName, - DatabaseAccountCreateUpdateParameters createUpdateParameters, Context context) { + private PollerFlux, DatabaseAccountGetResultsInner> beginUpdateAsync( + String resourceGroupName, String accountName, DatabaseAccountUpdateParameters updateParameters, + Context context) { context = this.client.mergeContext(context); Mono>> mono - = createOrUpdateWithResponseAsync(resourceGroupName, accountName, createUpdateParameters, context); + = updateWithResponseAsync(resourceGroupName, accountName, updateParameters, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), DatabaseAccountGetResultsInner.class, DatabaseAccountGetResultsInner.class, context); } /** - * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates - * on an account. + * Updates the properties of 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 createUpdateParameters The parameters to provide for the current database account. + * @param updateParameters The parameters to provide for the current database account. * @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 database account. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DatabaseAccountGetResultsInner> beginCreateOrUpdate( - String resourceGroupName, String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters) { - return this.beginCreateOrUpdateAsync(resourceGroupName, accountName, createUpdateParameters).getSyncPoller(); + public SyncPoller, DatabaseAccountGetResultsInner> + beginUpdate(String resourceGroupName, String accountName, DatabaseAccountUpdateParameters updateParameters) { + return this.beginUpdateAsync(resourceGroupName, accountName, updateParameters).getSyncPoller(); } /** - * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates - * on an account. + * Updates the properties of 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 createUpdateParameters The parameters to provide for the current database account. + * @param updateParameters The parameters to provide for the current database account. * @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. @@ -785,39 +831,36 @@ public SyncPoller, DatabaseAccountGet * @return the {@link SyncPoller} for polling of an Azure Cosmos DB database account. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, DatabaseAccountGetResultsInner> beginCreateOrUpdate( - String resourceGroupName, String accountName, DatabaseAccountCreateUpdateParameters createUpdateParameters, + public SyncPoller, DatabaseAccountGetResultsInner> beginUpdate( + String resourceGroupName, String accountName, DatabaseAccountUpdateParameters updateParameters, Context context) { - return this.beginCreateOrUpdateAsync(resourceGroupName, accountName, createUpdateParameters, context) - .getSyncPoller(); + return this.beginUpdateAsync(resourceGroupName, accountName, updateParameters, context).getSyncPoller(); } /** - * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates - * on an account. + * Updates the properties of 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 createUpdateParameters The parameters to provide for the current database account. + * @param updateParameters The parameters to provide for the current database account. * @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 database account on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createOrUpdateAsync(String resourceGroupName, String accountName, - DatabaseAccountCreateUpdateParameters createUpdateParameters) { - return beginCreateOrUpdateAsync(resourceGroupName, accountName, createUpdateParameters).last() + public Mono updateAsync(String resourceGroupName, String accountName, + DatabaseAccountUpdateParameters updateParameters) { + return beginUpdateAsync(resourceGroupName, accountName, updateParameters).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates - * on an account. + * Updates the properties of 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 createUpdateParameters The parameters to provide for the current database account. + * @param updateParameters The parameters to provide for the current database account. * @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. @@ -825,37 +868,35 @@ public Mono createOrUpdateAsync(String resourceG * @return an Azure Cosmos DB database account on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createOrUpdateAsync(String resourceGroupName, String accountName, - DatabaseAccountCreateUpdateParameters createUpdateParameters, Context context) { - return beginCreateOrUpdateAsync(resourceGroupName, accountName, createUpdateParameters, context).last() + private Mono updateAsync(String resourceGroupName, String accountName, + DatabaseAccountUpdateParameters updateParameters, Context context) { + return beginUpdateAsync(resourceGroupName, accountName, updateParameters, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates - * on an account. + * Updates the properties of 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 createUpdateParameters The parameters to provide for the current database account. + * @param updateParameters The parameters to provide for the current database account. * @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 database account. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DatabaseAccountGetResultsInner createOrUpdate(String resourceGroupName, String accountName, - DatabaseAccountCreateUpdateParameters createUpdateParameters) { - return createOrUpdateAsync(resourceGroupName, accountName, createUpdateParameters).block(); + public DatabaseAccountGetResultsInner update(String resourceGroupName, String accountName, + DatabaseAccountUpdateParameters updateParameters) { + return updateAsync(resourceGroupName, accountName, updateParameters).block(); } /** - * Creates or updates an Azure Cosmos DB database account. The "Update" method is preferred when performing updates - * on an account. + * Updates the properties of 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 createUpdateParameters The parameters to provide for the current database account. + * @param updateParameters The parameters to provide for the current database account. * @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. @@ -863,9 +904,9 @@ public DatabaseAccountGetResultsInner createOrUpdate(String resourceGroupName, S * @return an Azure Cosmos DB database account. */ @ServiceMethod(returns = ReturnType.SINGLE) - public DatabaseAccountGetResultsInner createOrUpdate(String resourceGroupName, String accountName, - DatabaseAccountCreateUpdateParameters createUpdateParameters, Context context) { - return createOrUpdateAsync(resourceGroupName, accountName, createUpdateParameters, context).block(); + public DatabaseAccountGetResultsInner update(String resourceGroupName, String accountName, + DatabaseAccountUpdateParameters updateParameters, Context context) { + return updateAsync(resourceGroupName, accountName, updateParameters, context).block(); } /** @@ -896,8 +937,8 @@ public Mono>> deleteWithResponseAsync(String resourceG return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -931,8 +972,8 @@ private Mono>> deleteWithResponseAsync(String resource return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, this.client.getApiVersion(), context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, context); } /** @@ -1066,21 +1107,18 @@ public void delete(String resourceGroupName, String accountName, Context context } /** - * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a - * write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values - * must be unique for each of the regions in which the database account exists. + * Lists all the Azure Cosmos DB database accounts available under the given resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName Cosmos DB database account name. - * @param failoverParameters The new failover policies for the database account. * @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}. + * @return the List operation response, that contains the database accounts and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> failoverPriorityChangeWithResponseAsync(String resourceGroupName, - String accountName, FailoverPolicies failoverParameters) { + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1093,39 +1131,29 @@ public Mono>> failoverPriorityChangeWithResponseAsync( 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 (failoverParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter failoverParameters is required and cannot be null.")); - } else { - failoverParameters.validate(); - } + final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.failoverPriorityChange(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), failoverParameters, context)) + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a - * write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values - * must be unique for each of the regions in which the database account exists. + * Lists all the Azure Cosmos DB database accounts available under the given resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName Cosmos DB database account name. - * @param failoverParameters The new failover policies for the database account. * @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}. + * @return the List operation response, that contains the database accounts and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> failoverPriorityChangeWithResponseAsync(String resourceGroupName, - String accountName, FailoverPolicies failoverParameters, Context context) { + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1138,214 +1166,110 @@ private Mono>> failoverPriorityChangeWithResponseAsync 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 (failoverParameters == null) { - return Mono - .error(new IllegalArgumentException("Parameter failoverParameters is required and cannot be null.")); - } else { - failoverParameters.validate(); - } + final String accept = "application/json"; context = this.client.mergeContext(context); - return service.failoverPriorityChange(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), failoverParameters, context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a - * write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values - * must be unique for each of the regions in which the database account exists. + * Lists all the Azure Cosmos DB database accounts available under the given resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName Cosmos DB database account name. - * @param failoverParameters The new failover policies for the database account. * @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. + * @return the List operation response, that contains the database accounts and their properties as paginated + * response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginFailoverPriorityChangeAsync(String resourceGroupName, - String accountName, FailoverPolicies failoverParameters) { - Mono>> mono - = failoverPriorityChangeWithResponseAsync(resourceGroupName, accountName, failoverParameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); } /** - * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a - * write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values - * must be unique for each of the regions in which the database account exists. + * Lists all the Azure Cosmos DB database accounts available under the given resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName Cosmos DB database account name. - * @param failoverParameters The new failover policies for the database account. * @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. + * @return the List operation response, that contains the database accounts and their properties as paginated + * response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginFailoverPriorityChangeAsync(String resourceGroupName, - String accountName, FailoverPolicies failoverParameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = failoverPriorityChangeWithResponseAsync(resourceGroupName, accountName, failoverParameters, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, + Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); } /** - * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a - * write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values - * must be unique for each of the regions in which the database account exists. + * Lists all the Azure Cosmos DB database accounts available under the given resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName Cosmos DB database account name. - * @param failoverParameters The new failover policies for the database account. * @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. + * @return the List operation response, that contains the database accounts and their properties as paginated + * response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginFailoverPriorityChange(String resourceGroupName, String accountName, - FailoverPolicies failoverParameters) { - return this.beginFailoverPriorityChangeAsync(resourceGroupName, accountName, failoverParameters) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); } /** - * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a - * write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values - * must be unique for each of the regions in which the database account exists. + * Lists all the Azure Cosmos DB database accounts available under the given resource group. * * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName Cosmos DB database account name. - * @param failoverParameters The new failover policies for the database account. * @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. + * @return the List operation response, that contains the database accounts and their properties as paginated + * response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginFailoverPriorityChange(String resourceGroupName, String accountName, - FailoverPolicies failoverParameters, Context context) { - return this.beginFailoverPriorityChangeAsync(resourceGroupName, accountName, failoverParameters, context) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, + Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); } /** - * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a - * write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values - * must be unique for each of the regions in which the database account exists. + * Lists all the Azure Cosmos DB database accounts available under the subscription. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName Cosmos DB database account name. - * @param failoverParameters The new failover policies for the database account. - * @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. + * @return the List operation response, that contains the database accounts and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono failoverPriorityChangeAsync(String resourceGroupName, String accountName, - FailoverPolicies failoverParameters) { - return beginFailoverPriorityChangeAsync(resourceGroupName, accountName, failoverParameters).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono> listSinglePageAsync() { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a - * write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values - * must be unique for each of the regions in which the database account exists. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName Cosmos DB database account name. - * @param failoverParameters The new failover policies for the database account. - * @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 failoverPriorityChangeAsync(String resourceGroupName, String accountName, - FailoverPolicies failoverParameters, Context context) { - return beginFailoverPriorityChangeAsync(resourceGroupName, accountName, failoverParameters, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a - * write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values - * must be unique for each of the regions in which the database account exists. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName Cosmos DB database account name. - * @param failoverParameters The new failover policies for the database account. - * @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 failoverPriorityChange(String resourceGroupName, String accountName, - FailoverPolicies failoverParameters) { - failoverPriorityChangeAsync(resourceGroupName, accountName, failoverParameters).block(); - } - - /** - * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a - * write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values - * must be unique for each of the regions in which the database account exists. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName Cosmos DB database account name. - * @param failoverParameters The new failover policies for the database account. - * @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 failoverPriorityChange(String resourceGroupName, String accountName, - FailoverPolicies failoverParameters, Context context) { - failoverPriorityChangeAsync(resourceGroupName, accountName, failoverParameters, context).block(); - } - - /** - * Lists all the Azure Cosmos DB database accounts available under the subscription. - * - * @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 database accounts and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - 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.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), 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 all the Azure Cosmos DB database accounts available under the subscription. + * Lists all the Azure Cosmos DB database accounts available under the subscription. * * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. @@ -1370,7 +1294,7 @@ private Mono> listSinglePageAsync( .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -1383,7 +1307,7 @@ private Mono> listSinglePageAsync( */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync()); + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -1398,7 +1322,8 @@ public PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context)); + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** @@ -1430,188 +1355,309 @@ public PagedIterable list(Context context) { } /** - * Lists all the Azure Cosmos DB database accounts available under the given resource group. + * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a + * write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values + * must be unique for each of the regions in which the database account exists. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param failoverParameters The new failover policies for the database account. * @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 database accounts and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByResourceGroupSinglePageAsync(String resourceGroupName) { + public Mono>> failoverPriorityChangeWithResponseAsync(String resourceGroupName, + String accountName, FailoverPolicies failoverParameters) { 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 (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() 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"; + if (failoverParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter failoverParameters is required and cannot be null.")); + } else { + failoverParameters.validate(); + } + final String contentType = "application/json"; return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), resourceGroupName, - this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .withContext(context -> service.failoverPriorityChange(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + contentType, failoverParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists all the Azure Cosmos DB database accounts available under the given resource group. + * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a + * write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values + * must be unique for each of the regions in which the database account exists. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param failoverParameters The new failover policies for the database account. * @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 database accounts and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByResourceGroupSinglePageAsync(String resourceGroupName, Context context) { + private Mono>> failoverPriorityChangeWithResponseAsync(String resourceGroupName, + String accountName, FailoverPolicies failoverParameters, 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 (this.client.getSubscriptionId() == null) { - return Mono.error(new IllegalArgumentException( - "Parameter this.client.getSubscriptionId() 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"; + if (failoverParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter failoverParameters is required and cannot be null.")); + } else { + failoverParameters.validate(); + } + final String contentType = "application/json"; context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), resourceGroupName, this.client.getApiVersion(), - this.client.getSubscriptionId(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + return service.failoverPriorityChange(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, contentType, failoverParameters, context); } /** - * Lists all the Azure Cosmos DB database accounts available under the given resource group. + * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a + * write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values + * must be unique for each of the regions in which the database account exists. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param failoverParameters The new failover policies for the database account. * @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 database accounts and their properties as paginated - * response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginFailoverPriorityChangeAsync(String resourceGroupName, + String accountName, FailoverPolicies failoverParameters) { + Mono>> mono + = failoverPriorityChangeWithResponseAsync(resourceGroupName, accountName, failoverParameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * Lists all the Azure Cosmos DB database accounts available under the given resource group. + * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a + * write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values + * must be unique for each of the regions in which the database account exists. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param failoverParameters The new failover policies for the database account. * @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 database accounts and their properties as paginated - * response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, - Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginFailoverPriorityChangeAsync(String resourceGroupName, + String accountName, FailoverPolicies failoverParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = failoverPriorityChangeWithResponseAsync(resourceGroupName, accountName, failoverParameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** - * Lists all the Azure Cosmos DB database accounts available under the given resource group. + * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a + * write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values + * must be unique for each of the regions in which the database account exists. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param failoverParameters The new failover policies for the database account. * @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 database accounts and their properties as paginated - * response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginFailoverPriorityChange(String resourceGroupName, String accountName, + FailoverPolicies failoverParameters) { + return this.beginFailoverPriorityChangeAsync(resourceGroupName, accountName, failoverParameters) + .getSyncPoller(); } /** - * Lists all the Azure Cosmos DB database accounts available under the given resource group. + * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a + * write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values + * must be unique for each of the regions in which the database account exists. * * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param failoverParameters The new failover policies for the database account. * @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 database accounts and their properties as paginated - * response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of long-running operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, - Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginFailoverPriorityChange(String resourceGroupName, String accountName, + FailoverPolicies failoverParameters, Context context) { + return this.beginFailoverPriorityChangeAsync(resourceGroupName, accountName, failoverParameters, context) + .getSyncPoller(); } /** - * Lists the access keys for the specified Azure Cosmos DB database account. + * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a + * write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values + * must be unique for each of the regions in which the database account exists. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. + * @param failoverParameters The new failover policies for the database account. * @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 access keys for the given database account along with {@link Response} on successful completion of - * {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> listKeysWithResponseAsync(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.listKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + public Mono failoverPriorityChangeAsync(String resourceGroupName, String accountName, + FailoverPolicies failoverParameters) { + return beginFailoverPriorityChangeAsync(resourceGroupName, accountName, failoverParameters).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Lists the access keys for the specified Azure Cosmos DB database account. + * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a + * write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values + * must be unique for each of the regions in which the database account exists. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. + * @param failoverParameters The new failover policies for the database account. * @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 access keys for the given database account along with {@link Response} on successful completion of - * {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listKeysWithResponseAsync(String resourceGroupName, + private Mono failoverPriorityChangeAsync(String resourceGroupName, String accountName, + FailoverPolicies failoverParameters, Context context) { + return beginFailoverPriorityChangeAsync(resourceGroupName, accountName, failoverParameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a + * write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values + * must be unique for each of the regions in which the database account exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param failoverParameters The new failover policies for the database account. + * @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 failoverPriorityChange(String resourceGroupName, String accountName, + FailoverPolicies failoverParameters) { + failoverPriorityChangeAsync(resourceGroupName, accountName, failoverParameters).block(); + } + + /** + * Changes the failover priority for the Azure Cosmos DB database account. A failover priority of 0 indicates a + * write region. The maximum value for a failover priority = (total number of regions - 1). Failover priority values + * must be unique for each of the regions in which the database account exists. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param failoverParameters The new failover policies for the database account. + * @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 failoverPriorityChange(String resourceGroupName, String accountName, + FailoverPolicies failoverParameters, Context context) { + failoverPriorityChangeAsync(resourceGroupName, accountName, failoverParameters, context).block(); + } + + /** + * Lists the access keys for the specified 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 access keys for the given database account along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> listKeysWithResponseAsync(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.listKeys(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the access keys for the specified 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 access keys for the given database account along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listKeysWithResponseAsync(String resourceGroupName, String accountName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -1630,8 +1676,8 @@ private Mono> listKeysWithResponseA } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, this.client.getApiVersion(), accept, context); + return service.listKeys(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, accept, context); } /** @@ -1714,8 +1760,8 @@ public DatabaseAccountListKeysResultInner listKeys(String resourceGroupName, Str final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listConnectionStrings(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), accept, context)) + context -> service.listConnectionStrings(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1751,8 +1797,8 @@ public DatabaseAccountListKeysResultInner listKeys(String resourceGroupName, Str } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listConnectionStrings(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), accept, context); + return service.listConnectionStrings(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context); } /** @@ -1840,10 +1886,10 @@ public Mono>> offlineRegionWithResponseAsync(String re } else { regionParameterForOffline.validate(); } - final String accept = "application/json"; + final String contentType = "application/json"; return FluxUtil - .withContext(context -> service.offlineRegion(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), regionParameterForOffline, accept, + .withContext(context -> service.offlineRegion(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, contentType, regionParameterForOffline, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1884,10 +1930,11 @@ private Mono>> offlineRegionWithResponseAsync(String r } else { regionParameterForOffline.validate(); } - final String accept = "application/json"; + final String contentType = "application/json"; context = this.client.mergeContext(context); - return service.offlineRegion(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, this.client.getApiVersion(), regionParameterForOffline, accept, context); + return service.offlineRegion(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, contentType, regionParameterForOffline, + context); } /** @@ -2073,10 +2120,11 @@ public Mono>> onlineRegionWithResponseAsync(String res } else { regionParameterForOnline.validate(); } - final String accept = "application/json"; + final String contentType = "application/json"; return FluxUtil - .withContext(context -> service.onlineRegion(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), regionParameterForOnline, accept, context)) + .withContext(context -> service.onlineRegion(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, contentType, regionParameterForOnline, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2116,10 +2164,11 @@ private Mono>> onlineRegionWithResponseAsync(String re } else { regionParameterForOnline.validate(); } - final String accept = "application/json"; + final String contentType = "application/json"; context = this.client.mergeContext(context); - return service.onlineRegion(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, this.client.getApiVersion(), regionParameterForOnline, accept, context); + return service.onlineRegion(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, contentType, regionParameterForOnline, + context); } /** @@ -2301,8 +2350,8 @@ public void onlineRegion(String resourceGroupName, String accountName, } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getReadOnlyKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.getReadOnlyKeys(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2338,8 +2387,8 @@ public void onlineRegion(String resourceGroupName, String accountName, } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getReadOnlyKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, this.client.getApiVersion(), accept, context); + return service.getReadOnlyKeys(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context); } /** @@ -2422,8 +2471,8 @@ public DatabaseAccountListReadOnlyKeysResultInner getReadOnlyKeys(String resourc } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listReadOnlyKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.listReadOnlyKeys(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2459,8 +2508,8 @@ public DatabaseAccountListReadOnlyKeysResultInner getReadOnlyKeys(String resourc } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listReadOnlyKeys(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, this.client.getApiVersion(), accept, context); + return service.listReadOnlyKeys(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context); } /** @@ -2547,9 +2596,10 @@ public Mono>> regenerateKeyWithResponseAsync(String re } else { keyToRegenerate.validate(); } + final String contentType = "application/json"; return FluxUtil - .withContext(context -> service.regenerateKey(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), keyToRegenerate, context)) + .withContext(context -> service.regenerateKey(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, contentType, keyToRegenerate, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2589,9 +2639,10 @@ private Mono>> regenerateKeyWithResponseAsync(String r } else { keyToRegenerate.validate(); } + final String contentType = "application/json"; context = this.client.mergeContext(context); - return service.regenerateKey(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, this.client.getApiVersion(), keyToRegenerate, context); + return service.regenerateKey(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, contentType, keyToRegenerate, context); } /** @@ -2741,101 +2792,6 @@ public void regenerateKey(String resourceGroupName, String accountName, regenerateKeyAsync(resourceGroupName, accountName, keyToRegenerate, context).block(); } - /** - * Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase - * letters, numbers, and the '-' character, and must be between 3 and 50 characters. - * - * @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 whether resource exists along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> checkNameExistsWithResponseAsync(String accountName) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } - if (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - return FluxUtil - .withContext(context -> service.checkNameExists(this.client.getEndpoint(), accountName, - this.client.getApiVersion(), context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase - * letters, numbers, and the '-' character, and must be between 3 and 50 characters. - * - * @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 whether resource exists along with {@link Response} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> checkNameExistsWithResponseAsync(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 (accountName == null) { - return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); - } - context = this.client.mergeContext(context); - return service.checkNameExists(this.client.getEndpoint(), accountName, this.client.getApiVersion(), context); - } - - /** - * Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase - * letters, numbers, and the '-' character, and must be between 3 and 50 characters. - * - * @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 whether resource exists on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono checkNameExistsAsync(String accountName) { - return checkNameExistsWithResponseAsync(accountName).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase - * letters, numbers, and the '-' character, and must be between 3 and 50 characters. - * - * @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 whether resource exists along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response checkNameExistsWithResponse(String accountName, Context context) { - return checkNameExistsWithResponseAsync(accountName, context).block(); - } - - /** - * Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase - * letters, numbers, and the '-' character, and must be between 3 and 50 characters. - * - * @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 whether resource exists. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public boolean checkNameExists(String accountName) { - return checkNameExistsWithResponse(accountName, Context.NONE).getValue(); - } - /** * Retrieves the metrics determined by the given filter for the given database account. * @@ -2873,10 +2829,10 @@ private Mono> listMetricsSinglePageAsync(String resou } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listMetrics(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), filter, accept, context)) + .withContext(context -> service.listMetrics(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, filter, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), null, null)) + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -2919,10 +2875,10 @@ private Mono> listMetricsSinglePageAsync(String resou final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listMetrics(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), filter, accept, context) + .listMetrics(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, filter, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -2940,7 +2896,8 @@ private Mono> listMetricsSinglePageAsync(String resou */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listMetricsAsync(String resourceGroupName, String accountName, String filter) { - return new PagedFlux<>(() -> listMetricsSinglePageAsync(resourceGroupName, accountName, filter)); + return new PagedFlux<>(() -> listMetricsSinglePageAsync(resourceGroupName, accountName, filter), + nextLink -> listMetricsNextSinglePageAsync(nextLink)); } /** @@ -2960,7 +2917,8 @@ public PagedFlux listMetricsAsync(String resourceGroupName, String @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listMetricsAsync(String resourceGroupName, String accountName, String filter, Context context) { - return new PagedFlux<>(() -> listMetricsSinglePageAsync(resourceGroupName, accountName, filter, context)); + return new PagedFlux<>(() -> listMetricsSinglePageAsync(resourceGroupName, accountName, filter, context), + nextLink -> listMetricsNextSinglePageAsync(nextLink, context)); } /** @@ -3034,10 +2992,10 @@ private Mono> listUsagesSinglePageAsync(String resourc } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listUsages(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), filter, accept, context)) + .withContext(context -> service.listUsages(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, filter, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), null, null)) + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -3076,10 +3034,10 @@ private Mono> listUsagesSinglePageAsync(String resourc final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listUsages(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), filter, accept, context) + .listUsages(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, filter, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -3096,7 +3054,8 @@ private Mono> listUsagesSinglePageAsync(String resourc */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listUsagesAsync(String resourceGroupName, String accountName, String filter) { - return new PagedFlux<>(() -> listUsagesSinglePageAsync(resourceGroupName, accountName, filter)); + return new PagedFlux<>(() -> listUsagesSinglePageAsync(resourceGroupName, accountName, filter), + nextLink -> listUsagesNextSinglePageAsync(nextLink)); } /** @@ -3112,7 +3071,8 @@ public PagedFlux listUsagesAsync(String resourceGroupName, String ac @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listUsagesAsync(String resourceGroupName, String accountName) { final String filter = null; - return new PagedFlux<>(() -> listUsagesSinglePageAsync(resourceGroupName, accountName, filter)); + return new PagedFlux<>(() -> listUsagesSinglePageAsync(resourceGroupName, accountName, filter), + nextLink -> listUsagesNextSinglePageAsync(nextLink)); } /** @@ -3131,7 +3091,8 @@ public PagedFlux listUsagesAsync(String resourceGroupName, String ac @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listUsagesAsync(String resourceGroupName, String accountName, String filter, Context context) { - return new PagedFlux<>(() -> listUsagesSinglePageAsync(resourceGroupName, accountName, filter, context)); + return new PagedFlux<>(() -> listUsagesSinglePageAsync(resourceGroupName, accountName, filter, context), + nextLink -> listUsagesNextSinglePageAsync(nextLink, context)); } /** @@ -3201,10 +3162,10 @@ private Mono> listMetricDefinitionsSinglePa final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listMetricDefinitions(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), accept, context)) + context -> service.listMetricDefinitions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -3241,10 +3202,10 @@ private Mono> listMetricDefinitionsSinglePa final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listMetricDefinitions(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, this.client.getApiVersion(), accept, context) + .listMetricDefinitions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -3259,7 +3220,8 @@ private Mono> listMetricDefinitionsSinglePa */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listMetricDefinitionsAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>(() -> listMetricDefinitionsSinglePageAsync(resourceGroupName, accountName)); + return new PagedFlux<>(() -> listMetricDefinitionsSinglePageAsync(resourceGroupName, accountName), + nextLink -> listMetricDefinitionsNextSinglePageAsync(nextLink)); } /** @@ -3276,7 +3238,8 @@ public PagedFlux listMetricDefinitionsAsync(String resour @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listMetricDefinitionsAsync(String resourceGroupName, String accountName, Context context) { - return new PagedFlux<>(() -> listMetricDefinitionsSinglePageAsync(resourceGroupName, accountName, context)); + return new PagedFlux<>(() -> listMetricDefinitionsSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listMetricDefinitionsNextSinglePageAsync(nextLink, context)); } /** @@ -3310,4 +3273,374 @@ public PagedIterable listMetricDefinitions(String resourc Context context) { return new PagedIterable<>(listMetricDefinitionsAsync(resourceGroupName, accountName, context)); } + + /** + * Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase + * letters, numbers, and the '-' character, and must be between 3 and 50 characters. + * + * @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 whether resource exists along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> checkNameExistsWithResponseAsync(String accountName) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + if (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.checkNameExists(this.client.getEndpoint(), this.client.getApiVersion(), + accountName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase + * letters, numbers, and the '-' character, and must be between 3 and 50 characters. + * + * @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 whether resource exists along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> checkNameExistsWithResponseAsync(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 (accountName == null) { + return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.checkNameExists(this.client.getEndpoint(), this.client.getApiVersion(), accountName, context); + } + + /** + * Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase + * letters, numbers, and the '-' character, and must be between 3 and 50 characters. + * + * @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 whether resource exists on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono checkNameExistsAsync(String accountName) { + return checkNameExistsWithResponseAsync(accountName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase + * letters, numbers, and the '-' character, and must be between 3 and 50 characters. + * + * @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 whether resource exists along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response checkNameExistsWithResponse(String accountName, Context context) { + return checkNameExistsWithResponseAsync(accountName, context).block(); + } + + /** + * Checks that the Azure Cosmos DB account name already exists. A valid account name may contain only lowercase + * letters, numbers, and the '-' character, and must be between 3 and 50 characters. + * + * @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 whether resource exists. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public boolean checkNameExists(String accountName) { + return checkNameExistsWithResponse(accountName, Context.NONE).getValue(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 database accounts and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 database accounts and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 database accounts and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 database accounts and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list metrics request along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listMetricsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list metrics request along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listMetricsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list usage request along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUsagesNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listUsagesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list usage request along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUsagesNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listUsagesNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list metric definitions request along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricDefinitionsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listMetricDefinitionsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list metric definitions request along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricDefinitionsNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listMetricDefinitionsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/DatabasesClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/DatabasesClientImpl.java index 6822ee3fff5f..bb44d10a923d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/DatabasesClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/DatabasesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -29,9 +29,9 @@ import com.azure.resourcemanager.cosmos.fluent.models.MetricDefinitionInner; import com.azure.resourcemanager.cosmos.fluent.models.MetricInner; import com.azure.resourcemanager.cosmos.fluent.models.UsageInner; -import com.azure.resourcemanager.cosmos.models.MetricDefinitionsListResult; -import com.azure.resourcemanager.cosmos.models.MetricListResult; -import com.azure.resourcemanager.cosmos.models.UsagesResult; +import com.azure.resourcemanager.cosmos.implementation.models.MetricDefinitionsListResult; +import com.azure.resourcemanager.cosmos.implementation.models.MetricListResult; +import com.azure.resourcemanager.cosmos.implementation.models.UsagesResult; import reactor.core.publisher.Mono; /** @@ -63,37 +63,58 @@ public final class DatabasesClientImpl implements DatabasesClient { * The interface defining all the services for CosmosDBManagementClientDatabases to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientDatabases") public interface DatabasesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metrics") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listMetrics(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listMetrics(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("databaseRid") String databaseRid, @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + @PathParam("databaseRid") String databaseRid, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/usages") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listUsages(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listUsages(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("databaseRid") String databaseRid, @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + @PathParam("databaseRid") String databaseRid, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/metricDefinitions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listMetricDefinitions(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listMetricDefinitions(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("databaseRid") String databaseRid, @QueryParam("api-version") String apiVersion, + @PathParam("databaseRid") String databaseRid, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMetricsNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listUsagesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMetricDefinitionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -138,10 +159,10 @@ private Mono> listMetricsSinglePageAsync(String resou } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listMetrics(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseRid, this.client.getApiVersion(), filter, accept, context)) + .withContext(context -> service.listMetrics(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseRid, filter, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), null, null)) + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -188,10 +209,10 @@ private Mono> listMetricsSinglePageAsync(String resou final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listMetrics(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, - databaseRid, this.client.getApiVersion(), filter, accept, context) + .listMetrics(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, databaseRid, filter, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -211,7 +232,8 @@ private Mono> listMetricsSinglePageAsync(String resou @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String filter) { - return new PagedFlux<>(() -> listMetricsSinglePageAsync(resourceGroupName, accountName, databaseRid, filter)); + return new PagedFlux<>(() -> listMetricsSinglePageAsync(resourceGroupName, accountName, databaseRid, filter), + nextLink -> listMetricsNextSinglePageAsync(nextLink)); } /** @@ -233,7 +255,8 @@ public PagedFlux listMetricsAsync(String resourceGroupName, String private PagedFlux listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String filter, Context context) { return new PagedFlux<>( - () -> listMetricsSinglePageAsync(resourceGroupName, accountName, databaseRid, filter, context)); + () -> listMetricsSinglePageAsync(resourceGroupName, accountName, databaseRid, filter, context), + nextLink -> listMetricsNextSinglePageAsync(nextLink, context)); } /** @@ -314,10 +337,10 @@ private Mono> listUsagesSinglePageAsync(String resourc } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listUsages(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseRid, this.client.getApiVersion(), filter, accept, context)) + .withContext(context -> service.listUsages(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseRid, filter, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), - res.getHeaders(), res.getValue().value(), null, null)) + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -360,10 +383,10 @@ private Mono> listUsagesSinglePageAsync(String resourc final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listUsages(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, - databaseRid, this.client.getApiVersion(), filter, accept, context) + .listUsages(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, databaseRid, filter, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -382,7 +405,8 @@ private Mono> listUsagesSinglePageAsync(String resourc @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listUsagesAsync(String resourceGroupName, String accountName, String databaseRid, String filter) { - return new PagedFlux<>(() -> listUsagesSinglePageAsync(resourceGroupName, accountName, databaseRid, filter)); + return new PagedFlux<>(() -> listUsagesSinglePageAsync(resourceGroupName, accountName, databaseRid, filter), + nextLink -> listUsagesNextSinglePageAsync(nextLink)); } /** @@ -399,7 +423,8 @@ public PagedFlux listUsagesAsync(String resourceGroupName, String ac @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listUsagesAsync(String resourceGroupName, String accountName, String databaseRid) { final String filter = null; - return new PagedFlux<>(() -> listUsagesSinglePageAsync(resourceGroupName, accountName, databaseRid, filter)); + return new PagedFlux<>(() -> listUsagesSinglePageAsync(resourceGroupName, accountName, databaseRid, filter), + nextLink -> listUsagesNextSinglePageAsync(nextLink)); } /** @@ -420,7 +445,8 @@ public PagedFlux listUsagesAsync(String resourceGroupName, String ac private PagedFlux listUsagesAsync(String resourceGroupName, String accountName, String databaseRid, String filter, Context context) { return new PagedFlux<>( - () -> listUsagesSinglePageAsync(resourceGroupName, accountName, databaseRid, filter, context)); + () -> listUsagesSinglePageAsync(resourceGroupName, accountName, databaseRid, filter, context), + nextLink -> listUsagesNextSinglePageAsync(nextLink, context)); } /** @@ -496,10 +522,10 @@ private Mono> listMetricDefinitionsSinglePa final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listMetricDefinitions(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseRid, this.client.getApiVersion(), accept, context)) + context -> service.listMetricDefinitions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseRid, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -540,10 +566,10 @@ private Mono> listMetricDefinitionsSinglePa final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listMetricDefinitions(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, databaseRid, this.client.getApiVersion(), accept, context) + .listMetricDefinitions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseRid, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -560,7 +586,8 @@ private Mono> listMetricDefinitionsSinglePa @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listMetricDefinitionsAsync(String resourceGroupName, String accountName, String databaseRid) { - return new PagedFlux<>(() -> listMetricDefinitionsSinglePageAsync(resourceGroupName, accountName, databaseRid)); + return new PagedFlux<>(() -> listMetricDefinitionsSinglePageAsync(resourceGroupName, accountName, databaseRid), + nextLink -> listMetricDefinitionsNextSinglePageAsync(nextLink)); } /** @@ -579,7 +606,8 @@ public PagedFlux listMetricDefinitionsAsync(String resour private PagedFlux listMetricDefinitionsAsync(String resourceGroupName, String accountName, String databaseRid, Context context) { return new PagedFlux<>( - () -> listMetricDefinitionsSinglePageAsync(resourceGroupName, accountName, databaseRid, context)); + () -> listMetricDefinitionsSinglePageAsync(resourceGroupName, accountName, databaseRid, context), + nextLink -> listMetricDefinitionsNextSinglePageAsync(nextLink, context)); } /** @@ -616,4 +644,168 @@ public PagedIterable listMetricDefinitions(String resourc String databaseRid, Context context) { return new PagedIterable<>(listMetricDefinitionsAsync(resourceGroupName, accountName, databaseRid, context)); } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list metrics request along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listMetricsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list metrics request along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listMetricsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list usage request along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUsagesNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listUsagesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), + res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list usage request along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listUsagesNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listUsagesNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list metric definitions request along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricDefinitionsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listMetricDefinitionsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list metric definitions request along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricDefinitionsNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listMetricDefinitionsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/FleetAnalyticsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/FleetAnalyticsClientImpl.java new file mode 100644 index 000000000000..546892c15b60 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/FleetAnalyticsClientImpl.java @@ -0,0 +1,820 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.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.FleetAnalyticsClient; +import com.azure.resourcemanager.cosmos.fluent.models.FleetAnalyticsResourceInner; +import com.azure.resourcemanager.cosmos.implementation.models.FleetAnalyticsListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in FleetAnalyticsClient. + */ +public final class FleetAnalyticsClientImpl implements FleetAnalyticsClient { + /** + * The proxy service used to perform REST calls. + */ + private final FleetAnalyticsService service; + + /** + * The service client containing this operation class. + */ + private final CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of FleetAnalyticsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + FleetAnalyticsClientImpl(CosmosDBManagementClientImpl client) { + this.service + = RestProxy.create(FleetAnalyticsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CosmosDBManagementClientFleetAnalytics to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CosmosDBManagementClientFleetAnalytics") + public interface FleetAnalyticsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetAnalytics/{fleetAnalyticsName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, + @PathParam("fleetAnalyticsName") String fleetAnalyticsName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetAnalytics/{fleetAnalyticsName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, + @PathParam("fleetAnalyticsName") String fleetAnalyticsName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") FleetAnalyticsResourceInner body, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetAnalytics/{fleetAnalyticsName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, + @PathParam("fleetAnalyticsName") String fleetAnalyticsName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetAnalytics") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics 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 FleetAnalytics along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, String fleetName, + String fleetAnalyticsName) { + 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 (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + if (fleetAnalyticsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fleetAnalyticsName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, fleetAnalyticsName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics 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 FleetAnalytics along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, String fleetName, + String fleetAnalyticsName, 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 (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + if (fleetAnalyticsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fleetAnalyticsName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, fleetName, fleetAnalyticsName, accept, context); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics 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 FleetAnalytics on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String fleetName, + String fleetAnalyticsName) { + return getWithResponseAsync(resourceGroupName, fleetName, fleetAnalyticsName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics 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 FleetAnalytics along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String fleetName, + String fleetAnalyticsName, Context context) { + return getWithResponseAsync(resourceGroupName, fleetName, fleetAnalyticsName, context).block(); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics 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 FleetAnalytics. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FleetAnalyticsResourceInner get(String resourceGroupName, String fleetName, String fleetAnalyticsName) { + return getWithResponse(resourceGroupName, fleetName, fleetAnalyticsName, Context.NONE).getValue(); + } + + /** + * Creates an Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @param body The parameters to provide for the current FleetAnalytics. + * @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 FleetAnalytics along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> createWithResponseAsync(String resourceGroupName, + String fleetName, String fleetAnalyticsName, FleetAnalyticsResourceInner body) { + 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 (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + if (fleetAnalyticsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fleetAnalyticsName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, fleetAnalyticsName, contentType, accept, + body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates an Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @param body The parameters to provide for the current FleetAnalytics. + * @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 FleetAnalytics along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> createWithResponseAsync(String resourceGroupName, + String fleetName, String fleetAnalyticsName, FleetAnalyticsResourceInner body, 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 (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + if (fleetAnalyticsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fleetAnalyticsName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, fleetName, fleetAnalyticsName, contentType, accept, body, context); + } + + /** + * Creates an Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @param body The parameters to provide for the current FleetAnalytics. + * @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 FleetAnalytics on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createAsync(String resourceGroupName, String fleetName, + String fleetAnalyticsName, FleetAnalyticsResourceInner body) { + return createWithResponseAsync(resourceGroupName, fleetName, fleetAnalyticsName, body) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Creates an Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @param body The parameters to provide for the current FleetAnalytics. + * @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 FleetAnalytics along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response createWithResponse(String resourceGroupName, String fleetName, + String fleetAnalyticsName, FleetAnalyticsResourceInner body, Context context) { + return createWithResponseAsync(resourceGroupName, fleetName, fleetAnalyticsName, body, context).block(); + } + + /** + * Creates an Azure Cosmos DB FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics name. + * @param body The parameters to provide for the current FleetAnalytics. + * @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 FleetAnalytics. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public FleetAnalyticsResourceInner create(String resourceGroupName, String fleetName, String fleetAnalyticsName, + FleetAnalyticsResourceInner body) { + return createWithResponse(resourceGroupName, fleetName, fleetAnalyticsName, body, Context.NONE).getValue(); + } + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics 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>> deleteWithResponseAsync(String resourceGroupName, String fleetName, + String fleetAnalyticsName) { + 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 (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + if (fleetAnalyticsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fleetAnalyticsName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, fleetAnalyticsName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics 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>> deleteWithResponseAsync(String resourceGroupName, String fleetName, + String fleetAnalyticsName, 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 (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + if (fleetAnalyticsName == null) { + return Mono + .error(new IllegalArgumentException("Parameter fleetAnalyticsName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, fleetName, fleetAnalyticsName, context); + } + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics 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> beginDeleteAsync(String resourceGroupName, String fleetName, + String fleetAnalyticsName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, fleetName, fleetAnalyticsName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics 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> beginDeleteAsync(String resourceGroupName, String fleetName, + String fleetAnalyticsName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, fleetName, fleetAnalyticsName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics 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> beginDelete(String resourceGroupName, String fleetName, + String fleetAnalyticsName) { + return this.beginDeleteAsync(resourceGroupName, fleetName, fleetAnalyticsName).getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics 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> beginDelete(String resourceGroupName, String fleetName, + String fleetAnalyticsName, Context context) { + return this.beginDeleteAsync(resourceGroupName, fleetName, fleetAnalyticsName, context).getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics 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 deleteAsync(String resourceGroupName, String fleetName, String fleetAnalyticsName) { + return beginDeleteAsync(resourceGroupName, fleetName, fleetAnalyticsName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics 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 deleteAsync(String resourceGroupName, String fleetName, String fleetAnalyticsName, + Context context) { + return beginDeleteAsync(resourceGroupName, fleetName, fleetAnalyticsName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics 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 delete(String resourceGroupName, String fleetName, String fleetAnalyticsName) { + deleteAsync(resourceGroupName, fleetName, fleetAnalyticsName).block(); + } + + /** + * Deletes an existing Azure Cosmos DB FleetAnalytics. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetAnalyticsName Cosmos DB fleetAnalytics 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 delete(String resourceGroupName, String fleetName, String fleetAnalyticsName, Context context) { + deleteAsync(resourceGroupName, fleetName, fleetAnalyticsName, context).block(); + } + + /** + * Lists all the FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @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 response of a FleetAnalyticsResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String fleetName) { + 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 (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @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 response of a FleetAnalyticsResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String fleetName, 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 (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, fleetName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all the FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @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 response of a FleetAnalyticsResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String fleetName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, fleetName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @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 response of a FleetAnalyticsResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String fleetName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, fleetName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @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 response of a FleetAnalyticsResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String fleetName) { + return new PagedIterable<>(listAsync(resourceGroupName, fleetName)); + } + + /** + * Lists all the FleetAnalytics under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @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 response of a FleetAnalyticsResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String fleetName, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, fleetName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a FleetAnalyticsResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a FleetAnalyticsResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/FleetsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/FleetsClientImpl.java index 7ecff0efc42a..ab9e7b3e00c4 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/FleetsClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/FleetsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -34,7 +34,7 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.cosmos.fluent.FleetsClient; import com.azure.resourcemanager.cosmos.fluent.models.FleetResourceInner; -import com.azure.resourcemanager.cosmos.models.FleetListResult; +import com.azure.resourcemanager.cosmos.implementation.models.FleetListResult; import com.azure.resourcemanager.cosmos.models.FleetResourceUpdate; import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; @@ -72,323 +72,77 @@ public final class FleetsClientImpl implements InnerSupportsGet> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByResourceGroup(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> create(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") FleetResourceInner body, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") FleetResourceInner body, Context context); @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, - @QueryParam("api-version") String apiVersion, @BodyParam("application/json") FleetResourceUpdate body, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, @BodyParam("application/json") FleetResourceUpdate body, + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + Context context); @Headers({ "Content-Type: application/json" }) - @Get("{nextLink}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/fleets") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listByResourceGroupNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Lists all the fleets under the subscription. - * - * @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 response of the List operation that contains the fleets and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync() { - 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.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the fleets under the subscription. - * - * @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 response of the List operation that contains the fleets and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), this.client.getApiVersion(), accept, - context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists all the fleets under the subscription. - * - * @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 response of the List operation that contains the fleets and their properties as paginated response - * with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the fleets under the subscription. - * - * @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 response of the List operation that contains the fleets and their properties as paginated response - * with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the fleets under the subscription. - * - * @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 response of the List operation that contains the fleets and their properties as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list() { - return new PagedIterable<>(listAsync()); - } - - /** - * Lists all the fleets under the subscription. - * - * @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 response of the List operation that contains the fleets and their properties as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(Context context) { - return new PagedIterable<>(listAsync(context)); - } - /** - * Lists all the fleets under the specified subscription and resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @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 response of the List operation that contains the fleets and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { - 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.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the fleets under the specified subscription and resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @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 response of the List operation that contains the fleets and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, - 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.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .listByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists all the fleets under the specified subscription and resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @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 response of the List operation that contains the fleets and their properties as paginated response - * with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByResourceGroupAsync(String resourceGroupName) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the fleets under the specified subscription and resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @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 response of the List operation that contains the fleets and their properties as paginated response - * with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { - return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), - nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the fleets under the specified subscription and resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @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 response of the List operation that contains the fleets and their properties as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); - } - - /** - * Lists all the fleets under the specified subscription and resource group. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @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 response of the List operation that contains the fleets and their properties as paginated response - * with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { - return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -421,9 +175,8 @@ public Mono> getByResourceGroupWithResponseAsync(St } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, fleetName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -458,8 +211,8 @@ private Mono> getByResourceGroupWithResponseAsync(S } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByResourceGroup(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - fleetName, this.client.getApiVersion(), accept, context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, accept, context); } /** @@ -544,10 +297,11 @@ public Mono> createWithResponseAsync(String resourc } else { body.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, fleetName, this.client.getApiVersion(), body, accept, context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, contentType, accept, body, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -586,10 +340,11 @@ private Mono> createWithResponseAsync(String resour } else { body.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, fleetName, - this.client.getApiVersion(), body, accept, context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, fleetName, contentType, accept, body, context); } /** @@ -677,8 +432,8 @@ public Mono> updateWithResponseAsync(String resourc } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, fleetName, this.client.getApiVersion(), body, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, accept, body, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -717,8 +472,8 @@ private Mono> updateWithResponseAsync(String resour } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, fleetName, - this.client.getApiVersion(), body, accept, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, fleetName, accept, body, context); } /** @@ -799,10 +554,9 @@ public Mono>> deleteWithResponseAsync(String resourceG if (fleetName == null) { return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, fleetName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -835,10 +589,9 @@ private Mono>> deleteWithResponseAsync(String resource if (fleetName == null) { return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, fleetName, - this.client.getApiVersion(), accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, fleetName, context); } /** @@ -970,6 +723,243 @@ public void delete(String resourceGroupName, String fleetName, Context context) deleteAsync(resourceGroupName, fleetName, context).block(); } + /** + * Lists all the fleets under the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 response of a FleetResource list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the fleets under the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 response of a FleetResource list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all the fleets under the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 response of a FleetResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the fleets under the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 response of a FleetResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the fleets under the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 response of a FleetResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * Lists all the fleets under the specified subscription and resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 response of a FleetResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all the fleets under the subscription. + * + * @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 response of a FleetResource list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the fleets under the subscription. + * + * @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 response of a FleetResource list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all the fleets under the subscription. + * + * @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 response of a FleetResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the fleets under the subscription. + * + * @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 response of a FleetResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the fleets under the subscription. + * + * @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 response of a FleetResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the fleets under the subscription. + * + * @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 response of a FleetResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + /** * Get the next page of items. * @@ -977,11 +967,11 @@ public void delete(String resourceGroupName, String fleetName, Context context) * @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 response of the List operation that contains the fleets and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a FleetResource list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink) { + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -990,7 +980,9 @@ private Mono> listNextSinglePageAsync(String n new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1004,11 +996,12 @@ private Mono> listNextSinglePageAsync(String n * @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 response of the List operation that contains the fleets and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a FleetResource list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listNextSinglePageAsync(String nextLink, Context context) { + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1018,7 +1011,7 @@ private Mono> listNextSinglePageAsync(String n } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } @@ -1030,11 +1023,11 @@ private Mono> listNextSinglePageAsync(String n * @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 response of the List operation that contains the fleets and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a FleetResource list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + private Mono> listNextSinglePageAsync(String nextLink) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1043,9 +1036,7 @@ private Mono> listByResourceGroupNextSinglePag new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); @@ -1059,12 +1050,11 @@ private Mono> listByResourceGroupNextSinglePag * @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 response of the List operation that contains the fleets and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a FleetResource list operation along with {@link PagedResponse} on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, - Context context) { + private Mono> listNextSinglePageAsync(String nextLink, Context context) { if (nextLink == null) { return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); } @@ -1074,7 +1064,7 @@ private Mono> listByResourceGroupNextSinglePag } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/FleetspaceAccountsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/FleetspaceAccountsClientImpl.java index 0bac1284cc9a..c282bfff600f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/FleetspaceAccountsClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/FleetspaceAccountsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -33,7 +33,7 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.cosmos.fluent.FleetspaceAccountsClient; import com.azure.resourcemanager.cosmos.fluent.models.FleetspaceAccountResourceInner; -import com.azure.resourcemanager.cosmos.models.FleetspaceAccountListResult; +import com.azure.resourcemanager.cosmos.implementation.models.FleetspaceAccountListResult; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -67,224 +67,59 @@ public final class FleetspaceAccountsClientImpl implements FleetspaceAccountsCli * The interface defining all the services for CosmosDBManagementClientFleetspaceAccounts to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientFleetspaceAccounts") public interface FleetspaceAccountsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}/fleetspaceAccounts") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, - @PathParam("fleetspaceName") String fleetspaceName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}/fleetspaceAccounts/{fleetspaceAccountName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, @PathParam("fleetspaceName") String fleetspaceName, - @PathParam("fleetspaceAccountName") String fleetspaceAccountName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("fleetspaceAccountName") String fleetspaceAccountName, @HeaderParam("Accept") String accept, + Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}/fleetspaceAccounts/{fleetspaceAccountName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, @PathParam("fleetspaceName") String fleetspaceName, @PathParam("fleetspaceAccountName") String fleetspaceAccountName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") FleetspaceAccountResourceInner body, @HeaderParam("Accept") String accept, - Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") FleetspaceAccountResourceInner body, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}/fleetspaceAccounts/{fleetspaceAccountName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, @PathParam("fleetspaceName") String fleetspaceName, - @PathParam("fleetspaceAccountName") String fleetspaceAccountName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("fleetspaceAccountName") String fleetspaceAccountName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}/fleetspaceAccounts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, + @PathParam("fleetspaceName") String fleetspaceName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext( - @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("$host") String endpoint, + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } - /** - * Lists all the fleetspaces accounts under a fleetspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. - * @param fleetspaceName Cosmos DB fleetspace name. Needs to be unique under a fleet. - * @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 global database accounts and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String fleetName, String fleetspaceName) { - 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 (fleetName == null) { - return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); - } - if (fleetspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter fleetspaceName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, fleetName, fleetspaceName, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the fleetspaces accounts under a fleetspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. - * @param fleetspaceName Cosmos DB fleetspace name. Needs to be unique under a fleet. - * @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 global database accounts and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String fleetName, String fleetspaceName, 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 (fleetName == null) { - return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); - } - if (fleetspaceName == null) { - return Mono.error(new IllegalArgumentException("Parameter fleetspaceName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, fleetName, - fleetspaceName, this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists all the fleetspaces accounts under a fleetspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. - * @param fleetspaceName Cosmos DB fleetspace name. Needs to be unique under a fleet. - * @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 global database accounts and their properties as paginated - * response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String fleetName, - String fleetspaceName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, fleetName, fleetspaceName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the fleetspaces accounts under a fleetspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. - * @param fleetspaceName Cosmos DB fleetspace name. Needs to be unique under a fleet. - * @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 global database accounts and their properties as paginated - * response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String fleetName, - String fleetspaceName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, fleetName, fleetspaceName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the fleetspaces accounts under a fleetspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. - * @param fleetspaceName Cosmos DB fleetspace name. Needs to be unique under a fleet. - * @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 global database accounts and their properties as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String fleetName, - String fleetspaceName) { - return new PagedIterable<>(listAsync(resourceGroupName, fleetName, fleetspaceName)); - } - - /** - * Lists all the fleetspaces accounts under a fleetspace. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. - * @param fleetspaceName Cosmos DB fleetspace name. Needs to be unique under a fleet. - * @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 global database accounts and their properties as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String fleetName, - String fleetspaceName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, fleetName, fleetspaceName, context)); - } - /** * Retrieves the properties of an existing Azure Cosmos DB fleetspace account under a fleetspace. * @@ -325,9 +160,9 @@ public Mono> getWithResponseAsync(Strin } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - fleetName, fleetspaceName, fleetspaceAccountName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, fleetspaceName, fleetspaceAccountName, + accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -372,8 +207,8 @@ private Mono> getWithResponseAsync(Stri } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, fleetName, - fleetspaceName, fleetspaceAccountName, this.client.getApiVersion(), accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, fleetName, fleetspaceName, fleetspaceAccountName, accept, context); } /** @@ -478,11 +313,12 @@ public Mono>> createWithResponseAsync(String resourceG } else { body.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, fleetName, fleetspaceName, fleetspaceAccountName, this.client.getApiVersion(), body, - accept, context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, fleetspaceName, fleetspaceAccountName, + contentType, accept, body, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -531,10 +367,11 @@ private Mono>> createWithResponseAsync(String resource } else { body.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, fleetName, - fleetspaceName, fleetspaceAccountName, this.client.getApiVersion(), body, accept, context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, fleetName, fleetspaceName, fleetspaceAccountName, contentType, accept, body, context); } /** @@ -748,11 +585,10 @@ public Mono>> deleteWithResponseAsync(String resourceG return Mono .error(new IllegalArgumentException("Parameter fleetspaceAccountName is required and cannot be null.")); } - final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - fleetName, fleetspaceName, fleetspaceAccountName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, fleetspaceName, fleetspaceAccountName, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -794,10 +630,9 @@ private Mono>> deleteWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter fleetspaceAccountName is required and cannot be null.")); } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, fleetName, - fleetspaceName, fleetspaceAccountName, this.client.getApiVersion(), accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, fleetName, fleetspaceName, fleetspaceAccountName, context); } /** @@ -957,6 +792,165 @@ public void delete(String resourceGroupName, String fleetName, String fleetspace deleteAsync(resourceGroupName, fleetName, fleetspaceName, fleetspaceAccountName, context).block(); } + /** + * Lists all the fleetspaces accounts under a fleetspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetspaceName Cosmos DB fleetspace name. Needs to be unique under a fleet. + * @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 response of a FleetspaceAccountResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String fleetName, String fleetspaceName) { + 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 (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + if (fleetspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, fleetspaceName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the fleetspaces accounts under a fleetspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetspaceName Cosmos DB fleetspace name. Needs to be unique under a fleet. + * @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 response of a FleetspaceAccountResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String fleetName, String fleetspaceName, 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 (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + if (fleetspaceName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetspaceName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, fleetName, fleetspaceName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all the fleetspaces accounts under a fleetspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetspaceName Cosmos DB fleetspace name. Needs to be unique under a fleet. + * @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 response of a FleetspaceAccountResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String fleetName, + String fleetspaceName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, fleetName, fleetspaceName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the fleetspaces accounts under a fleetspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetspaceName Cosmos DB fleetspace name. Needs to be unique under a fleet. + * @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 response of a FleetspaceAccountResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String fleetName, + String fleetspaceName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, fleetName, fleetspaceName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the fleetspaces accounts under a fleetspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetspaceName Cosmos DB fleetspace name. Needs to be unique under a fleet. + * @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 response of a FleetspaceAccountResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String fleetName, + String fleetspaceName) { + return new PagedIterable<>(listAsync(resourceGroupName, fleetName, fleetspaceName)); + } + + /** + * Lists all the fleetspaces accounts under a fleetspace. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @param fleetspaceName Cosmos DB fleetspace name. Needs to be unique under a fleet. + * @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 response of a FleetspaceAccountResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String fleetName, + String fleetspaceName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, fleetName, fleetspaceName, context)); + } + /** * Get the next page of items. * @@ -964,8 +958,8 @@ public void delete(String resourceGroupName, String fleetName, String fleetspace * @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 global database accounts and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a FleetspaceAccountResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -991,8 +985,8 @@ private Mono> listNextSinglePageAs * @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 global database accounts and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a FleetspaceAccountResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/FleetspacesClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/FleetspacesClientImpl.java index 77365e396f35..0a8d436e661d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/FleetspacesClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/FleetspacesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -34,7 +34,7 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.cosmos.fluent.FleetspacesClient; import com.azure.resourcemanager.cosmos.fluent.models.FleetspaceResourceInner; -import com.azure.resourcemanager.cosmos.models.FleetspaceListResult; +import com.azure.resourcemanager.cosmos.implementation.models.FleetspaceListResult; import com.azure.resourcemanager.cosmos.models.FleetspaceUpdate; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -69,58 +69,54 @@ public final class FleetspacesClientImpl implements FleetspacesClient { * The interface defining all the services for CosmosDBManagementClientFleetspaces to be used by the proxy service * to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientFleetspaces") public interface FleetspacesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, - @PathParam("fleetspaceName") String fleetspaceName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("fleetspaceName") String fleetspaceName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}") @ExpectedResponses({ 200, 201 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, - @PathParam("fleetspaceName") String fleetspaceName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") FleetspaceResourceInner body, @HeaderParam("Accept") String accept, + @PathParam("fleetspaceName") String fleetspaceName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") FleetspaceResourceInner body, Context context); @Headers({ "Content-Type: application/json" }) @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> update(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, - @PathParam("fleetspaceName") String fleetspaceName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") FleetspaceUpdate body, @HeaderParam("Accept") String accept, - Context context); + @PathParam("fleetspaceName") String fleetspaceName, @HeaderParam("Accept") String accept, + @BodyParam("application/json") FleetspaceUpdate body, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces/{fleetspaceName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, + @PathParam("fleetspaceName") String fleetspaceName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/fleets/{fleetName}/fleetspaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("fleetName") String fleetName, - @PathParam("fleetspaceName") String fleetspaceName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -128,152 +124,7 @@ Mono>> delete(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); - } - - /** - * Lists all the fleetspaces under a fleet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. - * @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 response of the List operation that contains the fleetspaces and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String fleetName) { - 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 (fleetName == null) { - return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.list(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, fleetName, this.client.getApiVersion(), accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Lists all the fleetspaces under a fleet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. - * @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 response of the List operation that contains the fleetspaces and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String fleetName, - 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 (fleetName == null) { - return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service - .list(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, fleetName, - this.client.getApiVersion(), accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), res.getValue().nextLink(), null)); - } - - /** - * Lists all the fleetspaces under a fleet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. - * @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 response of the List operation that contains the fleetspaces and their properties as paginated - * response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String fleetName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, fleetName), - nextLink -> listNextSinglePageAsync(nextLink)); - } - - /** - * Lists all the fleetspaces under a fleet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. - * @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 response of the List operation that contains the fleetspaces and their properties as paginated - * response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String fleetName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, fleetName, context), - nextLink -> listNextSinglePageAsync(nextLink, context)); - } - - /** - * Lists all the fleetspaces under a fleet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. - * @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 response of the List operation that contains the fleetspaces and their properties as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String fleetName) { - return new PagedIterable<>(listAsync(resourceGroupName, fleetName)); - } - - /** - * Lists all the fleetspaces under a fleet. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. - * @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 response of the List operation that contains the fleetspaces and their properties as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String fleetName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, fleetName, context)); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** @@ -310,8 +161,8 @@ public Mono> getWithResponseAsync(String resou } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, fleetName, fleetspaceName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, fleetspaceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -350,8 +201,8 @@ private Mono> getWithResponseAsync(String reso } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, fleetName, - fleetspaceName, this.client.getApiVersion(), accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, fleetName, fleetspaceName, accept, context); } /** @@ -443,10 +294,12 @@ public Mono>> createWithResponseAsync(String resourceG } else { body.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, fleetName, fleetspaceName, this.client.getApiVersion(), body, accept, context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, fleetspaceName, contentType, accept, + body, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -489,10 +342,11 @@ private Mono>> createWithResponseAsync(String resource } else { body.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, fleetName, - fleetspaceName, this.client.getApiVersion(), body, accept, context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, fleetName, fleetspaceName, contentType, accept, body, context); } /** @@ -693,8 +547,8 @@ public Mono>> updateWithResponseAsync(String resourceG } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, fleetName, fleetspaceName, this.client.getApiVersion(), body, accept, context)) + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, fleetspaceName, accept, body, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -737,8 +591,8 @@ private Mono>> updateWithResponseAsync(String resource } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.update(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, fleetName, - fleetspaceName, this.client.getApiVersion(), body, accept, context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, fleetName, fleetspaceName, accept, body, context); } /** @@ -971,10 +825,9 @@ public Mono>> deleteWithResponseAsync(String resourceG if (fleetspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter fleetspaceName is required and cannot be null.")); } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, fleetName, fleetspaceName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, fleetspaceName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1011,10 +864,9 @@ private Mono>> deleteWithResponseAsync(String resource if (fleetspaceName == null) { return Mono.error(new IllegalArgumentException("Parameter fleetspaceName is required and cannot be null.")); } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, fleetName, - fleetspaceName, this.client.getApiVersion(), accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, fleetName, fleetspaceName, context); } /** @@ -1159,6 +1011,147 @@ public void delete(String resourceGroupName, String fleetName, String fleetspace deleteAsync(resourceGroupName, fleetName, fleetspaceName, context).block(); } + /** + * Lists all the fleetspaces under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @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 response of a FleetspaceResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String fleetName) { + 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 (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, fleetName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the fleetspaces under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @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 response of a FleetspaceResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, String fleetName, + 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 (fleetName == null) { + return Mono.error(new IllegalArgumentException("Parameter fleetName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, fleetName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all the fleetspaces under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @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 response of a FleetspaceResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String fleetName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, fleetName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the fleetspaces under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @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 response of a FleetspaceResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String fleetName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, fleetName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the fleetspaces under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @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 response of a FleetspaceResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String fleetName) { + return new PagedIterable<>(listAsync(resourceGroupName, fleetName)); + } + + /** + * Lists all the fleetspaces under a fleet. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param fleetName Cosmos DB fleet name. Needs to be unique under a subscription. + * @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 response of a FleetspaceResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String fleetName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, fleetName, context)); + } + /** * Get the next page of items. * @@ -1166,8 +1159,8 @@ public void delete(String resourceGroupName, String fleetName, String fleetspace * @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 response of the List operation that contains the fleetspaces and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a FleetspaceResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink) { @@ -1193,8 +1186,8 @@ private Mono> listNextSinglePageAsync(Str * @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 response of the List operation that contains the fleetspaces and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the response of a FleetspaceResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono> listNextSinglePageAsync(String nextLink, Context context) { diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/GarnetClustersClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/GarnetClustersClientImpl.java new file mode 100644 index 000000000000..14d779484eaf --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/GarnetClustersClientImpl.java @@ -0,0 +1,1277 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.Patch; +import com.azure.core.annotation.PathParam; +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.GarnetClustersClient; +import com.azure.resourcemanager.cosmos.fluent.models.GarnetClusterResourceInner; +import com.azure.resourcemanager.cosmos.implementation.models.ListGarnetClusters; +import com.azure.resourcemanager.cosmos.models.GarnetClusterResourcePatch; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in GarnetClustersClient. + */ +public final class GarnetClustersClientImpl implements InnerSupportsGet, + InnerSupportsListing, InnerSupportsDelete, GarnetClustersClient { + /** + * The proxy service used to perform REST calls. + */ + private final GarnetClustersService service; + + /** + * The service client containing this operation class. + */ + private final CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of GarnetClustersClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GarnetClustersClientImpl(CosmosDBManagementClientImpl client) { + this.service + = RestProxy.create(GarnetClustersService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CosmosDBManagementClientGarnetClusters to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CosmosDBManagementClientGarnetClusters") + public interface GarnetClustersService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/garnetClusters/{clusterName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/garnetClusters/{clusterName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") GarnetClusterResourceInner body, Context context); + + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/garnetClusters/{clusterName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") GarnetClusterResourcePatch body, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/garnetClusters/{clusterName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("clusterName") String clusterName, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/garnetClusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/garnetClusters") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listBySubscriptionNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get the properties of a Garnet cache cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @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 properties of a Garnet cache cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String clusterName) { + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the properties of a Garnet cache cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @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 properties of a Garnet cache cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String clusterName, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, accept, context); + } + + /** + * Get the properties of a Garnet cache cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @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 properties of a Garnet cache cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync(String resourceGroupName, String clusterName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the properties of a Garnet cache cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @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 properties of a Garnet cache cluster along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String clusterName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * Get the properties of a Garnet cache cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @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 properties of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GarnetClusterResourceInner getByResourceGroup(String resourceGroupName, String clusterName) { + return getByResourceGroupWithResponse(resourceGroupName, clusterName, Context.NONE).getValue(); + } + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @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 representation of a Garnet cache cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createUpdateWithResponseAsync(String resourceGroupName, String clusterName, + GarnetClusterResourceInner body) { + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @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 representation of a Garnet cache cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createUpdateWithResponseAsync(String resourceGroupName, String clusterName, + GarnetClusterResourceInner body, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, body, context); + } + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, GarnetClusterResourceInner> + beginCreateUpdateAsync(String resourceGroupName, String clusterName, GarnetClusterResourceInner body) { + Mono>> mono = createUpdateWithResponseAsync(resourceGroupName, clusterName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GarnetClusterResourceInner.class, GarnetClusterResourceInner.class, + this.client.getContext()); + } + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GarnetClusterResourceInner> beginCreateUpdateAsync( + String resourceGroupName, String clusterName, GarnetClusterResourceInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createUpdateWithResponseAsync(resourceGroupName, clusterName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GarnetClusterResourceInner.class, GarnetClusterResourceInner.class, context); + } + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GarnetClusterResourceInner> + beginCreateUpdate(String resourceGroupName, String clusterName, GarnetClusterResourceInner body) { + return this.beginCreateUpdateAsync(resourceGroupName, clusterName, body).getSyncPoller(); + } + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GarnetClusterResourceInner> beginCreateUpdate( + String resourceGroupName, String clusterName, GarnetClusterResourceInner body, Context context) { + return this.beginCreateUpdateAsync(resourceGroupName, clusterName, body, context).getSyncPoller(); + } + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @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 representation of a Garnet cache cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createUpdateAsync(String resourceGroupName, String clusterName, + GarnetClusterResourceInner body) { + return beginCreateUpdateAsync(resourceGroupName, clusterName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @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 representation of a Garnet cache cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createUpdateAsync(String resourceGroupName, String clusterName, + GarnetClusterResourceInner body, Context context) { + return beginCreateUpdateAsync(resourceGroupName, clusterName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GarnetClusterResourceInner createUpdate(String resourceGroupName, String clusterName, + GarnetClusterResourceInner body) { + return createUpdateAsync(resourceGroupName, clusterName, body).block(); + } + + /** + * Create or update a Garnet cache cluster. When updating, you must specify all writable properties. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body Resource create parameters. + * @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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GarnetClusterResourceInner createUpdate(String resourceGroupName, String clusterName, + GarnetClusterResourceInner body, Context context) { + return createUpdateAsync(resourceGroupName, clusterName, body, context).block(); + } + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @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 representation of a Garnet cache cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, + GarnetClusterResourcePatch body) { + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @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 representation of a Garnet cache cluster along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, String clusterName, + GarnetClusterResourcePatch body, 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, contentType, accept, body, context); + } + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, GarnetClusterResourceInner> + beginUpdateAsync(String resourceGroupName, String clusterName, GarnetClusterResourcePatch body) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, clusterName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GarnetClusterResourceInner.class, GarnetClusterResourceInner.class, + this.client.getContext()); + } + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GarnetClusterResourceInner> beginUpdateAsync( + String resourceGroupName, String clusterName, GarnetClusterResourcePatch body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateWithResponseAsync(resourceGroupName, clusterName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GarnetClusterResourceInner.class, GarnetClusterResourceInner.class, context); + } + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GarnetClusterResourceInner> + beginUpdate(String resourceGroupName, String clusterName, GarnetClusterResourcePatch body) { + return this.beginUpdateAsync(resourceGroupName, clusterName, body).getSyncPoller(); + } + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GarnetClusterResourceInner> + beginUpdate(String resourceGroupName, String clusterName, GarnetClusterResourcePatch body, Context context) { + return this.beginUpdateAsync(resourceGroupName, clusterName, body, context).getSyncPoller(); + } + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @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 representation of a Garnet cache cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync(String resourceGroupName, String clusterName, + GarnetClusterResourcePatch body) { + return beginUpdateAsync(resourceGroupName, clusterName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @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 representation of a Garnet cache cluster on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String clusterName, + GarnetClusterResourcePatch body, Context context) { + return beginUpdateAsync(resourceGroupName, clusterName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GarnetClusterResourceInner update(String resourceGroupName, String clusterName, + GarnetClusterResourcePatch body) { + return updateAsync(resourceGroupName, clusterName, body).block(); + } + + /** + * Updates some of the properties of a garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @param body The resource properties to be updated. + * @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 representation of a Garnet cache cluster. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GarnetClusterResourceInner update(String resourceGroupName, String clusterName, + GarnetClusterResourcePatch body, Context context) { + return updateAsync(resourceGroupName, clusterName, body, context).block(); + } + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @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>> deleteWithResponseAsync(String resourceGroupName, String clusterName) { + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, clusterName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @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>> deleteWithResponseAsync(String resourceGroupName, String clusterName, + 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 (clusterName == null) { + return Mono.error(new IllegalArgumentException("Parameter clusterName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, clusterName, context); + } + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @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> beginDeleteAsync(String resourceGroupName, String clusterName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @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> beginDeleteAsync(String resourceGroupName, String clusterName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, clusterName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @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> beginDelete(String resourceGroupName, String clusterName) { + return this.beginDeleteAsync(resourceGroupName, clusterName).getSyncPoller(); + } + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @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> beginDelete(String resourceGroupName, String clusterName, + Context context) { + return this.beginDeleteAsync(resourceGroupName, clusterName, context).getSyncPoller(); + } + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @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 deleteAsync(String resourceGroupName, String clusterName) { + return beginDeleteAsync(resourceGroupName, clusterName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @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 deleteAsync(String resourceGroupName, String clusterName, Context context) { + return beginDeleteAsync(resourceGroupName, clusterName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @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 delete(String resourceGroupName, String clusterName) { + deleteAsync(resourceGroupName, clusterName).block(); + } + + /** + * Deletes a Garnet cluster. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param clusterName The name of the GarnetClusterResource. + * @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 delete(String resourceGroupName, String clusterName, Context context) { + deleteAsync(resourceGroupName, clusterName, context).block(); + } + + /** + * List all Garnet clusters in this resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of Garnet clusters along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all Garnet clusters in this resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of Garnet clusters along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupSinglePageAsync(String resourceGroupName, + 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List all Garnet clusters in this resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of Garnet clusters as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List all Garnet clusters in this resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of Garnet clusters as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List all Garnet clusters in this resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of Garnet clusters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List all Garnet clusters in this resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 list of Garnet clusters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * List all Garnet clusters in this subscription. + * + * @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 list of Garnet clusters along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all Garnet clusters in this subscription. + * + * @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 list of Garnet clusters along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List all Garnet clusters in this subscription. + * + * @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 list of Garnet clusters as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink)); + } + + /** + * List all Garnet clusters in this subscription. + * + * @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 list of Garnet clusters as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listBySubscriptionNextSinglePageAsync(nextLink, context)); + } + + /** + * List all Garnet clusters in this subscription. + * + * @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 list of Garnet clusters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * List all Garnet clusters in this subscription. + * + * @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 list of Garnet clusters as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 list of Garnet clusters along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 list of Garnet clusters along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 list of Garnet clusters along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 list of Garnet clusters along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listBySubscriptionNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listBySubscriptionNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/GraphResourcesClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/GraphResourcesClientImpl.java new file mode 100644 index 000000000000..be38d69a269d --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/GraphResourcesClientImpl.java @@ -0,0 +1,942 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.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.GraphResourcesClient; +import com.azure.resourcemanager.cosmos.fluent.models.GraphResourceGetResultsInner; +import com.azure.resourcemanager.cosmos.implementation.models.GraphResourcesListResult; +import com.azure.resourcemanager.cosmos.models.GraphResourceCreateUpdateParameters; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in GraphResourcesClient. + */ +public final class GraphResourcesClientImpl implements GraphResourcesClient { + /** + * The proxy service used to perform REST calls. + */ + private final GraphResourcesService service; + + /** + * The service client containing this operation class. + */ + private final CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of GraphResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + GraphResourcesClientImpl(CosmosDBManagementClientImpl client) { + this.service + = RestProxy.create(GraphResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CosmosDBManagementClientGraphResources to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CosmosDBManagementClientGraphResources") + public interface GraphResourcesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getGraph(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("graphName") String graphName, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createUpdateGraph(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("graphName") String graphName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") GraphResourceCreateUpdateParameters createUpdateGraphParameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs/{graphName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteGraphResource(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("graphName") String graphName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/graphs") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listGraphs(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listGraphsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets the Graph resource 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 graphName Cosmos DB graph resource 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 Graph resource 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> getGraphWithResponseAsync(String resourceGroupName, + String accountName, String graphName) { + 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 (graphName == null) { + return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getGraph(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, graphName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the Graph resource 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 graphName Cosmos DB graph resource 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 Graph resource 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> getGraphWithResponseAsync(String resourceGroupName, + String accountName, String graphName, 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 (graphName == null) { + return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getGraph(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, graphName, accept, context); + } + + /** + * Gets the Graph resource 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 graphName Cosmos DB graph resource 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 Graph resource under an existing Azure Cosmos DB database account with the provided name on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getGraphAsync(String resourceGroupName, String accountName, + String graphName) { + return getGraphWithResponseAsync(resourceGroupName, accountName, graphName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the Graph resource 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 graphName Cosmos DB graph resource 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 Graph resource under an existing Azure Cosmos DB database account with the provided name along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getGraphWithResponse(String resourceGroupName, String accountName, + String graphName, Context context) { + return getGraphWithResponseAsync(resourceGroupName, accountName, graphName, context).block(); + } + + /** + * Gets the Graph resource 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 graphName Cosmos DB graph resource 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 Graph resource under an existing Azure Cosmos DB database account with the provided name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GraphResourceGetResultsInner getGraph(String resourceGroupName, String accountName, String graphName) { + return getGraphWithResponse(resourceGroupName, accountName, graphName, Context.NONE).getValue(); + } + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @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 Graph resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createUpdateGraphWithResponseAsync(String resourceGroupName, + String accountName, String graphName, GraphResourceCreateUpdateParameters createUpdateGraphParameters) { + 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 (graphName == null) { + return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); + } + if (createUpdateGraphParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter createUpdateGraphParameters is required and cannot be null.")); + } else { + createUpdateGraphParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createUpdateGraph(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, graphName, contentType, accept, + createUpdateGraphParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @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 Graph resource along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createUpdateGraphWithResponseAsync(String resourceGroupName, + String accountName, String graphName, GraphResourceCreateUpdateParameters createUpdateGraphParameters, + 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 (graphName == null) { + return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); + } + if (createUpdateGraphParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter createUpdateGraphParameters is required and cannot be null.")); + } else { + createUpdateGraphParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createUpdateGraph(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, graphName, contentType, accept, + createUpdateGraphParameters, context); + } + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @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 Graph resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, GraphResourceGetResultsInner> + beginCreateUpdateGraphAsync(String resourceGroupName, String accountName, String graphName, + GraphResourceCreateUpdateParameters createUpdateGraphParameters) { + Mono>> mono = createUpdateGraphWithResponseAsync(resourceGroupName, accountName, + graphName, createUpdateGraphParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GraphResourceGetResultsInner.class, GraphResourceGetResultsInner.class, + this.client.getContext()); + } + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @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 Graph resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GraphResourceGetResultsInner> + beginCreateUpdateGraphAsync(String resourceGroupName, String accountName, String graphName, + GraphResourceCreateUpdateParameters createUpdateGraphParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createUpdateGraphWithResponseAsync(resourceGroupName, accountName, + graphName, createUpdateGraphParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GraphResourceGetResultsInner.class, GraphResourceGetResultsInner.class, + context); + } + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @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 Graph resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GraphResourceGetResultsInner> beginCreateUpdateGraph( + String resourceGroupName, String accountName, String graphName, + GraphResourceCreateUpdateParameters createUpdateGraphParameters) { + return this.beginCreateUpdateGraphAsync(resourceGroupName, accountName, graphName, createUpdateGraphParameters) + .getSyncPoller(); + } + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @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 Graph resource. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GraphResourceGetResultsInner> beginCreateUpdateGraph( + String resourceGroupName, String accountName, String graphName, + GraphResourceCreateUpdateParameters createUpdateGraphParameters, Context context) { + return this + .beginCreateUpdateGraphAsync(resourceGroupName, accountName, graphName, createUpdateGraphParameters, + context) + .getSyncPoller(); + } + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @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 Graph resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createUpdateGraphAsync(String resourceGroupName, String accountName, + String graphName, GraphResourceCreateUpdateParameters createUpdateGraphParameters) { + return beginCreateUpdateGraphAsync(resourceGroupName, accountName, graphName, createUpdateGraphParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @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 Graph resource on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createUpdateGraphAsync(String resourceGroupName, String accountName, + String graphName, GraphResourceCreateUpdateParameters createUpdateGraphParameters, Context context) { + return beginCreateUpdateGraphAsync(resourceGroupName, accountName, graphName, createUpdateGraphParameters, + context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @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 Graph resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GraphResourceGetResultsInner createUpdateGraph(String resourceGroupName, String accountName, + String graphName, GraphResourceCreateUpdateParameters createUpdateGraphParameters) { + return createUpdateGraphAsync(resourceGroupName, accountName, graphName, createUpdateGraphParameters).block(); + } + + /** + * Create or update an Azure Cosmos DB Graph. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource name. + * @param createUpdateGraphParameters The parameters to provide for the current graph. + * @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 Graph resource. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GraphResourceGetResultsInner createUpdateGraph(String resourceGroupName, String accountName, + String graphName, GraphResourceCreateUpdateParameters createUpdateGraphParameters, Context context) { + return createUpdateGraphAsync(resourceGroupName, accountName, graphName, createUpdateGraphParameters, context) + .block(); + } + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource 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>> deleteGraphResourceWithResponseAsync(String resourceGroupName, + String accountName, String graphName) { + 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 (graphName == null) { + return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.deleteGraphResource(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, graphName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource 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>> deleteGraphResourceWithResponseAsync(String resourceGroupName, + String accountName, String graphName, 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 (graphName == null) { + return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.deleteGraphResource(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, graphName, context); + } + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource 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> beginDeleteGraphResourceAsync(String resourceGroupName, + String accountName, String graphName) { + Mono>> mono + = deleteGraphResourceWithResponseAsync(resourceGroupName, accountName, graphName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource 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> beginDeleteGraphResourceAsync(String resourceGroupName, + String accountName, String graphName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteGraphResourceWithResponseAsync(resourceGroupName, accountName, graphName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource 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> beginDeleteGraphResource(String resourceGroupName, String accountName, + String graphName) { + return this.beginDeleteGraphResourceAsync(resourceGroupName, accountName, graphName).getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource 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> beginDeleteGraphResource(String resourceGroupName, String accountName, + String graphName, Context context) { + return this.beginDeleteGraphResourceAsync(resourceGroupName, accountName, graphName, context).getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource 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 deleteGraphResourceAsync(String resourceGroupName, String accountName, String graphName) { + return beginDeleteGraphResourceAsync(resourceGroupName, accountName, graphName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource 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 deleteGraphResourceAsync(String resourceGroupName, String accountName, String graphName, + Context context) { + return beginDeleteGraphResourceAsync(resourceGroupName, accountName, graphName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource 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 deleteGraphResource(String resourceGroupName, String accountName, String graphName) { + deleteGraphResourceAsync(resourceGroupName, accountName, graphName).block(); + } + + /** + * Deletes an existing Azure Cosmos DB Graph Resource. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param graphName Cosmos DB graph resource 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 deleteGraphResource(String resourceGroupName, String accountName, String graphName, Context context) { + deleteGraphResourceAsync(resourceGroupName, accountName, graphName, context).block(); + } + + /** + * Lists the graphs 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 Graph resource and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listGraphsSinglePageAsync(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.listGraphs(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the graphs 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 Graph resource and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listGraphsSinglePageAsync(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 + .listGraphs(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists the graphs 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 Graph resource and their properties as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listGraphsAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listGraphsSinglePageAsync(resourceGroupName, accountName), + nextLink -> listGraphsNextSinglePageAsync(nextLink)); + } + + /** + * Lists the graphs 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 Graph resource and their properties as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listGraphsAsync(String resourceGroupName, String accountName, + Context context) { + return new PagedFlux<>(() -> listGraphsSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listGraphsNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the graphs 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 Graph resource and their properties as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listGraphs(String resourceGroupName, String accountName) { + return new PagedIterable<>(listGraphsAsync(resourceGroupName, accountName)); + } + + /** + * Lists the graphs 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 Graph resource and their properties as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listGraphs(String resourceGroupName, String accountName, + Context context) { + return new PagedIterable<>(listGraphsAsync(resourceGroupName, accountName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 Graph resource and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listGraphsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listGraphsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 Graph resource and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listGraphsNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listGraphsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/GremlinResourcesClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/GremlinResourcesClientImpl.java index bca11e8868c0..eaeab2662226 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/GremlinResourcesClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/GremlinResourcesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -36,12 +36,16 @@ import com.azure.resourcemanager.cosmos.fluent.models.BackupInformationInner; import com.azure.resourcemanager.cosmos.fluent.models.GremlinDatabaseGetResultsInner; import com.azure.resourcemanager.cosmos.fluent.models.GremlinGraphGetResultsInner; +import com.azure.resourcemanager.cosmos.fluent.models.GremlinRoleAssignmentResourceInner; +import com.azure.resourcemanager.cosmos.fluent.models.GremlinRoleDefinitionResourceInner; import com.azure.resourcemanager.cosmos.fluent.models.ThroughputSettingsGetResultsInner; +import com.azure.resourcemanager.cosmos.implementation.models.GremlinDatabaseListResult; +import com.azure.resourcemanager.cosmos.implementation.models.GremlinGraphListResult; +import com.azure.resourcemanager.cosmos.implementation.models.GremlinRoleAssignmentListResult; +import com.azure.resourcemanager.cosmos.implementation.models.GremlinRoleDefinitionListResult; import com.azure.resourcemanager.cosmos.models.ContinuousBackupRestoreLocation; import com.azure.resourcemanager.cosmos.models.GremlinDatabaseCreateUpdateParameters; -import com.azure.resourcemanager.cosmos.models.GremlinDatabaseListResult; import com.azure.resourcemanager.cosmos.models.GremlinGraphCreateUpdateParameters; -import com.azure.resourcemanager.cosmos.models.GremlinGraphListResult; import com.azure.resourcemanager.cosmos.models.ThroughputSettingsUpdateParameters; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -76,201 +80,309 @@ public final class GremlinResourcesClientImpl implements GremlinResourcesClient * The interface defining all the services for CosmosDBManagementClientGremlinResources to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientGremlinResources") public interface GremlinResourcesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listGremlinDatabases(@HostParam("$host") String endpoint, + Mono> getGremlinDatabaseThroughput( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("databaseName") String databaseName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}") - @ExpectedResponses({ 200 }) + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getGremlinDatabase(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> updateGremlinDatabaseThroughput(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ThroughputSettingsUpdateParameters updateThroughputParameters, + Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createUpdateGremlinDatabase(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> migrateGremlinDatabaseToAutoscale(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters, - @HeaderParam("Accept") String accept, Context context); + @PathParam("databaseName") String databaseName, @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}/gremlinDatabases/{databaseName}") - @ExpectedResponses({ 202, 204 }) + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteGremlinDatabase(@HostParam("$host") String endpoint, + Mono>> migrateGremlinDatabaseToManualThroughput( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, - Context context); + @PathParam("databaseName") String databaseName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getGremlinDatabaseThroughput( - @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + Mono> getGremlinGraphThroughput( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, + @PathParam("databaseName") String databaseName, @PathParam("graphName") String graphName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default") + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateGremlinDatabaseThroughput(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> updateGremlinGraphThroughput(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, + @PathParam("databaseName") String databaseName, @PathParam("graphName") String graphName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") ThroughputSettingsUpdateParameters updateThroughputParameters, - @HeaderParam("Accept") String accept, Context context); + Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToAutoscale") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> migrateGremlinDatabaseToAutoscale(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> migrateGremlinGraphToAutoscale(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, + @PathParam("databaseName") String databaseName, @PathParam("graphName") String graphName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToManualThroughput") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> migrateGremlinDatabaseToManualThroughput(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> migrateGremlinGraphToManualThroughput(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, + @PathParam("databaseName") String databaseName, @PathParam("graphName") String graphName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listGremlinGraphs(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getGremlinDatabase(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createUpdateGremlinDatabase(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteGremlinDatabase(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listGremlinDatabases(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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}/gremlinDatabases/{databaseName}/graphs/{graphName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getGremlinGraph(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getGremlinGraph(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("databaseName") String databaseName, @PathParam("graphName") String graphName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createUpdateGremlinGraph(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createUpdateGremlinGraph(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("databaseName") String databaseName, @PathParam("graphName") String graphName, - @QueryParam("api-version") String apiVersion, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, - @HeaderParam("Accept") String accept, Context context); + Context context); @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteGremlinGraph(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> deleteGremlinGraph(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("databaseName") String databaseName, @PathParam("graphName") String graphName, - @QueryParam("api-version") String apiVersion, Context context); + @PathParam("databaseName") String databaseName, @PathParam("graphName") String graphName, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getGremlinGraphThroughput(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listGremlinGraphs(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, @HeaderParam("Accept") String accept, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/retrieveContinuousBackupInformation") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> retrieveContinuousBackupInformation(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("databaseName") String databaseName, @PathParam("graphName") String graphName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ContinuousBackupRestoreLocation location, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleDefinitions/{roleDefinitionId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getGremlinRoleDefinition( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("roleDefinitionId") String roleDefinitionId, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleDefinitions/{roleDefinitionId}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateGremlinGraphThroughput(@HostParam("$host") String endpoint, + Mono>> createUpdateGremlinRoleDefinition(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("roleDefinitionId") String roleDefinitionId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") GremlinRoleDefinitionResourceInner createUpdateGremlinRoleDefinitionParameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleDefinitions/{roleDefinitionId}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteGremlinRoleDefinition(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("roleDefinitionId") String roleDefinitionId, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleDefinitions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listGremlinRoleDefinitions( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("databaseName") String databaseName, @PathParam("graphName") String graphName, - @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}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToAutoscale") - @ExpectedResponses({ 200, 202 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleAssignments/{roleAssignmentId}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> migrateGremlinGraphToAutoscale(@HostParam("$host") String endpoint, + Mono> getGremlinRoleAssignment( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("databaseName") String databaseName, @PathParam("graphName") String graphName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("roleAssignmentId") String roleAssignmentId, @HeaderParam("Accept") String accept, + Context context); - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/throughputSettings/default/migrateToManualThroughput") + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleAssignments/{roleAssignmentId}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> migrateGremlinGraphToManualThroughput(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createUpdateGremlinRoleAssignment(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("databaseName") String databaseName, @PathParam("graphName") String graphName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("roleAssignmentId") String roleAssignmentId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") GremlinRoleAssignmentResourceInner createUpdateGremlinRoleAssignmentParameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleAssignments/{roleAssignmentId}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteGremlinRoleAssignment(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("roleAssignmentId") String roleAssignmentId, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinDatabases/{databaseName}/graphs/{graphName}/retrieveContinuousBackupInformation") - @ExpectedResponses({ 200, 202 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/gremlinRoleAssignments") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> retrieveContinuousBackupInformation(@HostParam("$host") String endpoint, + Mono> listGremlinRoleAssignments( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("databaseName") String databaseName, @PathParam("graphName") String graphName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ContinuousBackupRestoreLocation location, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listGremlinDatabasesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listGremlinGraphsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listGremlinRoleDefinitionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listGremlinRoleAssignmentsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Lists the Gremlin databases under an existing Azure Cosmos DB database account. + * Gets the RUs per second of the Gremlin 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 List operation response, that contains the Gremlin databases and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the RUs per second of the Gremlin 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> - listGremlinDatabasesSinglePageAsync(String resourceGroupName, String accountName) { + public Mono> getGremlinDatabaseThroughputWithResponseAsync( + 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.")); @@ -286,31 +398,34 @@ Mono>> retrieveContinuousBackupInformation(@HostParam( 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.listGremlinDatabases(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)) + context -> service.getGremlinDatabaseThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the Gremlin databases under an existing Azure Cosmos DB database account. + * Gets the RUs per second of the Gremlin 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 List operation response, that contains the Gremlin databases and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the RUs per second of the Gremlin 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> - listGremlinDatabasesSinglePageAsync(String resourceGroupName, String accountName, Context context) { + private Mono> getGremlinDatabaseThroughputWithResponseAsync( + 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.")); @@ -326,100 +441,93 @@ Mono>> retrieveContinuousBackupInformation(@HostParam( 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 - .listGremlinDatabases(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)); + return service.getGremlinDatabaseThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, accept, context); } /** - * Lists the Gremlin databases under an existing Azure Cosmos DB database account. + * Gets the RUs per second of the Gremlin 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 List operation response, that contains the Gremlin databases and their properties as paginated - * response with {@link PagedFlux}. + * @return the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the + * provided name on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listGremlinDatabasesAsync(String resourceGroupName, - String accountName) { - return new PagedFlux<>(() -> listGremlinDatabasesSinglePageAsync(resourceGroupName, accountName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getGremlinDatabaseThroughputAsync(String resourceGroupName, + String accountName, String databaseName) { + return getGremlinDatabaseThroughputWithResponseAsync(resourceGroupName, accountName, databaseName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Lists the Gremlin databases under an existing Azure Cosmos DB database account. + * Gets the RUs per second of the Gremlin 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 List operation response, that contains the Gremlin databases and their properties as paginated - * response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listGremlinDatabasesAsync(String resourceGroupName, - String accountName, Context context) { - return new PagedFlux<>(() -> listGremlinDatabasesSinglePageAsync(resourceGroupName, accountName, context)); - } - - /** - * Lists the Gremlin 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 Gremlin databases and their properties as paginated - * response with {@link PagedIterable}. + * @return the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the + * provided name along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listGremlinDatabases(String resourceGroupName, - String accountName) { - return new PagedIterable<>(listGremlinDatabasesAsync(resourceGroupName, accountName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getGremlinDatabaseThroughputWithResponse( + String resourceGroupName, String accountName, String databaseName, Context context) { + return getGremlinDatabaseThroughputWithResponseAsync(resourceGroupName, accountName, databaseName, context) + .block(); } /** - * Lists the Gremlin databases under an existing Azure Cosmos DB database account. + * Gets the RUs per second of the Gremlin 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 context The context to associate with this operation. + * @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 Gremlin databases and their properties as paginated - * response with {@link PagedIterable}. + * @return the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the + * provided name. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listGremlinDatabases(String resourceGroupName, - String accountName, Context context) { - return new PagedIterable<>(listGremlinDatabasesAsync(resourceGroupName, accountName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputSettingsGetResultsInner getGremlinDatabaseThroughput(String resourceGroupName, String accountName, + String databaseName) { + return getGremlinDatabaseThroughputWithResponse(resourceGroupName, accountName, databaseName, Context.NONE) + .getValue(); } /** - * Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. + * Update RUs per second of an Azure Cosmos DB Gremlin 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 RUs per second of the parameters to provide for the current Gremlin + * 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 Gremlin databases under an existing Azure Cosmos DB database account with the provided name along - * with {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getGremlinDatabaseWithResponseAsync(String resourceGroupName, - String accountName, String databaseName) { + public Mono>> updateGremlinDatabaseThroughputWithResponseAsync(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.")); @@ -438,30 +546,40 @@ public Mono> getGremlinDatabaseWithResp 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.getGremlinDatabase(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } + if (updateThroughputParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter updateThroughputParameters is required and cannot be null.")); + } else { + updateThroughputParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.updateGremlinDatabaseThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, contentType, accept, updateThroughputParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } /** - * Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. + * Update RUs per second of an Azure Cosmos DB Gremlin 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 RUs per second of the parameters to provide for the current Gremlin + * 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 Gremlin databases under an existing Azure Cosmos DB database account with the provided name along - * with {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getGremlinDatabaseWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, Context context) { + private Mono>> updateGremlinDatabaseThroughputWithResponseAsync(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.")); @@ -480,83 +598,216 @@ private Mono> getGremlinDatabaseWithRes 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 contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getGremlinDatabase(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, databaseName, this.client.getApiVersion(), accept, context); + return service.updateGremlinDatabaseThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, contentType, accept, + updateThroughputParameters, context); } /** - * Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. + * Update RUs per second of an Azure Cosmos DB Gremlin 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 RUs per second of the parameters to provide for the current Gremlin + * 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 Gremlin databases under an existing Azure Cosmos DB database account with the provided name on - * successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, ThroughputSettingsGetResultsInner> + beginUpdateGremlinDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, + ThroughputSettingsUpdateParameters updateThroughputParameters) { + Mono>> mono = updateGremlinDatabaseThroughputWithResponseAsync(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 Gremlin 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 RUs per second of the parameters to provide for the current Gremlin + * 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> + beginUpdateGremlinDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, + ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateGremlinDatabaseThroughputWithResponseAsync(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 Gremlin 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 RUs per second of the parameters to provide for the current Gremlin + * 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> + beginUpdateGremlinDatabaseThroughput(String resourceGroupName, String accountName, String databaseName, + ThroughputSettingsUpdateParameters updateThroughputParameters) { + return this + .beginUpdateGremlinDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, + updateThroughputParameters) + .getSyncPoller(); + } + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin 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 RUs per second of the parameters to provide for the current Gremlin + * 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> + beginUpdateGremlinDatabaseThroughput(String resourceGroupName, String accountName, String databaseName, + ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + return this + .beginUpdateGremlinDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, + updateThroughputParameters, context) + .getSyncPoller(); + } + + /** + * Update RUs per second of an Azure Cosmos DB Gremlin 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 RUs per second of the parameters to provide for the current Gremlin + * 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 getGremlinDatabaseAsync(String resourceGroupName, String accountName, - String databaseName) { - return getGremlinDatabaseWithResponseAsync(resourceGroupName, accountName, databaseName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono updateGremlinDatabaseThroughputAsync(String resourceGroupName, + String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return beginUpdateGremlinDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, + updateThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. + * Update RUs per second of an Azure Cosmos DB Gremlin 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 RUs per second of the parameters to provide for the current Gremlin + * 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 Gremlin databases under an existing Azure Cosmos DB database account with the provided name along - * with {@link Response}. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getGremlinDatabaseWithResponse(String resourceGroupName, - String accountName, String databaseName, Context context) { - return getGremlinDatabaseWithResponseAsync(resourceGroupName, accountName, databaseName, context).block(); + private Mono updateGremlinDatabaseThroughputAsync(String resourceGroupName, + String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, + Context context) { + return beginUpdateGremlinDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, + updateThroughputParameters, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Gets the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. + * Update RUs per second of an Azure Cosmos DB Gremlin 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 RUs per second of the parameters to provide for the current Gremlin + * 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 Gremlin databases under an existing Azure Cosmos DB database account with the provided name. + * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GremlinDatabaseGetResultsInner getGremlinDatabase(String resourceGroupName, String accountName, - String databaseName) { - return getGremlinDatabaseWithResponse(resourceGroupName, accountName, databaseName, Context.NONE).getValue(); + public ThroughputSettingsGetResultsInner updateGremlinDatabaseThroughput(String resourceGroupName, + String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return updateGremlinDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, + updateThroughputParameters).block(); } /** - * Create or update an Azure Cosmos DB Gremlin database. + * Update RUs per second of an Azure Cosmos DB Gremlin 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 createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin database. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin + * 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 Gremlin database along with {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createUpdateGremlinDatabaseWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, - GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters) { + public ThroughputSettingsGetResultsInner updateGremlinDatabaseThroughput(String resourceGroupName, + String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, + Context context) { + return updateGremlinDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, + updateThroughputParameters, context).block(); + } + + /** + * Migrate an Azure Cosmos DB Gremlin 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>> migrateGremlinDatabaseToAutoscaleWithResponseAsync(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.")); @@ -575,37 +826,30 @@ public Mono>> createUpdateGremlinDatabaseWithResponseA if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - if (createUpdateGremlinDatabaseParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter createUpdateGremlinDatabaseParameters is required and cannot be null.")); - } else { - createUpdateGremlinDatabaseParameters.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createUpdateGremlinDatabase(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, - this.client.getApiVersion(), createUpdateGremlinDatabaseParameters, accept, context)) + .withContext(context -> service.migrateGremlinDatabaseToAutoscale(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or update an Azure Cosmos DB Gremlin database. + * Migrate an Azure Cosmos DB Gremlin 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 createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin 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 Gremlin database along with {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createUpdateGremlinDatabaseWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, - GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters, Context context) { + private Mono>> migrateGremlinDatabaseToAutoscaleWithResponseAsync( + 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.")); @@ -624,195 +868,169 @@ private Mono>> createUpdateGremlinDatabaseWithResponse if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - if (createUpdateGremlinDatabaseParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter createUpdateGremlinDatabaseParameters is required and cannot be null.")); - } else { - createUpdateGremlinDatabaseParameters.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createUpdateGremlinDatabase(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, this.client.getApiVersion(), - createUpdateGremlinDatabaseParameters, accept, context); + return service.migrateGremlinDatabaseToAutoscale(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, accept, context); } /** - * Create or update an Azure Cosmos DB Gremlin database. + * Migrate an Azure Cosmos DB Gremlin 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 createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin 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 Gremlin database. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, GremlinDatabaseGetResultsInner> - beginCreateUpdateGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName, - GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters) { - Mono>> mono = createUpdateGremlinDatabaseWithResponseAsync(resourceGroupName, - accountName, databaseName, createUpdateGremlinDatabaseParameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), GremlinDatabaseGetResultsInner.class, GremlinDatabaseGetResultsInner.class, - this.client.getContext()); + public PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateGremlinDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName) { + Mono>> mono + = migrateGremlinDatabaseToAutoscaleWithResponseAsync(resourceGroupName, accountName, databaseName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, this.client.getContext()); } /** - * Create or update an Azure Cosmos DB Gremlin database. + * Migrate an Azure Cosmos DB Gremlin 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 createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin 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 Gremlin database. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, GremlinDatabaseGetResultsInner> - beginCreateUpdateGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName, - GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters, Context context) { + private PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateGremlinDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, + Context context) { context = this.client.mergeContext(context); - Mono>> mono = createUpdateGremlinDatabaseWithResponseAsync(resourceGroupName, - accountName, databaseName, createUpdateGremlinDatabaseParameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), GremlinDatabaseGetResultsInner.class, GremlinDatabaseGetResultsInner.class, - context); + Mono>> mono + = migrateGremlinDatabaseToAutoscaleWithResponseAsync(resourceGroupName, accountName, databaseName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, context); } /** - * Create or update an Azure Cosmos DB Gremlin database. + * Migrate an Azure Cosmos DB Gremlin 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 createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin 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 Gremlin database. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GremlinDatabaseGetResultsInner> - beginCreateUpdateGremlinDatabase(String resourceGroupName, String accountName, String databaseName, - GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters) { - return this - .beginCreateUpdateGremlinDatabaseAsync(resourceGroupName, accountName, databaseName, - createUpdateGremlinDatabaseParameters) + public SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateGremlinDatabaseToAutoscale(String resourceGroupName, String accountName, String databaseName) { + return this.beginMigrateGremlinDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName) .getSyncPoller(); } /** - * Create or update an Azure Cosmos DB Gremlin database. + * Migrate an Azure Cosmos DB Gremlin 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 createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin 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 Gremlin database. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GremlinDatabaseGetResultsInner> - beginCreateUpdateGremlinDatabase(String resourceGroupName, String accountName, String databaseName, - GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters, Context context) { - return this - .beginCreateUpdateGremlinDatabaseAsync(resourceGroupName, accountName, databaseName, - createUpdateGremlinDatabaseParameters, context) + public SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateGremlinDatabaseToAutoscale(String resourceGroupName, String accountName, String databaseName, + Context context) { + return this.beginMigrateGremlinDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName, context) .getSyncPoller(); } /** - * Create or update an Azure Cosmos DB Gremlin database. + * Migrate an Azure Cosmos DB Gremlin 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 createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin 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 Gremlin database on successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createUpdateGremlinDatabaseAsync(String resourceGroupName, - String accountName, String databaseName, - GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters) { - return beginCreateUpdateGremlinDatabaseAsync(resourceGroupName, accountName, databaseName, - createUpdateGremlinDatabaseParameters).last().flatMap(this.client::getLroFinalResultOrError); + public Mono migrateGremlinDatabaseToAutoscaleAsync(String resourceGroupName, + String accountName, String databaseName) { + return beginMigrateGremlinDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Create or update an Azure Cosmos DB Gremlin database. + * Migrate an Azure Cosmos DB Gremlin 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 createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin 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 Gremlin database on successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createUpdateGremlinDatabaseAsync(String resourceGroupName, - String accountName, String databaseName, - GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters, Context context) { - return beginCreateUpdateGremlinDatabaseAsync(resourceGroupName, accountName, databaseName, - createUpdateGremlinDatabaseParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono migrateGremlinDatabaseToAutoscaleAsync(String resourceGroupName, + String accountName, String databaseName, Context context) { + return beginMigrateGremlinDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Create or update an Azure Cosmos DB Gremlin database. + * Migrate an Azure Cosmos DB Gremlin 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 createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin 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 Gremlin database. + * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GremlinDatabaseGetResultsInner createUpdateGremlinDatabase(String resourceGroupName, String accountName, - String databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters) { - return createUpdateGremlinDatabaseAsync(resourceGroupName, accountName, databaseName, - createUpdateGremlinDatabaseParameters).block(); + public ThroughputSettingsGetResultsInner migrateGremlinDatabaseToAutoscale(String resourceGroupName, + String accountName, String databaseName) { + return migrateGremlinDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName).block(); } /** - * Create or update an Azure Cosmos DB Gremlin database. + * Migrate an Azure Cosmos DB Gremlin 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 createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin 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 Gremlin database. + * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GremlinDatabaseGetResultsInner createUpdateGremlinDatabase(String resourceGroupName, String accountName, - String databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters, - Context context) { - return createUpdateGremlinDatabaseAsync(resourceGroupName, accountName, databaseName, - createUpdateGremlinDatabaseParameters, context).block(); + public ThroughputSettingsGetResultsInner migrateGremlinDatabaseToAutoscale(String resourceGroupName, + String accountName, String databaseName, Context context) { + return migrateGremlinDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName, context).block(); } /** - * Deletes an existing Azure Cosmos DB Gremlin database. + * Migrate an Azure Cosmos DB Gremlin 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. @@ -820,11 +1038,12 @@ public GremlinDatabaseGetResultsInner createUpdateGremlinDatabase(String resourc * @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}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteGremlinDatabaseWithResponseAsync(String resourceGroupName, - String accountName, String databaseName) { + public Mono>> migrateGremlinDatabaseToManualThroughputWithResponseAsync( + 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.")); @@ -843,15 +1062,16 @@ public Mono>> deleteGremlinDatabaseWithResponseAsync(S 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.deleteGremlinDatabase(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, this.client.getApiVersion(), context)) + .withContext(context -> service.migrateGremlinDatabaseToManualThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes an existing Azure Cosmos DB Gremlin database. + * Migrate an Azure Cosmos DB Gremlin 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. @@ -860,11 +1080,12 @@ public Mono>> deleteGremlinDatabaseWithResponseAsync(S * @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}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteGremlinDatabaseWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, Context context) { + private Mono>> migrateGremlinDatabaseToManualThroughputWithResponseAsync( + 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.")); @@ -883,13 +1104,14 @@ private Mono>> deleteGremlinDatabaseWithResponseAsync( 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.deleteGremlinDatabase(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, this.client.getApiVersion(), context); + return service.migrateGremlinDatabaseToManualThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, accept, context); } /** - * Deletes an existing Azure Cosmos DB Gremlin database. + * Migrate an Azure Cosmos DB Gremlin 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. @@ -897,19 +1119,21 @@ private Mono>> deleteGremlinDatabaseWithResponseAsync( * @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. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteGremlinDatabaseAsync(String resourceGroupName, - String accountName, String databaseName) { + public PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateGremlinDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, + String databaseName) { Mono>> mono - = deleteGremlinDatabaseWithResponseAsync(resourceGroupName, accountName, databaseName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + = migrateGremlinDatabaseToManualThroughputWithResponseAsync(resourceGroupName, accountName, databaseName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, this.client.getContext()); } /** - * Deletes an existing Azure Cosmos DB Gremlin database. + * Migrate an Azure Cosmos DB Gremlin 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. @@ -918,20 +1142,22 @@ public PollerFlux, Void> beginDeleteGremlinDatabaseAsync(String * @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. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteGremlinDatabaseAsync(String resourceGroupName, - String accountName, String databaseName, Context context) { + private PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateGremlinDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, + String databaseName, Context context) { context = this.client.mergeContext(context); - Mono>> mono - = deleteGremlinDatabaseWithResponseAsync(resourceGroupName, accountName, databaseName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + Mono>> mono = migrateGremlinDatabaseToManualThroughputWithResponseAsync( + resourceGroupName, accountName, databaseName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, context); } /** - * Deletes an existing Azure Cosmos DB Gremlin database. + * Migrate an Azure Cosmos DB Gremlin 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. @@ -939,16 +1165,18 @@ private PollerFlux, Void> beginDeleteGremlinDatabaseAsync(Strin * @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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteGremlinDatabase(String resourceGroupName, String accountName, - String databaseName) { - return this.beginDeleteGremlinDatabaseAsync(resourceGroupName, accountName, databaseName).getSyncPoller(); + public SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateGremlinDatabaseToManualThroughput(String resourceGroupName, String accountName, + String databaseName) { + return this.beginMigrateGremlinDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName) + .getSyncPoller(); } /** - * Deletes an existing Azure Cosmos DB Gremlin database. + * Migrate an Azure Cosmos DB Gremlin 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. @@ -957,17 +1185,19 @@ public SyncPoller, Void> beginDeleteGremlinDatabase(String reso * @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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteGremlinDatabase(String resourceGroupName, String accountName, - String databaseName, Context context) { - return this.beginDeleteGremlinDatabaseAsync(resourceGroupName, accountName, databaseName, context) + public SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateGremlinDatabaseToManualThroughput(String resourceGroupName, String accountName, String databaseName, + Context context) { + return this + .beginMigrateGremlinDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName, context) .getSyncPoller(); } /** - * Deletes an existing Azure Cosmos DB Gremlin database. + * Migrate an Azure Cosmos DB Gremlin 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. @@ -975,16 +1205,17 @@ public SyncPoller, Void> beginDeleteGremlinDatabase(String reso * @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. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { - return beginDeleteGremlinDatabaseAsync(resourceGroupName, accountName, databaseName).last() + public Mono migrateGremlinDatabaseToManualThroughputAsync( + String resourceGroupName, String accountName, String databaseName) { + return beginMigrateGremlinDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes an existing Azure Cosmos DB Gremlin database. + * Migrate an Azure Cosmos DB Gremlin 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. @@ -993,17 +1224,18 @@ public Mono deleteGremlinDatabaseAsync(String resourceGroupName, String ac * @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. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName, - Context context) { - return beginDeleteGremlinDatabaseAsync(resourceGroupName, accountName, databaseName, context).last() + private Mono migrateGremlinDatabaseToManualThroughputAsync( + String resourceGroupName, String accountName, String databaseName, Context context) { + return beginMigrateGremlinDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName, context) + .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes an existing Azure Cosmos DB Gremlin database. + * Migrate an Azure Cosmos DB Gremlin 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. @@ -1011,14 +1243,16 @@ private Mono deleteGremlinDatabaseAsync(String resourceGroupName, String a * @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 void deleteGremlinDatabase(String resourceGroupName, String accountName, String databaseName) { - deleteGremlinDatabaseAsync(resourceGroupName, accountName, databaseName).block(); + public ThroughputSettingsGetResultsInner migrateGremlinDatabaseToManualThroughput(String resourceGroupName, + String accountName, String databaseName) { + return migrateGremlinDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName).block(); } /** - * Deletes an existing Azure Cosmos DB Gremlin database. + * Migrate an Azure Cosmos DB Gremlin 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. @@ -1027,29 +1261,31 @@ public void deleteGremlinDatabase(String resourceGroupName, String accountName, * @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 void deleteGremlinDatabase(String resourceGroupName, String accountName, String databaseName, - Context context) { - deleteGremlinDatabaseAsync(resourceGroupName, accountName, databaseName, context).block(); + public ThroughputSettingsGetResultsInner migrateGremlinDatabaseToManualThroughput(String resourceGroupName, + String accountName, String databaseName, Context context) { + return migrateGremlinDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName, context) + .block(); } /** - * Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the - * provided name. + * Gets the Gremlin graph throughput 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 graphName Cosmos DB graph 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 Gremlin database under an existing Azure Cosmos DB database account with the - * provided name along with {@link Response} on successful completion of {@link Mono}. + * @return the Gremlin graph throughput 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> getGremlinDatabaseThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName) { + public Mono> getGremlinGraphThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String graphName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1068,31 +1304,34 @@ public Mono> getGremlinDatabaseThrou if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } + if (graphName == null) { + return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getGremlinDatabaseThroughput(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.getGremlinGraphThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, graphName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the - * provided name. + * Gets the Gremlin graph throughput 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 graphName Cosmos DB graph 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 Gremlin database under an existing Azure Cosmos DB database account with the - * provided name along with {@link Response} on successful completion of {@link Mono}. + * @return the Gremlin graph throughput 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> getGremlinDatabaseThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, Context context) { + private Mono> getGremlinGraphThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String graphName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1111,81 +1350,83 @@ private Mono> getGremlinDatabaseThro if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } + if (graphName == null) { + return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getGremlinDatabaseThroughput(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, this.client.getApiVersion(), accept, context); + return service.getGremlinGraphThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, graphName, accept, context); } /** - * Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the - * provided name. + * Gets the Gremlin graph throughput 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 graphName Cosmos DB graph 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 Gremlin database under an existing Azure Cosmos DB database account with the - * provided name on successful completion of {@link Mono}. + * @return the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getGremlinDatabaseThroughputAsync(String resourceGroupName, - String accountName, String databaseName) { - return getGremlinDatabaseThroughputWithResponseAsync(resourceGroupName, accountName, databaseName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono getGremlinGraphThroughputAsync(String resourceGroupName, + String accountName, String databaseName, String graphName) { + return getGremlinGraphThroughputWithResponseAsync(resourceGroupName, accountName, databaseName, graphName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the - * provided name. + * Gets the Gremlin graph throughput 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 graphName Cosmos DB graph 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 Gremlin database under an existing Azure Cosmos DB database account with the - * provided name along with {@link Response}. + * @return the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name + * along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getGremlinDatabaseThroughputWithResponse( - String resourceGroupName, String accountName, String databaseName, Context context) { - return getGremlinDatabaseThroughputWithResponseAsync(resourceGroupName, accountName, databaseName, context) - .block(); + public Response getGremlinGraphThroughputWithResponse(String resourceGroupName, + String accountName, String databaseName, String graphName, Context context) { + return getGremlinGraphThroughputWithResponseAsync(resourceGroupName, accountName, databaseName, graphName, + context).block(); } /** - * Gets the RUs per second of the Gremlin database under an existing Azure Cosmos DB database account with the - * provided name. + * Gets the Gremlin graph throughput 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 graphName Cosmos DB graph 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 Gremlin database under an existing Azure Cosmos DB database account with the - * provided name. + * @return the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner getGremlinDatabaseThroughput(String resourceGroupName, String accountName, - String databaseName) { - return getGremlinDatabaseThroughputWithResponse(resourceGroupName, accountName, databaseName, Context.NONE) - .getValue(); + public ThroughputSettingsGetResultsInner getGremlinGraphThroughput(String resourceGroupName, String accountName, + String databaseName, String graphName) { + return getGremlinGraphThroughputWithResponse(resourceGroupName, accountName, databaseName, graphName, + Context.NONE).getValue(); } /** - * Update RUs per second of an Azure Cosmos DB Gremlin database. + * Update RUs per second of an Azure Cosmos DB Gremlin graph. * * @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 RUs per second of the parameters to provide for the current Gremlin - * database. + * @param graphName Cosmos DB graph name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. * @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. @@ -1193,8 +1434,9 @@ public ThroughputSettingsGetResultsInner getGremlinDatabaseThroughput(String res * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateGremlinDatabaseThroughputWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + public Mono>> updateGremlinGraphThroughputWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String graphName, + ThroughputSettingsUpdateParameters updateThroughputParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1213,28 +1455,32 @@ public Mono>> updateGremlinDatabaseThroughputWithRespo if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } + if (graphName == null) { + return Mono.error(new IllegalArgumentException("Parameter graphName 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 contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.updateGremlinDatabaseThroughput(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, - this.client.getApiVersion(), updateThroughputParameters, accept, context)) + .withContext(context -> service.updateGremlinGraphThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, graphName, contentType, accept, updateThroughputParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update RUs per second of an Azure Cosmos DB Gremlin database. + * Update RUs per second of an Azure Cosmos DB Gremlin graph. * * @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 RUs per second of the parameters to provide for the current Gremlin - * database. + * @param graphName Cosmos DB graph name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. * @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. @@ -1243,9 +1489,9 @@ public Mono>> updateGremlinDatabaseThroughputWithRespo * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateGremlinDatabaseThroughputWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, - Context context) { + private Mono>> updateGremlinGraphThroughputWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String graphName, + ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1264,27 +1510,31 @@ private Mono>> updateGremlinDatabaseThroughputWithResp if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } + if (graphName == null) { + return Mono.error(new IllegalArgumentException("Parameter graphName 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 contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.updateGremlinDatabaseThroughput(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, this.client.getApiVersion(), updateThroughputParameters, - accept, context); + return service.updateGremlinGraphThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, graphName, contentType, + accept, updateThroughputParameters, context); } /** - * Update RUs per second of an Azure Cosmos DB Gremlin database. + * Update RUs per second of an Azure Cosmos DB Gremlin graph. * * @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 RUs per second of the parameters to provide for the current Gremlin - * database. + * @param graphName Cosmos DB graph name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. * @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. @@ -1292,23 +1542,23 @@ private Mono>> updateGremlinDatabaseThroughputWithResp */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public PollerFlux, ThroughputSettingsGetResultsInner> - beginUpdateGremlinDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, - ThroughputSettingsUpdateParameters updateThroughputParameters) { - Mono>> mono = updateGremlinDatabaseThroughputWithResponseAsync(resourceGroupName, - accountName, databaseName, updateThroughputParameters); + beginUpdateGremlinGraphThroughputAsync(String resourceGroupName, String accountName, String databaseName, + String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + Mono>> mono = updateGremlinGraphThroughputWithResponseAsync(resourceGroupName, + accountName, databaseName, graphName, 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 Gremlin database. + * Update RUs per second of an Azure Cosmos DB Gremlin graph. * * @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 RUs per second of the parameters to provide for the current Gremlin - * database. + * @param graphName Cosmos DB graph name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. * @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. @@ -1317,24 +1567,24 @@ private Mono>> updateGremlinDatabaseThroughputWithResp */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ThroughputSettingsGetResultsInner> - beginUpdateGremlinDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, - ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + beginUpdateGremlinGraphThroughputAsync(String resourceGroupName, String accountName, String databaseName, + String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { context = this.client.mergeContext(context); - Mono>> mono = updateGremlinDatabaseThroughputWithResponseAsync(resourceGroupName, - accountName, databaseName, updateThroughputParameters, context); + Mono>> mono = updateGremlinGraphThroughputWithResponseAsync(resourceGroupName, + accountName, databaseName, graphName, updateThroughputParameters, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, ThroughputSettingsGetResultsInner.class, context); } /** - * Update RUs per second of an Azure Cosmos DB Gremlin database. + * Update RUs per second of an Azure Cosmos DB Gremlin graph. * * @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 RUs per second of the parameters to provide for the current Gremlin - * database. + * @param graphName Cosmos DB graph name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. * @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. @@ -1342,22 +1592,22 @@ private Mono>> updateGremlinDatabaseThroughputWithResp */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateGremlinDatabaseThroughput(String resourceGroupName, String accountName, String databaseName, - ThroughputSettingsUpdateParameters updateThroughputParameters) { + beginUpdateGremlinGraphThroughput(String resourceGroupName, String accountName, String databaseName, + String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters) { return this - .beginUpdateGremlinDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, + .beginUpdateGremlinGraphThroughputAsync(resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters) .getSyncPoller(); } /** - * Update RUs per second of an Azure Cosmos DB Gremlin database. + * Update RUs per second of an Azure Cosmos DB Gremlin graph. * * @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 RUs per second of the parameters to provide for the current Gremlin - * database. + * @param graphName Cosmos DB graph name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. * @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. @@ -1366,42 +1616,43 @@ private Mono>> updateGremlinDatabaseThroughputWithResp */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateGremlinDatabaseThroughput(String resourceGroupName, String accountName, String databaseName, - ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + beginUpdateGremlinGraphThroughput(String resourceGroupName, String accountName, String databaseName, + String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { return this - .beginUpdateGremlinDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, + .beginUpdateGremlinGraphThroughputAsync(resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters, context) .getSyncPoller(); } /** - * Update RUs per second of an Azure Cosmos DB Gremlin database. + * Update RUs per second of an Azure Cosmos DB Gremlin graph. * * @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 RUs per second of the parameters to provide for the current Gremlin - * database. + * @param graphName Cosmos DB graph name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. * @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 updateGremlinDatabaseThroughputAsync(String resourceGroupName, - String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return beginUpdateGremlinDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, + public Mono updateGremlinGraphThroughputAsync(String resourceGroupName, + String accountName, String databaseName, String graphName, + ThroughputSettingsUpdateParameters updateThroughputParameters) { + return beginUpdateGremlinGraphThroughputAsync(resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Update RUs per second of an Azure Cosmos DB Gremlin database. + * Update RUs per second of an Azure Cosmos DB Gremlin graph. * * @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 RUs per second of the parameters to provide for the current Gremlin - * database. + * @param graphName Cosmos DB graph name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. * @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. @@ -1409,41 +1660,41 @@ public Mono updateGremlinDatabaseThroughputAs * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateGremlinDatabaseThroughputAsync(String resourceGroupName, - String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, - Context context) { - return beginUpdateGremlinDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, + private Mono updateGremlinGraphThroughputAsync(String resourceGroupName, + String accountName, String databaseName, String graphName, + ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + return beginUpdateGremlinGraphThroughputAsync(resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Update RUs per second of an Azure Cosmos DB Gremlin database. + * Update RUs per second of an Azure Cosmos DB Gremlin graph. * * @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 RUs per second of the parameters to provide for the current Gremlin - * database. + * @param graphName Cosmos DB graph name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. * @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 updateGremlinDatabaseThroughput(String resourceGroupName, - String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return updateGremlinDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, + public ThroughputSettingsGetResultsInner updateGremlinGraphThroughput(String resourceGroupName, String accountName, + String databaseName, String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return updateGremlinGraphThroughputAsync(resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters).block(); } /** - * Update RUs per second of an Azure Cosmos DB Gremlin database. + * Update RUs per second of an Azure Cosmos DB Gremlin graph. * * @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 RUs per second of the parameters to provide for the current Gremlin - * database. + * @param graphName Cosmos DB graph name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. * @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. @@ -1451,19 +1702,20 @@ public ThroughputSettingsGetResultsInner updateGremlinDatabaseThroughput(String * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner updateGremlinDatabaseThroughput(String resourceGroupName, - String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, + public ThroughputSettingsGetResultsInner updateGremlinGraphThroughput(String resourceGroupName, String accountName, + String databaseName, String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { - return updateGremlinDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, + return updateGremlinGraphThroughputAsync(resourceGroupName, accountName, databaseName, graphName, updateThroughputParameters, context).block(); } /** - * Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph 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. @@ -1471,8 +1723,8 @@ public ThroughputSettingsGetResultsInner updateGremlinDatabaseThroughput(String * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> migrateGremlinDatabaseToAutoscaleWithResponseAsync(String resourceGroupName, - String accountName, String databaseName) { + public Mono>> migrateGremlinGraphToAutoscaleWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String graphName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1491,20 +1743,24 @@ public Mono>> migrateGremlinDatabaseToAutoscaleWithRes if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } + if (graphName == null) { + return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.migrateGremlinDatabaseToAutoscale(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.migrateGremlinGraphToAutoscale(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, graphName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph 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. @@ -1513,8 +1769,8 @@ public Mono>> migrateGremlinDatabaseToAutoscaleWithRes * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> migrateGremlinDatabaseToAutoscaleWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, Context context) { + private Mono>> migrateGremlinGraphToAutoscaleWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String graphName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1533,18 +1789,22 @@ private Mono>> migrateGremlinDatabaseToAutoscaleWithRe if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } + if (graphName == null) { + return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.migrateGremlinDatabaseToAutoscale(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, this.client.getApiVersion(), accept, context); + return service.migrateGremlinGraphToAutoscale(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, graphName, accept, context); } /** - * Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph 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. @@ -1552,20 +1812,22 @@ private Mono>> migrateGremlinDatabaseToAutoscaleWithRe */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateGremlinDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName) { + beginMigrateGremlinGraphToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, + String graphName) { Mono>> mono - = migrateGremlinDatabaseToAutoscaleWithResponseAsync(resourceGroupName, accountName, databaseName); + = migrateGremlinGraphToAutoscaleWithResponseAsync(resourceGroupName, accountName, databaseName, graphName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, ThroughputSettingsGetResultsInner.class, this.client.getContext()); } /** - * Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph 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. @@ -1574,22 +1836,23 @@ private Mono>> migrateGremlinDatabaseToAutoscaleWithRe */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateGremlinDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, - Context context) { + beginMigrateGremlinGraphToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, + String graphName, Context context) { context = this.client.mergeContext(context); - Mono>> mono - = migrateGremlinDatabaseToAutoscaleWithResponseAsync(resourceGroupName, accountName, databaseName, context); + Mono>> mono = migrateGremlinGraphToAutoscaleWithResponseAsync(resourceGroupName, + accountName, databaseName, graphName, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, ThroughputSettingsGetResultsInner.class, context); } /** - * Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph 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. @@ -1597,17 +1860,19 @@ private Mono>> migrateGremlinDatabaseToAutoscaleWithRe */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateGremlinDatabaseToAutoscale(String resourceGroupName, String accountName, String databaseName) { - return this.beginMigrateGremlinDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName) + beginMigrateGremlinGraphToAutoscale(String resourceGroupName, String accountName, String databaseName, + String graphName) { + return this.beginMigrateGremlinGraphToAutoscaleAsync(resourceGroupName, accountName, databaseName, graphName) .getSyncPoller(); } /** - * Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph 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. @@ -1616,36 +1881,39 @@ private Mono>> migrateGremlinDatabaseToAutoscaleWithRe */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateGremlinDatabaseToAutoscale(String resourceGroupName, String accountName, String databaseName, - Context context) { - return this.beginMigrateGremlinDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName, context) + beginMigrateGremlinGraphToAutoscale(String resourceGroupName, String accountName, String databaseName, + String graphName, Context context) { + return this + .beginMigrateGremlinGraphToAutoscaleAsync(resourceGroupName, accountName, databaseName, graphName, context) .getSyncPoller(); } /** - * Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph 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 migrateGremlinDatabaseToAutoscaleAsync(String resourceGroupName, - String accountName, String databaseName) { - return beginMigrateGremlinDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName).last() + public Mono migrateGremlinGraphToAutoscaleAsync(String resourceGroupName, + String accountName, String databaseName, String graphName) { + return beginMigrateGremlinGraphToAutoscaleAsync(resourceGroupName, accountName, databaseName, graphName).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph 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. @@ -1653,35 +1921,37 @@ public Mono migrateGremlinDatabaseToAutoscale * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono migrateGremlinDatabaseToAutoscaleAsync(String resourceGroupName, - String accountName, String databaseName, Context context) { - return beginMigrateGremlinDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono migrateGremlinGraphToAutoscaleAsync(String resourceGroupName, + String accountName, String databaseName, String graphName, Context context) { + return beginMigrateGremlinGraphToAutoscaleAsync(resourceGroupName, accountName, databaseName, graphName, + context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph 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 migrateGremlinDatabaseToAutoscale(String resourceGroupName, - String accountName, String databaseName) { - return migrateGremlinDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName).block(); - } - + public ThroughputSettingsGetResultsInner migrateGremlinGraphToAutoscale(String resourceGroupName, + String accountName, String databaseName, String graphName) { + return migrateGremlinGraphToAutoscaleAsync(resourceGroupName, accountName, databaseName, graphName).block(); + } + /** - * Migrate an Azure Cosmos DB Gremlin database from manual throughput to autoscale. + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph 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. @@ -1689,17 +1959,19 @@ public ThroughputSettingsGetResultsInner migrateGremlinDatabaseToAutoscale(Strin * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner migrateGremlinDatabaseToAutoscale(String resourceGroupName, - String accountName, String databaseName, Context context) { - return migrateGremlinDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName, context).block(); + public ThroughputSettingsGetResultsInner migrateGremlinGraphToAutoscale(String resourceGroupName, + String accountName, String databaseName, String graphName, Context context) { + return migrateGremlinGraphToAutoscaleAsync(resourceGroupName, accountName, databaseName, graphName, context) + .block(); } /** - * Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph 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. @@ -1707,8 +1979,8 @@ public ThroughputSettingsGetResultsInner migrateGremlinDatabaseToAutoscale(Strin * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> migrateGremlinDatabaseToManualThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName) { + public Mono>> migrateGremlinGraphToManualThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String graphName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1727,20 +1999,24 @@ public Mono>> migrateGremlinDatabaseToManualThroughput if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } + if (graphName == null) { + return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.migrateGremlinDatabaseToManualThroughput(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.migrateGremlinGraphToManualThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, graphName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph 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. @@ -1749,8 +2025,8 @@ public Mono>> migrateGremlinDatabaseToManualThroughput * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> migrateGremlinDatabaseToManualThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, Context context) { + private Mono>> migrateGremlinGraphToManualThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String graphName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1769,19 +2045,22 @@ private Mono>> migrateGremlinDatabaseToManualThroughpu if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } + if (graphName == null) { + return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.migrateGremlinDatabaseToManualThroughput(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, this.client.getApiVersion(), - accept, context); + return service.migrateGremlinGraphToManualThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, graphName, accept, context); } /** - * Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph 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. @@ -1789,21 +2068,22 @@ private Mono>> migrateGremlinDatabaseToManualThroughpu */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateGremlinDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, - String databaseName) { - Mono>> mono - = migrateGremlinDatabaseToManualThroughputWithResponseAsync(resourceGroupName, accountName, databaseName); + beginMigrateGremlinGraphToManualThroughputAsync(String resourceGroupName, String accountName, + String databaseName, String graphName) { + Mono>> mono = migrateGremlinGraphToManualThroughputWithResponseAsync( + resourceGroupName, accountName, databaseName, graphName); return this.client.getLroResult(mono, this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, ThroughputSettingsGetResultsInner.class, this.client.getContext()); } /** - * Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph 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. @@ -1812,22 +2092,23 @@ private Mono>> migrateGremlinDatabaseToManualThroughpu */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateGremlinDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, - String databaseName, Context context) { + beginMigrateGremlinGraphToManualThroughputAsync(String resourceGroupName, String accountName, + String databaseName, String graphName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = migrateGremlinDatabaseToManualThroughputWithResponseAsync( - resourceGroupName, accountName, databaseName, context); + Mono>> mono = migrateGremlinGraphToManualThroughputWithResponseAsync( + resourceGroupName, accountName, databaseName, graphName, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, ThroughputSettingsGetResultsInner.class, context); } /** - * Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph 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. @@ -1835,18 +2116,20 @@ private Mono>> migrateGremlinDatabaseToManualThroughpu */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateGremlinDatabaseToManualThroughput(String resourceGroupName, String accountName, - String databaseName) { - return this.beginMigrateGremlinDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName) + beginMigrateGremlinGraphToManualThroughput(String resourceGroupName, String accountName, String databaseName, + String graphName) { + return this + .beginMigrateGremlinGraphToManualThroughputAsync(resourceGroupName, accountName, databaseName, graphName) .getSyncPoller(); } /** - * Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph 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. @@ -1855,37 +2138,41 @@ private Mono>> migrateGremlinDatabaseToManualThroughpu */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateGremlinDatabaseToManualThroughput(String resourceGroupName, String accountName, String databaseName, - Context context) { + beginMigrateGremlinGraphToManualThroughput(String resourceGroupName, String accountName, String databaseName, + String graphName, Context context) { return this - .beginMigrateGremlinDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName, context) + .beginMigrateGremlinGraphToManualThroughputAsync(resourceGroupName, accountName, databaseName, graphName, + context) .getSyncPoller(); } /** - * Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph 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 migrateGremlinDatabaseToManualThroughputAsync( - String resourceGroupName, String accountName, String databaseName) { - return beginMigrateGremlinDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName).last() + public Mono migrateGremlinGraphToManualThroughputAsync(String resourceGroupName, + String accountName, String databaseName, String graphName) { + return beginMigrateGremlinGraphToManualThroughputAsync(resourceGroupName, accountName, databaseName, graphName) + .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph 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. @@ -1893,36 +2180,38 @@ public Mono migrateGremlinDatabaseToManualThr * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono migrateGremlinDatabaseToManualThroughputAsync( - String resourceGroupName, String accountName, String databaseName, Context context) { - return beginMigrateGremlinDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono migrateGremlinGraphToManualThroughputAsync(String resourceGroupName, + String accountName, String databaseName, String graphName, Context context) { + return beginMigrateGremlinGraphToManualThroughputAsync(resourceGroupName, accountName, databaseName, graphName, + context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph 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 migrateGremlinDatabaseToManualThroughput(String resourceGroupName, - String accountName, String databaseName) { - return migrateGremlinDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName).block(); + public ThroughputSettingsGetResultsInner migrateGremlinGraphToManualThroughput(String resourceGroupName, + String accountName, String databaseName, String graphName) { + return migrateGremlinGraphToManualThroughputAsync(resourceGroupName, accountName, databaseName, graphName) + .block(); } /** - * Migrate an Azure Cosmos DB Gremlin database from autoscale to manual throughput. + * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph 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. @@ -1930,14 +2219,14 @@ public ThroughputSettingsGetResultsInner migrateGremlinDatabaseToManualThroughpu * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner migrateGremlinDatabaseToManualThroughput(String resourceGroupName, - String accountName, String databaseName, Context context) { - return migrateGremlinDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName, context) - .block(); + public ThroughputSettingsGetResultsInner migrateGremlinGraphToManualThroughput(String resourceGroupName, + String accountName, String databaseName, String graphName, Context context) { + return migrateGremlinGraphToManualThroughputAsync(resourceGroupName, accountName, databaseName, graphName, + context).block(); } /** - * Lists the Gremlin graph under an existing Azure Cosmos DB database account. + * Gets the Gremlin databases 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. @@ -1945,11 +2234,11 @@ public ThroughputSettingsGetResultsInner migrateGremlinDatabaseToManualThroughpu * @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 graphs and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the Gremlin databases 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> listGremlinGraphsSinglePageAsync(String resourceGroupName, + public Mono> getGremlinDatabaseWithResponseAsync(String resourceGroupName, String accountName, String databaseName) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -1971,16 +2260,13 @@ private Mono> listGremlinGraphsSingle } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listGremlinGraphs(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)) + .withContext(context -> service.getGremlinDatabase(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the Gremlin graph under an existing Azure Cosmos DB database account. + * Gets the Gremlin databases 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. @@ -1989,11 +2275,11 @@ private Mono> listGremlinGraphsSingle * @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 graphs and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the Gremlin databases 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> listGremlinGraphsSinglePageAsync(String resourceGroupName, + private Mono> getGremlinDatabaseWithResponseAsync(String resourceGroupName, String accountName, String databaseName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -2015,15 +2301,12 @@ private Mono> listGremlinGraphsSingle } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listGremlinGraphs(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)); + return service.getGremlinDatabase(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, accept, context); } /** - * Lists the Gremlin graph under an existing Azure Cosmos DB database account. + * Gets the Gremlin databases 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. @@ -2031,17 +2314,18 @@ private Mono> listGremlinGraphsSingle * @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 graphs and their properties as paginated response with - * {@link PagedFlux}. + * @return the Gremlin databases under an existing Azure Cosmos DB database account with the provided name on + * successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listGremlinGraphsAsync(String resourceGroupName, String accountName, + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { - return new PagedFlux<>(() -> listGremlinGraphsSinglePageAsync(resourceGroupName, accountName, databaseName)); + return getGremlinDatabaseWithResponseAsync(resourceGroupName, accountName, databaseName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Lists the Gremlin graph under an existing Azure Cosmos DB database account. + * Gets the Gremlin databases 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. @@ -2050,18 +2334,17 @@ public PagedFlux listGremlinGraphsAsync(String reso * @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 graphs and their properties as paginated response with - * {@link PagedFlux}. + * @return the Gremlin databases under an existing Azure Cosmos DB database account with the provided name along + * with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listGremlinGraphsAsync(String resourceGroupName, String accountName, - String databaseName, Context context) { - return new PagedFlux<>( - () -> listGremlinGraphsSinglePageAsync(resourceGroupName, accountName, databaseName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getGremlinDatabaseWithResponse(String resourceGroupName, + String accountName, String databaseName, Context context) { + return getGremlinDatabaseWithResponseAsync(resourceGroupName, accountName, databaseName, context).block(); } /** - * Lists the Gremlin graph under an existing Azure Cosmos DB database account. + * Gets the Gremlin databases 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. @@ -2069,50 +2352,30 @@ private PagedFlux listGremlinGraphsAsync(String res * @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 graphs and their properties as paginated response with - * {@link PagedIterable}. + * @return the Gremlin databases under an existing Azure Cosmos DB database account with the provided name. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listGremlinGraphs(String resourceGroupName, String accountName, + @ServiceMethod(returns = ReturnType.SINGLE) + public GremlinDatabaseGetResultsInner getGremlinDatabase(String resourceGroupName, String accountName, String databaseName) { - return new PagedIterable<>(listGremlinGraphsAsync(resourceGroupName, accountName, databaseName)); - } - - /** - * Lists the Gremlin graph 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 graphs and their properties as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listGremlinGraphs(String resourceGroupName, String accountName, - String databaseName, Context context) { - return new PagedIterable<>(listGremlinGraphsAsync(resourceGroupName, accountName, databaseName, context)); + return getGremlinDatabaseWithResponse(resourceGroupName, accountName, databaseName, Context.NONE).getValue(); } /** - * Gets the Gremlin graph under an existing Azure Cosmos DB database account. + * Create or update an Azure Cosmos DB Gremlin 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 graphName Cosmos DB graph name. + * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin 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 Gremlin graph under an existing Azure Cosmos DB database account along with {@link Response} on - * successful completion of {@link Mono}. + * @return an Azure Cosmos DB Gremlin database along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getGremlinGraphWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String graphName) { + public Mono>> createUpdateGremlinDatabaseWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, + GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2131,33 +2394,38 @@ public Mono> getGremlinGraphWithResponseAs if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - if (graphName == null) { - return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); + if (createUpdateGremlinDatabaseParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateGremlinDatabaseParameters is required and cannot be null.")); + } else { + createUpdateGremlinDatabaseParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getGremlinGraph(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, graphName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.createUpdateGremlinDatabase(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, contentType, accept, createUpdateGremlinDatabaseParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the Gremlin graph under an existing Azure Cosmos DB database account. + * Create or update an Azure Cosmos DB Gremlin 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 graphName Cosmos DB graph name. + * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin 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 Gremlin graph under an existing Azure Cosmos DB database account along with {@link Response} on - * successful completion of {@link Mono}. + * @return an Azure Cosmos DB Gremlin database along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getGremlinGraphWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String graphName, Context context) { + private Mono>> createUpdateGremlinDatabaseWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, + GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2176,91 +2444,208 @@ private Mono> getGremlinGraphWithResponseA if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - if (graphName == null) { - return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); + if (createUpdateGremlinDatabaseParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateGremlinDatabaseParameters is required and cannot be null.")); + } else { + createUpdateGremlinDatabaseParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getGremlinGraph(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, databaseName, graphName, this.client.getApiVersion(), accept, context); + return service.createUpdateGremlinDatabase(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, contentType, accept, + createUpdateGremlinDatabaseParameters, context); } /** - * Gets the Gremlin graph under an existing Azure Cosmos DB database account. + * Create or update an Azure Cosmos DB Gremlin 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 graphName Cosmos DB graph name. + * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin 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 Gremlin graph under an existing Azure Cosmos DB database account on successful completion of - * {@link Mono}. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB Gremlin database. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getGremlinGraphAsync(String resourceGroupName, String accountName, - String databaseName, String graphName) { - return getGremlinGraphWithResponseAsync(resourceGroupName, accountName, databaseName, graphName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Gets the Gremlin graph 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. + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, GremlinDatabaseGetResultsInner> + beginCreateUpdateGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName, + GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters) { + Mono>> mono = createUpdateGremlinDatabaseWithResponseAsync(resourceGroupName, + accountName, databaseName, createUpdateGremlinDatabaseParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GremlinDatabaseGetResultsInner.class, GremlinDatabaseGetResultsInner.class, + this.client.getContext()); + } + + /** + * Create or update an Azure Cosmos DB Gremlin 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 graphName Cosmos DB graph name. + * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin 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 Gremlin graph under an existing Azure Cosmos DB database account along with {@link Response}. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB Gremlin database. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GremlinDatabaseGetResultsInner> + beginCreateUpdateGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName, + GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createUpdateGremlinDatabaseWithResponseAsync(resourceGroupName, + accountName, databaseName, createUpdateGremlinDatabaseParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GremlinDatabaseGetResultsInner.class, GremlinDatabaseGetResultsInner.class, + context); + } + + /** + * Create or update an Azure Cosmos DB Gremlin 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 createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin 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 Gremlin database. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GremlinDatabaseGetResultsInner> + beginCreateUpdateGremlinDatabase(String resourceGroupName, String accountName, String databaseName, + GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters) { + return this + .beginCreateUpdateGremlinDatabaseAsync(resourceGroupName, accountName, databaseName, + createUpdateGremlinDatabaseParameters) + .getSyncPoller(); + } + + /** + * Create or update an Azure Cosmos DB Gremlin 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 createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin 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 Gremlin database. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GremlinDatabaseGetResultsInner> + beginCreateUpdateGremlinDatabase(String resourceGroupName, String accountName, String databaseName, + GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters, Context context) { + return this + .beginCreateUpdateGremlinDatabaseAsync(resourceGroupName, accountName, databaseName, + createUpdateGremlinDatabaseParameters, context) + .getSyncPoller(); + } + + /** + * Create or update an Azure Cosmos DB Gremlin 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 createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin 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 Gremlin database on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getGremlinGraphWithResponse(String resourceGroupName, - String accountName, String databaseName, String graphName, Context context) { - return getGremlinGraphWithResponseAsync(resourceGroupName, accountName, databaseName, graphName, context) - .block(); + public Mono createUpdateGremlinDatabaseAsync(String resourceGroupName, + String accountName, String databaseName, + GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters) { + return beginCreateUpdateGremlinDatabaseAsync(resourceGroupName, accountName, databaseName, + createUpdateGremlinDatabaseParameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Gets the Gremlin graph under an existing Azure Cosmos DB database account. + * Create or update an Azure Cosmos DB Gremlin 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 graphName Cosmos DB graph name. + * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin 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 Gremlin graph under an existing Azure Cosmos DB database account. + * @return an Azure Cosmos DB Gremlin database on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GremlinGraphGetResultsInner getGremlinGraph(String resourceGroupName, String accountName, - String databaseName, String graphName) { - return getGremlinGraphWithResponse(resourceGroupName, accountName, databaseName, graphName, Context.NONE) - .getValue(); + private Mono createUpdateGremlinDatabaseAsync(String resourceGroupName, + String accountName, String databaseName, + GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters, Context context) { + return beginCreateUpdateGremlinDatabaseAsync(resourceGroupName, accountName, databaseName, + createUpdateGremlinDatabaseParameters, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Create or update an Azure Cosmos DB Gremlin graph. + * Create or update an Azure Cosmos DB Gremlin 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 graphName Cosmos DB graph name. - * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. + * @param createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin 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 Gremlin graph along with {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB Gremlin database. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createUpdateGremlinGraphWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String graphName, - GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) { + public GremlinDatabaseGetResultsInner createUpdateGremlinDatabase(String resourceGroupName, String accountName, + String databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters) { + return createUpdateGremlinDatabaseAsync(resourceGroupName, accountName, databaseName, + createUpdateGremlinDatabaseParameters).block(); + } + + /** + * Create or update an Azure Cosmos DB Gremlin 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 createUpdateGremlinDatabaseParameters The parameters to provide for the current Gremlin 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 Gremlin database. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GremlinDatabaseGetResultsInner createUpdateGremlinDatabase(String resourceGroupName, String accountName, + String databaseName, GremlinDatabaseCreateUpdateParameters createUpdateGremlinDatabaseParameters, + Context context) { + return createUpdateGremlinDatabaseAsync(resourceGroupName, accountName, databaseName, + createUpdateGremlinDatabaseParameters, context).block(); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin 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>> deleteGremlinDatabaseWithResponseAsync(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.")); @@ -2279,41 +2664,28 @@ public Mono>> createUpdateGremlinGraphWithResponseAsyn if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - if (graphName == null) { - return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); - } - if (createUpdateGremlinGraphParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter createUpdateGremlinGraphParameters is required and cannot be null.")); - } else { - createUpdateGremlinGraphParameters.validate(); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createUpdateGremlinGraph(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, graphName, - this.client.getApiVersion(), createUpdateGremlinGraphParameters, accept, context)) + .withContext( + context -> service.deleteGremlinDatabase(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or update an Azure Cosmos DB Gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin 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 graphName Cosmos DB graph name. - * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. * @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 Gremlin graph along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createUpdateGremlinGraphWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String graphName, - GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, Context context) { + private Mono>> deleteGremlinDatabaseWithResponseAsync(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.")); @@ -2332,218 +2704,171 @@ private Mono>> createUpdateGremlinGraphWithResponseAsy if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - if (graphName == null) { - return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); - } - if (createUpdateGremlinGraphParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter createUpdateGremlinGraphParameters is required and cannot be null.")); - } else { - createUpdateGremlinGraphParameters.validate(); - } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createUpdateGremlinGraph(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, graphName, this.client.getApiVersion(), - createUpdateGremlinGraphParameters, accept, context); + return service.deleteGremlinDatabase(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, context); } /** - * Create or update an Azure Cosmos DB Gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin 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 graphName Cosmos DB graph name. - * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. * @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 Gremlin graph. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, GremlinGraphGetResultsInner> - beginCreateUpdateGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, - String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) { - Mono>> mono = createUpdateGremlinGraphWithResponseAsync(resourceGroupName, - accountName, databaseName, graphName, createUpdateGremlinGraphParameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), GremlinGraphGetResultsInner.class, GremlinGraphGetResultsInner.class, + public PollerFlux, Void> beginDeleteGremlinDatabaseAsync(String resourceGroupName, + String accountName, String databaseName) { + Mono>> mono + = deleteGremlinDatabaseWithResponseAsync(resourceGroupName, accountName, databaseName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, this.client.getContext()); } /** - * Create or update an Azure Cosmos DB Gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin 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 graphName Cosmos DB graph name. - * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. * @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 Gremlin graph. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, GremlinGraphGetResultsInner> - beginCreateUpdateGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, - String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, Context context) { + private PollerFlux, Void> beginDeleteGremlinDatabaseAsync(String resourceGroupName, + String accountName, String databaseName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = createUpdateGremlinGraphWithResponseAsync(resourceGroupName, - accountName, databaseName, graphName, createUpdateGremlinGraphParameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), GremlinGraphGetResultsInner.class, GremlinGraphGetResultsInner.class, + Mono>> mono + = deleteGremlinDatabaseWithResponseAsync(resourceGroupName, accountName, databaseName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, context); } /** - * Create or update an Azure Cosmos DB Gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin 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 graphName Cosmos DB graph name. - * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. * @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 Gremlin graph. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GremlinGraphGetResultsInner> - beginCreateUpdateGremlinGraph(String resourceGroupName, String accountName, String databaseName, - String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) { - return this - .beginCreateUpdateGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName, - createUpdateGremlinGraphParameters) - .getSyncPoller(); + public SyncPoller, Void> beginDeleteGremlinDatabase(String resourceGroupName, String accountName, + String databaseName) { + return this.beginDeleteGremlinDatabaseAsync(resourceGroupName, accountName, databaseName).getSyncPoller(); } /** - * Create or update an Azure Cosmos DB Gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin 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 graphName Cosmos DB graph name. - * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. * @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 Gremlin graph. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, GremlinGraphGetResultsInner> - beginCreateUpdateGremlinGraph(String resourceGroupName, String accountName, String databaseName, - String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, Context context) { - return this - .beginCreateUpdateGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName, - createUpdateGremlinGraphParameters, context) + public SyncPoller, Void> beginDeleteGremlinDatabase(String resourceGroupName, String accountName, + String databaseName, Context context) { + return this.beginDeleteGremlinDatabaseAsync(resourceGroupName, accountName, databaseName, context) .getSyncPoller(); } /** - * Create or update an Azure Cosmos DB Gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin 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 graphName Cosmos DB graph name. - * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. * @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 Gremlin graph on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createUpdateGremlinGraphAsync(String resourceGroupName, String accountName, - String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) { - return beginCreateUpdateGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName, - createUpdateGremlinGraphParameters).last().flatMap(this.client::getLroFinalResultOrError); + public Mono deleteGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + return beginDeleteGremlinDatabaseAsync(resourceGroupName, accountName, databaseName).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Create or update an Azure Cosmos DB Gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin 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 graphName Cosmos DB graph name. - * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. * @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 Gremlin graph on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createUpdateGremlinGraphAsync(String resourceGroupName, - String accountName, String databaseName, String graphName, - GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, Context context) { - return beginCreateUpdateGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName, - createUpdateGremlinGraphParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono deleteGremlinDatabaseAsync(String resourceGroupName, String accountName, String databaseName, + Context context) { + return beginDeleteGremlinDatabaseAsync(resourceGroupName, accountName, databaseName, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Create or update an Azure Cosmos DB Gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin 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 graphName Cosmos DB graph name. - * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. * @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 Gremlin graph. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GremlinGraphGetResultsInner createUpdateGremlinGraph(String resourceGroupName, String accountName, - String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) { - return createUpdateGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName, - createUpdateGremlinGraphParameters).block(); + public void deleteGremlinDatabase(String resourceGroupName, String accountName, String databaseName) { + deleteGremlinDatabaseAsync(resourceGroupName, accountName, databaseName).block(); } /** - * Create or update an Azure Cosmos DB Gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin 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 graphName Cosmos DB graph name. - * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. * @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 Gremlin graph. */ @ServiceMethod(returns = ReturnType.SINGLE) - public GremlinGraphGetResultsInner createUpdateGremlinGraph(String resourceGroupName, String accountName, - String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, + public void deleteGremlinDatabase(String resourceGroupName, String accountName, String databaseName, Context context) { - return createUpdateGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName, - createUpdateGremlinGraphParameters, context).block(); + deleteGremlinDatabaseAsync(resourceGroupName, accountName, databaseName, context).block(); } /** - * Deletes an existing Azure Cosmos DB Gremlin graph. + * Lists the Gremlin 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 databaseName Cosmos DB database name. - * @param graphName Cosmos DB graph 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}. + * @return the List operation response, that contains the Gremlin databases and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteGremlinGraphWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String graphName) { + private Mono> + listGremlinDatabasesSinglePageAsync(String resourceGroupName, String accountName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2559,35 +2884,30 @@ public Mono>> deleteGremlinGraphWithResponseAsync(Stri 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 (graphName == null) { - return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); - } + final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.deleteGremlinGraph(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, graphName, this.client.getApiVersion(), context)) + .withContext(context -> service.listGremlinDatabases(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes an existing Azure Cosmos DB Gremlin graph. + * Lists the Gremlin 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 databaseName Cosmos DB database name. - * @param graphName Cosmos DB graph 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}. + * @return the List operation response, that contains the Gremlin databases and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteGremlinGraphWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String graphName, Context context) { + private Mono> + listGremlinDatabasesSinglePageAsync(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.")); @@ -2603,102 +2923,89 @@ private Mono>> deleteGremlinGraphWithResponseAsync(Str 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 (graphName == null) { - return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); - } + final String accept = "application/json"; context = this.client.mergeContext(context); - return service.deleteGremlinGraph(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, databaseName, graphName, this.client.getApiVersion(), context); + return service + .listGremlinDatabases(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Deletes an existing Azure Cosmos DB Gremlin graph. + * Lists the Gremlin 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 databaseName Cosmos DB database name. - * @param graphName Cosmos DB graph 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. + * @return the List operation response, that contains the Gremlin databases and their properties as paginated + * response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteGremlinGraphAsync(String resourceGroupName, String accountName, - String databaseName, String graphName) { - Mono>> mono - = deleteGremlinGraphWithResponseAsync(resourceGroupName, accountName, databaseName, graphName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listGremlinDatabasesAsync(String resourceGroupName, + String accountName) { + return new PagedFlux<>(() -> listGremlinDatabasesSinglePageAsync(resourceGroupName, accountName), + nextLink -> listGremlinDatabasesNextSinglePageAsync(nextLink)); } /** - * Deletes an existing Azure Cosmos DB Gremlin graph. + * Lists the Gremlin 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 databaseName Cosmos DB database name. - * @param graphName Cosmos DB graph 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. + * @return the List operation response, that contains the Gremlin databases and their properties as paginated + * response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteGremlinGraphAsync(String resourceGroupName, - String accountName, String databaseName, String graphName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteGremlinGraphWithResponseAsync(resourceGroupName, accountName, databaseName, graphName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listGremlinDatabasesAsync(String resourceGroupName, + String accountName, Context context) { + return new PagedFlux<>(() -> listGremlinDatabasesSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listGremlinDatabasesNextSinglePageAsync(nextLink, context)); } /** - * Deletes an existing Azure Cosmos DB Gremlin graph. + * Lists the Gremlin 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 databaseName Cosmos DB database name. - * @param graphName Cosmos DB graph 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. + * @return the List operation response, that contains the Gremlin databases and their properties as paginated + * response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteGremlinGraph(String resourceGroupName, String accountName, - String databaseName, String graphName) { - return this.beginDeleteGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listGremlinDatabases(String resourceGroupName, + String accountName) { + return new PagedIterable<>(listGremlinDatabasesAsync(resourceGroupName, accountName)); } /** - * Deletes an existing Azure Cosmos DB Gremlin graph. + * Lists the Gremlin 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 databaseName Cosmos DB database name. - * @param graphName Cosmos DB graph 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. + * @return the List operation response, that contains the Gremlin databases and their properties as paginated + * response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteGremlinGraph(String resourceGroupName, String accountName, - String databaseName, String graphName, Context context) { - return this.beginDeleteGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName, context) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listGremlinDatabases(String resourceGroupName, + String accountName, Context context) { + return new PagedIterable<>(listGremlinDatabasesAsync(resourceGroupName, accountName, context)); } /** - * Deletes an existing Azure Cosmos DB Gremlin graph. + * Gets the Gremlin graph 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. @@ -2707,17 +3014,43 @@ public SyncPoller, Void> beginDeleteGremlinGraph(String resourc * @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. + * @return the Gremlin graph under an existing Azure Cosmos DB database account along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, - String graphName) { - return beginDeleteGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName).last() - .flatMap(this.client::getLroFinalResultOrError); + public Mono> getGremlinGraphWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String graphName) { + 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 (graphName == null) { + return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getGremlinGraph(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, graphName, accept, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes an existing Azure Cosmos DB Gremlin graph. + * Gets the Gremlin graph 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. @@ -2727,17 +3060,41 @@ public Mono deleteGremlinGraphAsync(String resourceGroupName, String accou * @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. + * @return the Gremlin graph under an existing Azure Cosmos DB database account along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, - String graphName, Context context) { - return beginDeleteGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono> getGremlinGraphWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String graphName, 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 (graphName == null) { + return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getGremlinGraph(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, graphName, accept, context); } /** - * Deletes an existing Azure Cosmos DB Gremlin graph. + * Gets the Gremlin graph 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. @@ -2746,15 +3103,18 @@ private Mono deleteGremlinGraphAsync(String resourceGroupName, String acco * @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 Gremlin graph under an existing Azure Cosmos DB database account on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteGremlinGraph(String resourceGroupName, String accountName, String databaseName, - String graphName) { - deleteGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName).block(); + public Mono getGremlinGraphAsync(String resourceGroupName, String accountName, + String databaseName, String graphName) { + return getGremlinGraphWithResponseAsync(resourceGroupName, accountName, databaseName, graphName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes an existing Azure Cosmos DB Gremlin graph. + * Gets the Gremlin graph 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. @@ -2764,15 +3124,17 @@ public void deleteGremlinGraph(String resourceGroupName, String accountName, Str * @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 Gremlin graph under an existing Azure Cosmos DB database account along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteGremlinGraph(String resourceGroupName, String accountName, String databaseName, String graphName, - Context context) { - deleteGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName, context).block(); + public Response getGremlinGraphWithResponse(String resourceGroupName, + String accountName, String databaseName, String graphName, Context context) { + return getGremlinGraphWithResponseAsync(resourceGroupName, accountName, databaseName, graphName, context) + .block(); } /** - * Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. + * Gets the Gremlin graph 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. @@ -2781,12 +3143,32 @@ public void deleteGremlinGraph(String resourceGroupName, String accountName, Str * @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 Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name - * along with {@link Response} on successful completion of {@link Mono}. + * @return the Gremlin graph under an existing Azure Cosmos DB database account. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getGremlinGraphThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, String graphName) { + public GremlinGraphGetResultsInner getGremlinGraph(String resourceGroupName, String accountName, + String databaseName, String graphName) { + return getGremlinGraphWithResponse(resourceGroupName, accountName, databaseName, graphName, Context.NONE) + .getValue(); + } + + /** + * Create or update an Azure Cosmos DB Gremlin graph. + * + * @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 graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. + * @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 Gremlin graph along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createUpdateGremlinGraphWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String graphName, + GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2808,31 +3190,39 @@ public Mono> getGremlinGraphThroughp if (graphName == null) { return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); } + if (createUpdateGremlinGraphParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateGremlinGraphParameters is required and cannot be null.")); + } else { + createUpdateGremlinGraphParameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getGremlinGraphThroughput(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, graphName, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.createUpdateGremlinGraph(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, graphName, contentType, accept, createUpdateGremlinGraphParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. + * Create or update an Azure Cosmos DB Gremlin graph. * * @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 graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. * @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 Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name - * along with {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB Gremlin graph along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getGremlinGraphThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, String graphName, Context context) { + private Mono>> createUpdateGremlinGraphWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String graphName, + GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2854,90 +3244,216 @@ private Mono> getGremlinGraphThrough if (graphName == null) { return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); } + if (createUpdateGremlinGraphParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateGremlinGraphParameters is required and cannot be null.")); + } else { + createUpdateGremlinGraphParameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getGremlinGraphThroughput(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, graphName, this.client.getApiVersion(), accept, context); + return service.createUpdateGremlinGraph(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, graphName, contentType, + accept, createUpdateGremlinGraphParameters, context); } /** - * Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. + * Create or update an Azure Cosmos DB Gremlin graph. * * @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 graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. * @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 Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name on - * successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB Gremlin graph. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, GremlinGraphGetResultsInner> + beginCreateUpdateGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, + String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) { + Mono>> mono = createUpdateGremlinGraphWithResponseAsync(resourceGroupName, + accountName, databaseName, graphName, createUpdateGremlinGraphParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GremlinGraphGetResultsInner.class, GremlinGraphGetResultsInner.class, + this.client.getContext()); + } + + /** + * Create or update an Azure Cosmos DB Gremlin graph. + * + * @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 graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. + * @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 Gremlin graph. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GremlinGraphGetResultsInner> + beginCreateUpdateGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, + String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createUpdateGremlinGraphWithResponseAsync(resourceGroupName, + accountName, databaseName, graphName, createUpdateGremlinGraphParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GremlinGraphGetResultsInner.class, GremlinGraphGetResultsInner.class, + context); + } + + /** + * Create or update an Azure Cosmos DB Gremlin graph. + * + * @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 graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. + * @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 Gremlin graph. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GremlinGraphGetResultsInner> + beginCreateUpdateGremlinGraph(String resourceGroupName, String accountName, String databaseName, + String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) { + return this + .beginCreateUpdateGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName, + createUpdateGremlinGraphParameters) + .getSyncPoller(); + } + + /** + * Create or update an Azure Cosmos DB Gremlin graph. + * + * @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 graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. + * @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 Gremlin graph. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GremlinGraphGetResultsInner> + beginCreateUpdateGremlinGraph(String resourceGroupName, String accountName, String databaseName, + String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, Context context) { + return this + .beginCreateUpdateGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName, + createUpdateGremlinGraphParameters, context) + .getSyncPoller(); + } + + /** + * Create or update an Azure Cosmos DB Gremlin graph. + * + * @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 graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. + * @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 Gremlin graph on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getGremlinGraphThroughputAsync(String resourceGroupName, - String accountName, String databaseName, String graphName) { - return getGremlinGraphThroughputWithResponseAsync(resourceGroupName, accountName, databaseName, graphName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono createUpdateGremlinGraphAsync(String resourceGroupName, String accountName, + String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) { + return beginCreateUpdateGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName, + createUpdateGremlinGraphParameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. + * Create or update an Azure Cosmos DB Gremlin graph. * * @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 graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. * @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 Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name - * along with {@link Response}. + * @return an Azure Cosmos DB Gremlin graph on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getGremlinGraphThroughputWithResponse(String resourceGroupName, - String accountName, String databaseName, String graphName, Context context) { - return getGremlinGraphThroughputWithResponseAsync(resourceGroupName, accountName, databaseName, graphName, - context).block(); + private Mono createUpdateGremlinGraphAsync(String resourceGroupName, + String accountName, String databaseName, String graphName, + GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, Context context) { + return beginCreateUpdateGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName, + createUpdateGremlinGraphParameters, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Gets the Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. + * Create or update an Azure Cosmos DB Gremlin graph. * * @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 graphName Cosmos DB graph name. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. * @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 Gremlin graph throughput under an existing Azure Cosmos DB database account with the provided name. + * @return an Azure Cosmos DB Gremlin graph. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner getGremlinGraphThroughput(String resourceGroupName, String accountName, - String databaseName, String graphName) { - return getGremlinGraphThroughputWithResponse(resourceGroupName, accountName, databaseName, graphName, - Context.NONE).getValue(); + public GremlinGraphGetResultsInner createUpdateGremlinGraph(String resourceGroupName, String accountName, + String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters) { + return createUpdateGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName, + createUpdateGremlinGraphParameters).block(); } /** - * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * Create or update an Azure Cosmos DB Gremlin graph. * * @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 graphName Cosmos DB graph name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. + * @param createUpdateGremlinGraphParameters The parameters to provide for the current Gremlin graph. + * @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}. + * @return an Azure Cosmos DB Gremlin graph. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateGremlinGraphThroughputWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String graphName, - ThroughputSettingsUpdateParameters updateThroughputParameters) { + public GremlinGraphGetResultsInner createUpdateGremlinGraph(String resourceGroupName, String accountName, + String databaseName, String graphName, GremlinGraphCreateUpdateParameters createUpdateGremlinGraphParameters, + Context context) { + return createUpdateGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName, + createUpdateGremlinGraphParameters, context).block(); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin graph. + * + * @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 graphName Cosmos DB graph 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>> deleteGremlinGraphWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String graphName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2959,39 +3475,28 @@ public Mono>> updateGremlinGraphThroughputWithResponse if (graphName == null) { return Mono.error(new IllegalArgumentException("Parameter graphName 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.updateGremlinGraphThroughput(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, graphName, - this.client.getApiVersion(), updateThroughputParameters, accept, context)) + .withContext(context -> service.deleteGremlinGraph(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, graphName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin graph. * * @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 graphName Cosmos DB graph name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. * @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}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateGremlinGraphThroughputWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String graphName, - ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + private Mono>> deleteGremlinGraphWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String graphName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -3013,217 +3518,183 @@ private Mono>> updateGremlinGraphThroughputWithRespons if (graphName == null) { return Mono.error(new IllegalArgumentException("Parameter graphName 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.updateGremlinGraphThroughput(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, graphName, this.client.getApiVersion(), - updateThroughputParameters, accept, context); + return service.deleteGremlinGraph(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, graphName, context); } /** - * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin graph. * * @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 graphName Cosmos DB graph name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. * @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. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, ThroughputSettingsGetResultsInner> - beginUpdateGremlinGraphThroughputAsync(String resourceGroupName, String accountName, String databaseName, - String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - Mono>> mono = updateGremlinGraphThroughputWithResponseAsync(resourceGroupName, - accountName, databaseName, graphName, updateThroughputParameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, this.client.getContext()); + public PollerFlux, Void> beginDeleteGremlinGraphAsync(String resourceGroupName, String accountName, + String databaseName, String graphName) { + Mono>> mono + = deleteGremlinGraphWithResponseAsync(resourceGroupName, accountName, databaseName, graphName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin graph. * * @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 graphName Cosmos DB graph name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. * @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. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ThroughputSettingsGetResultsInner> - beginUpdateGremlinGraphThroughputAsync(String resourceGroupName, String accountName, String databaseName, - String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + private PollerFlux, Void> beginDeleteGremlinGraphAsync(String resourceGroupName, + String accountName, String databaseName, String graphName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = updateGremlinGraphThroughputWithResponseAsync(resourceGroupName, - accountName, databaseName, graphName, updateThroughputParameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, context); + Mono>> mono + = deleteGremlinGraphWithResponseAsync(resourceGroupName, accountName, databaseName, graphName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** - * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin graph. * * @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 graphName Cosmos DB graph name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. * @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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateGremlinGraphThroughput(String resourceGroupName, String accountName, String databaseName, - String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return this - .beginUpdateGremlinGraphThroughputAsync(resourceGroupName, accountName, databaseName, graphName, - updateThroughputParameters) + public SyncPoller, Void> beginDeleteGremlinGraph(String resourceGroupName, String accountName, + String databaseName, String graphName) { + return this.beginDeleteGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName) .getSyncPoller(); } /** - * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin graph. * * @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 graphName Cosmos DB graph name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. * @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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateGremlinGraphThroughput(String resourceGroupName, String accountName, String databaseName, - String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { - return this - .beginUpdateGremlinGraphThroughputAsync(resourceGroupName, accountName, databaseName, graphName, - updateThroughputParameters, context) + public SyncPoller, Void> beginDeleteGremlinGraph(String resourceGroupName, String accountName, + String databaseName, String graphName, Context context) { + return this.beginDeleteGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName, context) .getSyncPoller(); } /** - * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin graph. * * @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 graphName Cosmos DB graph name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. * @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}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateGremlinGraphThroughputAsync(String resourceGroupName, - String accountName, String databaseName, String graphName, - ThroughputSettingsUpdateParameters updateThroughputParameters) { - return beginUpdateGremlinGraphThroughputAsync(resourceGroupName, accountName, databaseName, graphName, - updateThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); + public Mono deleteGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, + String graphName) { + return beginDeleteGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin graph. * * @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 graphName Cosmos DB graph name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. * @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}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateGremlinGraphThroughputAsync(String resourceGroupName, - String accountName, String databaseName, String graphName, - ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { - return beginUpdateGremlinGraphThroughputAsync(resourceGroupName, accountName, databaseName, graphName, - updateThroughputParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono deleteGremlinGraphAsync(String resourceGroupName, String accountName, String databaseName, + String graphName, Context context) { + return beginDeleteGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin graph. * * @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 graphName Cosmos DB graph name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. * @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 updateGremlinGraphThroughput(String resourceGroupName, String accountName, - String databaseName, String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return updateGremlinGraphThroughputAsync(resourceGroupName, accountName, databaseName, graphName, - updateThroughputParameters).block(); + public void deleteGremlinGraph(String resourceGroupName, String accountName, String databaseName, + String graphName) { + deleteGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName).block(); } /** - * Update RUs per second of an Azure Cosmos DB Gremlin graph. + * Deletes an existing Azure Cosmos DB Gremlin graph. * * @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 graphName Cosmos DB graph name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current Gremlin graph. * @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 updateGremlinGraphThroughput(String resourceGroupName, String accountName, - String databaseName, String graphName, ThroughputSettingsUpdateParameters updateThroughputParameters, + public void deleteGremlinGraph(String resourceGroupName, String accountName, String databaseName, String graphName, Context context) { - return updateGremlinGraphThroughputAsync(resourceGroupName, accountName, databaseName, graphName, - updateThroughputParameters, context).block(); + deleteGremlinGraphAsync(resourceGroupName, accountName, databaseName, graphName, context).block(); } /** - * Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale. + * Lists the Gremlin graph 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 graphName Cosmos DB graph 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}. + * @return the List operation response, that contains the graphs and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> migrateGremlinGraphToAutoscaleWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String graphName) { + private Mono> listGremlinGraphsSinglePageAsync(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.")); @@ -3242,34 +3713,31 @@ public Mono>> migrateGremlinGraphToAutoscaleWithRespon if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - if (graphName == null) { - return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.migrateGremlinGraphToAutoscale(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, graphName, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.listGremlinGraphs(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale. + * Lists the Gremlin graph 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 graphName Cosmos DB graph 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}. + * @return the List operation response, that contains the graphs and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> migrateGremlinGraphToAutoscaleWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String graphName, Context context) { + private Mono> listGremlinGraphsSinglePageAsync(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.")); @@ -3288,198 +3756,162 @@ private Mono>> migrateGremlinGraphToAutoscaleWithRespo if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - if (graphName == null) { - return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.migrateGremlinGraphToAutoscale(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, graphName, this.client.getApiVersion(), accept, context); + return service + .listGremlinGraphs(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, databaseName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale. + * Lists the Gremlin graph 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 graphName Cosmos DB graph 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. + * @return the List operation response, that contains the graphs and their properties as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateGremlinGraphToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, - String graphName) { - Mono>> mono - = migrateGremlinGraphToAutoscaleWithResponseAsync(resourceGroupName, accountName, databaseName, graphName); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listGremlinGraphsAsync(String resourceGroupName, String accountName, + String databaseName) { + return new PagedFlux<>(() -> listGremlinGraphsSinglePageAsync(resourceGroupName, accountName, databaseName), + nextLink -> listGremlinGraphsNextSinglePageAsync(nextLink)); } /** - * Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale. + * Lists the Gremlin graph 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 graphName Cosmos DB graph 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. + * @return the List operation response, that contains the graphs and their properties as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateGremlinGraphToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, - String graphName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = migrateGremlinGraphToAutoscaleWithResponseAsync(resourceGroupName, - accountName, databaseName, graphName, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listGremlinGraphsAsync(String resourceGroupName, String accountName, + String databaseName, Context context) { + return new PagedFlux<>( + () -> listGremlinGraphsSinglePageAsync(resourceGroupName, accountName, databaseName, context), + nextLink -> listGremlinGraphsNextSinglePageAsync(nextLink, context)); } /** - * Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale. + * Lists the Gremlin graph 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 graphName Cosmos DB graph 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. + * @return the List operation response, that contains the graphs and their properties as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateGremlinGraphToAutoscale(String resourceGroupName, String accountName, String databaseName, - String graphName) { - return this.beginMigrateGremlinGraphToAutoscaleAsync(resourceGroupName, accountName, databaseName, graphName) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listGremlinGraphs(String resourceGroupName, String accountName, + String databaseName) { + return new PagedIterable<>(listGremlinGraphsAsync(resourceGroupName, accountName, databaseName)); } /** - * Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale. + * Lists the Gremlin graph 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 graphName Cosmos DB graph 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. + * @return the List operation response, that contains the graphs and their properties as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateGremlinGraphToAutoscale(String resourceGroupName, String accountName, String databaseName, - String graphName, Context context) { - return this - .beginMigrateGremlinGraphToAutoscaleAsync(resourceGroupName, accountName, databaseName, graphName, context) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listGremlinGraphs(String resourceGroupName, String accountName, + String databaseName, Context context) { + return new PagedIterable<>(listGremlinGraphsAsync(resourceGroupName, accountName, databaseName, context)); } /** - * Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale. + * Retrieves continuous backup information for a gremlin graph. * * @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 graphName Cosmos DB graph name. + * @param location The name of the continuous backup restore location. * @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}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono migrateGremlinGraphToAutoscaleAsync(String resourceGroupName, - String accountName, String databaseName, String graphName) { - return beginMigrateGremlinGraphToAutoscaleAsync(resourceGroupName, accountName, databaseName, graphName).last() - .flatMap(this.client::getLroFinalResultOrError); + public Mono>> retrieveContinuousBackupInformationWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String graphName, + ContinuousBackupRestoreLocation location) { + 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 (graphName == null) { + return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); + } + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } else { + location.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.retrieveContinuousBackupInformation(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, graphName, contentType, accept, location, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph 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 migrateGremlinGraphToAutoscaleAsync(String resourceGroupName, - String accountName, String databaseName, String graphName, Context context) { - return beginMigrateGremlinGraphToAutoscaleAsync(resourceGroupName, accountName, databaseName, graphName, - context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph 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 migrateGremlinGraphToAutoscale(String resourceGroupName, - String accountName, String databaseName, String graphName) { - return migrateGremlinGraphToAutoscaleAsync(resourceGroupName, accountName, databaseName, graphName).block(); - } - - /** - * Migrate an Azure Cosmos DB Gremlin graph from manual throughput to autoscale. + * Retrieves continuous backup information for a gremlin graph. * * @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 graphName Cosmos DB graph name. + * @param location The name of the continuous backup restore location. * @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 migrateGremlinGraphToAutoscale(String resourceGroupName, - String accountName, String databaseName, String graphName, Context context) { - return migrateGremlinGraphToAutoscaleAsync(resourceGroupName, accountName, databaseName, graphName, context) - .block(); - } - - /** - * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph 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}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> migrateGremlinGraphToManualThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, String graphName) { + private Mono>> retrieveContinuousBackupInformationWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String graphName, + ContinuousBackupRestoreLocation location, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -3501,246 +3933,213 @@ public Mono>> migrateGremlinGraphToManualThroughputWit if (graphName == null) { return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.migrateGremlinGraphToManualThroughput(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, graphName, - this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Migrate an Azure Cosmos DB Gremlin graph 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 graphName Cosmos DB graph 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>> migrateGremlinGraphToManualThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, String graphName, 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 (graphName == null) { - return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } else { + location.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.migrateGremlinGraphToManualThroughput(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, graphName, this.client.getApiVersion(), accept, context); + return service.retrieveContinuousBackupInformation(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, graphName, contentType, + accept, location, context); } /** - * Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput. + * Retrieves continuous backup information for a gremlin graph. * * @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 graphName Cosmos DB graph name. + * @param location The name of the continuous backup restore location. * @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. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateGremlinGraphToManualThroughputAsync(String resourceGroupName, String accountName, - String databaseName, String graphName) { - Mono>> mono = migrateGremlinGraphToManualThroughputWithResponseAsync( - resourceGroupName, accountName, databaseName, graphName); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, this.client.getContext()); + public PollerFlux, BackupInformationInner> + beginRetrieveContinuousBackupInformationAsync(String resourceGroupName, String accountName, String databaseName, + String graphName, ContinuousBackupRestoreLocation location) { + Mono>> mono = retrieveContinuousBackupInformationWithResponseAsync(resourceGroupName, + accountName, databaseName, graphName, location); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), BackupInformationInner.class, BackupInformationInner.class, + this.client.getContext()); } /** - * Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput. + * Retrieves continuous backup information for a gremlin graph. * * @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 graphName Cosmos DB graph name. + * @param location The name of the continuous backup restore location. * @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. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateGremlinGraphToManualThroughputAsync(String resourceGroupName, String accountName, - String databaseName, String graphName, Context context) { + private PollerFlux, BackupInformationInner> + beginRetrieveContinuousBackupInformationAsync(String resourceGroupName, String accountName, String databaseName, + String graphName, ContinuousBackupRestoreLocation location, Context context) { context = this.client.mergeContext(context); - Mono>> mono = migrateGremlinGraphToManualThroughputWithResponseAsync( - resourceGroupName, accountName, databaseName, graphName, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, context); + Mono>> mono = retrieveContinuousBackupInformationWithResponseAsync(resourceGroupName, + accountName, databaseName, graphName, location, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), BackupInformationInner.class, BackupInformationInner.class, context); } /** - * Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput. + * Retrieves continuous backup information for a gremlin graph. * * @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 graphName Cosmos DB graph name. + * @param location The name of the continuous backup restore location. * @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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateGremlinGraphToManualThroughput(String resourceGroupName, String accountName, String databaseName, - String graphName) { + public SyncPoller, BackupInformationInner> + beginRetrieveContinuousBackupInformation(String resourceGroupName, String accountName, String databaseName, + String graphName, ContinuousBackupRestoreLocation location) { return this - .beginMigrateGremlinGraphToManualThroughputAsync(resourceGroupName, accountName, databaseName, graphName) + .beginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, graphName, + location) .getSyncPoller(); } /** - * Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput. + * Retrieves continuous backup information for a gremlin graph. * * @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 graphName Cosmos DB graph name. + * @param location The name of the continuous backup restore location. * @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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateGremlinGraphToManualThroughput(String resourceGroupName, String accountName, String databaseName, - String graphName, Context context) { + public SyncPoller, BackupInformationInner> + beginRetrieveContinuousBackupInformation(String resourceGroupName, String accountName, String databaseName, + String graphName, ContinuousBackupRestoreLocation location, Context context) { return this - .beginMigrateGremlinGraphToManualThroughputAsync(resourceGroupName, accountName, databaseName, graphName, - context) + .beginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, graphName, + location, context) .getSyncPoller(); } /** - * Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput. + * Retrieves continuous backup information for a gremlin graph. * * @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 graphName Cosmos DB graph name. + * @param location The name of the continuous backup restore location. * @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}. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono migrateGremlinGraphToManualThroughputAsync(String resourceGroupName, - String accountName, String databaseName, String graphName) { - return beginMigrateGremlinGraphToManualThroughputAsync(resourceGroupName, accountName, databaseName, graphName) - .last() - .flatMap(this.client::getLroFinalResultOrError); + public Mono retrieveContinuousBackupInformationAsync(String resourceGroupName, + String accountName, String databaseName, String graphName, ContinuousBackupRestoreLocation location) { + return beginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, graphName, + location).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput. + * Retrieves continuous backup information for a gremlin graph. * * @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 graphName Cosmos DB graph name. + * @param location The name of the continuous backup restore location. * @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}. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono migrateGremlinGraphToManualThroughputAsync(String resourceGroupName, - String accountName, String databaseName, String graphName, Context context) { - return beginMigrateGremlinGraphToManualThroughputAsync(resourceGroupName, accountName, databaseName, graphName, - context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono retrieveContinuousBackupInformationAsync(String resourceGroupName, + String accountName, String databaseName, String graphName, ContinuousBackupRestoreLocation location, + Context context) { + return beginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, graphName, + location, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput. + * Retrieves continuous backup information for a gremlin graph. * * @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 graphName Cosmos DB graph name. + * @param location The name of the continuous backup restore location. * @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. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner migrateGremlinGraphToManualThroughput(String resourceGroupName, - String accountName, String databaseName, String graphName) { - return migrateGremlinGraphToManualThroughputAsync(resourceGroupName, accountName, databaseName, graphName) - .block(); + public BackupInformationInner retrieveContinuousBackupInformation(String resourceGroupName, String accountName, + String databaseName, String graphName, ContinuousBackupRestoreLocation location) { + return retrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, graphName, + location).block(); } /** - * Migrate an Azure Cosmos DB Gremlin graph from autoscale to manual throughput. + * Retrieves continuous backup information for a gremlin graph. * * @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 graphName Cosmos DB graph name. + * @param location The name of the continuous backup restore location. * @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. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner migrateGremlinGraphToManualThroughput(String resourceGroupName, - String accountName, String databaseName, String graphName, Context context) { - return migrateGremlinGraphToManualThroughputAsync(resourceGroupName, accountName, databaseName, graphName, - context).block(); + public BackupInformationInner retrieveContinuousBackupInformation(String resourceGroupName, String accountName, + String databaseName, String graphName, ContinuousBackupRestoreLocation location, Context context) { + return retrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, graphName, + location, context).block(); } /** - * Retrieves continuous backup information for a gremlin graph. + * Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Definition with the given Id. * * @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 graphName Cosmos DB graph name. - * @param location The name of the continuous backup restore location. + * @param roleDefinitionId The GUID for the Role Definition. * @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 backup information of a resource along with {@link Response} on successful completion of {@link Mono}. + * @return parameters to create and update an Azure Cosmos DB Gremlin Role Definition along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> retrieveContinuousBackupInformationWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, String graphName, - ContinuousBackupRestoreLocation location) { + public Mono> getGremlinRoleDefinitionWithResponseAsync( + String resourceGroupName, String accountName, String roleDefinitionId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -3756,43 +4155,34 @@ public Mono>> retrieveContinuousBackupInformationWithR 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 (graphName == null) { - return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } else { - location.validate(); + if (roleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.retrieveContinuousBackupInformation(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, graphName, - this.client.getApiVersion(), location, accept, context)) + .withContext( + context -> service.getGremlinRoleDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleDefinitionId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves continuous backup information for a gremlin graph. + * Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Definition with the given Id. * * @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 graphName Cosmos DB graph name. - * @param location The name of the continuous backup restore location. + * @param roleDefinitionId The GUID for the Role Definition. * @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 backup information of a resource along with {@link Response} on successful completion of {@link Mono}. + * @return parameters to create and update an Azure Cosmos DB Gremlin Role Definition along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> retrieveContinuousBackupInformationWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, String graphName, - ContinuousBackupRestoreLocation location, Context context) { + private Mono> getGremlinRoleDefinitionWithResponseAsync( + String resourceGroupName, String accountName, String roleDefinitionId, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -3808,200 +4198,1756 @@ private Mono>> retrieveContinuousBackupInformationWith 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 (roleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); } - if (graphName == null) { - return Mono.error(new IllegalArgumentException("Parameter graphName is required and cannot be null.")); + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getGremlinRoleDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleDefinitionId, accept, context); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Definition with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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 parameters to create and update an Azure Cosmos DB Gremlin Role Definition on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getGremlinRoleDefinitionAsync(String resourceGroupName, + String accountName, String roleDefinitionId) { + return getGremlinRoleDefinitionWithResponseAsync(resourceGroupName, accountName, roleDefinitionId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Definition with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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 parameters to create and update an Azure Cosmos DB Gremlin Role Definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getGremlinRoleDefinitionWithResponse(String resourceGroupName, + String accountName, String roleDefinitionId, Context context) { + return getGremlinRoleDefinitionWithResponseAsync(resourceGroupName, accountName, roleDefinitionId, context) + .block(); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Definition with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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 parameters to create and update an Azure Cosmos DB Gremlin Role Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GremlinRoleDefinitionResourceInner getGremlinRoleDefinition(String resourceGroupName, String accountName, + String roleDefinitionId) { + return getGremlinRoleDefinitionWithResponse(resourceGroupName, accountName, roleDefinitionId, Context.NONE) + .getValue(); + } + + /** + * Creates or updates an Azure Cosmos DB Gremlin Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateGremlinRoleDefinitionParameters The properties required to create or update a Role Definition. + * @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 parameters to create and update an Azure Cosmos DB Gremlin Role Definition along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createUpdateGremlinRoleDefinitionWithResponseAsync(String resourceGroupName, + String accountName, String roleDefinitionId, + GremlinRoleDefinitionResourceInner createUpdateGremlinRoleDefinitionParameters) { + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location 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 (roleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); + } + if (createUpdateGremlinRoleDefinitionParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateGremlinRoleDefinitionParameters is required and cannot be null.")); } else { - location.validate(); + createUpdateGremlinRoleDefinitionParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createUpdateGremlinRoleDefinition(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + roleDefinitionId, contentType, accept, createUpdateGremlinRoleDefinitionParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an Azure Cosmos DB Gremlin Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateGremlinRoleDefinitionParameters The properties required to create or update a Role Definition. + * @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 parameters to create and update an Azure Cosmos DB Gremlin Role Definition along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createUpdateGremlinRoleDefinitionWithResponseAsync( + String resourceGroupName, String accountName, String roleDefinitionId, + GremlinRoleDefinitionResourceInner createUpdateGremlinRoleDefinitionParameters, 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 (roleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); + } + if (createUpdateGremlinRoleDefinitionParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateGremlinRoleDefinitionParameters is required and cannot be null.")); + } else { + createUpdateGremlinRoleDefinitionParameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.retrieveContinuousBackupInformation(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, graphName, this.client.getApiVersion(), location, accept, - context); + return service.createUpdateGremlinRoleDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleDefinitionId, contentType, accept, + createUpdateGremlinRoleDefinitionParameters, context); } /** - * Retrieves continuous backup information for a gremlin graph. + * Creates or updates an Azure Cosmos DB Gremlin Role Definition. * * @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 graphName Cosmos DB graph name. - * @param location The name of the continuous backup restore location. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateGremlinRoleDefinitionParameters The properties required to create or update a Role Definition. * @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 backup information of a resource. + * @return the {@link PollerFlux} for polling of parameters to create and update an Azure Cosmos DB Gremlin Role + * Definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, BackupInformationInner> - beginRetrieveContinuousBackupInformationAsync(String resourceGroupName, String accountName, String databaseName, - String graphName, ContinuousBackupRestoreLocation location) { - Mono>> mono = retrieveContinuousBackupInformationWithResponseAsync(resourceGroupName, - accountName, databaseName, graphName, location); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), BackupInformationInner.class, BackupInformationInner.class, - this.client.getContext()); + public PollerFlux, GremlinRoleDefinitionResourceInner> + beginCreateUpdateGremlinRoleDefinitionAsync(String resourceGroupName, String accountName, + String roleDefinitionId, GremlinRoleDefinitionResourceInner createUpdateGremlinRoleDefinitionParameters) { + Mono>> mono = createUpdateGremlinRoleDefinitionWithResponseAsync(resourceGroupName, + accountName, roleDefinitionId, createUpdateGremlinRoleDefinitionParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GremlinRoleDefinitionResourceInner.class, + GremlinRoleDefinitionResourceInner.class, this.client.getContext()); } /** - * Retrieves continuous backup information for a gremlin graph. + * Creates or updates an Azure Cosmos DB Gremlin Role Definition. * * @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 graphName Cosmos DB graph name. - * @param location The name of the continuous backup restore location. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateGremlinRoleDefinitionParameters The properties required to create or update a Role Definition. * @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 backup information of a resource. + * @return the {@link PollerFlux} for polling of parameters to create and update an Azure Cosmos DB Gremlin Role + * Definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, BackupInformationInner> - beginRetrieveContinuousBackupInformationAsync(String resourceGroupName, String accountName, String databaseName, - String graphName, ContinuousBackupRestoreLocation location, Context context) { + private PollerFlux, GremlinRoleDefinitionResourceInner> + beginCreateUpdateGremlinRoleDefinitionAsync(String resourceGroupName, String accountName, + String roleDefinitionId, GremlinRoleDefinitionResourceInner createUpdateGremlinRoleDefinitionParameters, + Context context) { context = this.client.mergeContext(context); - Mono>> mono = retrieveContinuousBackupInformationWithResponseAsync(resourceGroupName, - accountName, databaseName, graphName, location, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), BackupInformationInner.class, BackupInformationInner.class, context); + Mono>> mono = createUpdateGremlinRoleDefinitionWithResponseAsync(resourceGroupName, + accountName, roleDefinitionId, createUpdateGremlinRoleDefinitionParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GremlinRoleDefinitionResourceInner.class, + GremlinRoleDefinitionResourceInner.class, context); } /** - * Retrieves continuous backup information for a gremlin graph. + * Creates or updates an Azure Cosmos DB Gremlin Role Definition. * * @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 graphName Cosmos DB graph name. - * @param location The name of the continuous backup restore location. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateGremlinRoleDefinitionParameters The properties required to create or update a Role Definition. * @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 backup information of a resource. + * @return the {@link SyncPoller} for polling of parameters to create and update an Azure Cosmos DB Gremlin Role + * Definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BackupInformationInner> - beginRetrieveContinuousBackupInformation(String resourceGroupName, String accountName, String databaseName, - String graphName, ContinuousBackupRestoreLocation location) { + public SyncPoller, GremlinRoleDefinitionResourceInner> + beginCreateUpdateGremlinRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId, + GremlinRoleDefinitionResourceInner createUpdateGremlinRoleDefinitionParameters) { return this - .beginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, graphName, - location) + .beginCreateUpdateGremlinRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, + createUpdateGremlinRoleDefinitionParameters) .getSyncPoller(); } /** - * Retrieves continuous backup information for a gremlin graph. + * Creates or updates an Azure Cosmos DB Gremlin Role Definition. * * @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 graphName Cosmos DB graph name. - * @param location The name of the continuous backup restore location. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateGremlinRoleDefinitionParameters The properties required to create or update a Role Definition. * @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 backup information of a resource. + * @return the {@link SyncPoller} for polling of parameters to create and update an Azure Cosmos DB Gremlin Role + * Definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BackupInformationInner> - beginRetrieveContinuousBackupInformation(String resourceGroupName, String accountName, String databaseName, - String graphName, ContinuousBackupRestoreLocation location, Context context) { + public SyncPoller, GremlinRoleDefinitionResourceInner> + beginCreateUpdateGremlinRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId, + GremlinRoleDefinitionResourceInner createUpdateGremlinRoleDefinitionParameters, Context context) { return this - .beginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, graphName, - location, context) + .beginCreateUpdateGremlinRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, + createUpdateGremlinRoleDefinitionParameters, context) .getSyncPoller(); } /** - * Retrieves continuous backup information for a gremlin graph. + * Creates or updates an Azure Cosmos DB Gremlin Role Definition. * * @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 graphName Cosmos DB graph name. - * @param location The name of the continuous backup restore location. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateGremlinRoleDefinitionParameters The properties required to create or update a Role Definition. * @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 backup information of a resource on successful completion of {@link Mono}. + * @return parameters to create and update an Azure Cosmos DB Gremlin Role Definition on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono retrieveContinuousBackupInformationAsync(String resourceGroupName, - String accountName, String databaseName, String graphName, ContinuousBackupRestoreLocation location) { - return beginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, graphName, - location).last().flatMap(this.client::getLroFinalResultOrError); + public Mono createUpdateGremlinRoleDefinitionAsync(String resourceGroupName, + String accountName, String roleDefinitionId, + GremlinRoleDefinitionResourceInner createUpdateGremlinRoleDefinitionParameters) { + return beginCreateUpdateGremlinRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, + createUpdateGremlinRoleDefinitionParameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Retrieves continuous backup information for a gremlin graph. + * Creates or updates an Azure Cosmos DB Gremlin Role Definition. * * @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 graphName Cosmos DB graph name. - * @param location The name of the continuous backup restore location. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateGremlinRoleDefinitionParameters The properties required to create or update a Role Definition. * @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 backup information of a resource on successful completion of {@link Mono}. + * @return parameters to create and update an Azure Cosmos DB Gremlin Role Definition on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono retrieveContinuousBackupInformationAsync(String resourceGroupName, - String accountName, String databaseName, String graphName, ContinuousBackupRestoreLocation location, - Context context) { - return beginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, graphName, - location, context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono createUpdateGremlinRoleDefinitionAsync(String resourceGroupName, + String accountName, String roleDefinitionId, + GremlinRoleDefinitionResourceInner createUpdateGremlinRoleDefinitionParameters, Context context) { + return beginCreateUpdateGremlinRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, + createUpdateGremlinRoleDefinitionParameters, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Retrieves continuous backup information for a gremlin graph. + * Creates or updates an Azure Cosmos DB Gremlin Role Definition. * * @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 graphName Cosmos DB graph name. - * @param location The name of the continuous backup restore location. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateGremlinRoleDefinitionParameters The properties required to create or update a Role Definition. * @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 backup information of a resource. + * @return parameters to create and update an Azure Cosmos DB Gremlin Role Definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BackupInformationInner retrieveContinuousBackupInformation(String resourceGroupName, String accountName, - String databaseName, String graphName, ContinuousBackupRestoreLocation location) { - return retrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, graphName, - location).block(); + public GremlinRoleDefinitionResourceInner createUpdateGremlinRoleDefinition(String resourceGroupName, + String accountName, String roleDefinitionId, + GremlinRoleDefinitionResourceInner createUpdateGremlinRoleDefinitionParameters) { + return createUpdateGremlinRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, + createUpdateGremlinRoleDefinitionParameters).block(); } /** - * Retrieves continuous backup information for a gremlin graph. + * Creates or updates an Azure Cosmos DB Gremlin Role Definition. * * @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 graphName Cosmos DB graph name. - * @param location The name of the continuous backup restore location. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateGremlinRoleDefinitionParameters The properties required to create or update a Role Definition. * @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 backup information of a resource. + * @return parameters to create and update an Azure Cosmos DB Gremlin Role Definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BackupInformationInner retrieveContinuousBackupInformation(String resourceGroupName, String accountName, - String databaseName, String graphName, ContinuousBackupRestoreLocation location, Context context) { - return retrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, graphName, - location, context).block(); + public GremlinRoleDefinitionResourceInner createUpdateGremlinRoleDefinition(String resourceGroupName, + String accountName, String roleDefinitionId, + GremlinRoleDefinitionResourceInner createUpdateGremlinRoleDefinitionParameters, Context context) { + return createUpdateGremlinRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, + createUpdateGremlinRoleDefinitionParameters, context).block(); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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>> deleteGremlinRoleDefinitionWithResponseAsync(String resourceGroupName, + String accountName, String roleDefinitionId) { + 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 (roleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> service.deleteGremlinRoleDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleDefinitionId, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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>> deleteGremlinRoleDefinitionWithResponseAsync(String resourceGroupName, + String accountName, String roleDefinitionId, 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 (roleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.deleteGremlinRoleDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleDefinitionId, context); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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> beginDeleteGremlinRoleDefinitionAsync(String resourceGroupName, + String accountName, String roleDefinitionId) { + Mono>> mono + = deleteGremlinRoleDefinitionWithResponseAsync(resourceGroupName, accountName, roleDefinitionId); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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> beginDeleteGremlinRoleDefinitionAsync(String resourceGroupName, + String accountName, String roleDefinitionId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteGremlinRoleDefinitionWithResponseAsync(resourceGroupName, accountName, roleDefinitionId, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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> beginDeleteGremlinRoleDefinition(String resourceGroupName, + String accountName, String roleDefinitionId) { + return this.beginDeleteGremlinRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId) + .getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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> beginDeleteGremlinRoleDefinition(String resourceGroupName, + String accountName, String roleDefinitionId, Context context) { + return this.beginDeleteGremlinRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, context) + .getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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 deleteGremlinRoleDefinitionAsync(String resourceGroupName, String accountName, + String roleDefinitionId) { + return beginDeleteGremlinRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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 deleteGremlinRoleDefinitionAsync(String resourceGroupName, String accountName, + String roleDefinitionId, Context context) { + return beginDeleteGremlinRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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 deleteGremlinRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId) { + deleteGremlinRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId).block(); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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 deleteGremlinRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId, + Context context) { + deleteGremlinRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, context).block(); + } + + /** + * Retrieves the list of all Azure Cosmos DB Gremlin Role Definitions. + * + * @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 response of a GremlinRoleDefinitionResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listGremlinRoleDefinitionsSinglePageAsync(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.listGremlinRoleDefinitions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the list of all Azure Cosmos DB Gremlin Role Definitions. + * + * @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 response of a GremlinRoleDefinitionResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listGremlinRoleDefinitionsSinglePageAsync(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 + .listGremlinRoleDefinitions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Retrieves the list of all Azure Cosmos DB Gremlin Role Definitions. + * + * @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 response of a GremlinRoleDefinitionResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listGremlinRoleDefinitionsAsync(String resourceGroupName, + String accountName) { + return new PagedFlux<>(() -> listGremlinRoleDefinitionsSinglePageAsync(resourceGroupName, accountName), + nextLink -> listGremlinRoleDefinitionsNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves the list of all Azure Cosmos DB Gremlin Role Definitions. + * + * @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 response of a GremlinRoleDefinitionResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listGremlinRoleDefinitionsAsync(String resourceGroupName, + String accountName, Context context) { + return new PagedFlux<>(() -> listGremlinRoleDefinitionsSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listGremlinRoleDefinitionsNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves the list of all Azure Cosmos DB Gremlin Role Definitions. + * + * @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 response of a GremlinRoleDefinitionResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listGremlinRoleDefinitions(String resourceGroupName, + String accountName) { + return new PagedIterable<>(listGremlinRoleDefinitionsAsync(resourceGroupName, accountName)); + } + + /** + * Retrieves the list of all Azure Cosmos DB Gremlin Role Definitions. + * + * @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 response of a GremlinRoleDefinitionResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listGremlinRoleDefinitions(String resourceGroupName, + String accountName, Context context) { + return new PagedIterable<>(listGremlinRoleDefinitionsAsync(resourceGroupName, accountName, context)); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Assignment with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB Gremlin Role Assignment along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getGremlinRoleAssignmentWithResponseAsync( + String resourceGroupName, String accountName, String roleAssignmentId) { + 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 (roleAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getGremlinRoleAssignment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleAssignmentId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Assignment with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB Gremlin Role Assignment along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getGremlinRoleAssignmentWithResponseAsync( + String resourceGroupName, String accountName, String roleAssignmentId, 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 (roleAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getGremlinRoleAssignment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleAssignmentId, accept, context); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Assignment with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB Gremlin Role Assignment on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getGremlinRoleAssignmentAsync(String resourceGroupName, + String accountName, String roleAssignmentId) { + return getGremlinRoleAssignmentWithResponseAsync(resourceGroupName, accountName, roleAssignmentId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Assignment with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB Gremlin Role Assignment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getGremlinRoleAssignmentWithResponse(String resourceGroupName, + String accountName, String roleAssignmentId, Context context) { + return getGremlinRoleAssignmentWithResponseAsync(resourceGroupName, accountName, roleAssignmentId, context) + .block(); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Gremlin Role Assignment with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB Gremlin Role Assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GremlinRoleAssignmentResourceInner getGremlinRoleAssignment(String resourceGroupName, String accountName, + String roleAssignmentId) { + return getGremlinRoleAssignmentWithResponse(resourceGroupName, accountName, roleAssignmentId, Context.NONE) + .getValue(); + } + + /** + * Creates or updates an Azure Cosmos DB Gremlin Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateGremlinRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB Gremlin Role Assignment along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createUpdateGremlinRoleAssignmentWithResponseAsync(String resourceGroupName, + String accountName, String roleAssignmentId, + GremlinRoleAssignmentResourceInner createUpdateGremlinRoleAssignmentParameters) { + 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 (roleAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); + } + if (createUpdateGremlinRoleAssignmentParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateGremlinRoleAssignmentParameters is required and cannot be null.")); + } else { + createUpdateGremlinRoleAssignmentParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createUpdateGremlinRoleAssignment(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + roleAssignmentId, contentType, accept, createUpdateGremlinRoleAssignmentParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an Azure Cosmos DB Gremlin Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateGremlinRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB Gremlin Role Assignment along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createUpdateGremlinRoleAssignmentWithResponseAsync( + String resourceGroupName, String accountName, String roleAssignmentId, + GremlinRoleAssignmentResourceInner createUpdateGremlinRoleAssignmentParameters, 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 (roleAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); + } + if (createUpdateGremlinRoleAssignmentParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateGremlinRoleAssignmentParameters is required and cannot be null.")); + } else { + createUpdateGremlinRoleAssignmentParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createUpdateGremlinRoleAssignment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleAssignmentId, contentType, accept, + createUpdateGremlinRoleAssignmentParameters, context); + } + + /** + * Creates or updates an Azure Cosmos DB Gremlin Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateGremlinRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB Gremlin Role + * Assignment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, GremlinRoleAssignmentResourceInner> + beginCreateUpdateGremlinRoleAssignmentAsync(String resourceGroupName, String accountName, + String roleAssignmentId, GremlinRoleAssignmentResourceInner createUpdateGremlinRoleAssignmentParameters) { + Mono>> mono = createUpdateGremlinRoleAssignmentWithResponseAsync(resourceGroupName, + accountName, roleAssignmentId, createUpdateGremlinRoleAssignmentParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GremlinRoleAssignmentResourceInner.class, + GremlinRoleAssignmentResourceInner.class, this.client.getContext()); + } + + /** + * Creates or updates an Azure Cosmos DB Gremlin Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateGremlinRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB Gremlin Role + * Assignment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, GremlinRoleAssignmentResourceInner> + beginCreateUpdateGremlinRoleAssignmentAsync(String resourceGroupName, String accountName, + String roleAssignmentId, GremlinRoleAssignmentResourceInner createUpdateGremlinRoleAssignmentParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createUpdateGremlinRoleAssignmentWithResponseAsync(resourceGroupName, + accountName, roleAssignmentId, createUpdateGremlinRoleAssignmentParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), GremlinRoleAssignmentResourceInner.class, + GremlinRoleAssignmentResourceInner.class, context); + } + + /** + * Creates or updates an Azure Cosmos DB Gremlin Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateGremlinRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB Gremlin Role + * Assignment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GremlinRoleAssignmentResourceInner> + beginCreateUpdateGremlinRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId, + GremlinRoleAssignmentResourceInner createUpdateGremlinRoleAssignmentParameters) { + return this + .beginCreateUpdateGremlinRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, + createUpdateGremlinRoleAssignmentParameters) + .getSyncPoller(); + } + + /** + * Creates or updates an Azure Cosmos DB Gremlin Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateGremlinRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB Gremlin Role + * Assignment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, GremlinRoleAssignmentResourceInner> + beginCreateUpdateGremlinRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId, + GremlinRoleAssignmentResourceInner createUpdateGremlinRoleAssignmentParameters, Context context) { + return this + .beginCreateUpdateGremlinRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, + createUpdateGremlinRoleAssignmentParameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates an Azure Cosmos DB Gremlin Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateGremlinRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB Gremlin Role Assignment on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createUpdateGremlinRoleAssignmentAsync(String resourceGroupName, + String accountName, String roleAssignmentId, + GremlinRoleAssignmentResourceInner createUpdateGremlinRoleAssignmentParameters) { + return beginCreateUpdateGremlinRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, + createUpdateGremlinRoleAssignmentParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an Azure Cosmos DB Gremlin Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateGremlinRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB Gremlin Role Assignment on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createUpdateGremlinRoleAssignmentAsync(String resourceGroupName, + String accountName, String roleAssignmentId, + GremlinRoleAssignmentResourceInner createUpdateGremlinRoleAssignmentParameters, Context context) { + return beginCreateUpdateGremlinRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, + createUpdateGremlinRoleAssignmentParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an Azure Cosmos DB Gremlin Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateGremlinRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB Gremlin Role Assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GremlinRoleAssignmentResourceInner createUpdateGremlinRoleAssignment(String resourceGroupName, + String accountName, String roleAssignmentId, + GremlinRoleAssignmentResourceInner createUpdateGremlinRoleAssignmentParameters) { + return createUpdateGremlinRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, + createUpdateGremlinRoleAssignmentParameters).block(); + } + + /** + * Creates or updates an Azure Cosmos DB Gremlin Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateGremlinRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB Gremlin Role Assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public GremlinRoleAssignmentResourceInner createUpdateGremlinRoleAssignment(String resourceGroupName, + String accountName, String roleAssignmentId, + GremlinRoleAssignmentResourceInner createUpdateGremlinRoleAssignmentParameters, Context context) { + return createUpdateGremlinRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, + createUpdateGremlinRoleAssignmentParameters, context).block(); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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>> deleteGremlinRoleAssignmentWithResponseAsync(String resourceGroupName, + String accountName, String roleAssignmentId) { + 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 (roleAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> service.deleteGremlinRoleAssignment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleAssignmentId, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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>> deleteGremlinRoleAssignmentWithResponseAsync(String resourceGroupName, + String accountName, String roleAssignmentId, 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 (roleAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.deleteGremlinRoleAssignment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleAssignmentId, context); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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> beginDeleteGremlinRoleAssignmentAsync(String resourceGroupName, + String accountName, String roleAssignmentId) { + Mono>> mono + = deleteGremlinRoleAssignmentWithResponseAsync(resourceGroupName, accountName, roleAssignmentId); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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> beginDeleteGremlinRoleAssignmentAsync(String resourceGroupName, + String accountName, String roleAssignmentId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteGremlinRoleAssignmentWithResponseAsync(resourceGroupName, accountName, roleAssignmentId, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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> beginDeleteGremlinRoleAssignment(String resourceGroupName, + String accountName, String roleAssignmentId) { + return this.beginDeleteGremlinRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId) + .getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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> beginDeleteGremlinRoleAssignment(String resourceGroupName, + String accountName, String roleAssignmentId, Context context) { + return this.beginDeleteGremlinRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, context) + .getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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 deleteGremlinRoleAssignmentAsync(String resourceGroupName, String accountName, + String roleAssignmentId) { + return beginDeleteGremlinRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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 deleteGremlinRoleAssignmentAsync(String resourceGroupName, String accountName, + String roleAssignmentId, Context context) { + return beginDeleteGremlinRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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 deleteGremlinRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId) { + deleteGremlinRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId).block(); + } + + /** + * Deletes an existing Azure Cosmos DB Gremlin Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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 deleteGremlinRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId, + Context context) { + deleteGremlinRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, context).block(); + } + + /** + * Retrieves the list of all Azure Cosmos DB Gremlin Role Assignments. + * + * @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 response of a GremlinRoleAssignmentResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listGremlinRoleAssignmentsSinglePageAsync(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.listGremlinRoleAssignments(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the list of all Azure Cosmos DB Gremlin Role Assignments. + * + * @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 response of a GremlinRoleAssignmentResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listGremlinRoleAssignmentsSinglePageAsync(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 + .listGremlinRoleAssignments(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Retrieves the list of all Azure Cosmos DB Gremlin Role Assignments. + * + * @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 response of a GremlinRoleAssignmentResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listGremlinRoleAssignmentsAsync(String resourceGroupName, + String accountName) { + return new PagedFlux<>(() -> listGremlinRoleAssignmentsSinglePageAsync(resourceGroupName, accountName), + nextLink -> listGremlinRoleAssignmentsNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves the list of all Azure Cosmos DB Gremlin Role Assignments. + * + * @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 response of a GremlinRoleAssignmentResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listGremlinRoleAssignmentsAsync(String resourceGroupName, + String accountName, Context context) { + return new PagedFlux<>(() -> listGremlinRoleAssignmentsSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listGremlinRoleAssignmentsNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves the list of all Azure Cosmos DB Gremlin Role Assignments. + * + * @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 response of a GremlinRoleAssignmentResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listGremlinRoleAssignments(String resourceGroupName, + String accountName) { + return new PagedIterable<>(listGremlinRoleAssignmentsAsync(resourceGroupName, accountName)); + } + + /** + * Retrieves the list of all Azure Cosmos DB Gremlin Role Assignments. + * + * @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 response of a GremlinRoleAssignmentResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listGremlinRoleAssignments(String resourceGroupName, + String accountName, Context context) { + return new PagedIterable<>(listGremlinRoleAssignmentsAsync(resourceGroupName, accountName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 Gremlin databases and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listGremlinDatabasesNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listGremlinDatabasesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 Gremlin databases and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listGremlinDatabasesNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listGremlinDatabasesNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 graphs and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listGremlinGraphsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listGremlinGraphsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 graphs and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listGremlinGraphsNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listGremlinGraphsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a GremlinRoleDefinitionResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listGremlinRoleDefinitionsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listGremlinRoleDefinitionsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a GremlinRoleDefinitionResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listGremlinRoleDefinitionsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listGremlinRoleDefinitionsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a GremlinRoleAssignmentResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listGremlinRoleAssignmentsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listGremlinRoleAssignmentsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a GremlinRoleAssignmentResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listGremlinRoleAssignmentsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listGremlinRoleAssignmentsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/LocationsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/LocationsClientImpl.java index 3a126f97a1c7..9c8f950e85e8 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/LocationsClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/LocationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.cosmos.fluent.LocationsClient; import com.azure.resourcemanager.cosmos.fluent.models.LocationGetResultInner; -import com.azure.resourcemanager.cosmos.models.LocationListResult; +import com.azure.resourcemanager.cosmos.implementation.models.LocationListResult; import reactor.core.publisher.Mono; /** @@ -59,24 +59,134 @@ public final class LocationsClientImpl implements LocationsClient { * The interface defining all the services for CosmosDBManagementClientLocations to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientLocations") public interface LocationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}") + @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); + Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + } + + /** + * Get the properties of an existing Cosmos DB location. + * + * @param location Cosmos DB region, with spaces between words and each word capitalized. + * @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 properties of an existing Cosmos DB location along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String location) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the properties of an existing Cosmos DB location. + * + * @param location Cosmos DB region, with spaces between words and each word capitalized. + * @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 properties of an existing Cosmos DB location along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String location, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + location, accept, context); + } + + /** + * Get the properties of an existing Cosmos DB location. + * + * @param location Cosmos DB region, with spaces between words and each word capitalized. + * @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 properties of an existing Cosmos DB location on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String location) { + return getWithResponseAsync(location).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Get the properties of an existing Cosmos DB location. + * + * @param location Cosmos DB region, with spaces between words and each word capitalized. + * @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 properties of an existing Cosmos DB location along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String location, Context context) { + return getWithResponseAsync(location, context).block(); + } + + /** + * Get the properties of an existing Cosmos DB location. + * + * @param location Cosmos DB region, with spaces between words and each word capitalized. + * @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 properties of an existing Cosmos DB location. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public LocationGetResultInner get(String location) { + return getWithResponse(location, Context.NONE).getValue(); } /** @@ -102,7 +212,7 @@ private Mono> listSinglePageAsync() { .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -132,7 +242,7 @@ private Mono> listSinglePageAsync(Context .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -145,7 +255,7 @@ private Mono> listSinglePageAsync(Context */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync()); + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -160,7 +270,8 @@ public PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context)); + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** @@ -192,105 +303,55 @@ public PagedIterable list(Context context) { } /** - * Get the properties of an existing Cosmos DB location. + * Get the next page of items. * - * @param location Cosmos DB region, with spaces between words and each word capitalized. + * @param nextLink The URL to get the next list of items. * @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 properties of an existing Cosmos DB location along with {@link Response} on successful completion of - * {@link Mono}. + * @return the List operation response, that contains Cosmos DB locations and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String location) { + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } 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 (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, accept, context)) + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Get the properties of an existing Cosmos DB location. + * Get the next page of items. * - * @param location Cosmos DB region, with spaces between words and each word capitalized. + * @param nextLink The URL to get the next list of items. * @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 properties of an existing Cosmos DB location along with {@link Response} on successful completion of - * {@link Mono}. + * @return the List operation response, that contains Cosmos DB locations and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String location, Context context) { + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } 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 (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), - location, accept, context); - } - - /** - * Get the properties of an existing Cosmos DB location. - * - * @param location Cosmos DB region, with spaces between words and each word capitalized. - * @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 properties of an existing Cosmos DB location on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String location) { - return getWithResponseAsync(location).flatMap(res -> Mono.justOrEmpty(res.getValue())); - } - - /** - * Get the properties of an existing Cosmos DB location. - * - * @param location Cosmos DB region, with spaces between words and each word capitalized. - * @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 properties of an existing Cosmos DB location along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String location, Context context) { - return getWithResponseAsync(location, context).block(); - } - - /** - * Get the properties of an existing Cosmos DB location. - * - * @param location Cosmos DB region, with spaces between words and each word capitalized. - * @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 properties of an existing Cosmos DB location. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public LocationGetResultInner get(String location) { - return getWithResponse(location, Context.NONE).getValue(); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/MongoDBResourcesClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/MongoDBResourcesClientImpl.java index 1d19e49b4049..a6467eeb42a3 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/MongoDBResourcesClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/MongoDBResourcesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -38,16 +38,21 @@ import com.azure.resourcemanager.cosmos.fluent.models.MongoDBDatabaseGetResultsInner; import com.azure.resourcemanager.cosmos.fluent.models.MongoRoleDefinitionGetResultsInner; import com.azure.resourcemanager.cosmos.fluent.models.MongoUserDefinitionGetResultsInner; +import com.azure.resourcemanager.cosmos.fluent.models.PhysicalPartitionStorageInfoCollectionInner; +import com.azure.resourcemanager.cosmos.fluent.models.PhysicalPartitionThroughputInfoResultInner; import com.azure.resourcemanager.cosmos.fluent.models.ThroughputSettingsGetResultsInner; +import com.azure.resourcemanager.cosmos.implementation.models.MongoDBCollectionListResult; +import com.azure.resourcemanager.cosmos.implementation.models.MongoDBDatabaseListResult; +import com.azure.resourcemanager.cosmos.implementation.models.MongoRoleDefinitionListResult; +import com.azure.resourcemanager.cosmos.implementation.models.MongoUserDefinitionListResult; import com.azure.resourcemanager.cosmos.models.ContinuousBackupRestoreLocation; +import com.azure.resourcemanager.cosmos.models.MergeParameters; import com.azure.resourcemanager.cosmos.models.MongoDBCollectionCreateUpdateParameters; -import com.azure.resourcemanager.cosmos.models.MongoDBCollectionListResult; import com.azure.resourcemanager.cosmos.models.MongoDBDatabaseCreateUpdateParameters; -import com.azure.resourcemanager.cosmos.models.MongoDBDatabaseListResult; import com.azure.resourcemanager.cosmos.models.MongoRoleDefinitionCreateUpdateParameters; -import com.azure.resourcemanager.cosmos.models.MongoRoleDefinitionListResult; import com.azure.resourcemanager.cosmos.models.MongoUserDefinitionCreateUpdateParameters; -import com.azure.resourcemanager.cosmos.models.MongoUserDefinitionListResult; +import com.azure.resourcemanager.cosmos.models.RedistributeThroughputParameters; +import com.azure.resourcemanager.cosmos.models.RetrieveThroughputParameters; import com.azure.resourcemanager.cosmos.models.ThroughputSettingsUpdateParameters; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -82,283 +87,373 @@ public final class MongoDBResourcesClientImpl implements MongoDBResourcesClient * The interface defining all the services for CosmosDBManagementClientMongoDBResources to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientMongoDBResources") public interface MongoDBResourcesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listMongoDBDatabases(@HostParam("$host") String endpoint, + Mono> getMongoDBDatabaseThroughput( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("databaseName") String databaseName, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateMongoDBDatabaseThroughput(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ThroughputSettingsUpdateParameters updateThroughputParameters, + Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}") - @ExpectedResponses({ 200 }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getMongoDBDatabase(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> migrateMongoDBDatabaseToAutoscale(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @PathParam("databaseName") String databaseName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createUpdateMongoDBDatabase(@HostParam("$host") String endpoint, + Mono>> migrateMongoDBDatabaseToManualThroughput( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters, - @HeaderParam("Accept") String accept, Context context); + @PathParam("databaseName") String databaseName, @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}/mongodbDatabases/{databaseName}") - @ExpectedResponses({ 202, 204 }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteMongoDBDatabase(@HostParam("$host") String endpoint, + Mono>> mongoDBDatabaseRetrieveThroughputDistribution( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") RetrieveThroughputParameters retrieveThroughputParameters, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/redistributeThroughput") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> mongoDBDatabaseRedistributeThroughput(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") RedistributeThroughputParameters redistributeThroughputParameters, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getMongoDBDatabaseThroughput( - @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + Mono> getMongoDBCollectionThroughput( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, + @PathParam("databaseName") String databaseName, @PathParam("collectionName") String collectionName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default") + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateMongoDBDatabaseThroughput(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> updateMongoDBCollectionThroughput(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, + @PathParam("databaseName") String databaseName, @PathParam("collectionName") String collectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") ThroughputSettingsUpdateParameters updateThroughputParameters, - @HeaderParam("Accept") String accept, Context context); + Context context); - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/retrieveThroughputDistribution") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> migrateMongoDBDatabaseToAutoscale(@HostParam("$host") String endpoint, + Mono>> mongoDBContainerRetrieveThroughputDistribution( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, + @PathParam("databaseName") String databaseName, @PathParam("collectionName") String collectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RetrieveThroughputParameters retrieveThroughputParameters, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/redistributeThroughput") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> mongoDBContainerRedistributeThroughput(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, @PathParam("collectionName") String collectionName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RedistributeThroughputParameters redistributeThroughputParameters, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToAutoscale") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> migrateMongoDBCollectionToAutoscale(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, @PathParam("collectionName") String collectionName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToManualThroughput") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> migrateMongoDBDatabaseToManualThroughput(@HostParam("$host") String endpoint, + Mono>> migrateMongoDBCollectionToManualThroughput( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, + @PathParam("databaseName") String databaseName, @PathParam("collectionName") String collectionName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listMongoDBCollections(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getMongoDBDatabase(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createUpdateMongoDBDatabase(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteMongoDBDatabase(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMongoDBDatabases(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/partitionMerge") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> mongoDBDatabasePartitionMerge(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") MergeParameters mergeParameters, + Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getMongoDBCollection(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getMongoDBCollection(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("databaseName") String databaseName, @PathParam("collectionName") String collectionName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createUpdateMongoDBCollection(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createUpdateMongoDBCollection(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("databaseName") String databaseName, @PathParam("collectionName") String collectionName, - @QueryParam("api-version") String apiVersion, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, - @HeaderParam("Accept") String accept, Context context); + Context context); @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteMongoDBCollection(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> deleteMongoDBCollection(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("databaseName") String databaseName, @PathParam("collectionName") String collectionName, - @QueryParam("api-version") String apiVersion, Context context); + Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getMongoDBCollectionThroughput( - @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("databaseName") String databaseName, @PathParam("collectionName") String collectionName, - @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}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default") - @ExpectedResponses({ 200, 202 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateMongoDBCollectionThroughput(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listMongoDBCollections(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("databaseName") String databaseName, @PathParam("collectionName") String collectionName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ThroughputSettingsUpdateParameters updateThroughputParameters, - @HeaderParam("Accept") String accept, Context context); + @PathParam("databaseName") String databaseName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToAutoscale") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/partitionMerge") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> migrateMongoDBCollectionToAutoscale(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> listMongoDBCollectionPartitionMerge(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("databaseName") String databaseName, @PathParam("collectionName") String collectionName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") MergeParameters mergeParameters, Context context); - @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/throughputSettings/default/migrateToManualThroughput") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/retrieveContinuousBackupInformation") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> migrateMongoDBCollectionToManualThroughput(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> retrieveContinuousBackupInformation(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("databaseName") String databaseName, @PathParam("collectionName") String collectionName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ContinuousBackupRestoreLocation location, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getMongoRoleDefinition(@HostParam("$host") String endpoint, - @PathParam("mongoRoleDefinitionId") String mongoRoleDefinitionId, + Mono> getMongoRoleDefinition( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("mongoRoleDefinitionId") String mongoRoleDefinitionId, @HeaderParam("Accept") String accept, + Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createUpdateMongoRoleDefinition(@HostParam("$host") String endpoint, - @PathParam("mongoRoleDefinitionId") String mongoRoleDefinitionId, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createUpdateMongoRoleDefinition(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, + @PathParam("mongoRoleDefinitionId") String mongoRoleDefinitionId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters, - @HeaderParam("Accept") String accept, Context context); + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions/{mongoRoleDefinitionId}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteMongoRoleDefinition(@HostParam("$host") String endpoint, - @PathParam("mongoRoleDefinitionId") String mongoRoleDefinitionId, - @PathParam("subscriptionId") String subscriptionId, + Mono>> deleteMongoRoleDefinition(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("mongoRoleDefinitionId") String mongoRoleDefinitionId, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbRoleDefinitions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listMongoRoleDefinitions(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listMongoRoleDefinitions(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getMongoUserDefinition(@HostParam("$host") String endpoint, - @PathParam("mongoUserDefinitionId") String mongoUserDefinitionId, + Mono> getMongoUserDefinition( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("mongoUserDefinitionId") String mongoUserDefinitionId, @HeaderParam("Accept") String accept, + Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createUpdateMongoUserDefinition(@HostParam("$host") String endpoint, - @PathParam("mongoUserDefinitionId") String mongoUserDefinitionId, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createUpdateMongoUserDefinition(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, + @PathParam("mongoUserDefinitionId") String mongoUserDefinitionId, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters, - @HeaderParam("Accept") String accept, Context context); + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions/{mongoUserDefinitionId}") @ExpectedResponses({ 200, 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteMongoUserDefinition(@HostParam("$host") String endpoint, - @PathParam("mongoUserDefinitionId") String mongoUserDefinitionId, - @PathParam("subscriptionId") String subscriptionId, + Mono>> deleteMongoUserDefinition(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("mongoUserDefinitionId") String mongoUserDefinitionId, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbUserDefinitions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listMongoUserDefinitions(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listMongoUserDefinitions(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/collections/{collectionName}/retrieveContinuousBackupInformation") - @ExpectedResponses({ 200, 202 }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) @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("collectionName") String collectionName, - @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ContinuousBackupRestoreLocation location, + Mono> listMongoDBDatabasesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMongoDBCollectionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMongoRoleDefinitionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMongoUserDefinitionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Lists the MongoDB databases under an existing Azure Cosmos DB database account. + * Gets the RUs per second of the MongoDB 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 List operation response, that contains the MongoDB databases and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the RUs per second of the MongoDB 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> - listMongoDBDatabasesSinglePageAsync(String resourceGroupName, String accountName) { + public Mono> getMongoDBDatabaseThroughputWithResponseAsync( + 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.")); @@ -374,31 +469,34 @@ Mono>> retrieveContinuousBackupInformation(@HostParam( 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.listMongoDBDatabases(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)) + context -> service.getMongoDBDatabaseThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the MongoDB databases under an existing Azure Cosmos DB database account. + * Gets the RUs per second of the MongoDB 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 List operation response, that contains the MongoDB databases and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the RUs per second of the MongoDB 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> - listMongoDBDatabasesSinglePageAsync(String resourceGroupName, String accountName, Context context) { + private Mono> getMongoDBDatabaseThroughputWithResponseAsync( + 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.")); @@ -414,100 +512,93 @@ Mono>> retrieveContinuousBackupInformation(@HostParam( 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 - .listMongoDBDatabases(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)); + return service.getMongoDBDatabaseThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, accept, context); } /** - * Lists the MongoDB databases under an existing Azure Cosmos DB database account. + * Gets the RUs per second of the MongoDB 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 List operation response, that contains the MongoDB databases and their properties as paginated - * response with {@link PagedFlux}. + * @return the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the + * provided name on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMongoDBDatabasesAsync(String resourceGroupName, - String accountName) { - return new PagedFlux<>(() -> listMongoDBDatabasesSinglePageAsync(resourceGroupName, accountName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getMongoDBDatabaseThroughputAsync(String resourceGroupName, + String accountName, String databaseName) { + return getMongoDBDatabaseThroughputWithResponseAsync(resourceGroupName, accountName, databaseName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Lists the MongoDB databases under an existing Azure Cosmos DB database account. + * Gets the RUs per second of the MongoDB 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 List operation response, that contains the MongoDB databases and their properties as paginated - * response with {@link PagedFlux}. + * @return the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the + * provided name along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listMongoDBDatabasesAsync(String resourceGroupName, - String accountName, Context context) { - return new PagedFlux<>(() -> listMongoDBDatabasesSinglePageAsync(resourceGroupName, accountName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getMongoDBDatabaseThroughputWithResponse( + String resourceGroupName, String accountName, String databaseName, Context context) { + return getMongoDBDatabaseThroughputWithResponseAsync(resourceGroupName, accountName, databaseName, context) + .block(); } /** - * Lists the MongoDB databases under an existing Azure Cosmos DB database account. + * Gets the RUs per second of the MongoDB 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 List operation response, that contains the MongoDB databases and their properties as paginated - * response with {@link PagedIterable}. + * @return the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the + * provided name. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMongoDBDatabases(String resourceGroupName, - String accountName) { - return new PagedIterable<>(listMongoDBDatabasesAsync(resourceGroupName, accountName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputSettingsGetResultsInner getMongoDBDatabaseThroughput(String resourceGroupName, String accountName, + String databaseName) { + return getMongoDBDatabaseThroughputWithResponse(resourceGroupName, accountName, databaseName, Context.NONE) + .getValue(); } /** - * Lists the MongoDB databases under an existing Azure Cosmos DB database account. + * Update RUs per second of the an Azure Cosmos DB MongoDB database. * * @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. + * @param databaseName Cosmos DB database name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB + * 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 List operation response, that contains the MongoDB databases and their properties as paginated - * response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMongoDBDatabases(String resourceGroupName, - String accountName, Context context) { - return new PagedIterable<>(listMongoDBDatabasesAsync(resourceGroupName, accountName, context)); - } - - /** - * Gets the MongoDB databases 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 MongoDB databases under an existing Azure Cosmos DB database account with the provided name along - * with {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getMongoDBDatabaseWithResponseAsync(String resourceGroupName, - String accountName, String databaseName) { + public Mono>> updateMongoDBDatabaseThroughputWithResponseAsync(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.")); @@ -526,30 +617,40 @@ public Mono> getMongoDBDatabaseWithResp 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 contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.getMongoDBDatabase(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.updateMongoDBDatabaseThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, contentType, accept, updateThroughputParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. + * Update RUs per second of the an Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB + * 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 MongoDB databases under an existing Azure Cosmos DB database account with the provided name along - * with {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getMongoDBDatabaseWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, Context context) { + private Mono>> updateMongoDBDatabaseThroughputWithResponseAsync(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.")); @@ -568,83 +669,216 @@ private Mono> getMongoDBDatabaseWithRes 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 contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getMongoDBDatabase(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, databaseName, this.client.getApiVersion(), accept, context); + return service.updateMongoDBDatabaseThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, contentType, accept, + updateThroughputParameters, context); } /** - * Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. + * Update RUs per second of the an Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB + * 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 MongoDB databases under an existing Azure Cosmos DB database account with the provided name on - * successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, ThroughputSettingsGetResultsInner> + beginUpdateMongoDBDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, + ThroughputSettingsUpdateParameters updateThroughputParameters) { + Mono>> mono = updateMongoDBDatabaseThroughputWithResponseAsync(resourceGroupName, + accountName, databaseName, updateThroughputParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, this.client.getContext()); + } + + /** + * Update RUs per second of the an Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB + * 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> + beginUpdateMongoDBDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, + ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateMongoDBDatabaseThroughputWithResponseAsync(resourceGroupName, + accountName, databaseName, updateThroughputParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, context); + } + + /** + * Update RUs per second of the an Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB + * 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> + beginUpdateMongoDBDatabaseThroughput(String resourceGroupName, String accountName, String databaseName, + ThroughputSettingsUpdateParameters updateThroughputParameters) { + return this + .beginUpdateMongoDBDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, + updateThroughputParameters) + .getSyncPoller(); + } + + /** + * Update RUs per second of the an Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB + * 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> + beginUpdateMongoDBDatabaseThroughput(String resourceGroupName, String accountName, String databaseName, + ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + return this + .beginUpdateMongoDBDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, + updateThroughputParameters, context) + .getSyncPoller(); + } + + /** + * Update RUs per second of the an Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB + * 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 getMongoDBDatabaseAsync(String resourceGroupName, String accountName, - String databaseName) { - return getMongoDBDatabaseWithResponseAsync(resourceGroupName, accountName, databaseName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono updateMongoDBDatabaseThroughputAsync(String resourceGroupName, + String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return beginUpdateMongoDBDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, + updateThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. + * Update RUs per second of the an Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB + * 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 MongoDB databases under an existing Azure Cosmos DB database account with the provided name along - * with {@link Response}. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMongoDBDatabaseWithResponse(String resourceGroupName, - String accountName, String databaseName, Context context) { - return getMongoDBDatabaseWithResponseAsync(resourceGroupName, accountName, databaseName, context).block(); + private Mono updateMongoDBDatabaseThroughputAsync(String resourceGroupName, + String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, + Context context) { + return beginUpdateMongoDBDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, + updateThroughputParameters, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Gets the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. + * Update RUs per second of the an Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB + * 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 MongoDB databases under an existing Azure Cosmos DB database account with the provided name. + * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MongoDBDatabaseGetResultsInner getMongoDBDatabase(String resourceGroupName, String accountName, - String databaseName) { - return getMongoDBDatabaseWithResponse(resourceGroupName, accountName, databaseName, Context.NONE).getValue(); + public ThroughputSettingsGetResultsInner updateMongoDBDatabaseThroughput(String resourceGroupName, + String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return updateMongoDBDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, + updateThroughputParameters).block(); } /** - * Create or updates Azure Cosmos DB MongoDB database. + * Update RUs per second of the an Azure Cosmos DB MongoDB 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 createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB database. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB + * 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 MongoDB database along with {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createUpdateMongoDBDatabaseWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, - MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters) { + public ThroughputSettingsGetResultsInner updateMongoDBDatabaseThroughput(String resourceGroupName, + String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, + Context context) { + return updateMongoDBDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, + updateThroughputParameters, context).block(); + } + + /** + * Migrate an Azure Cosmos DB MongoDB 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>> migrateMongoDBDatabaseToAutoscaleWithResponseAsync(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.")); @@ -663,37 +897,30 @@ public Mono>> createUpdateMongoDBDatabaseWithResponseA if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - if (createUpdateMongoDBDatabaseParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter createUpdateMongoDBDatabaseParameters is required and cannot be null.")); - } else { - createUpdateMongoDBDatabaseParameters.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createUpdateMongoDBDatabase(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, - this.client.getApiVersion(), createUpdateMongoDBDatabaseParameters, accept, context)) + .withContext(context -> service.migrateMongoDBDatabaseToAutoscale(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or updates Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB 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 createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB 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 MongoDB database along with {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createUpdateMongoDBDatabaseWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, - MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters, Context context) { + private Mono>> migrateMongoDBDatabaseToAutoscaleWithResponseAsync( + 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.")); @@ -712,195 +939,169 @@ private Mono>> createUpdateMongoDBDatabaseWithResponse if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - if (createUpdateMongoDBDatabaseParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter createUpdateMongoDBDatabaseParameters is required and cannot be null.")); - } else { - createUpdateMongoDBDatabaseParameters.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createUpdateMongoDBDatabase(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, this.client.getApiVersion(), - createUpdateMongoDBDatabaseParameters, accept, context); + return service.migrateMongoDBDatabaseToAutoscale(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, accept, context); } /** - * Create or updates Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB 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 createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB 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 MongoDB database. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, MongoDBDatabaseGetResultsInner> - beginCreateUpdateMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, - MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters) { - Mono>> mono = createUpdateMongoDBDatabaseWithResponseAsync(resourceGroupName, - accountName, databaseName, createUpdateMongoDBDatabaseParameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), MongoDBDatabaseGetResultsInner.class, MongoDBDatabaseGetResultsInner.class, - this.client.getContext()); + public PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateMongoDBDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName) { + Mono>> mono + = migrateMongoDBDatabaseToAutoscaleWithResponseAsync(resourceGroupName, accountName, databaseName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, this.client.getContext()); } /** - * Create or updates Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB 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 createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB 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 MongoDB database. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, MongoDBDatabaseGetResultsInner> - beginCreateUpdateMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, - MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters, Context context) { + private PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateMongoDBDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, + Context context) { context = this.client.mergeContext(context); - Mono>> mono = createUpdateMongoDBDatabaseWithResponseAsync(resourceGroupName, - accountName, databaseName, createUpdateMongoDBDatabaseParameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), MongoDBDatabaseGetResultsInner.class, MongoDBDatabaseGetResultsInner.class, - context); + Mono>> mono + = migrateMongoDBDatabaseToAutoscaleWithResponseAsync(resourceGroupName, accountName, databaseName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, context); } /** - * Create or updates Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB 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 createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB 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 MongoDB database. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, MongoDBDatabaseGetResultsInner> - beginCreateUpdateMongoDBDatabase(String resourceGroupName, String accountName, String databaseName, - MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters) { - return this - .beginCreateUpdateMongoDBDatabaseAsync(resourceGroupName, accountName, databaseName, - createUpdateMongoDBDatabaseParameters) + public SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateMongoDBDatabaseToAutoscale(String resourceGroupName, String accountName, String databaseName) { + return this.beginMigrateMongoDBDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName) .getSyncPoller(); } /** - * Create or updates Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB 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 createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB 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 MongoDB database. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, MongoDBDatabaseGetResultsInner> - beginCreateUpdateMongoDBDatabase(String resourceGroupName, String accountName, String databaseName, - MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters, Context context) { - return this - .beginCreateUpdateMongoDBDatabaseAsync(resourceGroupName, accountName, databaseName, - createUpdateMongoDBDatabaseParameters, context) + public SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateMongoDBDatabaseToAutoscale(String resourceGroupName, String accountName, String databaseName, + Context context) { + return this.beginMigrateMongoDBDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName, context) .getSyncPoller(); } /** - * Create or updates Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB 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 createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB 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 MongoDB database on successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createUpdateMongoDBDatabaseAsync(String resourceGroupName, - String accountName, String databaseName, - MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters) { - return beginCreateUpdateMongoDBDatabaseAsync(resourceGroupName, accountName, databaseName, - createUpdateMongoDBDatabaseParameters).last().flatMap(this.client::getLroFinalResultOrError); + public Mono migrateMongoDBDatabaseToAutoscaleAsync(String resourceGroupName, + String accountName, String databaseName) { + return beginMigrateMongoDBDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Create or updates Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB 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 createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB 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 MongoDB database on successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createUpdateMongoDBDatabaseAsync(String resourceGroupName, - String accountName, String databaseName, - MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters, Context context) { - return beginCreateUpdateMongoDBDatabaseAsync(resourceGroupName, accountName, databaseName, - createUpdateMongoDBDatabaseParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono migrateMongoDBDatabaseToAutoscaleAsync(String resourceGroupName, + String accountName, String databaseName, Context context) { + return beginMigrateMongoDBDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Create or updates Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB 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 createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB 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 MongoDB database. + * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MongoDBDatabaseGetResultsInner createUpdateMongoDBDatabase(String resourceGroupName, String accountName, - String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters) { - return createUpdateMongoDBDatabaseAsync(resourceGroupName, accountName, databaseName, - createUpdateMongoDBDatabaseParameters).block(); + public ThroughputSettingsGetResultsInner migrateMongoDBDatabaseToAutoscale(String resourceGroupName, + String accountName, String databaseName) { + return migrateMongoDBDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName).block(); } /** - * Create or updates Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB 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 createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB 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 MongoDB database. + * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MongoDBDatabaseGetResultsInner createUpdateMongoDBDatabase(String resourceGroupName, String accountName, - String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters, - Context context) { - return createUpdateMongoDBDatabaseAsync(resourceGroupName, accountName, databaseName, - createUpdateMongoDBDatabaseParameters, context).block(); + public ThroughputSettingsGetResultsInner migrateMongoDBDatabaseToAutoscale(String resourceGroupName, + String accountName, String databaseName, Context context) { + return migrateMongoDBDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName, context).block(); } /** - * Deletes an existing Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB 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. @@ -908,11 +1109,12 @@ public MongoDBDatabaseGetResultsInner createUpdateMongoDBDatabase(String resourc * @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}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteMongoDBDatabaseWithResponseAsync(String resourceGroupName, - String accountName, String databaseName) { + public Mono>> migrateMongoDBDatabaseToManualThroughputWithResponseAsync( + 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.")); @@ -931,15 +1133,16 @@ public Mono>> deleteMongoDBDatabaseWithResponseAsync(S 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.deleteMongoDBDatabase(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, this.client.getApiVersion(), context)) + .withContext(context -> service.migrateMongoDBDatabaseToManualThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes an existing Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB 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. @@ -948,11 +1151,12 @@ public Mono>> deleteMongoDBDatabaseWithResponseAsync(S * @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}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteMongoDBDatabaseWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, Context context) { + private Mono>> migrateMongoDBDatabaseToManualThroughputWithResponseAsync( + 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.")); @@ -971,13 +1175,14 @@ private Mono>> deleteMongoDBDatabaseWithResponseAsync( 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.deleteMongoDBDatabase(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, this.client.getApiVersion(), context); + return service.migrateMongoDBDatabaseToManualThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, accept, context); } /** - * Deletes an existing Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB 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. @@ -985,19 +1190,21 @@ private Mono>> deleteMongoDBDatabaseWithResponseAsync( * @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. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteMongoDBDatabaseAsync(String resourceGroupName, - String accountName, String databaseName) { + public PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateMongoDBDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, + String databaseName) { Mono>> mono - = deleteMongoDBDatabaseWithResponseAsync(resourceGroupName, accountName, databaseName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + = migrateMongoDBDatabaseToManualThroughputWithResponseAsync(resourceGroupName, accountName, databaseName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, this.client.getContext()); } /** - * Deletes an existing Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB 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. @@ -1006,20 +1213,22 @@ public PollerFlux, Void> beginDeleteMongoDBDatabaseAsync(String * @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. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteMongoDBDatabaseAsync(String resourceGroupName, - String accountName, String databaseName, Context context) { + private PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateMongoDBDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, + String databaseName, Context context) { context = this.client.mergeContext(context); - Mono>> mono - = deleteMongoDBDatabaseWithResponseAsync(resourceGroupName, accountName, databaseName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + Mono>> mono = migrateMongoDBDatabaseToManualThroughputWithResponseAsync( + resourceGroupName, accountName, databaseName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, context); } /** - * Deletes an existing Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB 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. @@ -1027,16 +1236,18 @@ private PollerFlux, Void> beginDeleteMongoDBDatabaseAsync(Strin * @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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteMongoDBDatabase(String resourceGroupName, String accountName, - String databaseName) { - return this.beginDeleteMongoDBDatabaseAsync(resourceGroupName, accountName, databaseName).getSyncPoller(); + public SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateMongoDBDatabaseToManualThroughput(String resourceGroupName, String accountName, + String databaseName) { + return this.beginMigrateMongoDBDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName) + .getSyncPoller(); } /** - * Deletes an existing Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB 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. @@ -1045,17 +1256,19 @@ public SyncPoller, Void> beginDeleteMongoDBDatabase(String reso * @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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteMongoDBDatabase(String resourceGroupName, String accountName, - String databaseName, Context context) { - return this.beginDeleteMongoDBDatabaseAsync(resourceGroupName, accountName, databaseName, context) + public SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateMongoDBDatabaseToManualThroughput(String resourceGroupName, String accountName, String databaseName, + Context context) { + return this + .beginMigrateMongoDBDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName, context) .getSyncPoller(); } /** - * Deletes an existing Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB 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. @@ -1063,16 +1276,17 @@ public SyncPoller, Void> beginDeleteMongoDBDatabase(String reso * @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. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { - return beginDeleteMongoDBDatabaseAsync(resourceGroupName, accountName, databaseName).last() + public Mono migrateMongoDBDatabaseToManualThroughputAsync( + String resourceGroupName, String accountName, String databaseName) { + return beginMigrateMongoDBDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes an existing Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB 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. @@ -1081,17 +1295,18 @@ public Mono deleteMongoDBDatabaseAsync(String resourceGroupName, String ac * @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. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, - Context context) { - return beginDeleteMongoDBDatabaseAsync(resourceGroupName, accountName, databaseName, context).last() + private Mono migrateMongoDBDatabaseToManualThroughputAsync( + String resourceGroupName, String accountName, String databaseName, Context context) { + return beginMigrateMongoDBDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName, context) + .last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes an existing Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB 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. @@ -1099,14 +1314,16 @@ private Mono deleteMongoDBDatabaseAsync(String resourceGroupName, String a * @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 void deleteMongoDBDatabase(String resourceGroupName, String accountName, String databaseName) { - deleteMongoDBDatabaseAsync(resourceGroupName, accountName, databaseName).block(); + public ThroughputSettingsGetResultsInner migrateMongoDBDatabaseToManualThroughput(String resourceGroupName, + String accountName, String databaseName) { + return migrateMongoDBDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName).block(); } /** - * Deletes an existing Azure Cosmos DB MongoDB database. + * Migrate an Azure Cosmos DB MongoDB 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. @@ -1115,29 +1332,33 @@ public void deleteMongoDBDatabase(String resourceGroupName, String accountName, * @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 void deleteMongoDBDatabase(String resourceGroupName, String accountName, String databaseName, - Context context) { - deleteMongoDBDatabaseAsync(resourceGroupName, accountName, databaseName, context).block(); + public ThroughputSettingsGetResultsInner migrateMongoDBDatabaseToManualThroughput(String resourceGroupName, + String accountName, String databaseName, Context context) { + return migrateMongoDBDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName, context) + .block(); } /** - * Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the - * provided name. + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB 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 RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the - * provided name along with {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getMongoDBDatabaseThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName) { + public Mono>> mongoDBDatabaseRetrieveThroughputDistributionWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1156,31 +1377,40 @@ public Mono> getMongoDBDatabaseThrou if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } + if (retrieveThroughputParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter retrieveThroughputParameters is required and cannot be null.")); + } else { + retrieveThroughputParameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getMongoDBDatabaseThroughput(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.mongoDBDatabaseRetrieveThroughputDistribution(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, contentType, accept, retrieveThroughputParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the - * provided name. + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB 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 RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the - * provided name along with {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getMongoDBDatabaseThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, Context context) { + private Mono>> mongoDBDatabaseRetrieveThroughputDistributionWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1199,90 +1429,227 @@ private Mono> getMongoDBDatabaseThro if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } + if (retrieveThroughputParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter retrieveThroughputParameters is required and cannot be null.")); + } else { + retrieveThroughputParameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getMongoDBDatabaseThroughput(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, this.client.getApiVersion(), accept, context); + return service.mongoDBDatabaseRetrieveThroughputDistribution(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, + contentType, accept, retrieveThroughputParameters, context); } /** - * Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the - * provided name. + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB 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 RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the - * provided name on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getMongoDBDatabaseThroughputAsync(String resourceGroupName, - String accountName, String databaseName) { - return getMongoDBDatabaseThroughputWithResponseAsync(resourceGroupName, accountName, databaseName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBDatabaseRetrieveThroughputDistributionAsync(String resourceGroupName, String accountName, + String databaseName, RetrieveThroughputParameters retrieveThroughputParameters) { + Mono>> mono = mongoDBDatabaseRetrieveThroughputDistributionWithResponseAsync( + resourceGroupName, accountName, databaseName, retrieveThroughputParameters); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, this.client.getContext()); } /** - * Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the - * provided name. + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB 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 RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the - * provided name along with {@link Response}. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBDatabaseRetrieveThroughputDistributionAsync(String resourceGroupName, String accountName, + String databaseName, RetrieveThroughputParameters retrieveThroughputParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = mongoDBDatabaseRetrieveThroughputDistributionWithResponseAsync( + resourceGroupName, accountName, databaseName, retrieveThroughputParameters, context); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, context); + } + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB 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 PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBDatabaseRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, RetrieveThroughputParameters retrieveThroughputParameters) { + return this + .beginMongoDBDatabaseRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + retrieveThroughputParameters) + .getSyncPoller(); + } + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB 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 PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBDatabaseRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, RetrieveThroughputParameters retrieveThroughputParameters, Context context) { + return this + .beginMongoDBDatabaseRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + retrieveThroughputParameters, context) + .getSyncPoller(); + } + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB 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 PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMongoDBDatabaseThroughputWithResponse( - String resourceGroupName, String accountName, String databaseName, Context context) { - return getMongoDBDatabaseThroughputWithResponseAsync(resourceGroupName, accountName, databaseName, context) - .block(); + public Mono mongoDBDatabaseRetrieveThroughputDistributionAsync( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters) { + return beginMongoDBDatabaseRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + retrieveThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Gets the RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the - * provided name. + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB 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 RUs per second of the MongoDB database under an existing Azure Cosmos DB database account with the - * provided name. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner getMongoDBDatabaseThroughput(String resourceGroupName, String accountName, - String databaseName) { - return getMongoDBDatabaseThroughputWithResponse(resourceGroupName, accountName, databaseName, Context.NONE) - .getValue(); + private Mono mongoDBDatabaseRetrieveThroughputDistributionAsync( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters, Context context) { + return beginMongoDBDatabaseRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + retrieveThroughputParameters, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Update RUs per second of the an Azure Cosmos DB MongoDB database. + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB - * database. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB 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}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> updateMongoDBDatabaseThroughputWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + public PhysicalPartitionThroughputInfoResultInner mongoDBDatabaseRetrieveThroughputDistribution( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters) { + return mongoDBDatabaseRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + retrieveThroughputParameters).block(); + } + + /** + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB 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 PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PhysicalPartitionThroughputInfoResultInner mongoDBDatabaseRetrieveThroughputDistribution( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters, Context context) { + return mongoDBDatabaseRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + retrieveThroughputParameters, context).block(); + } + + /** + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB 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 PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> mongoDBDatabaseRedistributeThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1301,39 +1668,40 @@ public Mono>> updateMongoDBDatabaseThroughputWithRespo 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.")); + if (redistributeThroughputParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter redistributeThroughputParameters is required and cannot be null.")); } else { - updateThroughputParameters.validate(); + redistributeThroughputParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.updateMongoDBDatabaseThroughput(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, - this.client.getApiVersion(), updateThroughputParameters, accept, context)) + .withContext(context -> service.mongoDBDatabaseRedistributeThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, contentType, accept, redistributeThroughputParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update RUs per second of the an Azure Cosmos DB MongoDB database. + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB - * database. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB 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}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateMongoDBDatabaseThroughputWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, - Context context) { + private Mono>> mongoDBDatabaseRedistributeThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1352,215 +1720,225 @@ private Mono>> updateMongoDBDatabaseThroughputWithResp 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.")); + if (redistributeThroughputParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter redistributeThroughputParameters is required and cannot be null.")); } else { - updateThroughputParameters.validate(); + redistributeThroughputParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.updateMongoDBDatabaseThroughput(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, this.client.getApiVersion(), updateThroughputParameters, - accept, context); + return service.mongoDBDatabaseRedistributeThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, contentType, accept, + redistributeThroughputParameters, context); } /** - * Update RUs per second of the an Azure Cosmos DB MongoDB database. + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB - * database. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB 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. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, ThroughputSettingsGetResultsInner> - beginUpdateMongoDBDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, - ThroughputSettingsUpdateParameters updateThroughputParameters) { - Mono>> mono = updateMongoDBDatabaseThroughputWithResponseAsync(resourceGroupName, - accountName, databaseName, updateThroughputParameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, this.client.getContext()); + public + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBDatabaseRedistributeThroughputAsync(String resourceGroupName, String accountName, + String databaseName, RedistributeThroughputParameters redistributeThroughputParameters) { + Mono>> mono = mongoDBDatabaseRedistributeThroughputWithResponseAsync( + resourceGroupName, accountName, databaseName, redistributeThroughputParameters); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, this.client.getContext()); } /** - * Update RUs per second of the an Azure Cosmos DB MongoDB database. + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB - * database. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB 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. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ThroughputSettingsGetResultsInner> - beginUpdateMongoDBDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, - ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + private + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBDatabaseRedistributeThroughputAsync(String resourceGroupName, String accountName, + String databaseName, RedistributeThroughputParameters redistributeThroughputParameters, Context context) { context = this.client.mergeContext(context); - Mono>> mono = updateMongoDBDatabaseThroughputWithResponseAsync(resourceGroupName, - accountName, databaseName, updateThroughputParameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, context); + Mono>> mono = mongoDBDatabaseRedistributeThroughputWithResponseAsync( + resourceGroupName, accountName, databaseName, redistributeThroughputParameters, context); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, context); } /** - * Update RUs per second of the an Azure Cosmos DB MongoDB database. + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB - * database. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB 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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateMongoDBDatabaseThroughput(String resourceGroupName, String accountName, String databaseName, - ThroughputSettingsUpdateParameters updateThroughputParameters) { + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBDatabaseRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters) { return this - .beginUpdateMongoDBDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, - updateThroughputParameters) + .beginMongoDBDatabaseRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + redistributeThroughputParameters) .getSyncPoller(); } /** - * Update RUs per second of the an Azure Cosmos DB MongoDB database. + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB - * database. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB 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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateMongoDBDatabaseThroughput(String resourceGroupName, String accountName, String databaseName, - ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBDatabaseRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context) { return this - .beginUpdateMongoDBDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, - updateThroughputParameters, context) + .beginMongoDBDatabaseRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + redistributeThroughputParameters, context) .getSyncPoller(); } /** - * Update RUs per second of the an Azure Cosmos DB MongoDB database. + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB - * database. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB 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}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateMongoDBDatabaseThroughputAsync(String resourceGroupName, - String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return beginUpdateMongoDBDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, - updateThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); + public Mono mongoDBDatabaseRedistributeThroughputAsync( + String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters) { + return beginMongoDBDatabaseRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + redistributeThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Update RUs per second of the an Azure Cosmos DB MongoDB database. + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB - * database. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB 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}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateMongoDBDatabaseThroughputAsync(String resourceGroupName, - String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, - Context context) { - return beginUpdateMongoDBDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, - updateThroughputParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono mongoDBDatabaseRedistributeThroughputAsync( + String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context) { + return beginMongoDBDatabaseRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + redistributeThroughputParameters, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Update RUs per second of the an Azure Cosmos DB MongoDB database. + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB - * database. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB 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. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner updateMongoDBDatabaseThroughput(String resourceGroupName, - String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return updateMongoDBDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, - updateThroughputParameters).block(); + public PhysicalPartitionThroughputInfoResultInner mongoDBDatabaseRedistributeThroughput(String resourceGroupName, + String accountName, String databaseName, RedistributeThroughputParameters redistributeThroughputParameters) { + return mongoDBDatabaseRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + redistributeThroughputParameters).block(); } /** - * Update RUs per second of the an Azure Cosmos DB MongoDB database. + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 RUs per second of the parameters to provide for the current MongoDB - * database. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB 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. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner updateMongoDBDatabaseThroughput(String resourceGroupName, - String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, + public PhysicalPartitionThroughputInfoResultInner mongoDBDatabaseRedistributeThroughput(String resourceGroupName, + String accountName, String databaseName, RedistributeThroughputParameters redistributeThroughputParameters, Context context) { - return updateMongoDBDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, - updateThroughputParameters, context).block(); + return mongoDBDatabaseRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + redistributeThroughputParameters, context).block(); } /** - * Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale. + * Gets the RUs per second of the MongoDB collection 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 collectionName Cosmos DB collection 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}. + * @return the RUs per second of the MongoDB collection 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>> migrateMongoDBDatabaseToAutoscaleWithResponseAsync(String resourceGroupName, - String accountName, String databaseName) { + public Mono> getMongoDBCollectionThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1579,30 +1957,35 @@ public Mono>> migrateMongoDBDatabaseToAutoscaleWithRes if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } + if (collectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.migrateMongoDBDatabaseToAutoscale(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.getMongoDBCollectionThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, collectionName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale. + * Gets the RUs per second of the MongoDB collection 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 collectionName Cosmos DB collection 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}. + * @return the RUs per second of the MongoDB collection 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>> migrateMongoDBDatabaseToAutoscaleWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, Context context) { + private Mono> getMongoDBCollectionThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1621,173 +2004,89 @@ private Mono>> migrateMongoDBDatabaseToAutoscaleWithRe if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } + if (collectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.migrateMongoDBDatabaseToAutoscale(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, this.client.getApiVersion(), accept, context); + return service.getMongoDBCollectionThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, collectionName, accept, + context); } /** - * Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale. + * Gets the RUs per second of the MongoDB collection 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 collectionName Cosmos DB collection 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. + * @return the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the + * provided name on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateMongoDBDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName) { - Mono>> mono - = migrateMongoDBDatabaseToAutoscaleWithResponseAsync(resourceGroupName, accountName, databaseName); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getMongoDBCollectionThroughputAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName) { + return getMongoDBCollectionThroughputWithResponseAsync(resourceGroupName, accountName, databaseName, + collectionName).flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale. + * Gets the RUs per second of the MongoDB collection 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 collectionName Cosmos DB collection 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> - beginMigrateMongoDBDatabaseToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, - Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = migrateMongoDBDatabaseToAutoscaleWithResponseAsync(resourceGroupName, accountName, databaseName, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, context); - } - - /** - * Migrate an Azure Cosmos DB MongoDB 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> - beginMigrateMongoDBDatabaseToAutoscale(String resourceGroupName, String accountName, String databaseName) { - return this.beginMigrateMongoDBDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName) - .getSyncPoller(); - } - - /** - * Migrate an Azure Cosmos DB MongoDB 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> - beginMigrateMongoDBDatabaseToAutoscale(String resourceGroupName, String accountName, String databaseName, - Context context) { - return this.beginMigrateMongoDBDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName, context) - .getSyncPoller(); - } - - /** - * Migrate an Azure Cosmos DB MongoDB 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 migrateMongoDBDatabaseToAutoscaleAsync(String resourceGroupName, - String accountName, String databaseName) { - return beginMigrateMongoDBDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Migrate an Azure Cosmos DB MongoDB 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 migrateMongoDBDatabaseToAutoscaleAsync(String resourceGroupName, - String accountName, String databaseName, Context context) { - return beginMigrateMongoDBDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName, context).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Migrate an Azure Cosmos DB MongoDB 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. + * @return the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the + * provided name along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner migrateMongoDBDatabaseToAutoscale(String resourceGroupName, - String accountName, String databaseName) { - return migrateMongoDBDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName).block(); + public Response getMongoDBCollectionThroughputWithResponse( + String resourceGroupName, String accountName, String databaseName, String collectionName, Context context) { + return getMongoDBCollectionThroughputWithResponseAsync(resourceGroupName, accountName, databaseName, + collectionName, context).block(); } /** - * Migrate an Azure Cosmos DB MongoDB database from manual throughput to autoscale. + * Gets the RUs per second of the MongoDB collection 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. + * @param collectionName Cosmos DB collection 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. + * @return the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the + * provided name. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner migrateMongoDBDatabaseToAutoscale(String resourceGroupName, - String accountName, String databaseName, Context context) { - return migrateMongoDBDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName, context).block(); + public ThroughputSettingsGetResultsInner getMongoDBCollectionThroughput(String resourceGroupName, + String accountName, String databaseName, String collectionName) { + return getMongoDBCollectionThroughputWithResponse(resourceGroupName, accountName, databaseName, collectionName, + Context.NONE).getValue(); } /** - * Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. * * @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 collectionName Cosmos DB collection name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB + * collection. * @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. @@ -1795,8 +2094,9 @@ public ThroughputSettingsGetResultsInner migrateMongoDBDatabaseToAutoscale(Strin * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> migrateMongoDBDatabaseToManualThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName) { + public Mono>> updateMongoDBCollectionThroughputWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName, + ThroughputSettingsUpdateParameters updateThroughputParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1815,20 +2115,33 @@ public Mono>> migrateMongoDBDatabaseToManualThroughput if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } + if (collectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter collectionName 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 contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.migrateMongoDBDatabaseToManualThroughput(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.updateMongoDBCollectionThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, collectionName, contentType, accept, updateThroughputParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. * * @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 collectionName Cosmos DB collection name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB + * collection. * @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. @@ -1837,8 +2150,9 @@ public Mono>> migrateMongoDBDatabaseToManualThroughput * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> migrateMongoDBDatabaseToManualThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, Context context) { + private Mono>> updateMongoDBCollectionThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1857,19 +2171,32 @@ private Mono>> migrateMongoDBDatabaseToManualThroughpu if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } + if (collectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter collectionName 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 contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.migrateMongoDBDatabaseToManualThroughput(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, this.client.getApiVersion(), - accept, context); + return service.updateMongoDBCollectionThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, collectionName, contentType, + accept, updateThroughputParameters, context); } /** - * Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. * * @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 collectionName Cosmos DB collection name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB + * collection. * @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. @@ -1877,21 +2204,24 @@ private Mono>> migrateMongoDBDatabaseToManualThroughpu */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateMongoDBDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, - String databaseName) { - Mono>> mono - = migrateMongoDBDatabaseToManualThroughputWithResponseAsync(resourceGroupName, accountName, databaseName); + beginUpdateMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, + String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + Mono>> mono = updateMongoDBCollectionThroughputWithResponseAsync(resourceGroupName, + accountName, databaseName, collectionName, updateThroughputParameters); return this.client.getLroResult(mono, this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, ThroughputSettingsGetResultsInner.class, this.client.getContext()); } /** - * Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. * * @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 collectionName Cosmos DB collection name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB + * collection. * @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. @@ -1900,22 +2230,25 @@ private Mono>> migrateMongoDBDatabaseToManualThroughpu */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateMongoDBDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, - String databaseName, Context context) { + beginUpdateMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, + String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { context = this.client.mergeContext(context); - Mono>> mono = migrateMongoDBDatabaseToManualThroughputWithResponseAsync( - resourceGroupName, accountName, databaseName, context); + Mono>> mono = updateMongoDBCollectionThroughputWithResponseAsync(resourceGroupName, + accountName, databaseName, collectionName, updateThroughputParameters, context); return this.client.getLroResult(mono, this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, ThroughputSettingsGetResultsInner.class, context); } /** - * Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. * * @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 collectionName Cosmos DB collection name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB + * collection. * @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. @@ -1923,18 +2256,23 @@ private Mono>> migrateMongoDBDatabaseToManualThroughpu */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateMongoDBDatabaseToManualThroughput(String resourceGroupName, String accountName, - String databaseName) { - return this.beginMigrateMongoDBDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName) + beginUpdateMongoDBCollectionThroughput(String resourceGroupName, String accountName, String databaseName, + String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return this + .beginUpdateMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, + updateThroughputParameters) .getSyncPoller(); } /** - * Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. * * @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 collectionName Cosmos DB collection name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB + * collection. * @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. @@ -1943,37 +2281,45 @@ private Mono>> migrateMongoDBDatabaseToManualThroughpu */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateMongoDBDatabaseToManualThroughput(String resourceGroupName, String accountName, String databaseName, - Context context) { + beginUpdateMongoDBCollectionThroughput(String resourceGroupName, String accountName, String databaseName, + String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { return this - .beginMigrateMongoDBDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName, context) + .beginUpdateMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, + updateThroughputParameters, context) .getSyncPoller(); } /** - * Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. * * @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 collectionName Cosmos DB collection name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB + * collection. * @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 migrateMongoDBDatabaseToManualThroughputAsync( - String resourceGroupName, String accountName, String databaseName) { - return beginMigrateMongoDBDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName).last() - .flatMap(this.client::getLroFinalResultOrError); + public Mono updateMongoDBCollectionThroughputAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName, + ThroughputSettingsUpdateParameters updateThroughputParameters) { + return beginUpdateMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, + updateThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. * * @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 collectionName Cosmos DB collection name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB + * collection. * @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. @@ -1981,36 +2327,44 @@ public Mono migrateMongoDBDatabaseToManualThr * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono migrateMongoDBDatabaseToManualThroughputAsync( - String resourceGroupName, String accountName, String databaseName, Context context) { - return beginMigrateMongoDBDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono updateMongoDBCollectionThroughputAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName, + ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + return beginUpdateMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, + updateThroughputParameters, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. * * @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 collectionName Cosmos DB collection name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB + * collection. * @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 migrateMongoDBDatabaseToManualThroughput(String resourceGroupName, - String accountName, String databaseName) { - return migrateMongoDBDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName).block(); + public ThroughputSettingsGetResultsInner updateMongoDBCollectionThroughput(String resourceGroupName, + String accountName, String databaseName, String collectionName, + ThroughputSettingsUpdateParameters updateThroughputParameters) { + return updateMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, + updateThroughputParameters).block(); } /** - * Migrate an Azure Cosmos DB MongoDB database from autoscale to manual throughput. + * Update the RUs per second of an Azure Cosmos DB MongoDB collection. * * @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 collectionName Cosmos DB collection name. + * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB + * collection. * @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. @@ -2018,27 +2372,32 @@ public ThroughputSettingsGetResultsInner migrateMongoDBDatabaseToManualThroughpu * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner migrateMongoDBDatabaseToManualThroughput(String resourceGroupName, - String accountName, String databaseName, Context context) { - return migrateMongoDBDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName, context) - .block(); + public ThroughputSettingsGetResultsInner updateMongoDBCollectionThroughput(String resourceGroupName, + String accountName, String databaseName, String collectionName, + ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + return updateMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, + updateThroughputParameters, context).block(); } /** - * Lists the MongoDB collection under an existing Azure Cosmos DB database account. + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB 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 List operation response, that contains the MongoDB collections and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listMongoDBCollectionsSinglePageAsync(String resourceGroupName, String accountName, String databaseName) { + public Mono>> mongoDBContainerRetrieveThroughputDistributionWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + RetrieveThroughputParameters retrieveThroughputParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2057,32 +2416,44 @@ public ThroughputSettingsGetResultsInner migrateMongoDBDatabaseToManualThroughpu if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } + if (collectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); + } + if (retrieveThroughputParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter retrieveThroughputParameters is required and cannot be null.")); + } else { + retrieveThroughputParameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listMongoDBCollections(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)) + .withContext(context -> service.mongoDBContainerRetrieveThroughputDistribution(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, collectionName, contentType, accept, retrieveThroughputParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the MongoDB collection under an existing Azure Cosmos DB database account. + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB 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 List operation response, that contains the MongoDB collections and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listMongoDBCollectionsSinglePageAsync( - String resourceGroupName, String accountName, String databaseName, Context context) { + private Mono>> mongoDBContainerRetrieveThroughputDistributionWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + RetrieveThroughputParameters retrieveThroughputParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2101,257 +2472,242 @@ private Mono> listMongoDBCollect if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } + if (collectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); + } + if (retrieveThroughputParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter retrieveThroughputParameters is required and cannot be null.")); + } else { + retrieveThroughputParameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listMongoDBCollections(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)); + return service.mongoDBContainerRetrieveThroughputDistribution(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, + collectionName, contentType, accept, retrieveThroughputParameters, context); } /** - * Lists the MongoDB collection under an existing Azure Cosmos DB database account. + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB 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 List operation response, that contains the MongoDB collections and their properties as paginated - * response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMongoDBCollectionsAsync(String resourceGroupName, - String accountName, String databaseName) { - return new PagedFlux<>( - () -> listMongoDBCollectionsSinglePageAsync(resourceGroupName, accountName, databaseName)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBContainerRetrieveThroughputDistributionAsync(String resourceGroupName, String accountName, + String databaseName, String collectionName, RetrieveThroughputParameters retrieveThroughputParameters) { + Mono>> mono = mongoDBContainerRetrieveThroughputDistributionWithResponseAsync( + resourceGroupName, accountName, databaseName, collectionName, retrieveThroughputParameters); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, this.client.getContext()); } /** - * Lists the MongoDB collection under an existing Azure Cosmos DB database account. + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB 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 List operation response, that contains the MongoDB collections and their properties as paginated - * response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listMongoDBCollectionsAsync(String resourceGroupName, - String accountName, String databaseName, Context context) { - return new PagedFlux<>( - () -> listMongoDBCollectionsSinglePageAsync(resourceGroupName, accountName, databaseName, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBContainerRetrieveThroughputDistributionAsync(String resourceGroupName, String accountName, + String databaseName, String collectionName, RetrieveThroughputParameters retrieveThroughputParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = mongoDBContainerRetrieveThroughputDistributionWithResponseAsync( + resourceGroupName, accountName, databaseName, collectionName, retrieveThroughputParameters, context); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, context); } /** - * Lists the MongoDB collection under an existing Azure Cosmos DB database account. + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB 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 List operation response, that contains the MongoDB collections and their properties as paginated - * response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMongoDBCollections(String resourceGroupName, - String accountName, String databaseName) { - return new PagedIterable<>(listMongoDBCollectionsAsync(resourceGroupName, accountName, databaseName)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBContainerRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, String collectionName, RetrieveThroughputParameters retrieveThroughputParameters) { + return this + .beginMongoDBContainerRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + collectionName, retrieveThroughputParameters) + .getSyncPoller(); } /** - * Lists the MongoDB collection under an existing Azure Cosmos DB database account. + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB 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 List operation response, that contains the MongoDB collections and their properties as paginated - * response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMongoDBCollections(String resourceGroupName, - String accountName, String databaseName, Context context) { - return new PagedIterable<>(listMongoDBCollectionsAsync(resourceGroupName, accountName, databaseName, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBContainerRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, String collectionName, RetrieveThroughputParameters retrieveThroughputParameters, + Context context) { + return this + .beginMongoDBContainerRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + collectionName, retrieveThroughputParameters, context) + .getSyncPoller(); } /** - * Gets the MongoDB collection under an existing Azure Cosmos DB database account. + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB 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 MongoDB collection under an existing Azure Cosmos DB database account along with {@link Response} on - * successful completion of {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getMongoDBCollectionWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, String collectionName) { - 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 (collectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.getMongoDBCollection(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, collectionName, - this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + public Mono mongoDBContainerRetrieveThroughputDistributionAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + RetrieveThroughputParameters retrieveThroughputParameters) { + return beginMongoDBContainerRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + collectionName, retrieveThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Gets the MongoDB collection under an existing Azure Cosmos DB database account. + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB 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 MongoDB collection under an existing Azure Cosmos DB database account along with {@link Response} on - * successful completion of {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getMongoDBCollectionWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, String collectionName, 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 (collectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); - } - final String accept = "application/json"; - context = this.client.mergeContext(context); - return service.getMongoDBCollection(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, collectionName, this.client.getApiVersion(), accept, context); + private Mono mongoDBContainerRetrieveThroughputDistributionAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + RetrieveThroughputParameters retrieveThroughputParameters, Context context) { + return beginMongoDBContainerRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + collectionName, retrieveThroughputParameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Gets the MongoDB collection under an existing Azure Cosmos DB database account. + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB 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 MongoDB collection under an existing Azure Cosmos DB database account on successful completion of - * {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getMongoDBCollectionAsync(String resourceGroupName, - String accountName, String databaseName, String collectionName) { - return getMongoDBCollectionWithResponseAsync(resourceGroupName, accountName, databaseName, collectionName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public PhysicalPartitionThroughputInfoResultInner mongoDBContainerRetrieveThroughputDistribution( + String resourceGroupName, String accountName, String databaseName, String collectionName, + RetrieveThroughputParameters retrieveThroughputParameters) { + return mongoDBContainerRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + collectionName, retrieveThroughputParameters).block(); } /** - * Gets the MongoDB collection under an existing Azure Cosmos DB database account. + * Retrieve throughput distribution for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution for the + * current MongoDB 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 MongoDB collection under an existing Azure Cosmos DB database account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMongoDBCollectionWithResponse(String resourceGroupName, - String accountName, String databaseName, String collectionName, Context context) { - return getMongoDBCollectionWithResponseAsync(resourceGroupName, accountName, databaseName, collectionName, - context).block(); - } - - /** - * Gets the MongoDB collection 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 collectionName Cosmos DB collection 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 MongoDB collection under an existing Azure Cosmos DB database account. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MongoDBCollectionGetResultsInner getMongoDBCollection(String resourceGroupName, String accountName, - String databaseName, String collectionName) { - return getMongoDBCollectionWithResponse(resourceGroupName, accountName, databaseName, collectionName, - Context.NONE).getValue(); + public PhysicalPartitionThroughputInfoResultInner mongoDBContainerRetrieveThroughputDistribution( + String resourceGroupName, String accountName, String databaseName, String collectionName, + RetrieveThroughputParameters retrieveThroughputParameters, Context context) { + return mongoDBContainerRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + collectionName, retrieveThroughputParameters, context).block(); } /** - * Create or update an Azure Cosmos DB MongoDB Collection. + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. - * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB 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 MongoDB collection along with {@link Response} on successful completion of - * {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createUpdateMongoDBCollectionWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String collectionName, - MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) { + public Mono>> mongoDBContainerRedistributeThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + RedistributeThroughputParameters redistributeThroughputParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2373,39 +2729,41 @@ public Mono>> createUpdateMongoDBCollectionWithRespons if (collectionName == null) { return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); } - if (createUpdateMongoDBCollectionParameters == null) { + if (redistributeThroughputParameters == null) { return Mono.error(new IllegalArgumentException( - "Parameter createUpdateMongoDBCollectionParameters is required and cannot be null.")); + "Parameter redistributeThroughputParameters is required and cannot be null.")); } else { - createUpdateMongoDBCollectionParameters.validate(); + redistributeThroughputParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createUpdateMongoDBCollection(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, collectionName, - this.client.getApiVersion(), createUpdateMongoDBCollectionParameters, accept, context)) + .withContext(context -> service.mongoDBContainerRedistributeThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, collectionName, contentType, accept, redistributeThroughputParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or update an Azure Cosmos DB MongoDB Collection. + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. - * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB 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 MongoDB collection along with {@link Response} on successful completion of - * {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createUpdateMongoDBCollectionWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String collectionName, - MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, Context context) { + private Mono>> mongoDBContainerRedistributeThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2427,206 +2785,222 @@ private Mono>> createUpdateMongoDBCollectionWithRespon if (collectionName == null) { return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); } - if (createUpdateMongoDBCollectionParameters == null) { + if (redistributeThroughputParameters == null) { return Mono.error(new IllegalArgumentException( - "Parameter createUpdateMongoDBCollectionParameters is required and cannot be null.")); + "Parameter redistributeThroughputParameters is required and cannot be null.")); } else { - createUpdateMongoDBCollectionParameters.validate(); + redistributeThroughputParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createUpdateMongoDBCollection(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, collectionName, this.client.getApiVersion(), - createUpdateMongoDBCollectionParameters, accept, context); + return service.mongoDBContainerRedistributeThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, collectionName, contentType, + accept, redistributeThroughputParameters, context); } /** - * Create or update an Azure Cosmos DB MongoDB Collection. + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. - * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB 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 MongoDB collection. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, MongoDBCollectionGetResultsInner> - beginCreateUpdateMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, - String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) { - Mono>> mono = createUpdateMongoDBCollectionWithResponseAsync(resourceGroupName, - accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), MongoDBCollectionGetResultsInner.class, - MongoDBCollectionGetResultsInner.class, this.client.getContext()); + public + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBContainerRedistributeThroughputAsync(String resourceGroupName, String accountName, + String databaseName, String collectionName, + RedistributeThroughputParameters redistributeThroughputParameters) { + Mono>> mono = mongoDBContainerRedistributeThroughputWithResponseAsync( + resourceGroupName, accountName, databaseName, collectionName, redistributeThroughputParameters); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, this.client.getContext()); } /** - * Create or update an Azure Cosmos DB MongoDB Collection. + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. - * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB 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 MongoDB collection. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, MongoDBCollectionGetResultsInner> - beginCreateUpdateMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, - String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, - Context context) { + private + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBContainerRedistributeThroughputAsync(String resourceGroupName, String accountName, + String databaseName, String collectionName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context) { context = this.client.mergeContext(context); - Mono>> mono = createUpdateMongoDBCollectionWithResponseAsync(resourceGroupName, - accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), MongoDBCollectionGetResultsInner.class, - MongoDBCollectionGetResultsInner.class, context); + Mono>> mono = mongoDBContainerRedistributeThroughputWithResponseAsync( + resourceGroupName, accountName, databaseName, collectionName, redistributeThroughputParameters, context); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, context); } /** - * Create or update an Azure Cosmos DB MongoDB Collection. + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. - * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB 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 MongoDB collection. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, MongoDBCollectionGetResultsInner> - beginCreateUpdateMongoDBCollection(String resourceGroupName, String accountName, String databaseName, - String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) { + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBContainerRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + String collectionName, RedistributeThroughputParameters redistributeThroughputParameters) { return this - .beginCreateUpdateMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName, - createUpdateMongoDBCollectionParameters) + .beginMongoDBContainerRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + collectionName, redistributeThroughputParameters) .getSyncPoller(); } /** - * Create or update an Azure Cosmos DB MongoDB Collection. + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. - * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB 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 MongoDB collection. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, MongoDBCollectionGetResultsInner> - beginCreateUpdateMongoDBCollection(String resourceGroupName, String accountName, String databaseName, - String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, - Context context) { + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginMongoDBContainerRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + String collectionName, RedistributeThroughputParameters redistributeThroughputParameters, Context context) { return this - .beginCreateUpdateMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName, - createUpdateMongoDBCollectionParameters, context) + .beginMongoDBContainerRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + collectionName, redistributeThroughputParameters, context) .getSyncPoller(); } /** - * Create or update an Azure Cosmos DB MongoDB Collection. + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. - * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB 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 MongoDB collection on successful completion of {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createUpdateMongoDBCollectionAsync(String resourceGroupName, - String accountName, String databaseName, String collectionName, - MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) { - return beginCreateUpdateMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName, - createUpdateMongoDBCollectionParameters).last().flatMap(this.client::getLroFinalResultOrError); + public Mono mongoDBContainerRedistributeThroughputAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + RedistributeThroughputParameters redistributeThroughputParameters) { + return beginMongoDBContainerRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + collectionName, redistributeThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Create or update an Azure Cosmos DB MongoDB Collection. + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. - * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB 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 MongoDB collection on successful completion of {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createUpdateMongoDBCollectionAsync(String resourceGroupName, - String accountName, String databaseName, String collectionName, - MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, Context context) { - return beginCreateUpdateMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName, - createUpdateMongoDBCollectionParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono mongoDBContainerRedistributeThroughputAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context) { + return beginMongoDBContainerRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + collectionName, redistributeThroughputParameters, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Create or update an Azure Cosmos DB MongoDB Collection. + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. - * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB 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 MongoDB collection. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MongoDBCollectionGetResultsInner createUpdateMongoDBCollection(String resourceGroupName, String accountName, - String databaseName, String collectionName, - MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) { - return createUpdateMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName, - createUpdateMongoDBCollectionParameters).block(); + public PhysicalPartitionThroughputInfoResultInner mongoDBContainerRedistributeThroughput(String resourceGroupName, + String accountName, String databaseName, String collectionName, + RedistributeThroughputParameters redistributeThroughputParameters) { + return mongoDBContainerRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, + redistributeThroughputParameters).block(); } /** - * Create or update an Azure Cosmos DB MongoDB Collection. + * Redistribute throughput for an Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. - * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput for the current + * MongoDB 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 MongoDB collection. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MongoDBCollectionGetResultsInner createUpdateMongoDBCollection(String resourceGroupName, String accountName, - String databaseName, String collectionName, - MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, Context context) { - return createUpdateMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName, - createUpdateMongoDBCollectionParameters, context).block(); + public PhysicalPartitionThroughputInfoResultInner mongoDBContainerRedistributeThroughput(String resourceGroupName, + String accountName, String databaseName, String collectionName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context) { + return mongoDBContainerRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, + redistributeThroughputParameters, context).block(); } /** - * Deletes an existing Azure Cosmos DB MongoDB Collection. + * Migrate an Azure Cosmos DB MongoDB collection 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. @@ -2635,11 +3009,12 @@ public MongoDBCollectionGetResultsInner createUpdateMongoDBCollection(String res * @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}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteMongoDBCollectionWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String collectionName) { + public Mono>> migrateMongoDBCollectionToAutoscaleWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2661,15 +3036,16 @@ public Mono>> deleteMongoDBCollectionWithResponseAsync if (collectionName == null) { return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); } + final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.deleteMongoDBCollection(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, collectionName, this.client.getApiVersion(), context)) + .withContext(context -> service.migrateMongoDBCollectionToAutoscale(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, collectionName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes an existing Azure Cosmos DB MongoDB Collection. + * Migrate an Azure Cosmos DB MongoDB collection 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. @@ -2679,11 +3055,12 @@ public Mono>> deleteMongoDBCollectionWithResponseAsync * @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}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteMongoDBCollectionWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String collectionName, Context context) { + private Mono>> migrateMongoDBCollectionToAutoscaleWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2705,13 +3082,15 @@ private Mono>> deleteMongoDBCollectionWithResponseAsyn if (collectionName == null) { return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); } + final String accept = "application/json"; context = this.client.mergeContext(context); - return service.deleteMongoDBCollection(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, collectionName, this.client.getApiVersion(), context); + return service.migrateMongoDBCollectionToAutoscale(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, collectionName, accept, + context); } /** - * Deletes an existing Azure Cosmos DB MongoDB Collection. + * Migrate an Azure Cosmos DB MongoDB collection 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. @@ -2720,19 +3099,21 @@ private Mono>> deleteMongoDBCollectionWithResponseAsyn * @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. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteMongoDBCollectionAsync(String resourceGroupName, - String accountName, String databaseName, String collectionName) { - Mono>> mono - = deleteMongoDBCollectionWithResponseAsync(resourceGroupName, accountName, databaseName, collectionName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + public PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateMongoDBCollectionToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, + String collectionName) { + Mono>> mono = migrateMongoDBCollectionToAutoscaleWithResponseAsync(resourceGroupName, + accountName, databaseName, collectionName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, this.client.getContext()); } /** - * Deletes an existing Azure Cosmos DB MongoDB Collection. + * Migrate an Azure Cosmos DB MongoDB collection 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. @@ -2742,20 +3123,22 @@ public PollerFlux, Void> beginDeleteMongoDBCollectionAsync(Stri * @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. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteMongoDBCollectionAsync(String resourceGroupName, - String accountName, String databaseName, String collectionName, Context context) { + private PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateMongoDBCollectionToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, + String collectionName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = deleteMongoDBCollectionWithResponseAsync(resourceGroupName, accountName, - databaseName, collectionName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + Mono>> mono = migrateMongoDBCollectionToAutoscaleWithResponseAsync(resourceGroupName, + accountName, databaseName, collectionName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, context); } /** - * Deletes an existing Azure Cosmos DB MongoDB Collection. + * Migrate an Azure Cosmos DB MongoDB collection 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. @@ -2764,17 +3147,19 @@ private PollerFlux, Void> beginDeleteMongoDBCollectionAsync(Str * @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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteMongoDBCollection(String resourceGroupName, String accountName, - String databaseName, String collectionName) { - return this.beginDeleteMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName) + public SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateMongoDBCollectionToAutoscale(String resourceGroupName, String accountName, String databaseName, + String collectionName) { + return this + .beginMigrateMongoDBCollectionToAutoscaleAsync(resourceGroupName, accountName, databaseName, collectionName) .getSyncPoller(); } /** - * Deletes an existing Azure Cosmos DB MongoDB Collection. + * Migrate an Azure Cosmos DB MongoDB collection 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. @@ -2784,18 +3169,20 @@ public SyncPoller, Void> beginDeleteMongoDBCollection(String re * @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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteMongoDBCollection(String resourceGroupName, String accountName, - String databaseName, String collectionName, Context context) { + public SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateMongoDBCollectionToAutoscale(String resourceGroupName, String accountName, String databaseName, + String collectionName, Context context) { return this - .beginDeleteMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName, context) + .beginMigrateMongoDBCollectionToAutoscaleAsync(resourceGroupName, accountName, databaseName, collectionName, + context) .getSyncPoller(); } /** - * Deletes an existing Azure Cosmos DB MongoDB Collection. + * Migrate an Azure Cosmos DB MongoDB collection 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. @@ -2804,17 +3191,17 @@ public SyncPoller, Void> beginDeleteMongoDBCollection(String re * @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. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, - String collectionName) { - return beginDeleteMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName).last() - .flatMap(this.client::getLroFinalResultOrError); + public Mono migrateMongoDBCollectionToAutoscaleAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName) { + return beginMigrateMongoDBCollectionToAutoscaleAsync(resourceGroupName, accountName, databaseName, + collectionName).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes an existing Azure Cosmos DB MongoDB Collection. + * Migrate an Azure Cosmos DB MongoDB collection 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. @@ -2824,18 +3211,17 @@ public Mono deleteMongoDBCollectionAsync(String resourceGroupName, String * @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. + * @return an Azure Cosmos DB resource throughput on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, - String collectionName, Context context) { - return beginDeleteMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono migrateMongoDBCollectionToAutoscaleAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName, Context context) { + return beginMigrateMongoDBCollectionToAutoscaleAsync(resourceGroupName, accountName, databaseName, + collectionName, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes an existing Azure Cosmos DB MongoDB Collection. + * Migrate an Azure Cosmos DB MongoDB collection 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. @@ -2844,15 +3230,17 @@ private Mono deleteMongoDBCollectionAsync(String resourceGroupName, String * @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 void deleteMongoDBCollection(String resourceGroupName, String accountName, String databaseName, - String collectionName) { - deleteMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName).block(); + public ThroughputSettingsGetResultsInner migrateMongoDBCollectionToAutoscale(String resourceGroupName, + String accountName, String databaseName, String collectionName) { + return migrateMongoDBCollectionToAutoscaleAsync(resourceGroupName, accountName, databaseName, collectionName) + .block(); } /** - * Deletes an existing Azure Cosmos DB MongoDB Collection. + * Migrate an Azure Cosmos DB MongoDB collection 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. @@ -2862,16 +3250,17 @@ public void deleteMongoDBCollection(String resourceGroupName, String accountName * @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 void deleteMongoDBCollection(String resourceGroupName, String accountName, String databaseName, - String collectionName, Context context) { - deleteMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName, context).block(); + public ThroughputSettingsGetResultsInner migrateMongoDBCollectionToAutoscale(String resourceGroupName, + String accountName, String databaseName, String collectionName, Context context) { + return migrateMongoDBCollectionToAutoscaleAsync(resourceGroupName, accountName, databaseName, collectionName, + context).block(); } /** - * Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the - * provided name. + * Migrate an Azure Cosmos DB MongoDB collection 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. @@ -2880,11 +3269,11 @@ public void deleteMongoDBCollection(String resourceGroupName, String accountName * @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 MongoDB collection under an existing Azure Cosmos DB database account with the - * provided name along with {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getMongoDBCollectionThroughputWithResponseAsync( + public Mono>> migrateMongoDBCollectionToManualThroughputWithResponseAsync( String resourceGroupName, String accountName, String databaseName, String collectionName) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -2909,15 +3298,14 @@ public Mono> getMongoDBCollectionThr } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getMongoDBCollectionThroughput(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, collectionName, - this.client.getApiVersion(), accept, context)) + .withContext(context -> service.migrateMongoDBCollectionToManualThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, collectionName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the - * provided name. + * Migrate an Azure Cosmos DB MongoDB collection 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. @@ -2927,11 +3315,11 @@ public Mono> getMongoDBCollectionThr * @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 MongoDB collection under an existing Azure Cosmos DB database account with the - * provided name along with {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getMongoDBCollectionThroughputWithResponseAsync( + private Mono>> migrateMongoDBCollectionToManualThroughputWithResponseAsync( String resourceGroupName, String accountName, String databaseName, String collectionName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -2956,13 +3344,13 @@ private Mono> getMongoDBCollectionTh } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getMongoDBCollectionThroughput(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, collectionName, this.client.getApiVersion(), accept, context); + return service.migrateMongoDBCollectionToManualThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, + collectionName, accept, context); } /** - * Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the - * provided name. + * Migrate an Azure Cosmos DB MongoDB collection 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. @@ -2971,19 +3359,21 @@ private Mono> getMongoDBCollectionTh * @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 MongoDB collection under an existing Azure Cosmos DB database account with the - * provided name on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getMongoDBCollectionThroughputAsync(String resourceGroupName, - String accountName, String databaseName, String collectionName) { - return getMongoDBCollectionThroughputWithResponseAsync(resourceGroupName, accountName, databaseName, - collectionName).flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateMongoDBCollectionToManualThroughputAsync(String resourceGroupName, String accountName, + String databaseName, String collectionName) { + Mono>> mono = migrateMongoDBCollectionToManualThroughputWithResponseAsync( + resourceGroupName, accountName, databaseName, collectionName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, this.client.getContext()); } /** - * Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the - * provided name. + * Migrate an Azure Cosmos DB MongoDB collection 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. @@ -2993,19 +3383,22 @@ public Mono getMongoDBCollectionThroughputAsy * @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 MongoDB collection under an existing Azure Cosmos DB database account with the - * provided name along with {@link Response}. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMongoDBCollectionThroughputWithResponse( - String resourceGroupName, String accountName, String databaseName, String collectionName, Context context) { - return getMongoDBCollectionThroughputWithResponseAsync(resourceGroupName, accountName, databaseName, - collectionName, context).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateMongoDBCollectionToManualThroughputAsync(String resourceGroupName, String accountName, + String databaseName, String collectionName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = migrateMongoDBCollectionToManualThroughputWithResponseAsync( + resourceGroupName, accountName, databaseName, collectionName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, context); } /** - * Gets the RUs per second of the MongoDB collection under an existing Azure Cosmos DB database account with the - * provided name. + * Migrate an Azure Cosmos DB MongoDB collection 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. @@ -3014,35 +3407,134 @@ public Response getMongoDBCollectionThroughpu * @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 MongoDB collection under an existing Azure Cosmos DB database account with the - * provided name. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner getMongoDBCollectionThroughput(String resourceGroupName, - String accountName, String databaseName, String collectionName) { - return getMongoDBCollectionThroughputWithResponse(resourceGroupName, accountName, databaseName, collectionName, - Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateMongoDBCollectionToManualThroughput(String resourceGroupName, String accountName, + String databaseName, String collectionName) { + return this + .beginMigrateMongoDBCollectionToManualThroughputAsync(resourceGroupName, accountName, databaseName, + collectionName) + .getSyncPoller(); } /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * Migrate an Azure Cosmos DB MongoDB collection 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 collectionName Cosmos DB collection name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB - * collection. + * @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}. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateMongoDBCollectionToManualThroughput(String resourceGroupName, String accountName, + String databaseName, String collectionName, Context context) { + return this + .beginMigrateMongoDBCollectionToManualThroughputAsync(resourceGroupName, accountName, databaseName, + collectionName, context) + .getSyncPoller(); + } + + /** + * Migrate an Azure Cosmos DB MongoDB collection 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 collectionName Cosmos DB collection 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>> updateMongoDBCollectionThroughputWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String collectionName, - ThroughputSettingsUpdateParameters updateThroughputParameters) { + public Mono migrateMongoDBCollectionToManualThroughputAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName) { + return beginMigrateMongoDBCollectionToManualThroughputAsync(resourceGroupName, accountName, databaseName, + collectionName).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Migrate an Azure Cosmos DB MongoDB collection 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 collectionName Cosmos DB collection 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 migrateMongoDBCollectionToManualThroughputAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, Context context) { + return beginMigrateMongoDBCollectionToManualThroughputAsync(resourceGroupName, accountName, databaseName, + collectionName, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Migrate an Azure Cosmos DB MongoDB collection 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 collectionName Cosmos DB collection 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 migrateMongoDBCollectionToManualThroughput(String resourceGroupName, + String accountName, String databaseName, String collectionName) { + return migrateMongoDBCollectionToManualThroughputAsync(resourceGroupName, accountName, databaseName, + collectionName).block(); + } + + /** + * Migrate an Azure Cosmos DB MongoDB collection 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 collectionName Cosmos DB collection 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 migrateMongoDBCollectionToManualThroughput(String resourceGroupName, + String accountName, String databaseName, String collectionName, Context context) { + return migrateMongoDBCollectionToManualThroughputAsync(resourceGroupName, accountName, databaseName, + collectionName, context).block(); + } + + /** + * Gets the MongoDB databases 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 MongoDB databases 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> getMongoDBDatabaseWithResponseAsync(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.")); @@ -3061,43 +3553,29 @@ public Mono>> updateMongoDBCollectionThroughputWithRes if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - if (collectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter collectionName 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.updateMongoDBCollectionThroughput(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, collectionName, - this.client.getApiVersion(), updateThroughputParameters, accept, context)) + .withContext(context -> service.getMongoDBDatabase(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * Gets the MongoDB databases 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 collectionName Cosmos DB collection name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB - * collection. * @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}. + * @return the MongoDB databases 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>> updateMongoDBCollectionThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, String collectionName, - ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + private Mono> getMongoDBDatabaseWithResponseAsync(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.")); @@ -3116,229 +3594,133 @@ private Mono>> updateMongoDBCollectionThroughputWithRe if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - if (collectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter collectionName 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.updateMongoDBCollectionThroughput(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, collectionName, this.client.getApiVersion(), - updateThroughputParameters, accept, context); + return service.getMongoDBDatabase(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, accept, context); } /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * Gets the MongoDB databases 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 collectionName Cosmos DB collection name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB - * collection. * @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. + * @return the MongoDB databases under an existing Azure Cosmos DB database account with the provided name on + * successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, ThroughputSettingsGetResultsInner> - beginUpdateMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, - String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - Mono>> mono = updateMongoDBCollectionThroughputWithResponseAsync(resourceGroupName, - accountName, databaseName, collectionName, updateThroughputParameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getMongoDBDatabaseAsync(String resourceGroupName, String accountName, + String databaseName) { + return getMongoDBDatabaseWithResponseAsync(resourceGroupName, accountName, databaseName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * Gets the MongoDB databases 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 collectionName Cosmos DB collection name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB - * collection. * @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> - beginUpdateMongoDBCollectionThroughputAsync(String resourceGroupName, String accountName, String databaseName, - String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = updateMongoDBCollectionThroughputWithResponseAsync(resourceGroupName, - accountName, databaseName, collectionName, updateThroughputParameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, context); - } - - /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. - * - * @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 collectionName Cosmos DB collection name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB - * collection. - * @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. + * @return the MongoDB databases under an existing Azure Cosmos DB database account with the provided name along + * with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateMongoDBCollectionThroughput(String resourceGroupName, String accountName, String databaseName, - String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return this - .beginUpdateMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, - updateThroughputParameters) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getMongoDBDatabaseWithResponse(String resourceGroupName, + String accountName, String databaseName, Context context) { + return getMongoDBDatabaseWithResponseAsync(resourceGroupName, accountName, databaseName, context).block(); } /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * Gets the MongoDB databases 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 collectionName Cosmos DB collection name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB - * collection. - * @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. + * @return the MongoDB databases under an existing Azure Cosmos DB database account with the provided name. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateMongoDBCollectionThroughput(String resourceGroupName, String accountName, String databaseName, - String collectionName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { - return this - .beginUpdateMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, - updateThroughputParameters, context) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public MongoDBDatabaseGetResultsInner getMongoDBDatabase(String resourceGroupName, String accountName, + String databaseName) { + return getMongoDBDatabaseWithResponse(resourceGroupName, accountName, databaseName, Context.NONE).getValue(); } /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * Create or updates Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB - * collection. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB 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}. + * @return an Azure Cosmos DB MongoDB database along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateMongoDBCollectionThroughputAsync(String resourceGroupName, - String accountName, String databaseName, String collectionName, - ThroughputSettingsUpdateParameters updateThroughputParameters) { - return beginUpdateMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, - updateThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); + public Mono>> createUpdateMongoDBDatabaseWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, + MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters) { + 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 (createUpdateMongoDBDatabaseParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateMongoDBDatabaseParameters is required and cannot be null.")); + } else { + createUpdateMongoDBDatabaseParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createUpdateMongoDBDatabase(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, contentType, accept, createUpdateMongoDBDatabaseParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. + * Create or updates Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB - * collection. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB 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}. + * @return an Azure Cosmos DB MongoDB database along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateMongoDBCollectionThroughputAsync(String resourceGroupName, - String accountName, String databaseName, String collectionName, - ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { - return beginUpdateMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, - updateThroughputParameters, context).last().flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. - * - * @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 collectionName Cosmos DB collection name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB - * collection. - * @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 updateMongoDBCollectionThroughput(String resourceGroupName, - String accountName, String databaseName, String collectionName, - ThroughputSettingsUpdateParameters updateThroughputParameters) { - return updateMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, - updateThroughputParameters).block(); - } - - /** - * Update the RUs per second of an Azure Cosmos DB MongoDB collection. - * - * @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 collectionName Cosmos DB collection name. - * @param updateThroughputParameters The RUs per second of the parameters to provide for the current MongoDB - * collection. - * @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 updateMongoDBCollectionThroughput(String resourceGroupName, - String accountName, String databaseName, String collectionName, - ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { - return updateMongoDBCollectionThroughputAsync(resourceGroupName, accountName, databaseName, collectionName, - updateThroughputParameters, context).block(); - } - - /** - * Migrate an Azure Cosmos DB MongoDB collection 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 collectionName Cosmos DB collection 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>> migrateMongoDBCollectionToAutoscaleWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, String collectionName) { + private Mono>> createUpdateMongoDBDatabaseWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, + MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -3357,247 +3739,208 @@ public Mono>> migrateMongoDBCollectionToAutoscaleWithR if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - if (collectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); - } - final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.migrateMongoDBCollectionToAutoscale(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, collectionName, - this.client.getApiVersion(), accept, context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); - } - - /** - * Migrate an Azure Cosmos DB MongoDB collection 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 collectionName Cosmos DB collection 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>> migrateMongoDBCollectionToAutoscaleWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, String collectionName, 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) { + if (createUpdateMongoDBDatabaseParameters == 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 (collectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); + "Parameter createUpdateMongoDBDatabaseParameters is required and cannot be null.")); + } else { + createUpdateMongoDBDatabaseParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.migrateMongoDBCollectionToAutoscale(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, collectionName, this.client.getApiVersion(), accept, context); + return service.createUpdateMongoDBDatabase(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, contentType, accept, + createUpdateMongoDBDatabaseParameters, context); } /** - * Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale. + * Create or updates Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB 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. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB MongoDB database. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateMongoDBCollectionToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, - String collectionName) { - Mono>> mono = migrateMongoDBCollectionToAutoscaleWithResponseAsync(resourceGroupName, - accountName, databaseName, collectionName); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, this.client.getContext()); + public PollerFlux, MongoDBDatabaseGetResultsInner> + beginCreateUpdateMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, + MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters) { + Mono>> mono = createUpdateMongoDBDatabaseWithResponseAsync(resourceGroupName, + accountName, databaseName, createUpdateMongoDBDatabaseParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), MongoDBDatabaseGetResultsInner.class, MongoDBDatabaseGetResultsInner.class, + this.client.getContext()); } /** - * Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale. + * Create or updates Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB 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. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB MongoDB database. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateMongoDBCollectionToAutoscaleAsync(String resourceGroupName, String accountName, String databaseName, - String collectionName, Context context) { + private PollerFlux, MongoDBDatabaseGetResultsInner> + beginCreateUpdateMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, + MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters, Context context) { context = this.client.mergeContext(context); - Mono>> mono = migrateMongoDBCollectionToAutoscaleWithResponseAsync(resourceGroupName, - accountName, databaseName, collectionName, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, context); + Mono>> mono = createUpdateMongoDBDatabaseWithResponseAsync(resourceGroupName, + accountName, databaseName, createUpdateMongoDBDatabaseParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), MongoDBDatabaseGetResultsInner.class, MongoDBDatabaseGetResultsInner.class, + context); } /** - * Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale. + * Create or updates Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB 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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB MongoDB database. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateMongoDBCollectionToAutoscale(String resourceGroupName, String accountName, String databaseName, - String collectionName) { + public SyncPoller, MongoDBDatabaseGetResultsInner> + beginCreateUpdateMongoDBDatabase(String resourceGroupName, String accountName, String databaseName, + MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters) { return this - .beginMigrateMongoDBCollectionToAutoscaleAsync(resourceGroupName, accountName, databaseName, collectionName) + .beginCreateUpdateMongoDBDatabaseAsync(resourceGroupName, accountName, databaseName, + createUpdateMongoDBDatabaseParameters) .getSyncPoller(); } /** - * Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale. + * Create or updates Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB 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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB MongoDB database. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateMongoDBCollectionToAutoscale(String resourceGroupName, String accountName, String databaseName, - String collectionName, Context context) { + public SyncPoller, MongoDBDatabaseGetResultsInner> + beginCreateUpdateMongoDBDatabase(String resourceGroupName, String accountName, String databaseName, + MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters, Context context) { return this - .beginMigrateMongoDBCollectionToAutoscaleAsync(resourceGroupName, accountName, databaseName, collectionName, - context) + .beginCreateUpdateMongoDBDatabaseAsync(resourceGroupName, accountName, databaseName, + createUpdateMongoDBDatabaseParameters, context) .getSyncPoller(); } /** - * Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale. + * Create or updates Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB 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}. + * @return an Azure Cosmos DB MongoDB database on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono migrateMongoDBCollectionToAutoscaleAsync(String resourceGroupName, - String accountName, String databaseName, String collectionName) { - return beginMigrateMongoDBCollectionToAutoscaleAsync(resourceGroupName, accountName, databaseName, - collectionName).last().flatMap(this.client::getLroFinalResultOrError); + public Mono createUpdateMongoDBDatabaseAsync(String resourceGroupName, + String accountName, String databaseName, + MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters) { + return beginCreateUpdateMongoDBDatabaseAsync(resourceGroupName, accountName, databaseName, + createUpdateMongoDBDatabaseParameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale. + * Create or updates Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB 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}. + * @return an Azure Cosmos DB MongoDB database on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono migrateMongoDBCollectionToAutoscaleAsync(String resourceGroupName, - String accountName, String databaseName, String collectionName, Context context) { - return beginMigrateMongoDBCollectionToAutoscaleAsync(resourceGroupName, accountName, databaseName, - collectionName, context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono createUpdateMongoDBDatabaseAsync(String resourceGroupName, + String accountName, String databaseName, + MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters, Context context) { + return beginCreateUpdateMongoDBDatabaseAsync(resourceGroupName, accountName, databaseName, + createUpdateMongoDBDatabaseParameters, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale. + * Create or updates Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB 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. + * @return an Azure Cosmos DB MongoDB database. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner migrateMongoDBCollectionToAutoscale(String resourceGroupName, - String accountName, String databaseName, String collectionName) { - return migrateMongoDBCollectionToAutoscaleAsync(resourceGroupName, accountName, databaseName, collectionName) - .block(); + public MongoDBDatabaseGetResultsInner createUpdateMongoDBDatabase(String resourceGroupName, String accountName, + String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters) { + return createUpdateMongoDBDatabaseAsync(resourceGroupName, accountName, databaseName, + createUpdateMongoDBDatabaseParameters).block(); } /** - * Migrate an Azure Cosmos DB MongoDB collection from manual throughput to autoscale. + * Create or updates Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection name. + * @param createUpdateMongoDBDatabaseParameters The parameters to provide for the current MongoDB 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. + * @return an Azure Cosmos DB MongoDB database. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner migrateMongoDBCollectionToAutoscale(String resourceGroupName, - String accountName, String databaseName, String collectionName, Context context) { - return migrateMongoDBCollectionToAutoscaleAsync(resourceGroupName, accountName, databaseName, collectionName, - context).block(); + public MongoDBDatabaseGetResultsInner createUpdateMongoDBDatabase(String resourceGroupName, String accountName, + String databaseName, MongoDBDatabaseCreateUpdateParameters createUpdateMongoDBDatabaseParameters, + Context context) { + return createUpdateMongoDBDatabaseAsync(resourceGroupName, accountName, databaseName, + createUpdateMongoDBDatabaseParameters, context).block(); } /** - * Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection 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}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> migrateMongoDBCollectionToManualThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, String collectionName) { + public Mono>> deleteMongoDBDatabaseWithResponseAsync(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.")); @@ -3616,34 +3959,28 @@ public Mono>> migrateMongoDBCollectionToManualThroughp if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - if (collectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); - } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.migrateMongoDBCollectionToManualThroughput(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, collectionName, - this.client.getApiVersion(), accept, context)) + .withContext( + context -> service.deleteMongoDBDatabase(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection 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}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> migrateMongoDBCollectionToManualThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, String collectionName, Context context) { + private Mono>> deleteMongoDBDatabaseWithResponseAsync(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.")); @@ -3662,210 +3999,175 @@ private Mono>> migrateMongoDBCollectionToManualThrough if (databaseName == null) { return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); } - if (collectionName == null) { - return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); - } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.migrateMongoDBCollectionToManualThroughput(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, collectionName, - this.client.getApiVersion(), accept, context); + return service.deleteMongoDBDatabase(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, context); } /** - * Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection 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. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateMongoDBCollectionToManualThroughputAsync(String resourceGroupName, String accountName, - String databaseName, String collectionName) { - Mono>> mono = migrateMongoDBCollectionToManualThroughputWithResponseAsync( - resourceGroupName, accountName, databaseName, collectionName); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, this.client.getContext()); + public PollerFlux, Void> beginDeleteMongoDBDatabaseAsync(String resourceGroupName, + String accountName, String databaseName) { + Mono>> mono + = deleteMongoDBDatabaseWithResponseAsync(resourceGroupName, accountName, databaseName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection 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. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateMongoDBCollectionToManualThroughputAsync(String resourceGroupName, String accountName, - String databaseName, String collectionName, Context context) { + private PollerFlux, Void> beginDeleteMongoDBDatabaseAsync(String resourceGroupName, + String accountName, String databaseName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = migrateMongoDBCollectionToManualThroughputWithResponseAsync( - resourceGroupName, accountName, databaseName, collectionName, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, context); + Mono>> mono + = deleteMongoDBDatabaseWithResponseAsync(resourceGroupName, accountName, databaseName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** - * Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection 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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateMongoDBCollectionToManualThroughput(String resourceGroupName, String accountName, - String databaseName, String collectionName) { - return this - .beginMigrateMongoDBCollectionToManualThroughputAsync(resourceGroupName, accountName, databaseName, - collectionName) - .getSyncPoller(); + public SyncPoller, Void> beginDeleteMongoDBDatabase(String resourceGroupName, String accountName, + String databaseName) { + return this.beginDeleteMongoDBDatabaseAsync(resourceGroupName, accountName, databaseName).getSyncPoller(); } /** - * Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection 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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateMongoDBCollectionToManualThroughput(String resourceGroupName, String accountName, - String databaseName, String collectionName, Context context) { - return this - .beginMigrateMongoDBCollectionToManualThroughputAsync(resourceGroupName, accountName, databaseName, - collectionName, context) + public SyncPoller, Void> beginDeleteMongoDBDatabase(String resourceGroupName, String accountName, + String databaseName, Context context) { + return this.beginDeleteMongoDBDatabaseAsync(resourceGroupName, accountName, databaseName, context) .getSyncPoller(); } /** - * Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection 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}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono migrateMongoDBCollectionToManualThroughputAsync( - String resourceGroupName, String accountName, String databaseName, String collectionName) { - return beginMigrateMongoDBCollectionToManualThroughputAsync(resourceGroupName, accountName, databaseName, - collectionName).last().flatMap(this.client::getLroFinalResultOrError); + public Mono deleteMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName) { + return beginDeleteMongoDBDatabaseAsync(resourceGroupName, accountName, databaseName).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection 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}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono migrateMongoDBCollectionToManualThroughputAsync( - String resourceGroupName, String accountName, String databaseName, String collectionName, Context context) { - return beginMigrateMongoDBCollectionToManualThroughputAsync(resourceGroupName, accountName, databaseName, - collectionName, context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono deleteMongoDBDatabaseAsync(String resourceGroupName, String accountName, String databaseName, + Context context) { + return beginDeleteMongoDBDatabaseAsync(resourceGroupName, accountName, databaseName, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection 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 migrateMongoDBCollectionToManualThroughput(String resourceGroupName, - String accountName, String databaseName, String collectionName) { - return migrateMongoDBCollectionToManualThroughputAsync(resourceGroupName, accountName, databaseName, - collectionName).block(); + public void deleteMongoDBDatabase(String resourceGroupName, String accountName, String databaseName) { + deleteMongoDBDatabaseAsync(resourceGroupName, accountName, databaseName).block(); } /** - * Migrate an Azure Cosmos DB MongoDB collection from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB MongoDB 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 collectionName Cosmos DB collection 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 migrateMongoDBCollectionToManualThroughput(String resourceGroupName, - String accountName, String databaseName, String collectionName, Context context) { - return migrateMongoDBCollectionToManualThroughputAsync(resourceGroupName, accountName, databaseName, - collectionName, context).block(); + public void deleteMongoDBDatabase(String resourceGroupName, String accountName, String databaseName, + Context context) { + deleteMongoDBDatabaseAsync(resourceGroupName, accountName, databaseName, context).block(); } /** - * Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. + * Lists the MongoDB databases under an existing Azure Cosmos DB database account. * - * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. * @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 an Azure Cosmos DB Mongo Role Definition along with {@link Response} on successful completion of - * {@link Mono}. + * @return the List operation response, that contains the MongoDB databases and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getMongoRoleDefinitionWithResponseAsync( - String mongoRoleDefinitionId, String resourceGroupName, String accountName) { + private Mono> + listMongoDBDatabasesSinglePageAsync(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 (mongoRoleDefinitionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter mongoRoleDefinitionId 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.")); @@ -3879,36 +4181,32 @@ public Mono> getMongoRoleDefinition } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getMongoRoleDefinition(this.client.getEndpoint(), mongoRoleDefinitionId, - this.client.getSubscriptionId(), resourceGroupName, accountName, this.client.getApiVersion(), accept, - context)) + .withContext(context -> service.listMongoDBDatabases(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. + * Lists the MongoDB databases under an existing Azure Cosmos DB database account. * - * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. * @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 an Azure Cosmos DB Mongo Role Definition along with {@link Response} on successful completion of - * {@link Mono}. + * @return the List operation response, that contains the MongoDB databases and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getMongoRoleDefinitionWithResponseAsync( - String mongoRoleDefinitionId, String resourceGroupName, String accountName, Context context) { + private Mono> + listMongoDBDatabasesSinglePageAsync(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 (mongoRoleDefinitionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter mongoRoleDefinitionId 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.")); @@ -3922,91 +4220,105 @@ private Mono> getMongoRoleDefinitio } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getMongoRoleDefinition(this.client.getEndpoint(), mongoRoleDefinitionId, - this.client.getSubscriptionId(), resourceGroupName, accountName, this.client.getApiVersion(), accept, - context); + return service + .listMongoDBDatabases(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. + * Lists the MongoDB databases under an existing Azure Cosmos DB database account. * - * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. * @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 an Azure Cosmos DB Mongo Role Definition on successful completion of {@link Mono}. + * @return the List operation response, that contains the MongoDB databases and their properties as paginated + * response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getMongoRoleDefinitionAsync(String mongoRoleDefinitionId, - String resourceGroupName, String accountName) { - return getMongoRoleDefinitionWithResponseAsync(mongoRoleDefinitionId, resourceGroupName, accountName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMongoDBDatabasesAsync(String resourceGroupName, + String accountName) { + return new PagedFlux<>(() -> listMongoDBDatabasesSinglePageAsync(resourceGroupName, accountName), + nextLink -> listMongoDBDatabasesNextSinglePageAsync(nextLink)); } /** - * Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. + * Lists the MongoDB databases under an existing Azure Cosmos DB database account. * - * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. * @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 an Azure Cosmos DB Mongo Role Definition along with {@link Response}. + * @return the List operation response, that contains the MongoDB databases and their properties as paginated + * response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMongoRoleDefinitionWithResponse(String mongoRoleDefinitionId, - String resourceGroupName, String accountName, Context context) { - return getMongoRoleDefinitionWithResponseAsync(mongoRoleDefinitionId, resourceGroupName, accountName, context) - .block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listMongoDBDatabasesAsync(String resourceGroupName, + String accountName, Context context) { + return new PagedFlux<>(() -> listMongoDBDatabasesSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listMongoDBDatabasesNextSinglePageAsync(nextLink, context)); } /** - * Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. + * Lists the MongoDB databases under an existing Azure Cosmos DB database account. * - * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. * @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 an Azure Cosmos DB Mongo Role Definition. + * @return the List operation response, that contains the MongoDB databases and their properties as paginated + * response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public MongoRoleDefinitionGetResultsInner getMongoRoleDefinition(String mongoRoleDefinitionId, - String resourceGroupName, String accountName) { - return getMongoRoleDefinitionWithResponse(mongoRoleDefinitionId, resourceGroupName, accountName, Context.NONE) - .getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMongoDBDatabases(String resourceGroupName, + String accountName) { + return new PagedIterable<>(listMongoDBDatabasesAsync(resourceGroupName, accountName)); } /** - * Creates or updates an Azure Cosmos DB Mongo Role Definition. + * Lists the MongoDB databases under an existing Azure Cosmos DB database account. * - * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param createUpdateMongoRoleDefinitionParameters The properties required to create or update a Role Definition. + * @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 Mongo Role Definition along with {@link Response} on successful completion of - * {@link Mono}. + * @return the List operation response, that contains the MongoDB databases and their properties as paginated + * response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMongoDBDatabases(String resourceGroupName, + String accountName, Context context) { + return new PagedIterable<>(listMongoDBDatabasesAsync(resourceGroupName, accountName, context)); + } + + /** + * Merges the partitions of a MongoDB 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 mergeParameters The parameters for the merge 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 list of physical partitions and their properties returned by a merge operation along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createUpdateMongoRoleDefinitionWithResponseAsync( - String mongoRoleDefinitionId, String resourceGroupName, String accountName, - MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters) { + public Mono>> mongoDBDatabasePartitionMergeWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (mongoRoleDefinitionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter mongoRoleDefinitionId 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.")); @@ -4018,46 +4330,45 @@ public Mono>> createUpdateMongoRoleDefinitionWithRespo if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } - if (createUpdateMongoRoleDefinitionParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter createUpdateMongoRoleDefinitionParameters is required and cannot be null.")); + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (mergeParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter mergeParameters is required and cannot be null.")); } else { - createUpdateMongoRoleDefinitionParameters.validate(); + mergeParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createUpdateMongoRoleDefinition(this.client.getEndpoint(), - mongoRoleDefinitionId, this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), createUpdateMongoRoleDefinitionParameters, accept, context)) + .withContext(context -> service.mongoDBDatabasePartitionMerge(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, contentType, accept, mergeParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates or updates an Azure Cosmos DB Mongo Role Definition. + * Merges the partitions of a MongoDB database. * - * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param createUpdateMongoRoleDefinitionParameters The properties required to create or update a Role Definition. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge operation. * @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 Mongo Role Definition along with {@link Response} on successful completion of - * {@link Mono}. + * @return list of physical partitions and their properties returned by a merge operation along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createUpdateMongoRoleDefinitionWithResponseAsync( - String mongoRoleDefinitionId, String resourceGroupName, String accountName, - MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters, Context context) { + private Mono>> mongoDBDatabasePartitionMergeWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (mongoRoleDefinitionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter mongoRoleDefinitionId 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.")); @@ -4069,217 +4380,227 @@ private Mono>> createUpdateMongoRoleDefinitionWithResp if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } - if (createUpdateMongoRoleDefinitionParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter createUpdateMongoRoleDefinitionParameters is required and cannot be null.")); + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (mergeParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter mergeParameters is required and cannot be null.")); } else { - createUpdateMongoRoleDefinitionParameters.validate(); + mergeParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createUpdateMongoRoleDefinition(this.client.getEndpoint(), mongoRoleDefinitionId, - this.client.getSubscriptionId(), resourceGroupName, accountName, this.client.getApiVersion(), - createUpdateMongoRoleDefinitionParameters, accept, context); + return service.mongoDBDatabasePartitionMerge(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, contentType, accept, + mergeParameters, context); } /** - * Creates or updates an Azure Cosmos DB Mongo Role Definition. + * Merges the partitions of a MongoDB database. * - * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param createUpdateMongoRoleDefinitionParameters The properties required to create or update a Role Definition. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge 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 Mongo Role Definition. + * @return the {@link PollerFlux} for polling of list of physical partitions and their properties returned by a + * merge operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, MongoRoleDefinitionGetResultsInner> - beginCreateUpdateMongoRoleDefinitionAsync(String mongoRoleDefinitionId, String resourceGroupName, - String accountName, MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters) { - Mono>> mono = createUpdateMongoRoleDefinitionWithResponseAsync(mongoRoleDefinitionId, - resourceGroupName, accountName, createUpdateMongoRoleDefinitionParameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), MongoRoleDefinitionGetResultsInner.class, - MongoRoleDefinitionGetResultsInner.class, this.client.getContext()); + public + PollerFlux, PhysicalPartitionStorageInfoCollectionInner> + beginMongoDBDatabasePartitionMergeAsync(String resourceGroupName, String accountName, String databaseName, + MergeParameters mergeParameters) { + Mono>> mono = mongoDBDatabasePartitionMergeWithResponseAsync(resourceGroupName, + accountName, databaseName, mergeParameters); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), PhysicalPartitionStorageInfoCollectionInner.class, + PhysicalPartitionStorageInfoCollectionInner.class, this.client.getContext()); } /** - * Creates or updates an Azure Cosmos DB Mongo Role Definition. + * Merges the partitions of a MongoDB database. * - * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param createUpdateMongoRoleDefinitionParameters The properties required to create or update a Role Definition. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge operation. * @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 Mongo Role Definition. + * @return the {@link PollerFlux} for polling of list of physical partitions and their properties returned by a + * merge operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, MongoRoleDefinitionGetResultsInner> - beginCreateUpdateMongoRoleDefinitionAsync(String mongoRoleDefinitionId, String resourceGroupName, - String accountName, MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters, - Context context) { + private + PollerFlux, PhysicalPartitionStorageInfoCollectionInner> + beginMongoDBDatabasePartitionMergeAsync(String resourceGroupName, String accountName, String databaseName, + MergeParameters mergeParameters, Context context) { context = this.client.mergeContext(context); - Mono>> mono = createUpdateMongoRoleDefinitionWithResponseAsync(mongoRoleDefinitionId, - resourceGroupName, accountName, createUpdateMongoRoleDefinitionParameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), MongoRoleDefinitionGetResultsInner.class, - MongoRoleDefinitionGetResultsInner.class, context); + Mono>> mono = mongoDBDatabasePartitionMergeWithResponseAsync(resourceGroupName, + accountName, databaseName, mergeParameters, context); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), PhysicalPartitionStorageInfoCollectionInner.class, + PhysicalPartitionStorageInfoCollectionInner.class, context); } /** - * Creates or updates an Azure Cosmos DB Mongo Role Definition. + * Merges the partitions of a MongoDB database. * - * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param createUpdateMongoRoleDefinitionParameters The properties required to create or update a Role Definition. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge 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 Mongo Role Definition. + * @return the {@link SyncPoller} for polling of list of physical partitions and their properties returned by a + * merge operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, MongoRoleDefinitionGetResultsInner> - beginCreateUpdateMongoRoleDefinition(String mongoRoleDefinitionId, String resourceGroupName, String accountName, - MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters) { + public + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginMongoDBDatabasePartitionMerge(String resourceGroupName, String accountName, String databaseName, + MergeParameters mergeParameters) { return this - .beginCreateUpdateMongoRoleDefinitionAsync(mongoRoleDefinitionId, resourceGroupName, accountName, - createUpdateMongoRoleDefinitionParameters) + .beginMongoDBDatabasePartitionMergeAsync(resourceGroupName, accountName, databaseName, mergeParameters) .getSyncPoller(); } /** - * Creates or updates an Azure Cosmos DB Mongo Role Definition. + * Merges the partitions of a MongoDB database. * - * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param createUpdateMongoRoleDefinitionParameters The properties required to create or update a Role Definition. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge operation. * @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 Mongo Role Definition. + * @return the {@link SyncPoller} for polling of list of physical partitions and their properties returned by a + * merge operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, MongoRoleDefinitionGetResultsInner> - beginCreateUpdateMongoRoleDefinition(String mongoRoleDefinitionId, String resourceGroupName, String accountName, - MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters, Context context) { + public + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginMongoDBDatabasePartitionMerge(String resourceGroupName, String accountName, String databaseName, + MergeParameters mergeParameters, Context context) { return this - .beginCreateUpdateMongoRoleDefinitionAsync(mongoRoleDefinitionId, resourceGroupName, accountName, - createUpdateMongoRoleDefinitionParameters, context) + .beginMongoDBDatabasePartitionMergeAsync(resourceGroupName, accountName, databaseName, mergeParameters, + context) .getSyncPoller(); } /** - * Creates or updates an Azure Cosmos DB Mongo Role Definition. + * Merges the partitions of a MongoDB database. * - * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param createUpdateMongoRoleDefinitionParameters The properties required to create or update a Role Definition. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge 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 Mongo Role Definition on successful completion of {@link Mono}. + * @return list of physical partitions and their properties returned by a merge operation on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createUpdateMongoRoleDefinitionAsync(String mongoRoleDefinitionId, - String resourceGroupName, String accountName, - MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters) { - return beginCreateUpdateMongoRoleDefinitionAsync(mongoRoleDefinitionId, resourceGroupName, accountName, - createUpdateMongoRoleDefinitionParameters).last().flatMap(this.client::getLroFinalResultOrError); + public Mono mongoDBDatabasePartitionMergeAsync( + String resourceGroupName, String accountName, String databaseName, MergeParameters mergeParameters) { + return beginMongoDBDatabasePartitionMergeAsync(resourceGroupName, accountName, databaseName, mergeParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Creates or updates an Azure Cosmos DB Mongo Role Definition. + * Merges the partitions of a MongoDB database. * - * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param createUpdateMongoRoleDefinitionParameters The properties required to create or update a Role Definition. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge operation. * @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 Mongo Role Definition on successful completion of {@link Mono}. + * @return list of physical partitions and their properties returned by a merge operation on successful completion + * of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createUpdateMongoRoleDefinitionAsync(String mongoRoleDefinitionId, - String resourceGroupName, String accountName, - MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters, Context context) { - return beginCreateUpdateMongoRoleDefinitionAsync(mongoRoleDefinitionId, resourceGroupName, accountName, - createUpdateMongoRoleDefinitionParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono mongoDBDatabasePartitionMergeAsync( + String resourceGroupName, String accountName, String databaseName, MergeParameters mergeParameters, + Context context) { + return beginMongoDBDatabasePartitionMergeAsync(resourceGroupName, accountName, databaseName, mergeParameters, + context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Creates or updates an Azure Cosmos DB Mongo Role Definition. + * Merges the partitions of a MongoDB database. * - * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param createUpdateMongoRoleDefinitionParameters The properties required to create or update a Role Definition. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge 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 Mongo Role Definition. + * @return list of physical partitions and their properties returned by a merge operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MongoRoleDefinitionGetResultsInner createUpdateMongoRoleDefinition(String mongoRoleDefinitionId, - String resourceGroupName, String accountName, - MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters) { - return createUpdateMongoRoleDefinitionAsync(mongoRoleDefinitionId, resourceGroupName, accountName, - createUpdateMongoRoleDefinitionParameters).block(); + public PhysicalPartitionStorageInfoCollectionInner mongoDBDatabasePartitionMerge(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters) { + return mongoDBDatabasePartitionMergeAsync(resourceGroupName, accountName, databaseName, mergeParameters) + .block(); } /** - * Creates or updates an Azure Cosmos DB Mongo Role Definition. + * Merges the partitions of a MongoDB database. * - * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param createUpdateMongoRoleDefinitionParameters The properties required to create or update a Role Definition. + * @param databaseName Cosmos DB database name. + * @param mergeParameters The parameters for the merge operation. * @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 Mongo Role Definition. + * @return list of physical partitions and their properties returned by a merge operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MongoRoleDefinitionGetResultsInner createUpdateMongoRoleDefinition(String mongoRoleDefinitionId, - String resourceGroupName, String accountName, - MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters, Context context) { - return createUpdateMongoRoleDefinitionAsync(mongoRoleDefinitionId, resourceGroupName, accountName, - createUpdateMongoRoleDefinitionParameters, context).block(); + public PhysicalPartitionStorageInfoCollectionInner mongoDBDatabasePartitionMerge(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters, Context context) { + return mongoDBDatabasePartitionMergeAsync(resourceGroupName, accountName, databaseName, mergeParameters, + context).block(); } /** - * Deletes an existing Azure Cosmos DB Mongo Role Definition. + * Gets the MongoDB collection under an existing Azure Cosmos DB database account. * - * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. * @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 collectionName Cosmos DB collection 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}. + * @return the MongoDB collection under an existing Azure Cosmos DB database account along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteMongoRoleDefinitionWithResponseAsync(String mongoRoleDefinitionId, - String resourceGroupName, String accountName) { + public Mono> getMongoDBCollectionWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (mongoRoleDefinitionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter mongoRoleDefinitionId 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.")); @@ -4291,37 +4612,41 @@ public Mono>> deleteMongoRoleDefinitionWithResponseAsy 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 (collectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.deleteMongoRoleDefinition(this.client.getEndpoint(), mongoRoleDefinitionId, - this.client.getSubscriptionId(), resourceGroupName, accountName, this.client.getApiVersion(), accept, + .withContext(context -> service.getMongoDBCollection(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, collectionName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes an existing Azure Cosmos DB Mongo Role Definition. + * Gets the MongoDB collection under an existing Azure Cosmos DB database account. * - * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. * @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 collectionName Cosmos DB collection 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}. + * @return the MongoDB collection under an existing Azure Cosmos DB database account along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteMongoRoleDefinitionWithResponseAsync(String mongoRoleDefinitionId, - String resourceGroupName, String accountName, Context context) { + private Mono> getMongoDBCollectionWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (mongoRoleDefinitionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter mongoRoleDefinitionId 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.")); @@ -4333,176 +4658,96 @@ private Mono>> deleteMongoRoleDefinitionWithResponseAs 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 (collectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.deleteMongoRoleDefinition(this.client.getEndpoint(), mongoRoleDefinitionId, - this.client.getSubscriptionId(), resourceGroupName, accountName, this.client.getApiVersion(), accept, + return service.getMongoDBCollection(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, collectionName, accept, context); } /** - * Deletes an existing Azure Cosmos DB Mongo Role Definition. + * Gets the MongoDB collection under an existing Azure Cosmos DB database account. * - * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. * @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 collectionName Cosmos DB collection 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. + * @return the MongoDB collection under an existing Azure Cosmos DB database account on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteMongoRoleDefinitionAsync(String mongoRoleDefinitionId, - String resourceGroupName, String accountName) { - Mono>> mono - = deleteMongoRoleDefinitionWithResponseAsync(mongoRoleDefinitionId, resourceGroupName, accountName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getMongoDBCollectionAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName) { + return getMongoDBCollectionWithResponseAsync(resourceGroupName, accountName, databaseName, collectionName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Deletes an existing Azure Cosmos DB Mongo Role Definition. + * Gets the MongoDB collection under an existing Azure Cosmos DB database account. * - * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. * @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 collectionName Cosmos DB collection 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> beginDeleteMongoRoleDefinitionAsync(String mongoRoleDefinitionId, - String resourceGroupName, String accountName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteMongoRoleDefinitionWithResponseAsync(mongoRoleDefinitionId, - resourceGroupName, accountName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Deletes an existing Azure Cosmos DB Mongo Role Definition. - * - * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. - * @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 {@link SyncPoller} for polling of long-running operation. + * @return the MongoDB collection under an existing Azure Cosmos DB database account along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteMongoRoleDefinition(String mongoRoleDefinitionId, - String resourceGroupName, String accountName) { - return this.beginDeleteMongoRoleDefinitionAsync(mongoRoleDefinitionId, resourceGroupName, accountName) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getMongoDBCollectionWithResponse(String resourceGroupName, + String accountName, String databaseName, String collectionName, Context context) { + return getMongoDBCollectionWithResponseAsync(resourceGroupName, accountName, databaseName, collectionName, + context).block(); } /** - * Deletes an existing Azure Cosmos DB Mongo Role Definition. + * Gets the MongoDB collection under an existing Azure Cosmos DB database account. * - * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. * @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. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection 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. + * @return the MongoDB collection under an existing Azure Cosmos DB database account. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteMongoRoleDefinition(String mongoRoleDefinitionId, - String resourceGroupName, String accountName, Context context) { - return this.beginDeleteMongoRoleDefinitionAsync(mongoRoleDefinitionId, resourceGroupName, accountName, context) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public MongoDBCollectionGetResultsInner getMongoDBCollection(String resourceGroupName, String accountName, + String databaseName, String collectionName) { + return getMongoDBCollectionWithResponse(resourceGroupName, accountName, databaseName, collectionName, + Context.NONE).getValue(); } /** - * Deletes an existing Azure Cosmos DB Mongo Role Definition. + * Create or update an Azure Cosmos DB MongoDB Collection. * - * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. * @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 collectionName Cosmos DB collection name. + * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. * @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. + * @return an Azure Cosmos DB MongoDB collection along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteMongoRoleDefinitionAsync(String mongoRoleDefinitionId, String resourceGroupName, - String accountName) { - return beginDeleteMongoRoleDefinitionAsync(mongoRoleDefinitionId, resourceGroupName, accountName).last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes an existing Azure Cosmos DB Mongo Role Definition. - * - * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. - * @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 A {@link Mono} that completes when a successful response is received. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteMongoRoleDefinitionAsync(String mongoRoleDefinitionId, String resourceGroupName, - String accountName, Context context) { - return beginDeleteMongoRoleDefinitionAsync(mongoRoleDefinitionId, resourceGroupName, accountName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); - } - - /** - * Deletes an existing Azure Cosmos DB Mongo Role Definition. - * - * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteMongoRoleDefinition(String mongoRoleDefinitionId, String resourceGroupName, String accountName) { - deleteMongoRoleDefinitionAsync(mongoRoleDefinitionId, resourceGroupName, accountName).block(); - } - - /** - * Deletes an existing Azure Cosmos DB Mongo Role Definition. - * - * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. - * @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. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteMongoRoleDefinition(String mongoRoleDefinitionId, String resourceGroupName, String accountName, - Context context) { - deleteMongoRoleDefinitionAsync(mongoRoleDefinitionId, resourceGroupName, accountName, context).block(); - } - - /** - * Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. - * - * @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 relevant Mongo Role Definitions along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listMongoRoleDefinitionsSinglePageAsync(String resourceGroupName, String accountName) { + public Mono>> createUpdateMongoDBCollectionWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName, + MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -4518,31 +4763,46 @@ public void deleteMongoRoleDefinition(String mongoRoleDefinitionId, String resou 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 (collectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); + } + if (createUpdateMongoDBCollectionParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateMongoDBCollectionParameters is required and cannot be null.")); + } else { + createUpdateMongoDBCollectionParameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listMongoRoleDefinitions(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)) + .withContext(context -> service.createUpdateMongoDBCollection(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, collectionName, contentType, accept, createUpdateMongoDBCollectionParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. + * Create or update an Azure Cosmos DB MongoDB Collection. * * @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 collectionName Cosmos DB collection name. + * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. * @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 relevant Mongo Role Definitions along with {@link PagedResponse} on successful completion of + * @return an Azure Cosmos DB MongoDB collection along with {@link Response} on successful completion of * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listMongoRoleDefinitionsSinglePageAsync(String resourceGroupName, String accountName, Context context) { + private Mono>> createUpdateMongoDBCollectionWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName, + MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -4558,242 +4818,230 @@ public void deleteMongoRoleDefinition(String mongoRoleDefinitionId, String resou 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 (collectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); + } + if (createUpdateMongoDBCollectionParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateMongoDBCollectionParameters is required and cannot be null.")); + } else { + createUpdateMongoDBCollectionParameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listMongoRoleDefinitions(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)); + return service.createUpdateMongoDBCollection(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, collectionName, contentType, + accept, createUpdateMongoDBCollectionParameters, context); } /** - * Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. + * Create or update an Azure Cosmos DB MongoDB Collection. * * @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 collectionName Cosmos DB collection name. + * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. * @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 relevant Mongo Role Definitions as paginated response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB MongoDB collection. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMongoRoleDefinitionsAsync(String resourceGroupName, - String accountName) { - return new PagedFlux<>(() -> listMongoRoleDefinitionsSinglePageAsync(resourceGroupName, accountName)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, MongoDBCollectionGetResultsInner> + beginCreateUpdateMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, + String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) { + Mono>> mono = createUpdateMongoDBCollectionWithResponseAsync(resourceGroupName, + accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), MongoDBCollectionGetResultsInner.class, + MongoDBCollectionGetResultsInner.class, this.client.getContext()); } /** - * Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. + * Create or update an Azure Cosmos DB MongoDB Collection. * * @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 collectionName Cosmos DB collection name. + * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. * @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 relevant Mongo Role Definitions as paginated response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB MongoDB collection. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listMongoRoleDefinitionsAsync(String resourceGroupName, - String accountName, Context context) { - return new PagedFlux<>(() -> listMongoRoleDefinitionsSinglePageAsync(resourceGroupName, accountName, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MongoDBCollectionGetResultsInner> + beginCreateUpdateMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, + String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createUpdateMongoDBCollectionWithResponseAsync(resourceGroupName, + accountName, databaseName, collectionName, createUpdateMongoDBCollectionParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), MongoDBCollectionGetResultsInner.class, + MongoDBCollectionGetResultsInner.class, context); } /** - * Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. + * Create or update an Azure Cosmos DB MongoDB Collection. * * @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 collectionName Cosmos DB collection name. + * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. * @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 relevant Mongo Role Definitions as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB MongoDB collection. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMongoRoleDefinitions(String resourceGroupName, - String accountName) { - return new PagedIterable<>(listMongoRoleDefinitionsAsync(resourceGroupName, accountName)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MongoDBCollectionGetResultsInner> + beginCreateUpdateMongoDBCollection(String resourceGroupName, String accountName, String databaseName, + String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) { + return this + .beginCreateUpdateMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName, + createUpdateMongoDBCollectionParameters) + .getSyncPoller(); } /** - * Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. + * Create or update an Azure Cosmos DB MongoDB Collection. * * @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 collectionName Cosmos DB collection name. + * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. * @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 relevant Mongo Role Definitions as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB MongoDB collection. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMongoRoleDefinitions(String resourceGroupName, - String accountName, Context context) { - return new PagedIterable<>(listMongoRoleDefinitionsAsync(resourceGroupName, accountName, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MongoDBCollectionGetResultsInner> + beginCreateUpdateMongoDBCollection(String resourceGroupName, String accountName, String databaseName, + String collectionName, MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, + Context context) { + return this + .beginCreateUpdateMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName, + createUpdateMongoDBCollectionParameters, context) + .getSyncPoller(); } /** - * Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id. + * Create or update an Azure Cosmos DB MongoDB Collection. * - * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. * @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 collectionName Cosmos DB collection name. + * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. * @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 User Definition along with {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB MongoDB collection on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getMongoUserDefinitionWithResponseAsync( - String mongoUserDefinitionId, 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 (mongoUserDefinitionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter mongoUserDefinitionId 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.getMongoUserDefinition(this.client.getEndpoint(), mongoUserDefinitionId, - this.client.getSubscriptionId(), resourceGroupName, accountName, this.client.getApiVersion(), accept, - context)) - .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + public Mono createUpdateMongoDBCollectionAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName, + MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) { + return beginCreateUpdateMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName, + createUpdateMongoDBCollectionParameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id. + * Create or update an Azure Cosmos DB MongoDB Collection. * - * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. * @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 collectionName Cosmos DB collection name. + * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. * @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 User Definition along with {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB MongoDB collection on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getMongoUserDefinitionWithResponseAsync( - String mongoUserDefinitionId, 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 (mongoUserDefinitionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter mongoUserDefinitionId 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.getMongoUserDefinition(this.client.getEndpoint(), mongoUserDefinitionId, - this.client.getSubscriptionId(), resourceGroupName, accountName, this.client.getApiVersion(), accept, - context); - } - - /** - * Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id. - * - * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. - * @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 an Azure Cosmos DB User Definition on successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getMongoUserDefinitionAsync(String mongoUserDefinitionId, - String resourceGroupName, String accountName) { - return getMongoUserDefinitionWithResponseAsync(mongoUserDefinitionId, resourceGroupName, accountName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono createUpdateMongoDBCollectionAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName, + MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, Context context) { + return beginCreateUpdateMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName, + createUpdateMongoDBCollectionParameters, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id. + * Create or update an Azure Cosmos DB MongoDB Collection. * - * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. * @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. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection name. + * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. * @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 User Definition along with {@link Response}. + * @return an Azure Cosmos DB MongoDB collection. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getMongoUserDefinitionWithResponse(String mongoUserDefinitionId, - String resourceGroupName, String accountName, Context context) { - return getMongoUserDefinitionWithResponseAsync(mongoUserDefinitionId, resourceGroupName, accountName, context) - .block(); + public MongoDBCollectionGetResultsInner createUpdateMongoDBCollection(String resourceGroupName, String accountName, + String databaseName, String collectionName, + MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters) { + return createUpdateMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName, + createUpdateMongoDBCollectionParameters).block(); } /** - * Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id. + * Create or update an Azure Cosmos DB MongoDB Collection. * - * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. * @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 collectionName Cosmos DB collection name. + * @param createUpdateMongoDBCollectionParameters The parameters to provide for the current MongoDB Collection. + * @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 User Definition. + * @return an Azure Cosmos DB MongoDB collection. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MongoUserDefinitionGetResultsInner getMongoUserDefinition(String mongoUserDefinitionId, - String resourceGroupName, String accountName) { - return getMongoUserDefinitionWithResponse(mongoUserDefinitionId, resourceGroupName, accountName, Context.NONE) - .getValue(); + public MongoDBCollectionGetResultsInner createUpdateMongoDBCollection(String resourceGroupName, String accountName, + String databaseName, String collectionName, + MongoDBCollectionCreateUpdateParameters createUpdateMongoDBCollectionParameters, Context context) { + return createUpdateMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName, + createUpdateMongoDBCollectionParameters, context).block(); } /** - * Creates or updates an Azure Cosmos DB Mongo User Definition. + * Deletes an existing Azure Cosmos DB MongoDB Collection. * - * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param createUpdateMongoUserDefinitionParameters The properties required to create or update a User Definition. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection 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 User Definition along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createUpdateMongoUserDefinitionWithResponseAsync( - String mongoUserDefinitionId, String resourceGroupName, String accountName, - MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters) { + public Mono>> deleteMongoDBCollectionWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (mongoUserDefinitionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter mongoUserDefinitionId 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.")); @@ -4805,45 +5053,39 @@ public Mono>> createUpdateMongoUserDefinitionWithRespo if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } - if (createUpdateMongoUserDefinitionParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter createUpdateMongoUserDefinitionParameters is required and cannot be null.")); - } else { - createUpdateMongoUserDefinitionParameters.validate(); + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (collectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createUpdateMongoUserDefinition(this.client.getEndpoint(), - mongoUserDefinitionId, this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), createUpdateMongoUserDefinitionParameters, accept, context)) + .withContext(context -> service.deleteMongoDBCollection(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, collectionName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Creates or updates an Azure Cosmos DB Mongo User Definition. + * Deletes an existing Azure Cosmos DB MongoDB Collection. * - * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param createUpdateMongoUserDefinitionParameters The properties required to create or update a User Definition. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection 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 User Definition along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createUpdateMongoUserDefinitionWithResponseAsync( - String mongoUserDefinitionId, String resourceGroupName, String accountName, - MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters, Context context) { + private Mono>> deleteMongoDBCollectionWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); } - if (mongoUserDefinitionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter mongoUserDefinitionId 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.")); @@ -4855,217 +5097,195 @@ private Mono>> createUpdateMongoUserDefinitionWithResp if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } - if (createUpdateMongoUserDefinitionParameters == null) { - return Mono.error(new IllegalArgumentException( - "Parameter createUpdateMongoUserDefinitionParameters is required and cannot be null.")); - } else { - createUpdateMongoUserDefinitionParameters.validate(); + if (databaseName == null) { + return Mono.error(new IllegalArgumentException("Parameter databaseName is required and cannot be null.")); + } + if (collectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createUpdateMongoUserDefinition(this.client.getEndpoint(), mongoUserDefinitionId, - this.client.getSubscriptionId(), resourceGroupName, accountName, this.client.getApiVersion(), - createUpdateMongoUserDefinitionParameters, accept, context); + return service.deleteMongoDBCollection(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, collectionName, context); } /** - * Creates or updates an Azure Cosmos DB Mongo User Definition. + * Deletes an existing Azure Cosmos DB MongoDB Collection. * - * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param createUpdateMongoUserDefinitionParameters The properties required to create or update a User Definition. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection 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 User Definition. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, MongoUserDefinitionGetResultsInner> - beginCreateUpdateMongoUserDefinitionAsync(String mongoUserDefinitionId, String resourceGroupName, - String accountName, MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters) { - Mono>> mono = createUpdateMongoUserDefinitionWithResponseAsync(mongoUserDefinitionId, - resourceGroupName, accountName, createUpdateMongoUserDefinitionParameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), MongoUserDefinitionGetResultsInner.class, - MongoUserDefinitionGetResultsInner.class, this.client.getContext()); + public PollerFlux, Void> beginDeleteMongoDBCollectionAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName) { + Mono>> mono + = deleteMongoDBCollectionWithResponseAsync(resourceGroupName, accountName, databaseName, collectionName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * Creates or updates an Azure Cosmos DB Mongo User Definition. + * Deletes an existing Azure Cosmos DB MongoDB Collection. * - * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param createUpdateMongoUserDefinitionParameters The properties required to create or update a User Definition. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection 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 User Definition. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, MongoUserDefinitionGetResultsInner> - beginCreateUpdateMongoUserDefinitionAsync(String mongoUserDefinitionId, String resourceGroupName, - String accountName, MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters, - Context context) { + private PollerFlux, Void> beginDeleteMongoDBCollectionAsync(String resourceGroupName, + String accountName, String databaseName, String collectionName, Context context) { context = this.client.mergeContext(context); - Mono>> mono = createUpdateMongoUserDefinitionWithResponseAsync(mongoUserDefinitionId, - resourceGroupName, accountName, createUpdateMongoUserDefinitionParameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), MongoUserDefinitionGetResultsInner.class, - MongoUserDefinitionGetResultsInner.class, context); + Mono>> mono = deleteMongoDBCollectionWithResponseAsync(resourceGroupName, accountName, + databaseName, collectionName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** - * Creates or updates an Azure Cosmos DB Mongo User Definition. + * Deletes an existing Azure Cosmos DB MongoDB Collection. * - * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param createUpdateMongoUserDefinitionParameters The properties required to create or update a User Definition. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection 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 User Definition. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, MongoUserDefinitionGetResultsInner> - beginCreateUpdateMongoUserDefinition(String mongoUserDefinitionId, String resourceGroupName, String accountName, - MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters) { - return this - .beginCreateUpdateMongoUserDefinitionAsync(mongoUserDefinitionId, resourceGroupName, accountName, - createUpdateMongoUserDefinitionParameters) + public SyncPoller, Void> beginDeleteMongoDBCollection(String resourceGroupName, String accountName, + String databaseName, String collectionName) { + return this.beginDeleteMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName) .getSyncPoller(); } /** - * Creates or updates an Azure Cosmos DB Mongo User Definition. + * Deletes an existing Azure Cosmos DB MongoDB Collection. * - * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param createUpdateMongoUserDefinitionParameters The properties required to create or update a User Definition. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection 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 User Definition. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, MongoUserDefinitionGetResultsInner> - beginCreateUpdateMongoUserDefinition(String mongoUserDefinitionId, String resourceGroupName, String accountName, - MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters, Context context) { + public SyncPoller, Void> beginDeleteMongoDBCollection(String resourceGroupName, String accountName, + String databaseName, String collectionName, Context context) { return this - .beginCreateUpdateMongoUserDefinitionAsync(mongoUserDefinitionId, resourceGroupName, accountName, - createUpdateMongoUserDefinitionParameters, context) + .beginDeleteMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName, context) .getSyncPoller(); } /** - * Creates or updates an Azure Cosmos DB Mongo User Definition. + * Deletes an existing Azure Cosmos DB MongoDB Collection. * - * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param createUpdateMongoUserDefinitionParameters The properties required to create or update a User Definition. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection 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 User Definition on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createUpdateMongoUserDefinitionAsync(String mongoUserDefinitionId, - String resourceGroupName, String accountName, - MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters) { - return beginCreateUpdateMongoUserDefinitionAsync(mongoUserDefinitionId, resourceGroupName, accountName, - createUpdateMongoUserDefinitionParameters).last().flatMap(this.client::getLroFinalResultOrError); + public Mono deleteMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, + String collectionName) { + return beginDeleteMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Creates or updates an Azure Cosmos DB Mongo User Definition. + * Deletes an existing Azure Cosmos DB MongoDB Collection. * - * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param createUpdateMongoUserDefinitionParameters The properties required to create or update a User Definition. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection 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 User Definition on successful completion of {@link Mono}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createUpdateMongoUserDefinitionAsync(String mongoUserDefinitionId, - String resourceGroupName, String accountName, - MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters, Context context) { - return beginCreateUpdateMongoUserDefinitionAsync(mongoUserDefinitionId, resourceGroupName, accountName, - createUpdateMongoUserDefinitionParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono deleteMongoDBCollectionAsync(String resourceGroupName, String accountName, String databaseName, + String collectionName, Context context) { + return beginDeleteMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Creates or updates an Azure Cosmos DB Mongo User Definition. + * Deletes an existing Azure Cosmos DB MongoDB Collection. * - * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param createUpdateMongoUserDefinitionParameters The properties required to create or update a User Definition. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection 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 User Definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MongoUserDefinitionGetResultsInner createUpdateMongoUserDefinition(String mongoUserDefinitionId, - String resourceGroupName, String accountName, - MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters) { - return createUpdateMongoUserDefinitionAsync(mongoUserDefinitionId, resourceGroupName, accountName, - createUpdateMongoUserDefinitionParameters).block(); + public void deleteMongoDBCollection(String resourceGroupName, String accountName, String databaseName, + String collectionName) { + deleteMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName).block(); } /** - * Creates or updates an Azure Cosmos DB Mongo User Definition. + * Deletes an existing Azure Cosmos DB MongoDB Collection. * - * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param createUpdateMongoUserDefinitionParameters The properties required to create or update a User Definition. + * @param databaseName Cosmos DB database name. + * @param collectionName Cosmos DB collection 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 User Definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public MongoUserDefinitionGetResultsInner createUpdateMongoUserDefinition(String mongoUserDefinitionId, - String resourceGroupName, String accountName, - MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters, Context context) { - return createUpdateMongoUserDefinitionAsync(mongoUserDefinitionId, resourceGroupName, accountName, - createUpdateMongoUserDefinitionParameters, context).block(); + public void deleteMongoDBCollection(String resourceGroupName, String accountName, String databaseName, + String collectionName, Context context) { + deleteMongoDBCollectionAsync(resourceGroupName, accountName, databaseName, collectionName, context).block(); } /** - * Deletes an existing Azure Cosmos DB Mongo User Definition. + * Lists the MongoDB collection under an existing Azure Cosmos DB database account. * - * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. * @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}. + * @return the List operation response, that contains the MongoDB collections and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteMongoUserDefinitionWithResponseAsync(String mongoUserDefinitionId, - String resourceGroupName, String accountName) { + private Mono> + listMongoDBCollectionsSinglePageAsync(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 (mongoUserDefinitionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter mongoUserDefinitionId 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.")); @@ -5077,37 +5297,39 @@ public Mono>> deleteMongoUserDefinitionWithResponseAsy 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.deleteMongoUserDefinition(this.client.getEndpoint(), mongoUserDefinitionId, - this.client.getSubscriptionId(), resourceGroupName, accountName, this.client.getApiVersion(), accept, - context)) + .withContext( + context -> service.listMongoDBCollections(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes an existing Azure Cosmos DB Mongo User Definition. + * Lists the MongoDB collection under an existing Azure Cosmos DB database account. * - * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. * @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}. + * @return the List operation response, that contains the MongoDB collections and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteMongoUserDefinitionWithResponseAsync(String mongoUserDefinitionId, - String resourceGroupName, String accountName, Context context) { + private Mono> listMongoDBCollectionsSinglePageAsync( + 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 (mongoUserDefinitionId == null) { - return Mono - .error(new IllegalArgumentException("Parameter mongoUserDefinitionId 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.")); @@ -5119,175 +5341,114 @@ private Mono>> deleteMongoUserDefinitionWithResponseAs 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.deleteMongoUserDefinition(this.client.getEndpoint(), mongoUserDefinitionId, - this.client.getSubscriptionId(), resourceGroupName, accountName, this.client.getApiVersion(), accept, - context); - } - - /** - * Deletes an existing Azure Cosmos DB Mongo User Definition. - * - * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. - * @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 {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteMongoUserDefinitionAsync(String mongoUserDefinitionId, - String resourceGroupName, String accountName) { - Mono>> mono - = deleteMongoUserDefinitionWithResponseAsync(mongoUserDefinitionId, resourceGroupName, accountName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes an existing Azure Cosmos DB Mongo User Definition. - * - * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. - * @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 {@link PollerFlux} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteMongoUserDefinitionAsync(String mongoUserDefinitionId, - String resourceGroupName, String accountName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = deleteMongoUserDefinitionWithResponseAsync(mongoUserDefinitionId, - resourceGroupName, accountName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); - } - - /** - * Deletes an existing Azure Cosmos DB Mongo User Definition. - * - * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. - * @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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteMongoUserDefinition(String mongoUserDefinitionId, - String resourceGroupName, String accountName) { - return this.beginDeleteMongoUserDefinitionAsync(mongoUserDefinitionId, resourceGroupName, accountName) - .getSyncPoller(); - } - - /** - * Deletes an existing Azure Cosmos DB Mongo User Definition. - * - * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. - * @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 {@link SyncPoller} for polling of long-running operation. - */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteMongoUserDefinition(String mongoUserDefinitionId, - String resourceGroupName, String accountName, Context context) { - return this.beginDeleteMongoUserDefinitionAsync(mongoUserDefinitionId, resourceGroupName, accountName, context) - .getSyncPoller(); + return service + .listMongoDBCollections(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Deletes an existing Azure Cosmos DB Mongo User Definition. + * Lists the MongoDB collection under an existing Azure Cosmos DB database account. * - * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. * @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. + * @return the List operation response, that contains the MongoDB collections and their properties as paginated + * response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteMongoUserDefinitionAsync(String mongoUserDefinitionId, String resourceGroupName, - String accountName) { - return beginDeleteMongoUserDefinitionAsync(mongoUserDefinitionId, resourceGroupName, accountName).last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMongoDBCollectionsAsync(String resourceGroupName, + String accountName, String databaseName) { + return new PagedFlux<>( + () -> listMongoDBCollectionsSinglePageAsync(resourceGroupName, accountName, databaseName), + nextLink -> listMongoDBCollectionsNextSinglePageAsync(nextLink)); } /** - * Deletes an existing Azure Cosmos DB Mongo User Definition. + * Lists the MongoDB collection under an existing Azure Cosmos DB database account. * - * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. * @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. + * @return the List operation response, that contains the MongoDB collections and their properties as paginated + * response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteMongoUserDefinitionAsync(String mongoUserDefinitionId, String resourceGroupName, - String accountName, Context context) { - return beginDeleteMongoUserDefinitionAsync(mongoUserDefinitionId, resourceGroupName, accountName, context) - .last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listMongoDBCollectionsAsync(String resourceGroupName, + String accountName, String databaseName, Context context) { + return new PagedFlux<>( + () -> listMongoDBCollectionsSinglePageAsync(resourceGroupName, accountName, databaseName, context), + nextLink -> listMongoDBCollectionsNextSinglePageAsync(nextLink, context)); } /** - * Deletes an existing Azure Cosmos DB Mongo User Definition. + * Lists the MongoDB collection under an existing Azure Cosmos DB database account. * - * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. * @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 MongoDB collections and their properties as paginated + * response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteMongoUserDefinition(String mongoUserDefinitionId, String resourceGroupName, String accountName) { - deleteMongoUserDefinitionAsync(mongoUserDefinitionId, resourceGroupName, accountName).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMongoDBCollections(String resourceGroupName, + String accountName, String databaseName) { + return new PagedIterable<>(listMongoDBCollectionsAsync(resourceGroupName, accountName, databaseName)); } /** - * Deletes an existing Azure Cosmos DB Mongo User Definition. + * Lists the MongoDB collection under an existing Azure Cosmos DB database account. * - * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. * @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 MongoDB collections and their properties as paginated + * response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteMongoUserDefinition(String mongoUserDefinitionId, String resourceGroupName, String accountName, - Context context) { - deleteMongoUserDefinitionAsync(mongoUserDefinitionId, resourceGroupName, accountName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMongoDBCollections(String resourceGroupName, + String accountName, String databaseName, Context context) { + return new PagedIterable<>(listMongoDBCollectionsAsync(resourceGroupName, accountName, databaseName, context)); } /** - * Retrieves the list of all Azure Cosmos DB Mongo User Definition. + * Merges the partitions of a MongoDB Collection. * * @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 collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge 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 relevant User Definition along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of physical partitions and their properties returned by a merge operation along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listMongoUserDefinitionsSinglePageAsync(String resourceGroupName, String accountName) { + public Mono>> listMongoDBCollectionPartitionMergeWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + MergeParameters mergeParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -5303,30 +5464,46 @@ public void deleteMongoUserDefinition(String mongoUserDefinitionId, String resou 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 (collectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); + } + if (mergeParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter mergeParameters is required and cannot be null.")); + } else { + mergeParameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listMongoUserDefinitions(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)) + .withContext(context -> service.listMongoDBCollectionPartitionMerge(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, collectionName, contentType, accept, mergeParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves the list of all Azure Cosmos DB Mongo User Definition. + * Merges the partitions of a MongoDB Collection. * * @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 collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge operation. * @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 relevant User Definition along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return list of physical partitions and their properties returned by a merge operation along with + * {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listMongoUserDefinitionsSinglePageAsync(String resourceGroupName, String accountName, Context context) { + private Mono>> listMongoDBCollectionPartitionMergeWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + MergeParameters mergeParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -5342,79 +5519,218 @@ public void deleteMongoUserDefinition(String mongoUserDefinitionId, String resou 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 (collectionName == null) { + return Mono.error(new IllegalArgumentException("Parameter collectionName is required and cannot be null.")); + } + if (mergeParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter mergeParameters is required and cannot be null.")); + } else { + mergeParameters.validate(); + } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listMongoUserDefinitions(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)); + return service.listMongoDBCollectionPartitionMerge(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, collectionName, contentType, + accept, mergeParameters, context); } /** - * Retrieves the list of all Azure Cosmos DB Mongo User Definition. + * Merges the partitions of a MongoDB Collection. * * @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 collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge 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 relevant User Definition as paginated response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of list of physical partitions and their properties returned by a + * merge operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listMongoUserDefinitionsAsync(String resourceGroupName, - String accountName) { - return new PagedFlux<>(() -> listMongoUserDefinitionsSinglePageAsync(resourceGroupName, accountName)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + PollerFlux, PhysicalPartitionStorageInfoCollectionInner> + beginListMongoDBCollectionPartitionMergeAsync(String resourceGroupName, String accountName, String databaseName, + String collectionName, MergeParameters mergeParameters) { + Mono>> mono = listMongoDBCollectionPartitionMergeWithResponseAsync(resourceGroupName, + accountName, databaseName, collectionName, mergeParameters); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), PhysicalPartitionStorageInfoCollectionInner.class, + PhysicalPartitionStorageInfoCollectionInner.class, this.client.getContext()); } /** - * Retrieves the list of all Azure Cosmos DB Mongo User Definition. + * Merges the partitions of a MongoDB Collection. * * @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 collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge operation. * @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 relevant User Definition as paginated response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of list of physical partitions and their properties returned by a + * merge operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listMongoUserDefinitionsAsync(String resourceGroupName, - String accountName, Context context) { - return new PagedFlux<>(() -> listMongoUserDefinitionsSinglePageAsync(resourceGroupName, accountName, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, PhysicalPartitionStorageInfoCollectionInner> + beginListMongoDBCollectionPartitionMergeAsync(String resourceGroupName, String accountName, String databaseName, + String collectionName, MergeParameters mergeParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = listMongoDBCollectionPartitionMergeWithResponseAsync(resourceGroupName, + accountName, databaseName, collectionName, mergeParameters, context); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), PhysicalPartitionStorageInfoCollectionInner.class, + PhysicalPartitionStorageInfoCollectionInner.class, context); } /** - * Retrieves the list of all Azure Cosmos DB Mongo User Definition. + * Merges the partitions of a MongoDB Collection. * * @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 collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge 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 relevant User Definition as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of list of physical partitions and their properties returned by a + * merge operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMongoUserDefinitions(String resourceGroupName, - String accountName) { - return new PagedIterable<>(listMongoUserDefinitionsAsync(resourceGroupName, accountName)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginListMongoDBCollectionPartitionMerge(String resourceGroupName, String accountName, String databaseName, + String collectionName, MergeParameters mergeParameters) { + return this + .beginListMongoDBCollectionPartitionMergeAsync(resourceGroupName, accountName, databaseName, collectionName, + mergeParameters) + .getSyncPoller(); } /** - * Retrieves the list of all Azure Cosmos DB Mongo User Definition. + * Merges the partitions of a MongoDB Collection. * * @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 collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge operation. * @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 relevant User Definition as paginated response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of list of physical partitions and their properties returned by a + * merge operation. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listMongoUserDefinitions(String resourceGroupName, - String accountName, Context context) { - return new PagedIterable<>(listMongoUserDefinitionsAsync(resourceGroupName, accountName, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginListMongoDBCollectionPartitionMerge(String resourceGroupName, String accountName, String databaseName, + String collectionName, MergeParameters mergeParameters, Context context) { + return this + .beginListMongoDBCollectionPartitionMergeAsync(resourceGroupName, accountName, databaseName, collectionName, + mergeParameters, context) + .getSyncPoller(); + } + + /** + * Merges the partitions of a MongoDB Collection. + * + * @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 collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge 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 list of physical partitions and their properties returned by a merge operation on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listMongoDBCollectionPartitionMergeAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + MergeParameters mergeParameters) { + return beginListMongoDBCollectionPartitionMergeAsync(resourceGroupName, accountName, databaseName, + collectionName, mergeParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Merges the partitions of a MongoDB Collection. + * + * @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 collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge operation. + * @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 list of physical partitions and their properties returned by a merge operation on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listMongoDBCollectionPartitionMergeAsync( + String resourceGroupName, String accountName, String databaseName, String collectionName, + MergeParameters mergeParameters, Context context) { + return beginListMongoDBCollectionPartitionMergeAsync(resourceGroupName, accountName, databaseName, + collectionName, mergeParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Merges the partitions of a MongoDB Collection. + * + * @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 collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge 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 list of physical partitions and their properties returned by a merge operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PhysicalPartitionStorageInfoCollectionInner listMongoDBCollectionPartitionMerge(String resourceGroupName, + String accountName, String databaseName, String collectionName, MergeParameters mergeParameters) { + return listMongoDBCollectionPartitionMergeAsync(resourceGroupName, accountName, databaseName, collectionName, + mergeParameters).block(); + } + + /** + * Merges the partitions of a MongoDB Collection. + * + * @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 collectionName Cosmos DB collection name. + * @param mergeParameters The parameters for the merge operation. + * @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 list of physical partitions and their properties returned by a merge operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PhysicalPartitionStorageInfoCollectionInner listMongoDBCollectionPartitionMerge(String resourceGroupName, + String accountName, String databaseName, String collectionName, MergeParameters mergeParameters, + Context context) { + return listMongoDBCollectionPartitionMergeAsync(resourceGroupName, accountName, databaseName, collectionName, + mergeParameters, context).block(); } /** @@ -5428,7 +5744,7 @@ public PagedIterable listMongoUserDefinition * @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 backup information of a resource along with {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> retrieveContinuousBackupInformationWithResponseAsync( @@ -5460,11 +5776,12 @@ public Mono>> retrieveContinuousBackupInformationWithR } else { location.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.retrieveContinuousBackupInformation(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, collectionName, - this.client.getApiVersion(), location, accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, collectionName, contentType, accept, location, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -5480,7 +5797,7 @@ public Mono>> retrieveContinuousBackupInformationWithR * @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 backup information of a resource along with {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> retrieveContinuousBackupInformationWithResponseAsync( @@ -5512,11 +5829,12 @@ private Mono>> retrieveContinuousBackupInformationWith } else { location.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.retrieveContinuousBackupInformation(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, collectionName, this.client.getApiVersion(), location, accept, - context); + return service.retrieveContinuousBackupInformation(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, collectionName, contentType, + accept, location, context); } /** @@ -5530,7 +5848,7 @@ private Mono>> retrieveContinuousBackupInformationWith * @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 backup information of a resource. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public PollerFlux, BackupInformationInner> @@ -5555,7 +5873,7 @@ private Mono>> retrieveContinuousBackupInformationWith * @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 backup information of a resource. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, BackupInformationInner> @@ -5579,7 +5897,7 @@ private Mono>> retrieveContinuousBackupInformationWith * @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 backup information of a resource. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, BackupInformationInner> @@ -5603,7 +5921,7 @@ private Mono>> retrieveContinuousBackupInformationWith * @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 backup information of a resource. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, BackupInformationInner> @@ -5626,7 +5944,7 @@ private Mono>> retrieveContinuousBackupInformationWith * @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 backup information of a resource on successful completion of {@link Mono}. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) public Mono retrieveContinuousBackupInformationAsync(String resourceGroupName, @@ -5647,7 +5965,7 @@ public Mono retrieveContinuousBackupInformationAsync(Str * @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 backup information of a resource on successful completion of {@link Mono}. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) private Mono retrieveContinuousBackupInformationAsync(String resourceGroupName, @@ -5668,7 +5986,7 @@ private Mono retrieveContinuousBackupInformationAsync(St * @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 backup information of a resource. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) public BackupInformationInner retrieveContinuousBackupInformation(String resourceGroupName, String accountName, @@ -5689,7 +6007,7 @@ public BackupInformationInner retrieveContinuousBackupInformation(String resourc * @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 backup information of a resource. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) public BackupInformationInner retrieveContinuousBackupInformation(String resourceGroupName, String accountName, @@ -5697,4 +6015,1708 @@ public BackupInformationInner retrieveContinuousBackupInformation(String resourc return retrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, collectionName, location, context).block(); } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. + * + * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. + * @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 an Azure Cosmos DB Mongo Role Definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getMongoRoleDefinitionWithResponseAsync( + String mongoRoleDefinitionId, String resourceGroupName, String accountName) { + if (mongoRoleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter mongoRoleDefinitionId 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.getMongoRoleDefinition(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + mongoRoleDefinitionId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. + * + * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. + * @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 an Azure Cosmos DB Mongo Role Definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getMongoRoleDefinitionWithResponseAsync( + String mongoRoleDefinitionId, String resourceGroupName, String accountName, Context context) { + if (mongoRoleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter mongoRoleDefinitionId 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.getMongoRoleDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, mongoRoleDefinitionId, accept, context); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. + * + * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. + * @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 an Azure Cosmos DB Mongo Role Definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getMongoRoleDefinitionAsync(String mongoRoleDefinitionId, + String resourceGroupName, String accountName) { + return getMongoRoleDefinitionWithResponseAsync(mongoRoleDefinitionId, resourceGroupName, accountName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. + * + * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. + * @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 an Azure Cosmos DB Mongo Role Definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getMongoRoleDefinitionWithResponse(String mongoRoleDefinitionId, + String resourceGroupName, String accountName, Context context) { + return getMongoRoleDefinitionWithResponseAsync(mongoRoleDefinitionId, resourceGroupName, accountName, context) + .block(); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Mongo Role Definition with the given Id. + * + * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. + * @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 an Azure Cosmos DB Mongo Role Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MongoRoleDefinitionGetResultsInner getMongoRoleDefinition(String mongoRoleDefinitionId, + String resourceGroupName, String accountName) { + return getMongoRoleDefinitionWithResponse(mongoRoleDefinitionId, resourceGroupName, accountName, Context.NONE) + .getValue(); + } + + /** + * Creates or updates an Azure Cosmos DB Mongo Role Definition. + * + * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateMongoRoleDefinitionParameters The properties required to create or update a Role Definition. + * @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 Mongo Role Definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createUpdateMongoRoleDefinitionWithResponseAsync( + String mongoRoleDefinitionId, String resourceGroupName, String accountName, + MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters) { + if (mongoRoleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter mongoRoleDefinitionId 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 (createUpdateMongoRoleDefinitionParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateMongoRoleDefinitionParameters is required and cannot be null.")); + } else { + createUpdateMongoRoleDefinitionParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createUpdateMongoRoleDefinition(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + mongoRoleDefinitionId, contentType, accept, createUpdateMongoRoleDefinitionParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an Azure Cosmos DB Mongo Role Definition. + * + * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateMongoRoleDefinitionParameters The properties required to create or update a Role Definition. + * @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 Mongo Role Definition along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createUpdateMongoRoleDefinitionWithResponseAsync( + String mongoRoleDefinitionId, String resourceGroupName, String accountName, + MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters, Context context) { + if (mongoRoleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter mongoRoleDefinitionId 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 (createUpdateMongoRoleDefinitionParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateMongoRoleDefinitionParameters is required and cannot be null.")); + } else { + createUpdateMongoRoleDefinitionParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createUpdateMongoRoleDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, mongoRoleDefinitionId, contentType, accept, + createUpdateMongoRoleDefinitionParameters, context); + } + + /** + * Creates or updates an Azure Cosmos DB Mongo Role Definition. + * + * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateMongoRoleDefinitionParameters The properties required to create or update a Role Definition. + * @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 Mongo Role Definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, MongoRoleDefinitionGetResultsInner> + beginCreateUpdateMongoRoleDefinitionAsync(String mongoRoleDefinitionId, String resourceGroupName, + String accountName, MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters) { + Mono>> mono = createUpdateMongoRoleDefinitionWithResponseAsync(mongoRoleDefinitionId, + resourceGroupName, accountName, createUpdateMongoRoleDefinitionParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), MongoRoleDefinitionGetResultsInner.class, + MongoRoleDefinitionGetResultsInner.class, this.client.getContext()); + } + + /** + * Creates or updates an Azure Cosmos DB Mongo Role Definition. + * + * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateMongoRoleDefinitionParameters The properties required to create or update a Role Definition. + * @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 Mongo Role Definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MongoRoleDefinitionGetResultsInner> + beginCreateUpdateMongoRoleDefinitionAsync(String mongoRoleDefinitionId, String resourceGroupName, + String accountName, MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createUpdateMongoRoleDefinitionWithResponseAsync(mongoRoleDefinitionId, + resourceGroupName, accountName, createUpdateMongoRoleDefinitionParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), MongoRoleDefinitionGetResultsInner.class, + MongoRoleDefinitionGetResultsInner.class, context); + } + + /** + * Creates or updates an Azure Cosmos DB Mongo Role Definition. + * + * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateMongoRoleDefinitionParameters The properties required to create or update a Role Definition. + * @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 Mongo Role Definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MongoRoleDefinitionGetResultsInner> + beginCreateUpdateMongoRoleDefinition(String mongoRoleDefinitionId, String resourceGroupName, String accountName, + MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters) { + return this + .beginCreateUpdateMongoRoleDefinitionAsync(mongoRoleDefinitionId, resourceGroupName, accountName, + createUpdateMongoRoleDefinitionParameters) + .getSyncPoller(); + } + + /** + * Creates or updates an Azure Cosmos DB Mongo Role Definition. + * + * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateMongoRoleDefinitionParameters The properties required to create or update a Role Definition. + * @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 Mongo Role Definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MongoRoleDefinitionGetResultsInner> + beginCreateUpdateMongoRoleDefinition(String mongoRoleDefinitionId, String resourceGroupName, String accountName, + MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters, Context context) { + return this + .beginCreateUpdateMongoRoleDefinitionAsync(mongoRoleDefinitionId, resourceGroupName, accountName, + createUpdateMongoRoleDefinitionParameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates an Azure Cosmos DB Mongo Role Definition. + * + * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateMongoRoleDefinitionParameters The properties required to create or update a Role Definition. + * @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 Mongo Role Definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createUpdateMongoRoleDefinitionAsync(String mongoRoleDefinitionId, + String resourceGroupName, String accountName, + MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters) { + return beginCreateUpdateMongoRoleDefinitionAsync(mongoRoleDefinitionId, resourceGroupName, accountName, + createUpdateMongoRoleDefinitionParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an Azure Cosmos DB Mongo Role Definition. + * + * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateMongoRoleDefinitionParameters The properties required to create or update a Role Definition. + * @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 Mongo Role Definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createUpdateMongoRoleDefinitionAsync(String mongoRoleDefinitionId, + String resourceGroupName, String accountName, + MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters, Context context) { + return beginCreateUpdateMongoRoleDefinitionAsync(mongoRoleDefinitionId, resourceGroupName, accountName, + createUpdateMongoRoleDefinitionParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an Azure Cosmos DB Mongo Role Definition. + * + * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateMongoRoleDefinitionParameters The properties required to create or update a Role Definition. + * @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 Mongo Role Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MongoRoleDefinitionGetResultsInner createUpdateMongoRoleDefinition(String mongoRoleDefinitionId, + String resourceGroupName, String accountName, + MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters) { + return createUpdateMongoRoleDefinitionAsync(mongoRoleDefinitionId, resourceGroupName, accountName, + createUpdateMongoRoleDefinitionParameters).block(); + } + + /** + * Creates or updates an Azure Cosmos DB Mongo Role Definition. + * + * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateMongoRoleDefinitionParameters The properties required to create or update a Role Definition. + * @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 Mongo Role Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MongoRoleDefinitionGetResultsInner createUpdateMongoRoleDefinition(String mongoRoleDefinitionId, + String resourceGroupName, String accountName, + MongoRoleDefinitionCreateUpdateParameters createUpdateMongoRoleDefinitionParameters, Context context) { + return createUpdateMongoRoleDefinitionAsync(mongoRoleDefinitionId, resourceGroupName, accountName, + createUpdateMongoRoleDefinitionParameters, context).block(); + } + + /** + * Deletes an existing Azure Cosmos DB Mongo Role Definition. + * + * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteMongoRoleDefinitionWithResponseAsync(String mongoRoleDefinitionId, + String resourceGroupName, String accountName) { + if (mongoRoleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter mongoRoleDefinitionId 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.")); + } + return FluxUtil + .withContext( + context -> service.deleteMongoRoleDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, mongoRoleDefinitionId, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing Azure Cosmos DB Mongo Role Definition. + * + * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteMongoRoleDefinitionWithResponseAsync(String mongoRoleDefinitionId, + String resourceGroupName, String accountName, Context context) { + if (mongoRoleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter mongoRoleDefinitionId 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.")); + } + context = this.client.mergeContext(context); + return service.deleteMongoRoleDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, mongoRoleDefinitionId, context); + } + + /** + * Deletes an existing Azure Cosmos DB Mongo Role Definition. + * + * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginDeleteMongoRoleDefinitionAsync(String mongoRoleDefinitionId, + String resourceGroupName, String accountName) { + Mono>> mono + = deleteMongoRoleDefinitionWithResponseAsync(mongoRoleDefinitionId, resourceGroupName, accountName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing Azure Cosmos DB Mongo Role Definition. + * + * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteMongoRoleDefinitionAsync(String mongoRoleDefinitionId, + String resourceGroupName, String accountName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteMongoRoleDefinitionWithResponseAsync(mongoRoleDefinitionId, + resourceGroupName, accountName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing Azure Cosmos DB Mongo Role Definition. + * + * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteMongoRoleDefinition(String mongoRoleDefinitionId, + String resourceGroupName, String accountName) { + return this.beginDeleteMongoRoleDefinitionAsync(mongoRoleDefinitionId, resourceGroupName, accountName) + .getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB Mongo Role Definition. + * + * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteMongoRoleDefinition(String mongoRoleDefinitionId, + String resourceGroupName, String accountName, Context context) { + return this.beginDeleteMongoRoleDefinitionAsync(mongoRoleDefinitionId, resourceGroupName, accountName, context) + .getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB Mongo Role Definition. + * + * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteMongoRoleDefinitionAsync(String mongoRoleDefinitionId, String resourceGroupName, + String accountName) { + return beginDeleteMongoRoleDefinitionAsync(mongoRoleDefinitionId, resourceGroupName, accountName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB Mongo Role Definition. + * + * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteMongoRoleDefinitionAsync(String mongoRoleDefinitionId, String resourceGroupName, + String accountName, Context context) { + return beginDeleteMongoRoleDefinitionAsync(mongoRoleDefinitionId, resourceGroupName, accountName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB Mongo Role Definition. + * + * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteMongoRoleDefinition(String mongoRoleDefinitionId, String resourceGroupName, String accountName) { + deleteMongoRoleDefinitionAsync(mongoRoleDefinitionId, resourceGroupName, accountName).block(); + } + + /** + * Deletes an existing Azure Cosmos DB Mongo Role Definition. + * + * @param mongoRoleDefinitionId The ID for the Role Definition {dbName.roleName}. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteMongoRoleDefinition(String mongoRoleDefinitionId, String resourceGroupName, String accountName, + Context context) { + deleteMongoRoleDefinitionAsync(mongoRoleDefinitionId, resourceGroupName, accountName, context).block(); + } + + /** + * Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. + * + * @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 relevant Mongo Role Definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listMongoRoleDefinitionsSinglePageAsync(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.listMongoRoleDefinitions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. + * + * @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 relevant Mongo Role Definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listMongoRoleDefinitionsSinglePageAsync(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 + .listMongoRoleDefinitions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. + * + * @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 relevant Mongo Role Definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMongoRoleDefinitionsAsync(String resourceGroupName, + String accountName) { + return new PagedFlux<>(() -> listMongoRoleDefinitionsSinglePageAsync(resourceGroupName, accountName), + nextLink -> listMongoRoleDefinitionsNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. + * + * @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 relevant Mongo Role Definitions as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listMongoRoleDefinitionsAsync(String resourceGroupName, + String accountName, Context context) { + return new PagedFlux<>(() -> listMongoRoleDefinitionsSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listMongoRoleDefinitionsNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. + * + * @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 relevant Mongo Role Definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMongoRoleDefinitions(String resourceGroupName, + String accountName) { + return new PagedIterable<>(listMongoRoleDefinitionsAsync(resourceGroupName, accountName)); + } + + /** + * Retrieves the list of all Azure Cosmos DB Mongo Role Definitions. + * + * @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 relevant Mongo Role Definitions as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMongoRoleDefinitions(String resourceGroupName, + String accountName, Context context) { + return new PagedIterable<>(listMongoRoleDefinitionsAsync(resourceGroupName, accountName, context)); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id. + * + * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. + * @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 an Azure Cosmos DB User Definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getMongoUserDefinitionWithResponseAsync( + String mongoUserDefinitionId, String resourceGroupName, String accountName) { + if (mongoUserDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter mongoUserDefinitionId 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.getMongoUserDefinition(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + mongoUserDefinitionId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id. + * + * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. + * @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 an Azure Cosmos DB User Definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getMongoUserDefinitionWithResponseAsync( + String mongoUserDefinitionId, String resourceGroupName, String accountName, Context context) { + if (mongoUserDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter mongoUserDefinitionId 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.getMongoUserDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, mongoUserDefinitionId, accept, context); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id. + * + * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. + * @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 an Azure Cosmos DB User Definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getMongoUserDefinitionAsync(String mongoUserDefinitionId, + String resourceGroupName, String accountName) { + return getMongoUserDefinitionWithResponseAsync(mongoUserDefinitionId, resourceGroupName, accountName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id. + * + * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. + * @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 an Azure Cosmos DB User Definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getMongoUserDefinitionWithResponse(String mongoUserDefinitionId, + String resourceGroupName, String accountName, Context context) { + return getMongoUserDefinitionWithResponseAsync(mongoUserDefinitionId, resourceGroupName, accountName, context) + .block(); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Mongo User Definition with the given Id. + * + * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. + * @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 an Azure Cosmos DB User Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MongoUserDefinitionGetResultsInner getMongoUserDefinition(String mongoUserDefinitionId, + String resourceGroupName, String accountName) { + return getMongoUserDefinitionWithResponse(mongoUserDefinitionId, resourceGroupName, accountName, Context.NONE) + .getValue(); + } + + /** + * Creates or updates an Azure Cosmos DB Mongo User Definition. + * + * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateMongoUserDefinitionParameters The properties required to create or update a User Definition. + * @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 User Definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createUpdateMongoUserDefinitionWithResponseAsync( + String mongoUserDefinitionId, String resourceGroupName, String accountName, + MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters) { + if (mongoUserDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter mongoUserDefinitionId 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 (createUpdateMongoUserDefinitionParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateMongoUserDefinitionParameters is required and cannot be null.")); + } else { + createUpdateMongoUserDefinitionParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createUpdateMongoUserDefinition(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + mongoUserDefinitionId, contentType, accept, createUpdateMongoUserDefinitionParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an Azure Cosmos DB Mongo User Definition. + * + * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateMongoUserDefinitionParameters The properties required to create or update a User Definition. + * @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 User Definition along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createUpdateMongoUserDefinitionWithResponseAsync( + String mongoUserDefinitionId, String resourceGroupName, String accountName, + MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters, Context context) { + if (mongoUserDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter mongoUserDefinitionId 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 (createUpdateMongoUserDefinitionParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateMongoUserDefinitionParameters is required and cannot be null.")); + } else { + createUpdateMongoUserDefinitionParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createUpdateMongoUserDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, mongoUserDefinitionId, contentType, accept, + createUpdateMongoUserDefinitionParameters, context); + } + + /** + * Creates or updates an Azure Cosmos DB Mongo User Definition. + * + * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateMongoUserDefinitionParameters The properties required to create or update a User Definition. + * @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 User Definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, MongoUserDefinitionGetResultsInner> + beginCreateUpdateMongoUserDefinitionAsync(String mongoUserDefinitionId, String resourceGroupName, + String accountName, MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters) { + Mono>> mono = createUpdateMongoUserDefinitionWithResponseAsync(mongoUserDefinitionId, + resourceGroupName, accountName, createUpdateMongoUserDefinitionParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), MongoUserDefinitionGetResultsInner.class, + MongoUserDefinitionGetResultsInner.class, this.client.getContext()); + } + + /** + * Creates or updates an Azure Cosmos DB Mongo User Definition. + * + * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateMongoUserDefinitionParameters The properties required to create or update a User Definition. + * @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 User Definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MongoUserDefinitionGetResultsInner> + beginCreateUpdateMongoUserDefinitionAsync(String mongoUserDefinitionId, String resourceGroupName, + String accountName, MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createUpdateMongoUserDefinitionWithResponseAsync(mongoUserDefinitionId, + resourceGroupName, accountName, createUpdateMongoUserDefinitionParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), MongoUserDefinitionGetResultsInner.class, + MongoUserDefinitionGetResultsInner.class, context); + } + + /** + * Creates or updates an Azure Cosmos DB Mongo User Definition. + * + * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateMongoUserDefinitionParameters The properties required to create or update a User Definition. + * @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 User Definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MongoUserDefinitionGetResultsInner> + beginCreateUpdateMongoUserDefinition(String mongoUserDefinitionId, String resourceGroupName, String accountName, + MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters) { + return this + .beginCreateUpdateMongoUserDefinitionAsync(mongoUserDefinitionId, resourceGroupName, accountName, + createUpdateMongoUserDefinitionParameters) + .getSyncPoller(); + } + + /** + * Creates or updates an Azure Cosmos DB Mongo User Definition. + * + * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateMongoUserDefinitionParameters The properties required to create or update a User Definition. + * @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 User Definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MongoUserDefinitionGetResultsInner> + beginCreateUpdateMongoUserDefinition(String mongoUserDefinitionId, String resourceGroupName, String accountName, + MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters, Context context) { + return this + .beginCreateUpdateMongoUserDefinitionAsync(mongoUserDefinitionId, resourceGroupName, accountName, + createUpdateMongoUserDefinitionParameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates an Azure Cosmos DB Mongo User Definition. + * + * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateMongoUserDefinitionParameters The properties required to create or update a User Definition. + * @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 User Definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createUpdateMongoUserDefinitionAsync(String mongoUserDefinitionId, + String resourceGroupName, String accountName, + MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters) { + return beginCreateUpdateMongoUserDefinitionAsync(mongoUserDefinitionId, resourceGroupName, accountName, + createUpdateMongoUserDefinitionParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an Azure Cosmos DB Mongo User Definition. + * + * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateMongoUserDefinitionParameters The properties required to create or update a User Definition. + * @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 User Definition on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createUpdateMongoUserDefinitionAsync(String mongoUserDefinitionId, + String resourceGroupName, String accountName, + MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters, Context context) { + return beginCreateUpdateMongoUserDefinitionAsync(mongoUserDefinitionId, resourceGroupName, accountName, + createUpdateMongoUserDefinitionParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an Azure Cosmos DB Mongo User Definition. + * + * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateMongoUserDefinitionParameters The properties required to create or update a User Definition. + * @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 User Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MongoUserDefinitionGetResultsInner createUpdateMongoUserDefinition(String mongoUserDefinitionId, + String resourceGroupName, String accountName, + MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters) { + return createUpdateMongoUserDefinitionAsync(mongoUserDefinitionId, resourceGroupName, accountName, + createUpdateMongoUserDefinitionParameters).block(); + } + + /** + * Creates or updates an Azure Cosmos DB Mongo User Definition. + * + * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param createUpdateMongoUserDefinitionParameters The properties required to create or update a User Definition. + * @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 User Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MongoUserDefinitionGetResultsInner createUpdateMongoUserDefinition(String mongoUserDefinitionId, + String resourceGroupName, String accountName, + MongoUserDefinitionCreateUpdateParameters createUpdateMongoUserDefinitionParameters, Context context) { + return createUpdateMongoUserDefinitionAsync(mongoUserDefinitionId, resourceGroupName, accountName, + createUpdateMongoUserDefinitionParameters, context).block(); + } + + /** + * Deletes an existing Azure Cosmos DB Mongo User Definition. + * + * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> deleteMongoUserDefinitionWithResponseAsync(String mongoUserDefinitionId, + String resourceGroupName, String accountName) { + if (mongoUserDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter mongoUserDefinitionId 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.")); + } + return FluxUtil + .withContext( + context -> service.deleteMongoUserDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, mongoUserDefinitionId, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing Azure Cosmos DB Mongo User Definition. + * + * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. + * @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 {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> deleteMongoUserDefinitionWithResponseAsync(String mongoUserDefinitionId, + String resourceGroupName, String accountName, Context context) { + if (mongoUserDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter mongoUserDefinitionId 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.")); + } + context = this.client.mergeContext(context); + return service.deleteMongoUserDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, mongoUserDefinitionId, context); + } + + /** + * Deletes an existing Azure Cosmos DB Mongo User Definition. + * + * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginDeleteMongoUserDefinitionAsync(String mongoUserDefinitionId, + String resourceGroupName, String accountName) { + Mono>> mono + = deleteMongoUserDefinitionWithResponseAsync(mongoUserDefinitionId, resourceGroupName, accountName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing Azure Cosmos DB Mongo User Definition. + * + * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. + * @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 {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, Void> beginDeleteMongoUserDefinitionAsync(String mongoUserDefinitionId, + String resourceGroupName, String accountName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteMongoUserDefinitionWithResponseAsync(mongoUserDefinitionId, + resourceGroupName, accountName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing Azure Cosmos DB Mongo User Definition. + * + * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteMongoUserDefinition(String mongoUserDefinitionId, + String resourceGroupName, String accountName) { + return this.beginDeleteMongoUserDefinitionAsync(mongoUserDefinitionId, resourceGroupName, accountName) + .getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB Mongo User Definition. + * + * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. + * @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 {@link SyncPoller} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, Void> beginDeleteMongoUserDefinition(String mongoUserDefinitionId, + String resourceGroupName, String accountName, Context context) { + return this.beginDeleteMongoUserDefinitionAsync(mongoUserDefinitionId, resourceGroupName, accountName, context) + .getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB Mongo User Definition. + * + * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono deleteMongoUserDefinitionAsync(String mongoUserDefinitionId, String resourceGroupName, + String accountName) { + return beginDeleteMongoUserDefinitionAsync(mongoUserDefinitionId, resourceGroupName, accountName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB Mongo User Definition. + * + * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. + * @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 A {@link Mono} that completes when a successful response is received. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono deleteMongoUserDefinitionAsync(String mongoUserDefinitionId, String resourceGroupName, + String accountName, Context context) { + return beginDeleteMongoUserDefinitionAsync(mongoUserDefinitionId, resourceGroupName, accountName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB Mongo User Definition. + * + * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteMongoUserDefinition(String mongoUserDefinitionId, String resourceGroupName, String accountName) { + deleteMongoUserDefinitionAsync(mongoUserDefinitionId, resourceGroupName, accountName).block(); + } + + /** + * Deletes an existing Azure Cosmos DB Mongo User Definition. + * + * @param mongoUserDefinitionId The ID for the User Definition {dbName.userName}. + * @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. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public void deleteMongoUserDefinition(String mongoUserDefinitionId, String resourceGroupName, String accountName, + Context context) { + deleteMongoUserDefinitionAsync(mongoUserDefinitionId, resourceGroupName, accountName, context).block(); + } + + /** + * Retrieves the list of all Azure Cosmos DB Mongo User Definition. + * + * @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 relevant User Definition along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listMongoUserDefinitionsSinglePageAsync(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.listMongoUserDefinitions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the list of all Azure Cosmos DB Mongo User Definition. + * + * @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 relevant User Definition along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listMongoUserDefinitionsSinglePageAsync(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 + .listMongoUserDefinitions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Retrieves the list of all Azure Cosmos DB Mongo User Definition. + * + * @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 relevant User Definition as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMongoUserDefinitionsAsync(String resourceGroupName, + String accountName) { + return new PagedFlux<>(() -> listMongoUserDefinitionsSinglePageAsync(resourceGroupName, accountName), + nextLink -> listMongoUserDefinitionsNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves the list of all Azure Cosmos DB Mongo User Definition. + * + * @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 relevant User Definition as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listMongoUserDefinitionsAsync(String resourceGroupName, + String accountName, Context context) { + return new PagedFlux<>(() -> listMongoUserDefinitionsSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listMongoUserDefinitionsNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves the list of all Azure Cosmos DB Mongo User Definition. + * + * @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 relevant User Definition as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMongoUserDefinitions(String resourceGroupName, + String accountName) { + return new PagedIterable<>(listMongoUserDefinitionsAsync(resourceGroupName, accountName)); + } + + /** + * Retrieves the list of all Azure Cosmos DB Mongo User Definition. + * + * @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 relevant User Definition as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMongoUserDefinitions(String resourceGroupName, + String accountName, Context context) { + return new PagedIterable<>(listMongoUserDefinitionsAsync(resourceGroupName, accountName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 MongoDB databases and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listMongoDBDatabasesNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listMongoDBDatabasesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 MongoDB databases and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMongoDBDatabasesNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listMongoDBDatabasesNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 MongoDB collections and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listMongoDBCollectionsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listMongoDBCollectionsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 MongoDB collections and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listMongoDBCollectionsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listMongoDBCollectionsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 relevant Mongo Role Definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listMongoRoleDefinitionsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listMongoRoleDefinitionsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 relevant Mongo Role Definitions along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listMongoRoleDefinitionsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listMongoRoleDefinitionsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 relevant User Definition along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listMongoUserDefinitionsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listMongoUserDefinitionsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 relevant User Definition along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listMongoUserDefinitionsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listMongoUserDefinitionsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/MongoMIResourcesClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/MongoMIResourcesClientImpl.java new file mode 100644 index 000000000000..d282013e3b03 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/MongoMIResourcesClientImpl.java @@ -0,0 +1,1887 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.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.MongoMIResourcesClient; +import com.azure.resourcemanager.cosmos.fluent.models.MongoMIRoleAssignmentResourceInner; +import com.azure.resourcemanager.cosmos.fluent.models.MongoMIRoleDefinitionResourceInner; +import com.azure.resourcemanager.cosmos.implementation.models.MongoMIRoleAssignmentListResult; +import com.azure.resourcemanager.cosmos.implementation.models.MongoMIRoleDefinitionListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in MongoMIResourcesClient. + */ +public final class MongoMIResourcesClientImpl implements MongoMIResourcesClient { + /** + * The proxy service used to perform REST calls. + */ + private final MongoMIResourcesService service; + + /** + * The service client containing this operation class. + */ + private final CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of MongoMIResourcesClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + MongoMIResourcesClientImpl(CosmosDBManagementClientImpl client) { + this.service + = RestProxy.create(MongoMIResourcesService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CosmosDBManagementClientMongoMIResources to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CosmosDBManagementClientMongoMIResources") + public interface MongoMIResourcesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleDefinitions/{roleDefinitionId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getMongoMIRoleDefinition( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("roleDefinitionId") String roleDefinitionId, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleDefinitions/{roleDefinitionId}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createUpdateMongoMIRoleDefinition(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("roleDefinitionId") String roleDefinitionId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") MongoMIRoleDefinitionResourceInner createUpdateMongoMIRoleDefinitionParameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleDefinitions/{roleDefinitionId}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteMongoMIRoleDefinition(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("roleDefinitionId") String roleDefinitionId, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleDefinitions") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMongoMIRoleDefinitions( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleAssignments/{roleAssignmentId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getMongoMIRoleAssignment( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("roleAssignmentId") String roleAssignmentId, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleAssignments/{roleAssignmentId}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createUpdateMongoMIRoleAssignment(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("roleAssignmentId") String roleAssignmentId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") MongoMIRoleAssignmentResourceInner createUpdateMongoMIRoleAssignmentParameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleAssignments/{roleAssignmentId}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteMongoMIRoleAssignment(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("roleAssignmentId") String roleAssignmentId, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongoMIRoleAssignments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMongoMIRoleAssignments( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMongoMIRoleDefinitionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMongoMIRoleAssignmentsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Definition with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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 parameters to create and update an Azure Cosmos DB MongoMI Role Definition along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getMongoMIRoleDefinitionWithResponseAsync( + String resourceGroupName, String accountName, String roleDefinitionId) { + 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 (roleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getMongoMIRoleDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleDefinitionId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Definition with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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 parameters to create and update an Azure Cosmos DB MongoMI Role Definition along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getMongoMIRoleDefinitionWithResponseAsync( + String resourceGroupName, String accountName, String roleDefinitionId, 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 (roleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getMongoMIRoleDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleDefinitionId, accept, context); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Definition with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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 parameters to create and update an Azure Cosmos DB MongoMI Role Definition on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getMongoMIRoleDefinitionAsync(String resourceGroupName, + String accountName, String roleDefinitionId) { + return getMongoMIRoleDefinitionWithResponseAsync(resourceGroupName, accountName, roleDefinitionId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Definition with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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 parameters to create and update an Azure Cosmos DB MongoMI Role Definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getMongoMIRoleDefinitionWithResponse(String resourceGroupName, + String accountName, String roleDefinitionId, Context context) { + return getMongoMIRoleDefinitionWithResponseAsync(resourceGroupName, accountName, roleDefinitionId, context) + .block(); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Definition with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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 parameters to create and update an Azure Cosmos DB MongoMI Role Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MongoMIRoleDefinitionResourceInner getMongoMIRoleDefinition(String resourceGroupName, String accountName, + String roleDefinitionId) { + return getMongoMIRoleDefinitionWithResponse(resourceGroupName, accountName, roleDefinitionId, Context.NONE) + .getValue(); + } + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateMongoMIRoleDefinitionParameters The properties required to create or update a Role Definition. + * @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 parameters to create and update an Azure Cosmos DB MongoMI Role Definition along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createUpdateMongoMIRoleDefinitionWithResponseAsync(String resourceGroupName, + String accountName, String roleDefinitionId, + MongoMIRoleDefinitionResourceInner createUpdateMongoMIRoleDefinitionParameters) { + 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 (roleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); + } + if (createUpdateMongoMIRoleDefinitionParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateMongoMIRoleDefinitionParameters is required and cannot be null.")); + } else { + createUpdateMongoMIRoleDefinitionParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createUpdateMongoMIRoleDefinition(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + roleDefinitionId, contentType, accept, createUpdateMongoMIRoleDefinitionParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateMongoMIRoleDefinitionParameters The properties required to create or update a Role Definition. + * @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 parameters to create and update an Azure Cosmos DB MongoMI Role Definition along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createUpdateMongoMIRoleDefinitionWithResponseAsync( + String resourceGroupName, String accountName, String roleDefinitionId, + MongoMIRoleDefinitionResourceInner createUpdateMongoMIRoleDefinitionParameters, 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 (roleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); + } + if (createUpdateMongoMIRoleDefinitionParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateMongoMIRoleDefinitionParameters is required and cannot be null.")); + } else { + createUpdateMongoMIRoleDefinitionParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createUpdateMongoMIRoleDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleDefinitionId, contentType, accept, + createUpdateMongoMIRoleDefinitionParameters, context); + } + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateMongoMIRoleDefinitionParameters The properties required to create or update a Role Definition. + * @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 parameters to create and update an Azure Cosmos DB MongoMI Role + * Definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, MongoMIRoleDefinitionResourceInner> + beginCreateUpdateMongoMIRoleDefinitionAsync(String resourceGroupName, String accountName, + String roleDefinitionId, MongoMIRoleDefinitionResourceInner createUpdateMongoMIRoleDefinitionParameters) { + Mono>> mono = createUpdateMongoMIRoleDefinitionWithResponseAsync(resourceGroupName, + accountName, roleDefinitionId, createUpdateMongoMIRoleDefinitionParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), MongoMIRoleDefinitionResourceInner.class, + MongoMIRoleDefinitionResourceInner.class, this.client.getContext()); + } + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateMongoMIRoleDefinitionParameters The properties required to create or update a Role Definition. + * @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 parameters to create and update an Azure Cosmos DB MongoMI Role + * Definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MongoMIRoleDefinitionResourceInner> + beginCreateUpdateMongoMIRoleDefinitionAsync(String resourceGroupName, String accountName, + String roleDefinitionId, MongoMIRoleDefinitionResourceInner createUpdateMongoMIRoleDefinitionParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createUpdateMongoMIRoleDefinitionWithResponseAsync(resourceGroupName, + accountName, roleDefinitionId, createUpdateMongoMIRoleDefinitionParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), MongoMIRoleDefinitionResourceInner.class, + MongoMIRoleDefinitionResourceInner.class, context); + } + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateMongoMIRoleDefinitionParameters The properties required to create or update a Role Definition. + * @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 parameters to create and update an Azure Cosmos DB MongoMI Role + * Definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MongoMIRoleDefinitionResourceInner> + beginCreateUpdateMongoMIRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId, + MongoMIRoleDefinitionResourceInner createUpdateMongoMIRoleDefinitionParameters) { + return this + .beginCreateUpdateMongoMIRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, + createUpdateMongoMIRoleDefinitionParameters) + .getSyncPoller(); + } + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateMongoMIRoleDefinitionParameters The properties required to create or update a Role Definition. + * @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 parameters to create and update an Azure Cosmos DB MongoMI Role + * Definition. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MongoMIRoleDefinitionResourceInner> + beginCreateUpdateMongoMIRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId, + MongoMIRoleDefinitionResourceInner createUpdateMongoMIRoleDefinitionParameters, Context context) { + return this + .beginCreateUpdateMongoMIRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, + createUpdateMongoMIRoleDefinitionParameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateMongoMIRoleDefinitionParameters The properties required to create or update a Role Definition. + * @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 parameters to create and update an Azure Cosmos DB MongoMI Role Definition on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createUpdateMongoMIRoleDefinitionAsync(String resourceGroupName, + String accountName, String roleDefinitionId, + MongoMIRoleDefinitionResourceInner createUpdateMongoMIRoleDefinitionParameters) { + return beginCreateUpdateMongoMIRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, + createUpdateMongoMIRoleDefinitionParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateMongoMIRoleDefinitionParameters The properties required to create or update a Role Definition. + * @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 parameters to create and update an Azure Cosmos DB MongoMI Role Definition on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createUpdateMongoMIRoleDefinitionAsync(String resourceGroupName, + String accountName, String roleDefinitionId, + MongoMIRoleDefinitionResourceInner createUpdateMongoMIRoleDefinitionParameters, Context context) { + return beginCreateUpdateMongoMIRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, + createUpdateMongoMIRoleDefinitionParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateMongoMIRoleDefinitionParameters The properties required to create or update a Role Definition. + * @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 parameters to create and update an Azure Cosmos DB MongoMI Role Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MongoMIRoleDefinitionResourceInner createUpdateMongoMIRoleDefinition(String resourceGroupName, + String accountName, String roleDefinitionId, + MongoMIRoleDefinitionResourceInner createUpdateMongoMIRoleDefinitionParameters) { + return createUpdateMongoMIRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, + createUpdateMongoMIRoleDefinitionParameters).block(); + } + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateMongoMIRoleDefinitionParameters The properties required to create or update a Role Definition. + * @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 parameters to create and update an Azure Cosmos DB MongoMI Role Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MongoMIRoleDefinitionResourceInner createUpdateMongoMIRoleDefinition(String resourceGroupName, + String accountName, String roleDefinitionId, + MongoMIRoleDefinitionResourceInner createUpdateMongoMIRoleDefinitionParameters, Context context) { + return createUpdateMongoMIRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, + createUpdateMongoMIRoleDefinitionParameters, context).block(); + } + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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>> deleteMongoMIRoleDefinitionWithResponseAsync(String resourceGroupName, + String accountName, String roleDefinitionId) { + 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 (roleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> service.deleteMongoMIRoleDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleDefinitionId, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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>> deleteMongoMIRoleDefinitionWithResponseAsync(String resourceGroupName, + String accountName, String roleDefinitionId, 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 (roleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.deleteMongoMIRoleDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleDefinitionId, context); + } + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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> beginDeleteMongoMIRoleDefinitionAsync(String resourceGroupName, + String accountName, String roleDefinitionId) { + Mono>> mono + = deleteMongoMIRoleDefinitionWithResponseAsync(resourceGroupName, accountName, roleDefinitionId); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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> beginDeleteMongoMIRoleDefinitionAsync(String resourceGroupName, + String accountName, String roleDefinitionId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteMongoMIRoleDefinitionWithResponseAsync(resourceGroupName, accountName, roleDefinitionId, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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> beginDeleteMongoMIRoleDefinition(String resourceGroupName, + String accountName, String roleDefinitionId) { + return this.beginDeleteMongoMIRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId) + .getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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> beginDeleteMongoMIRoleDefinition(String resourceGroupName, + String accountName, String roleDefinitionId, Context context) { + return this.beginDeleteMongoMIRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, context) + .getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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 deleteMongoMIRoleDefinitionAsync(String resourceGroupName, String accountName, + String roleDefinitionId) { + return beginDeleteMongoMIRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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 deleteMongoMIRoleDefinitionAsync(String resourceGroupName, String accountName, + String roleDefinitionId, Context context) { + return beginDeleteMongoMIRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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 deleteMongoMIRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId) { + deleteMongoMIRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId).block(); + } + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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 deleteMongoMIRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId, + Context context) { + deleteMongoMIRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, context).block(); + } + + /** + * Retrieves the list of all Azure Cosmos DB MongoMI Role Definitions. + * + * @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 response of a MongoMIRoleDefinitionResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listMongoMIRoleDefinitionsSinglePageAsync(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.listMongoMIRoleDefinitions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the list of all Azure Cosmos DB MongoMI Role Definitions. + * + * @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 response of a MongoMIRoleDefinitionResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listMongoMIRoleDefinitionsSinglePageAsync(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 + .listMongoMIRoleDefinitions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Retrieves the list of all Azure Cosmos DB MongoMI Role Definitions. + * + * @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 response of a MongoMIRoleDefinitionResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMongoMIRoleDefinitionsAsync(String resourceGroupName, + String accountName) { + return new PagedFlux<>(() -> listMongoMIRoleDefinitionsSinglePageAsync(resourceGroupName, accountName), + nextLink -> listMongoMIRoleDefinitionsNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves the list of all Azure Cosmos DB MongoMI Role Definitions. + * + * @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 response of a MongoMIRoleDefinitionResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listMongoMIRoleDefinitionsAsync(String resourceGroupName, + String accountName, Context context) { + return new PagedFlux<>(() -> listMongoMIRoleDefinitionsSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listMongoMIRoleDefinitionsNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves the list of all Azure Cosmos DB MongoMI Role Definitions. + * + * @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 response of a MongoMIRoleDefinitionResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMongoMIRoleDefinitions(String resourceGroupName, + String accountName) { + return new PagedIterable<>(listMongoMIRoleDefinitionsAsync(resourceGroupName, accountName)); + } + + /** + * Retrieves the list of all Azure Cosmos DB MongoMI Role Definitions. + * + * @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 response of a MongoMIRoleDefinitionResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMongoMIRoleDefinitions(String resourceGroupName, + String accountName, Context context) { + return new PagedIterable<>(listMongoMIRoleDefinitionsAsync(resourceGroupName, accountName, context)); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Assignment with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB MongoMI Role Assignment along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getMongoMIRoleAssignmentWithResponseAsync( + String resourceGroupName, String accountName, String roleAssignmentId) { + 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 (roleAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getMongoMIRoleAssignment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleAssignmentId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Assignment with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB MongoMI Role Assignment along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getMongoMIRoleAssignmentWithResponseAsync( + String resourceGroupName, String accountName, String roleAssignmentId, 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 (roleAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getMongoMIRoleAssignment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleAssignmentId, accept, context); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Assignment with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB MongoMI Role Assignment on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getMongoMIRoleAssignmentAsync(String resourceGroupName, + String accountName, String roleAssignmentId) { + return getMongoMIRoleAssignmentWithResponseAsync(resourceGroupName, accountName, roleAssignmentId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Assignment with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB MongoMI Role Assignment along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getMongoMIRoleAssignmentWithResponse(String resourceGroupName, + String accountName, String roleAssignmentId, Context context) { + return getMongoMIRoleAssignmentWithResponseAsync(resourceGroupName, accountName, roleAssignmentId, context) + .block(); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB MongoMI Role Assignment with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB MongoMI Role Assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MongoMIRoleAssignmentResourceInner getMongoMIRoleAssignment(String resourceGroupName, String accountName, + String roleAssignmentId) { + return getMongoMIRoleAssignmentWithResponse(resourceGroupName, accountName, roleAssignmentId, Context.NONE) + .getValue(); + } + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateMongoMIRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB MongoMI Role Assignment along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createUpdateMongoMIRoleAssignmentWithResponseAsync(String resourceGroupName, + String accountName, String roleAssignmentId, + MongoMIRoleAssignmentResourceInner createUpdateMongoMIRoleAssignmentParameters) { + 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 (roleAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); + } + if (createUpdateMongoMIRoleAssignmentParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateMongoMIRoleAssignmentParameters is required and cannot be null.")); + } else { + createUpdateMongoMIRoleAssignmentParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createUpdateMongoMIRoleAssignment(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + roleAssignmentId, contentType, accept, createUpdateMongoMIRoleAssignmentParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateMongoMIRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB MongoMI Role Assignment along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createUpdateMongoMIRoleAssignmentWithResponseAsync( + String resourceGroupName, String accountName, String roleAssignmentId, + MongoMIRoleAssignmentResourceInner createUpdateMongoMIRoleAssignmentParameters, 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 (roleAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); + } + if (createUpdateMongoMIRoleAssignmentParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateMongoMIRoleAssignmentParameters is required and cannot be null.")); + } else { + createUpdateMongoMIRoleAssignmentParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createUpdateMongoMIRoleAssignment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleAssignmentId, contentType, accept, + createUpdateMongoMIRoleAssignmentParameters, context); + } + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateMongoMIRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB MongoMI Role + * Assignment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, MongoMIRoleAssignmentResourceInner> + beginCreateUpdateMongoMIRoleAssignmentAsync(String resourceGroupName, String accountName, + String roleAssignmentId, MongoMIRoleAssignmentResourceInner createUpdateMongoMIRoleAssignmentParameters) { + Mono>> mono = createUpdateMongoMIRoleAssignmentWithResponseAsync(resourceGroupName, + accountName, roleAssignmentId, createUpdateMongoMIRoleAssignmentParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), MongoMIRoleAssignmentResourceInner.class, + MongoMIRoleAssignmentResourceInner.class, this.client.getContext()); + } + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateMongoMIRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB MongoMI Role + * Assignment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, MongoMIRoleAssignmentResourceInner> + beginCreateUpdateMongoMIRoleAssignmentAsync(String resourceGroupName, String accountName, + String roleAssignmentId, MongoMIRoleAssignmentResourceInner createUpdateMongoMIRoleAssignmentParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createUpdateMongoMIRoleAssignmentWithResponseAsync(resourceGroupName, + accountName, roleAssignmentId, createUpdateMongoMIRoleAssignmentParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), MongoMIRoleAssignmentResourceInner.class, + MongoMIRoleAssignmentResourceInner.class, context); + } + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateMongoMIRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB MongoMI Role + * Assignment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MongoMIRoleAssignmentResourceInner> + beginCreateUpdateMongoMIRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId, + MongoMIRoleAssignmentResourceInner createUpdateMongoMIRoleAssignmentParameters) { + return this + .beginCreateUpdateMongoMIRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, + createUpdateMongoMIRoleAssignmentParameters) + .getSyncPoller(); + } + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateMongoMIRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB MongoMI Role + * Assignment. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, MongoMIRoleAssignmentResourceInner> + beginCreateUpdateMongoMIRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId, + MongoMIRoleAssignmentResourceInner createUpdateMongoMIRoleAssignmentParameters, Context context) { + return this + .beginCreateUpdateMongoMIRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, + createUpdateMongoMIRoleAssignmentParameters, context) + .getSyncPoller(); + } + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateMongoMIRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB MongoMI Role Assignment on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createUpdateMongoMIRoleAssignmentAsync(String resourceGroupName, + String accountName, String roleAssignmentId, + MongoMIRoleAssignmentResourceInner createUpdateMongoMIRoleAssignmentParameters) { + return beginCreateUpdateMongoMIRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, + createUpdateMongoMIRoleAssignmentParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateMongoMIRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB MongoMI Role Assignment on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createUpdateMongoMIRoleAssignmentAsync(String resourceGroupName, + String accountName, String roleAssignmentId, + MongoMIRoleAssignmentResourceInner createUpdateMongoMIRoleAssignmentParameters, Context context) { + return beginCreateUpdateMongoMIRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, + createUpdateMongoMIRoleAssignmentParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateMongoMIRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB MongoMI Role Assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MongoMIRoleAssignmentResourceInner createUpdateMongoMIRoleAssignment(String resourceGroupName, + String accountName, String roleAssignmentId, + MongoMIRoleAssignmentResourceInner createUpdateMongoMIRoleAssignmentParameters) { + return createUpdateMongoMIRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, + createUpdateMongoMIRoleAssignmentParameters).block(); + } + + /** + * Creates or updates an Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateMongoMIRoleAssignmentParameters The properties required to create or update a Role Assignment. + * @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 parameters to create and update an Azure Cosmos DB MongoMI Role Assignment. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public MongoMIRoleAssignmentResourceInner createUpdateMongoMIRoleAssignment(String resourceGroupName, + String accountName, String roleAssignmentId, + MongoMIRoleAssignmentResourceInner createUpdateMongoMIRoleAssignmentParameters, Context context) { + return createUpdateMongoMIRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, + createUpdateMongoMIRoleAssignmentParameters, context).block(); + } + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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>> deleteMongoMIRoleAssignmentWithResponseAsync(String resourceGroupName, + String accountName, String roleAssignmentId) { + 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 (roleAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); + } + return FluxUtil + .withContext( + context -> service.deleteMongoMIRoleAssignment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleAssignmentId, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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>> deleteMongoMIRoleAssignmentWithResponseAsync(String resourceGroupName, + String accountName, String roleAssignmentId, 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 (roleAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.deleteMongoMIRoleAssignment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleAssignmentId, context); + } + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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> beginDeleteMongoMIRoleAssignmentAsync(String resourceGroupName, + String accountName, String roleAssignmentId) { + Mono>> mono + = deleteMongoMIRoleAssignmentWithResponseAsync(resourceGroupName, accountName, roleAssignmentId); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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> beginDeleteMongoMIRoleAssignmentAsync(String resourceGroupName, + String accountName, String roleAssignmentId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteMongoMIRoleAssignmentWithResponseAsync(resourceGroupName, accountName, roleAssignmentId, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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> beginDeleteMongoMIRoleAssignment(String resourceGroupName, + String accountName, String roleAssignmentId) { + return this.beginDeleteMongoMIRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId) + .getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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> beginDeleteMongoMIRoleAssignment(String resourceGroupName, + String accountName, String roleAssignmentId, Context context) { + return this.beginDeleteMongoMIRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, context) + .getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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 deleteMongoMIRoleAssignmentAsync(String resourceGroupName, String accountName, + String roleAssignmentId) { + return beginDeleteMongoMIRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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 deleteMongoMIRoleAssignmentAsync(String resourceGroupName, String accountName, + String roleAssignmentId, Context context) { + return beginDeleteMongoMIRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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 deleteMongoMIRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId) { + deleteMongoMIRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId).block(); + } + + /** + * Deletes an existing Azure Cosmos DB MongoMI Role Assignment. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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 deleteMongoMIRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId, + Context context) { + deleteMongoMIRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, context).block(); + } + + /** + * Retrieves the list of all Azure Cosmos DB MongoMI Role Assignments. + * + * @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 response of a MongoMIRoleAssignmentResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listMongoMIRoleAssignmentsSinglePageAsync(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.listMongoMIRoleAssignments(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the list of all Azure Cosmos DB MongoMI Role Assignments. + * + * @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 response of a MongoMIRoleAssignmentResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listMongoMIRoleAssignmentsSinglePageAsync(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 + .listMongoMIRoleAssignments(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Retrieves the list of all Azure Cosmos DB MongoMI Role Assignments. + * + * @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 response of a MongoMIRoleAssignmentResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listMongoMIRoleAssignmentsAsync(String resourceGroupName, + String accountName) { + return new PagedFlux<>(() -> listMongoMIRoleAssignmentsSinglePageAsync(resourceGroupName, accountName), + nextLink -> listMongoMIRoleAssignmentsNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves the list of all Azure Cosmos DB MongoMI Role Assignments. + * + * @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 response of a MongoMIRoleAssignmentResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listMongoMIRoleAssignmentsAsync(String resourceGroupName, + String accountName, Context context) { + return new PagedFlux<>(() -> listMongoMIRoleAssignmentsSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listMongoMIRoleAssignmentsNextSinglePageAsync(nextLink, context)); + } + + /** + * Retrieves the list of all Azure Cosmos DB MongoMI Role Assignments. + * + * @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 response of a MongoMIRoleAssignmentResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMongoMIRoleAssignments(String resourceGroupName, + String accountName) { + return new PagedIterable<>(listMongoMIRoleAssignmentsAsync(resourceGroupName, accountName)); + } + + /** + * Retrieves the list of all Azure Cosmos DB MongoMI Role Assignments. + * + * @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 response of a MongoMIRoleAssignmentResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listMongoMIRoleAssignments(String resourceGroupName, + String accountName, Context context) { + return new PagedIterable<>(listMongoMIRoleAssignmentsAsync(resourceGroupName, accountName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a MongoMIRoleDefinitionResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listMongoMIRoleDefinitionsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listMongoMIRoleDefinitionsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a MongoMIRoleDefinitionResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listMongoMIRoleDefinitionsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listMongoMIRoleDefinitionsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a MongoMIRoleAssignmentResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listMongoMIRoleAssignmentsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listMongoMIRoleAssignmentsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a MongoMIRoleAssignmentResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listMongoMIRoleAssignmentsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listMongoMIRoleAssignmentsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/NetworkSecurityPerimeterConfigurationsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/NetworkSecurityPerimeterConfigurationsClientImpl.java new file mode 100644 index 000000000000..31d1ab85c23a --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/NetworkSecurityPerimeterConfigurationsClientImpl.java @@ -0,0 +1,685 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation; + +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.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.NetworkSecurityPerimeterConfigurationsClient; +import com.azure.resourcemanager.cosmos.fluent.models.NetworkSecurityPerimeterConfigurationInner; +import com.azure.resourcemanager.cosmos.implementation.models.NetworkSecurityPerimeterConfigurationListResult; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in + * NetworkSecurityPerimeterConfigurationsClient. + */ +public final class NetworkSecurityPerimeterConfigurationsClientImpl + implements NetworkSecurityPerimeterConfigurationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final NetworkSecurityPerimeterConfigurationsService service; + + /** + * The service client containing this operation class. + */ + private final CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of NetworkSecurityPerimeterConfigurationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + NetworkSecurityPerimeterConfigurationsClientImpl(CosmosDBManagementClientImpl client) { + this.service = RestProxy.create(NetworkSecurityPerimeterConfigurationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CosmosDBManagementClientNetworkSecurityPerimeterConfigurations to be + * used by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CosmosDBManagementClientNetworkSecurityPerimeterConfigurations") + public interface NetworkSecurityPerimeterConfigurationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("networkSecurityPerimeterConfigurationName") String networkSecurityPerimeterConfigurationName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/networkSecurityPerimeterConfigurations/{networkSecurityPerimeterConfigurationName}/reconcile") + @ExpectedResponses({ 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> reconcile(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("networkSecurityPerimeterConfigurationName") String networkSecurityPerimeterConfigurationName, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Gets effective Network Security Perimeter Configuration for association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @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 effective Network Security Perimeter Configuration for association along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, + String accountName, String networkSecurityPerimeterConfigurationName) { + 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 (networkSecurityPerimeterConfigurationName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter networkSecurityPerimeterConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, + networkSecurityPerimeterConfigurationName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets effective Network Security Perimeter Configuration for association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @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 effective Network Security Perimeter Configuration for association along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String accountName, String networkSecurityPerimeterConfigurationName, 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 (networkSecurityPerimeterConfigurationName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter networkSecurityPerimeterConfigurationName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, networkSecurityPerimeterConfigurationName, accept, context); + } + + /** + * Gets effective Network Security Perimeter Configuration for association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @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 effective Network Security Perimeter Configuration for association on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName) { + return getWithResponseAsync(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets effective Network Security Perimeter Configuration for association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @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 effective Network Security Perimeter Configuration for association along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String accountName, String networkSecurityPerimeterConfigurationName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName, context) + .block(); + } + + /** + * Gets effective Network Security Perimeter Configuration for association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @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 effective Network Security Perimeter Configuration for association. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public NetworkSecurityPerimeterConfigurationInner get(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName) { + return getWithResponse(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName, Context.NONE) + .getValue(); + } + + /** + * Gets list of effective Network Security Perimeter Configuration for cosmos db 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 list of effective Network Security Perimeter Configuration for cosmos db account along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listSinglePageAsync(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.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets list of effective Network Security Perimeter Configuration for cosmos db 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 list of effective Network Security Perimeter Configuration for cosmos db account along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listSinglePageAsync(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 + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Gets list of effective Network Security Perimeter Configuration for cosmos db 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 list of effective Network Security Perimeter Configuration for cosmos db account as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, + String accountName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Gets list of effective Network Security Perimeter Configuration for cosmos db 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 list of effective Network Security Perimeter Configuration for cosmos db account as paginated response + * with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, + String accountName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets list of effective Network Security Perimeter Configuration for cosmos db 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 list of effective Network Security Perimeter Configuration for cosmos db account as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, + String accountName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName)); + } + + /** + * Gets list of effective Network Security Perimeter Configuration for cosmos db 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 list of effective Network Security Perimeter Configuration for cosmos db account as paginated response + * with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); + } + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @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>> reconcileWithResponseAsync(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName) { + 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 (networkSecurityPerimeterConfigurationName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter networkSecurityPerimeterConfigurationName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.reconcile(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, + networkSecurityPerimeterConfigurationName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @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>> reconcileWithResponseAsync(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName, 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 (networkSecurityPerimeterConfigurationName == null) { + return Mono.error(new IllegalArgumentException( + "Parameter networkSecurityPerimeterConfigurationName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.reconcile(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, networkSecurityPerimeterConfigurationName, + context); + } + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @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> beginReconcileAsync(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName) { + Mono>> mono + = reconcileWithResponseAsync(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @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> beginReconcileAsync(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = reconcileWithResponseAsync(resourceGroupName, accountName, + networkSecurityPerimeterConfigurationName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @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> beginReconcile(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName) { + return this.beginReconcileAsync(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName) + .getSyncPoller(); + } + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @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> beginReconcile(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName, Context context) { + return this + .beginReconcileAsync(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName, context) + .getSyncPoller(); + } + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @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 reconcileAsync(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName) { + return beginReconcileAsync(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @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 reconcileAsync(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName, Context context) { + return beginReconcileAsync(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @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 reconcile(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName) { + reconcileAsync(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName).block(); + } + + /** + * Refreshes any information about the association. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param networkSecurityPerimeterConfigurationName The name for Network Security Perimeter configuration. + * @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 reconcile(String resourceGroupName, String accountName, + String networkSecurityPerimeterConfigurationName, Context context) { + reconcileAsync(resourceGroupName, accountName, networkSecurityPerimeterConfigurationName, context).block(); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 list of effective Network Security Perimeter Configuration for cosmos db account along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 list of effective Network Security Perimeter Configuration for cosmos db account along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/NotebookWorkspacesClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/NotebookWorkspacesClientImpl.java index 0a47b7158419..1100b685c77c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/NotebookWorkspacesClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/NotebookWorkspacesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -35,8 +35,8 @@ import com.azure.resourcemanager.cosmos.fluent.NotebookWorkspacesClient; import com.azure.resourcemanager.cosmos.fluent.models.NotebookWorkspaceConnectionInfoResultInner; import com.azure.resourcemanager.cosmos.fluent.models.NotebookWorkspaceInner; +import com.azure.resourcemanager.cosmos.implementation.models.NotebookWorkspaceListResult; import com.azure.resourcemanager.cosmos.models.NotebookWorkspaceCreateUpdateParameters; -import com.azure.resourcemanager.cosmos.models.NotebookWorkspaceListResult; import com.azure.resourcemanager.cosmos.models.NotebookWorkspaceName; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -71,50 +71,46 @@ public final class NotebookWorkspacesClientImpl implements NotebookWorkspacesCli * The interface defining all the services for CosmosDBManagementClientNotebookWorkspaces to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientNotebookWorkspaces") public interface NotebookWorkspacesService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByDatabaseAccount(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("accountName") String accountName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("accountName") String accountName, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("notebookWorkspaceName") NotebookWorkspaceName notebookWorkspaceName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("accountName") String accountName, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("notebookWorkspaceName") NotebookWorkspaceName notebookWorkspaceName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") NotebookWorkspaceCreateUpdateParameters notebookCreateUpdateParameters, - @HeaderParam("Accept") String accept, Context context); + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("accountName") String accountName, - @PathParam("notebookWorkspaceName") NotebookWorkspaceName notebookWorkspaceName, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("notebookWorkspaceName") NotebookWorkspaceName notebookWorkspaceName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDatabaseAccount(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -122,179 +118,37 @@ Mono>> delete(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listConnectionInfo( - @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("accountName") String accountName, + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("notebookWorkspaceName") NotebookWorkspaceName notebookWorkspaceName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/regenerateAuthToken") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> regenerateAuthToken(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("accountName") String accountName, - @PathParam("notebookWorkspaceName") NotebookWorkspaceName notebookWorkspaceName, - @HeaderParam("Accept") String accept, Context context); + Mono>> regenerateAuthToken(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("notebookWorkspaceName") NotebookWorkspaceName notebookWorkspaceName, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}/start") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> start(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("accountName") String accountName, - @PathParam("notebookWorkspaceName") NotebookWorkspaceName notebookWorkspaceName, - @HeaderParam("Accept") String accept, Context context); - } - - /** - * Gets the notebook workspace resources of an existing Cosmos DB 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 notebook workspace resources of an existing Cosmos DB account along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDatabaseAccountSinglePageAsync(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.listByDatabaseAccount(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accountName, 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())); - } - - /** - * Gets the notebook workspace resources of an existing Cosmos DB 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 notebook workspace resources of an existing Cosmos DB account along with {@link PagedResponse} on - * successful completion of {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDatabaseAccountSinglePageAsync(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 - .listByDatabaseAccount(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), accountName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); - } + Mono>> start(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("notebookWorkspaceName") NotebookWorkspaceName notebookWorkspaceName, Context context); - /** - * Gets the notebook workspace resources of an existing Cosmos DB 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 notebook workspace resources of an existing Cosmos DB account as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByDatabaseAccountAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>(() -> listByDatabaseAccountSinglePageAsync(resourceGroupName, accountName)); - } - - /** - * Gets the notebook workspace resources of an existing Cosmos DB 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 notebook workspace resources of an existing Cosmos DB account as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDatabaseAccountAsync(String resourceGroupName, String accountName, - Context context) { - return new PagedFlux<>(() -> listByDatabaseAccountSinglePageAsync(resourceGroupName, accountName, context)); - } - - /** - * Gets the notebook workspace resources of an existing Cosmos DB 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 notebook workspace resources of an existing Cosmos DB account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName) { - return new PagedIterable<>(listByDatabaseAccountAsync(resourceGroupName, accountName)); - } - - /** - * Gets the notebook workspace resources of an existing Cosmos DB 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 notebook workspace resources of an existing Cosmos DB account as paginated response with - * {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName, - Context context) { - return new PagedIterable<>(listByDatabaseAccountAsync(resourceGroupName, accountName, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDatabaseAccountNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -332,9 +186,8 @@ public Mono> getWithResponseAsync(String resour .error(new IllegalArgumentException("Parameter notebookWorkspaceName is required and cannot be null.")); } final String accept = "application/json"; - return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accountName, notebookWorkspaceName, accept, context)) + return FluxUtil.withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -375,8 +228,8 @@ private Mono> getWithResponseAsync(String resou } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), accountName, notebookWorkspaceName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, notebookWorkspaceName, accept, context); } /** @@ -473,11 +326,12 @@ public Mono>> createOrUpdateWithResponseAsync(String r } else { notebookCreateUpdateParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accountName, notebookWorkspaceName, - notebookCreateUpdateParameters, accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, contentType, + accept, notebookCreateUpdateParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -523,11 +377,12 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { notebookCreateUpdateParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), accountName, notebookWorkspaceName, notebookCreateUpdateParameters, accept, - context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, contentType, accept, + notebookCreateUpdateParameters, context); } /** @@ -737,10 +592,9 @@ public Mono>> deleteWithResponseAsync(String resourceG return Mono .error(new IllegalArgumentException("Parameter notebookWorkspaceName is required and cannot be null.")); } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accountName, notebookWorkspaceName, accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -778,10 +632,9 @@ private Mono>> deleteWithResponseAsync(String resource return Mono .error(new IllegalArgumentException("Parameter notebookWorkspaceName is required and cannot be null.")); } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), accountName, notebookWorkspaceName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, notebookWorkspaceName, context); } /** @@ -930,6 +783,154 @@ public void delete(String resourceGroupName, String accountName, NotebookWorkspa deleteAsync(resourceGroupName, accountName, notebookWorkspaceName, context).block(); } + /** + * Gets the notebook workspace resources of an existing Cosmos DB 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 notebook workspace resources of an existing Cosmos DB account along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDatabaseAccountSinglePageAsync(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.listByDatabaseAccount(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the notebook workspace resources of an existing Cosmos DB 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 notebook workspace resources of an existing Cosmos DB account along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDatabaseAccountSinglePageAsync(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 + .listByDatabaseAccount(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Gets the notebook workspace resources of an existing Cosmos DB 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 notebook workspace resources of an existing Cosmos DB account as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByDatabaseAccountAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listByDatabaseAccountSinglePageAsync(resourceGroupName, accountName), + nextLink -> listByDatabaseAccountNextSinglePageAsync(nextLink)); + } + + /** + * Gets the notebook workspace resources of an existing Cosmos DB 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 notebook workspace resources of an existing Cosmos DB account as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDatabaseAccountAsync(String resourceGroupName, String accountName, + Context context) { + return new PagedFlux<>(() -> listByDatabaseAccountSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listByDatabaseAccountNextSinglePageAsync(nextLink, context)); + } + + /** + * Gets the notebook workspace resources of an existing Cosmos DB 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 notebook workspace resources of an existing Cosmos DB account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName) { + return new PagedIterable<>(listByDatabaseAccountAsync(resourceGroupName, accountName)); + } + + /** + * Gets the notebook workspace resources of an existing Cosmos DB 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 notebook workspace resources of an existing Cosmos DB account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName, + Context context) { + return new PagedIterable<>(listByDatabaseAccountAsync(resourceGroupName, accountName, context)); + } + /** * Retrieves the connection info for the notebook workspace. * @@ -966,9 +967,9 @@ public Mono> listConnection } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listConnectionInfo(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accountName, - notebookWorkspaceName, accept, context)) + .withContext(context -> service.listConnectionInfo(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1009,8 +1010,8 @@ private Mono> listConnectio } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.listConnectionInfo(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), accountName, notebookWorkspaceName, accept, context); + return service.listConnectionInfo(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, accept, context); } /** @@ -1101,11 +1102,9 @@ public Mono>> regenerateAuthTokenWithResponseAsync(Str return Mono .error(new IllegalArgumentException("Parameter notebookWorkspaceName is required and cannot be null.")); } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.regenerateAuthToken(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, this.client.getApiVersion(), accountName, - notebookWorkspaceName, accept, context)) + .withContext(context -> service.regenerateAuthToken(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1143,10 +1142,9 @@ private Mono>> regenerateAuthTokenWithResponseAsync(St return Mono .error(new IllegalArgumentException("Parameter notebookWorkspaceName is required and cannot be null.")); } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.regenerateAuthToken(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accountName, notebookWorkspaceName, accept, context); + return service.regenerateAuthToken(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, context); } /** @@ -1331,10 +1329,9 @@ public Mono>> startWithResponseAsync(String resourceGr return Mono .error(new IllegalArgumentException("Parameter notebookWorkspaceName is required and cannot be null.")); } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.start(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accountName, notebookWorkspaceName, accept, context)) + .withContext(context -> service.start(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, notebookWorkspaceName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1372,10 +1369,9 @@ private Mono>> startWithResponseAsync(String resourceG return Mono .error(new IllegalArgumentException("Parameter notebookWorkspaceName is required and cannot be null.")); } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.start(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), accountName, notebookWorkspaceName, accept, context); + return service.start(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, notebookWorkspaceName, context); } /** @@ -1523,4 +1519,60 @@ public void start(String resourceGroupName, String accountName, NotebookWorkspac Context context) { startAsync(resourceGroupName, accountName, notebookWorkspaceName, context).block(); } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 notebook workspace resources of an existing Cosmos DB account along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDatabaseAccountNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByDatabaseAccountNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 notebook workspace resources of an existing Cosmos DB account along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDatabaseAccountNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByDatabaseAccountNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/OperationsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/OperationsClientImpl.java index 337f3a1ab793..e2c24233e777 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/OperationsClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/OperationsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.cosmos.fluent.OperationsClient; import com.azure.resourcemanager.cosmos.fluent.models.OperationInner; -import com.azure.resourcemanager.cosmos.models.OperationListResult; +import com.azure.resourcemanager.cosmos.implementation.models.OperationListResult; import reactor.core.publisher.Mono; /** @@ -59,14 +59,14 @@ public final class OperationsClientImpl implements OperationsClient { * The interface defining all the services for CosmosDBManagementClientOperations to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientOperations") public interface OperationsService { @Headers({ "Content-Type: application/json" }) @Get("/providers/Microsoft.DocumentDB/operations") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @@ -74,7 +74,7 @@ Mono> list(@HostParam("$host") String endpoint, @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) Mono> listNext(@PathParam(value = "nextLink", encoded = true) String nextLink, - @HostParam("$host") String endpoint, @HeaderParam("Accept") String accept, Context context); + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/PartitionKeyRangeIdRegionsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/PartitionKeyRangeIdRegionsClientImpl.java index 88886e4c3699..9d4b96332007 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/PartitionKeyRangeIdRegionsClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/PartitionKeyRangeIdRegionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.cosmos.fluent.PartitionKeyRangeIdRegionsClient; import com.azure.resourcemanager.cosmos.fluent.models.PartitionMetricInner; -import com.azure.resourcemanager.cosmos.models.PartitionMetricListResult; +import com.azure.resourcemanager.cosmos.implementation.models.PartitionMetricListResult; import reactor.core.publisher.Mono; /** @@ -59,20 +59,28 @@ public final class PartitionKeyRangeIdRegionsClientImpl implements PartitionKeyR * The interface defining all the services for CosmosDBManagementClientPartitionKeyRangeIdRegions to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientPartitionKeyRangeIdRegions") public interface PartitionKeyRangeIdRegionsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/region/{region}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listMetrics(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listMetrics(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("region") String region, @PathParam("databaseRid") String databaseRid, @PathParam("collectionRid") String collectionRid, - @PathParam("partitionKeyRangeId") String partitionKeyRangeId, @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + @PathParam("partitionKeyRangeId") String partitionKeyRangeId, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMetricsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -130,11 +138,11 @@ private Mono> listMetricsSinglePageAsync(Str } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listMetrics(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, region, databaseRid, collectionRid, partitionKeyRangeId, - this.client.getApiVersion(), filter, accept, context)) + .withContext(context -> service.listMetrics(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, region, databaseRid, collectionRid, + partitionKeyRangeId, filter, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -195,11 +203,11 @@ private Mono> listMetricsSinglePageAsync(Str final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listMetrics(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, - region, databaseRid, collectionRid, partitionKeyRangeId, this.client.getApiVersion(), filter, accept, + .listMetrics(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, region, databaseRid, collectionRid, partitionKeyRangeId, filter, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -223,7 +231,7 @@ private Mono> listMetricsSinglePageAsync(Str public PagedFlux listMetricsAsync(String resourceGroupName, String accountName, String region, String databaseRid, String collectionRid, String partitionKeyRangeId, String filter) { return new PagedFlux<>(() -> listMetricsSinglePageAsync(resourceGroupName, accountName, region, databaseRid, - collectionRid, partitionKeyRangeId, filter)); + collectionRid, partitionKeyRangeId, filter), nextLink -> listMetricsNextSinglePageAsync(nextLink)); } /** @@ -249,7 +257,8 @@ private PagedFlux listMetricsAsync(String resourceGroupNam String region, String databaseRid, String collectionRid, String partitionKeyRangeId, String filter, Context context) { return new PagedFlux<>(() -> listMetricsSinglePageAsync(resourceGroupName, accountName, region, databaseRid, - collectionRid, partitionKeyRangeId, filter, context)); + collectionRid, partitionKeyRangeId, filter, context), + nextLink -> listMetricsNextSinglePageAsync(nextLink, context)); } /** @@ -300,4 +309,58 @@ public PagedIterable listMetrics(String resourceGroupName, return new PagedIterable<>(listMetricsAsync(resourceGroupName, accountName, region, databaseRid, collectionRid, partitionKeyRangeId, filter, context)); } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list partition metrics request along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listMetricsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list partition metrics request along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listMetricsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/PartitionKeyRangeIdsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/PartitionKeyRangeIdsClientImpl.java index 284fb80304d7..e03f5a40b1e0 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/PartitionKeyRangeIdsClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/PartitionKeyRangeIdsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.cosmos.fluent.PartitionKeyRangeIdsClient; import com.azure.resourcemanager.cosmos.fluent.models.PartitionMetricInner; -import com.azure.resourcemanager.cosmos.models.PartitionMetricListResult; +import com.azure.resourcemanager.cosmos.implementation.models.PartitionMetricListResult; import reactor.core.publisher.Mono; /** @@ -59,19 +59,27 @@ public final class PartitionKeyRangeIdsClientImpl implements PartitionKeyRangeId * The interface defining all the services for CosmosDBManagementClientPartitionKeyRangeIds to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientPartitionKeyRangeIds") public interface PartitionKeyRangeIdsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/databases/{databaseRid}/collections/{collectionRid}/partitionKeyRangeId/{partitionKeyRangeId}/metrics") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listMetrics(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listMetrics(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("databaseRid") String databaseRid, @PathParam("collectionRid") String collectionRid, - @PathParam("partitionKeyRangeId") String partitionKeyRangeId, @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + @PathParam("partitionKeyRangeId") String partitionKeyRangeId, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMetricsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -124,11 +132,11 @@ private Mono> listMetricsSinglePageAsync(Str } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listMetrics(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseRid, collectionRid, partitionKeyRangeId, - this.client.getApiVersion(), filter, accept, context)) + .withContext(context -> service.listMetrics(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseRid, collectionRid, + partitionKeyRangeId, filter, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -185,10 +193,11 @@ private Mono> listMetricsSinglePageAsync(Str final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listMetrics(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, - databaseRid, collectionRid, partitionKeyRangeId, this.client.getApiVersion(), filter, accept, context) + .listMetrics(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, databaseRid, collectionRid, partitionKeyRangeId, filter, accept, + context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -211,7 +220,7 @@ private Mono> listMetricsSinglePageAsync(Str public PagedFlux listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String partitionKeyRangeId, String filter) { return new PagedFlux<>(() -> listMetricsSinglePageAsync(resourceGroupName, accountName, databaseRid, - collectionRid, partitionKeyRangeId, filter)); + collectionRid, partitionKeyRangeId, filter), nextLink -> listMetricsNextSinglePageAsync(nextLink)); } /** @@ -235,7 +244,8 @@ public PagedFlux listMetricsAsync(String resourceGroupName private PagedFlux listMetricsAsync(String resourceGroupName, String accountName, String databaseRid, String collectionRid, String partitionKeyRangeId, String filter, Context context) { return new PagedFlux<>(() -> listMetricsSinglePageAsync(resourceGroupName, accountName, databaseRid, - collectionRid, partitionKeyRangeId, filter, context)); + collectionRid, partitionKeyRangeId, filter, context), + nextLink -> listMetricsNextSinglePageAsync(nextLink, context)); } /** @@ -284,4 +294,58 @@ public PagedIterable listMetrics(String resourceGroupName, return new PagedIterable<>(listMetricsAsync(resourceGroupName, accountName, databaseRid, collectionRid, partitionKeyRangeId, filter, context)); } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list partition metrics request along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listMetricsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list partition metrics request along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listMetricsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/PercentileSourceTargetsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/PercentileSourceTargetsClientImpl.java index 50d71208bc11..43777bfd76fa 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/PercentileSourceTargetsClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/PercentileSourceTargetsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.cosmos.fluent.PercentileSourceTargetsClient; import com.azure.resourcemanager.cosmos.fluent.models.PercentileMetricInner; -import com.azure.resourcemanager.cosmos.models.PercentileMetricListResult; +import com.azure.resourcemanager.cosmos.implementation.models.PercentileMetricListResult; import reactor.core.publisher.Mono; /** @@ -59,18 +59,25 @@ public final class PercentileSourceTargetsClientImpl implements PercentileSource * The interface defining all the services for CosmosDBManagementClientPercentileSourceTargets to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientPercentileSourceTargets") public interface PercentileSourceTargetsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sourceRegion/{sourceRegion}/targetRegion/{targetRegion}/percentile/metrics") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listMetrics(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listMetrics(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("sourceRegion") String sourceRegion, @PathParam("targetRegion") String targetRegion, - @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMetricsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -122,11 +129,11 @@ private Mono> listMetricsSinglePageAsync(St } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listMetrics(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, sourceRegion, targetRegion, this.client.getApiVersion(), filter, accept, - context)) + .withContext(context -> service.listMetrics(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, sourceRegion, targetRegion, filter, + accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -180,10 +187,10 @@ private Mono> listMetricsSinglePageAsync(St final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listMetrics(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, - sourceRegion, targetRegion, this.client.getApiVersion(), filter, accept, context) + .listMetrics(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, sourceRegion, targetRegion, filter, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -208,7 +215,8 @@ private Mono> listMetricsSinglePageAsync(St public PagedFlux listMetricsAsync(String resourceGroupName, String accountName, String sourceRegion, String targetRegion, String filter) { return new PagedFlux<>( - () -> listMetricsSinglePageAsync(resourceGroupName, accountName, sourceRegion, targetRegion, filter)); + () -> listMetricsSinglePageAsync(resourceGroupName, accountName, sourceRegion, targetRegion, filter), + nextLink -> listMetricsNextSinglePageAsync(nextLink)); } /** @@ -234,7 +242,7 @@ public PagedFlux listMetricsAsync(String resourceGroupNam private PagedFlux listMetricsAsync(String resourceGroupName, String accountName, String sourceRegion, String targetRegion, String filter, Context context) { return new PagedFlux<>(() -> listMetricsSinglePageAsync(resourceGroupName, accountName, sourceRegion, - targetRegion, filter, context)); + targetRegion, filter, context), nextLink -> listMetricsNextSinglePageAsync(nextLink, context)); } /** @@ -287,4 +295,59 @@ public PagedIterable listMetrics(String resourceGroupName return new PagedIterable<>( listMetricsAsync(resourceGroupName, accountName, sourceRegion, targetRegion, filter, context)); } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list percentile metrics request along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listMetricsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list percentile metrics request along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricsNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listMetricsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/PercentileTargetsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/PercentileTargetsClientImpl.java index 996a14240d13..30dd13d9b53c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/PercentileTargetsClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/PercentileTargetsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.cosmos.fluent.PercentileTargetsClient; import com.azure.resourcemanager.cosmos.fluent.models.PercentileMetricInner; -import com.azure.resourcemanager.cosmos.models.PercentileMetricListResult; +import com.azure.resourcemanager.cosmos.implementation.models.PercentileMetricListResult; import reactor.core.publisher.Mono; /** @@ -59,18 +59,26 @@ public final class PercentileTargetsClientImpl implements PercentileTargetsClien * The interface defining all the services for CosmosDBManagementClientPercentileTargets to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientPercentileTargets") public interface PercentileTargetsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/targetRegion/{targetRegion}/percentile/metrics") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listMetrics(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listMetrics(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("targetRegion") String targetRegion, @QueryParam("api-version") String apiVersion, - @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + @PathParam("targetRegion") String targetRegion, @QueryParam("$filter") String filter, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMetricsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -116,10 +124,10 @@ private Mono> listMetricsSinglePageAsync(St } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listMetrics(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, targetRegion, this.client.getApiVersion(), filter, accept, context)) + .withContext(context -> service.listMetrics(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, targetRegion, filter, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -168,10 +176,10 @@ private Mono> listMetricsSinglePageAsync(St final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listMetrics(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, - targetRegion, this.client.getApiVersion(), filter, accept, context) + .listMetrics(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, targetRegion, filter, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -193,7 +201,8 @@ private Mono> listMetricsSinglePageAsync(St @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listMetricsAsync(String resourceGroupName, String accountName, String targetRegion, String filter) { - return new PagedFlux<>(() -> listMetricsSinglePageAsync(resourceGroupName, accountName, targetRegion, filter)); + return new PagedFlux<>(() -> listMetricsSinglePageAsync(resourceGroupName, accountName, targetRegion, filter), + nextLink -> listMetricsNextSinglePageAsync(nextLink)); } /** @@ -217,7 +226,8 @@ public PagedFlux listMetricsAsync(String resourceGroupNam private PagedFlux listMetricsAsync(String resourceGroupName, String accountName, String targetRegion, String filter, Context context) { return new PagedFlux<>( - () -> listMetricsSinglePageAsync(resourceGroupName, accountName, targetRegion, filter, context)); + () -> listMetricsSinglePageAsync(resourceGroupName, accountName, targetRegion, filter, context), + nextLink -> listMetricsNextSinglePageAsync(nextLink, context)); } /** @@ -264,4 +274,59 @@ public PagedIterable listMetrics(String resourceGroupName String targetRegion, String filter, Context context) { return new PagedIterable<>(listMetricsAsync(resourceGroupName, accountName, targetRegion, filter, context)); } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list percentile metrics request along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listMetricsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list percentile metrics request along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricsNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listMetricsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/PercentilesClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/PercentilesClientImpl.java index 9ceb4381e821..96b003c67933 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/PercentilesClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/PercentilesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.cosmos.fluent.PercentilesClient; import com.azure.resourcemanager.cosmos.fluent.models.PercentileMetricInner; -import com.azure.resourcemanager.cosmos.models.PercentileMetricListResult; +import com.azure.resourcemanager.cosmos.implementation.models.PercentileMetricListResult; import reactor.core.publisher.Mono; /** @@ -59,17 +59,24 @@ public final class PercentilesClientImpl implements PercentilesClient { * The interface defining all the services for CosmosDBManagementClientPercentiles to be used by the proxy service * to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientPercentiles") public interface PercentilesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/percentile/metrics") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listMetrics(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listMetrics(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @QueryParam("$filter") String filter, + @QueryParam("$filter") String filter, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listMetricsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -111,10 +118,10 @@ private Mono> listMetricsSinglePageAsync(St } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listMetrics(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), filter, accept, context)) + .withContext(context -> service.listMetrics(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, filter, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -158,10 +165,10 @@ private Mono> listMetricsSinglePageAsync(St final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listMetrics(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, - this.client.getApiVersion(), filter, accept, context) + .listMetrics(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, filter, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -181,7 +188,8 @@ private Mono> listMetricsSinglePageAsync(St @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listMetricsAsync(String resourceGroupName, String accountName, String filter) { - return new PagedFlux<>(() -> listMetricsSinglePageAsync(resourceGroupName, accountName, filter)); + return new PagedFlux<>(() -> listMetricsSinglePageAsync(resourceGroupName, accountName, filter), + nextLink -> listMetricsNextSinglePageAsync(nextLink)); } /** @@ -202,7 +210,8 @@ public PagedFlux listMetricsAsync(String resourceGroupNam @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listMetricsAsync(String resourceGroupName, String accountName, String filter, Context context) { - return new PagedFlux<>(() -> listMetricsSinglePageAsync(resourceGroupName, accountName, filter, context)); + return new PagedFlux<>(() -> listMetricsSinglePageAsync(resourceGroupName, accountName, filter, context), + nextLink -> listMetricsNextSinglePageAsync(nextLink, context)); } /** @@ -245,4 +254,59 @@ public PagedIterable listMetrics(String resourceGroupName Context context) { return new PagedIterable<>(listMetricsAsync(resourceGroupName, accountName, filter, context)); } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list percentile metrics request along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listMetricsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response to a list percentile metrics request along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listMetricsNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listMetricsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/PrivateEndpointConnectionsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/PrivateEndpointConnectionsClientImpl.java index d174642ccfc3..80f30269de45 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/PrivateEndpointConnectionsClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/PrivateEndpointConnectionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -33,7 +33,7 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.cosmos.fluent.PrivateEndpointConnectionsClient; import com.azure.resourcemanager.cosmos.fluent.models.PrivateEndpointConnectionInner; -import com.azure.resourcemanager.cosmos.models.PrivateEndpointConnectionListResult; +import com.azure.resourcemanager.cosmos.implementation.models.PrivateEndpointConnectionListResult; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -67,195 +67,55 @@ public final class PrivateEndpointConnectionsClientImpl implements PrivateEndpoi * The interface defining all the services for CosmosDBManagementClientPrivateEndpointConnections to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientPrivateEndpointConnections") public interface PrivateEndpointConnectionsService { - @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections") - @ExpectedResponses({ 200 }) - @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByDatabaseAccount(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("accountName") String accountName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("accountName") String accountName, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createOrUpdate(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("accountName") String accountName, + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, - @BodyParam("application/json") PrivateEndpointConnectionInner parameters, - @HeaderParam("Accept") String accept, Context context); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") PrivateEndpointConnectionInner parameters, Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections/{privateEndpointConnectionName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateEndpointConnections") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDatabaseAccount( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("accountName") String accountName, - @PathParam("privateEndpointConnectionName") String privateEndpointConnectionName, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, @HeaderParam("Accept") String accept, Context context); - } - - /** - * List all private endpoint connections on a Cosmos DB 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 a list of private endpoint connections along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByDatabaseAccountSinglePageAsync(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.listByDatabaseAccount(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accountName, 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())); - } - - /** - * List all private endpoint connections on a Cosmos DB 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 a list of private endpoint connections along with {@link PagedResponse} on successful completion of - * {@link Mono}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listByDatabaseAccountSinglePageAsync(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 - .listByDatabaseAccount(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), accountName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); - } - - /** - * List all private endpoint connections on a Cosmos DB 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 a list of private endpoint connections as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByDatabaseAccountAsync(String resourceGroupName, - String accountName) { - return new PagedFlux<>(() -> listByDatabaseAccountSinglePageAsync(resourceGroupName, accountName)); - } - /** - * List all private endpoint connections on a Cosmos DB 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 a list of private endpoint connections as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDatabaseAccountAsync(String resourceGroupName, - String accountName, Context context) { - return new PagedFlux<>(() -> listByDatabaseAccountSinglePageAsync(resourceGroupName, accountName, context)); - } - - /** - * List all private endpoint connections on a Cosmos DB 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 a list of private endpoint connections as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDatabaseAccount(String resourceGroupName, - String accountName) { - return new PagedIterable<>(listByDatabaseAccountAsync(resourceGroupName, accountName)); - } - - /** - * List all private endpoint connections on a Cosmos DB 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 a list of private endpoint connections as paginated response with {@link PagedIterable}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDatabaseAccount(String resourceGroupName, - String accountName, Context context) { - return new PagedIterable<>(listByDatabaseAccountAsync(resourceGroupName, accountName, context)); + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByDatabaseAccountNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -293,9 +153,9 @@ public Mono> getWithResponseAsync(Strin } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), accountName, privateEndpointConnectionName, accept, context)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, privateEndpointConnectionName, accept, + context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -335,8 +195,8 @@ private Mono> getWithResponseAsync(Stri } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), accountName, privateEndpointConnectionName, accept, context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, privateEndpointConnectionName, accept, context); } /** @@ -431,11 +291,12 @@ public Mono>> createOrUpdateWithResponseAsync(String r } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accountName, privateEndpointConnectionName, parameters, - accept, context)) + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, privateEndpointConnectionName, + contentType, accept, parameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -480,10 +341,12 @@ private Mono>> createOrUpdateWithResponseAsync(String } else { parameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createOrUpdate(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), accountName, privateEndpointConnectionName, parameters, accept, context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, privateEndpointConnectionName, contentType, + accept, parameters, context); } /** @@ -688,11 +551,8 @@ public Mono>> deleteWithResponseAsync(String resourceG return Mono.error(new IllegalArgumentException( "Parameter privateEndpointConnectionName is required and cannot be null.")); } - final String accept = "application/json"; - return FluxUtil - .withContext( - context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), accountName, privateEndpointConnectionName, accept, context)) + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, privateEndpointConnectionName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -730,10 +590,9 @@ private Mono>> deleteWithResponseAsync(String resource return Mono.error(new IllegalArgumentException( "Parameter privateEndpointConnectionName is required and cannot be null.")); } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), accountName, privateEndpointConnectionName, accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, privateEndpointConnectionName, context); } /** @@ -881,4 +740,207 @@ public void delete(String resourceGroupName, String accountName, String privateE Context context) { deleteAsync(resourceGroupName, accountName, privateEndpointConnectionName, context).block(); } + + /** + * List all private endpoint connections on a Cosmos DB 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 a list of private endpoint connections along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByDatabaseAccountSinglePageAsync(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.listByDatabaseAccount(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all private endpoint connections on a Cosmos DB 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 a list of private endpoint connections along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByDatabaseAccountSinglePageAsync(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 + .listByDatabaseAccount(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List all private endpoint connections on a Cosmos DB 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 a list of private endpoint connections as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByDatabaseAccountAsync(String resourceGroupName, + String accountName) { + return new PagedFlux<>(() -> listByDatabaseAccountSinglePageAsync(resourceGroupName, accountName), + nextLink -> listByDatabaseAccountNextSinglePageAsync(nextLink)); + } + + /** + * List all private endpoint connections on a Cosmos DB 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 a list of private endpoint connections as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDatabaseAccountAsync(String resourceGroupName, + String accountName, Context context) { + return new PagedFlux<>(() -> listByDatabaseAccountSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listByDatabaseAccountNextSinglePageAsync(nextLink, context)); + } + + /** + * List all private endpoint connections on a Cosmos DB 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 a list of private endpoint connections as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDatabaseAccount(String resourceGroupName, + String accountName) { + return new PagedIterable<>(listByDatabaseAccountAsync(resourceGroupName, accountName)); + } + + /** + * List all private endpoint connections on a Cosmos DB 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 a list of private endpoint connections as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDatabaseAccount(String resourceGroupName, + String accountName, Context context) { + return new PagedIterable<>(listByDatabaseAccountAsync(resourceGroupName, accountName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 list of private endpoint connections along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByDatabaseAccountNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByDatabaseAccountNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 list of private endpoint connections along with {@link PagedResponse} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByDatabaseAccountNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByDatabaseAccountNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/PrivateLinkResourcesClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/PrivateLinkResourcesClientImpl.java index 0fc3c39f7500..39f9c43e2a45 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/PrivateLinkResourcesClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/PrivateLinkResourcesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.cosmos.fluent.PrivateLinkResourcesClient; import com.azure.resourcemanager.cosmos.fluent.models.PrivateLinkResourceInner; -import com.azure.resourcemanager.cosmos.models.PrivateLinkResourceListResult; +import com.azure.resourcemanager.cosmos.implementation.models.PrivateLinkResourceListResult; import reactor.core.publisher.Mono; /** @@ -59,26 +59,33 @@ public final class PrivateLinkResourcesClientImpl implements PrivateLinkResource * The interface defining all the services for CosmosDBManagementClientPrivateLinkResources to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientPrivateLinkResources") public interface PrivateLinkResourcesService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateLinkResources/{groupName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("groupName") String groupName, @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateLinkResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByDatabaseAccount(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("accountName") String accountName, @HeaderParam("Accept") String accept, Context context); + Mono> listByDatabaseAccount(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/privateLinkResources/{groupName}") + @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @QueryParam("api-version") String apiVersion, - @PathParam("accountName") String accountName, @PathParam("groupName") String groupName, + Mono> listByDatabaseAccountNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -87,15 +94,16 @@ Mono> get(@HostParam("$host") String endpoint * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. + * @param groupName The name of the private link resource. * @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 private link resources that need to be created for a Cosmos DB account along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the private link resources that need to be created for a Cosmos DB account along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDatabaseAccountSinglePageAsync(String resourceGroupName, - String accountName) { + public Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String groupName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -111,13 +119,13 @@ private Mono> listByDatabaseAccountSingl if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.listByDatabaseAccount(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accountName, accept, context)) - .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, groupName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -126,16 +134,17 @@ private Mono> listByDatabaseAccountSingl * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. + * @param groupName The name of the private link resource. * @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 private link resources that need to be created for a Cosmos DB account along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the private link resources that need to be created for a Cosmos DB account along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listByDatabaseAccountSinglePageAsync(String resourceGroupName, - String accountName, Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String groupName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -151,13 +160,13 @@ private Mono> listByDatabaseAccountSingl if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + if (groupName == null) { + return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listByDatabaseAccount(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), accountName, accept, context) - .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, groupName, accept, context); } /** @@ -165,16 +174,17 @@ private Mono> listByDatabaseAccountSingl * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. + * @param groupName The name of the private link resource. * @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 private link resources that need to be created for a Cosmos DB account as paginated response with - * {@link PagedFlux}. + * @return the private link resources that need to be created for a Cosmos DB account on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listByDatabaseAccountAsync(String resourceGroupName, - String accountName) { - return new PagedFlux<>(() -> listByDatabaseAccountSinglePageAsync(resourceGroupName, accountName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String accountName, String groupName) { + return getWithResponseAsync(resourceGroupName, accountName, groupName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -182,33 +192,17 @@ public PagedFlux listByDatabaseAccountAsync(String res * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. + * @param groupName The name of the private link resource. * @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 private link resources that need to be created for a Cosmos DB account as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listByDatabaseAccountAsync(String resourceGroupName, String accountName, - Context context) { - return new PagedFlux<>(() -> listByDatabaseAccountSinglePageAsync(resourceGroupName, accountName, context)); - } - - /** - * Gets the private link resources that need to be created for a Cosmos DB 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 private link resources that need to be created for a Cosmos DB account as paginated response with - * {@link PagedIterable}. + * @return the private link resources that need to be created for a Cosmos DB account along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName) { - return new PagedIterable<>(listByDatabaseAccountAsync(resourceGroupName, accountName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, + String groupName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, groupName, context).block(); } /** @@ -216,17 +210,15 @@ public PagedIterable listByDatabaseAccount(String reso * * @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. + * @param groupName The name of the private link resource. * @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 private link resources that need to be created for a Cosmos DB account as paginated response with - * {@link PagedIterable}. + * @return the private link resources that need to be created for a Cosmos DB account. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName, - Context context) { - return new PagedIterable<>(listByDatabaseAccountAsync(resourceGroupName, accountName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public PrivateLinkResourceInner get(String resourceGroupName, String accountName, String groupName) { + return getWithResponse(resourceGroupName, accountName, groupName, Context.NONE).getValue(); } /** @@ -234,16 +226,15 @@ public PagedIterable listByDatabaseAccount(String reso * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param groupName The name of the private link resource. * @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 private link resources that need to be created for a Cosmos DB account along with {@link Response} on - * successful completion of {@link Mono}. + * @return the private link resources that need to be created for a Cosmos DB account along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String resourceGroupName, String accountName, - String groupName) { + private Mono> listByDatabaseAccountSinglePageAsync(String resourceGroupName, + String accountName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -259,13 +250,13 @@ public Mono> getWithResponseAsync(String reso if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } - if (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, this.client.getApiVersion(), accountName, groupName, accept, context)) + .withContext( + context -> service.listByDatabaseAccount(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -274,17 +265,16 @@ public Mono> getWithResponseAsync(String reso * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param groupName The name of the private link resource. * @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 private link resources that need to be created for a Cosmos DB account along with {@link Response} on - * successful completion of {@link Mono}. + * @return the private link resources that need to be created for a Cosmos DB account along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String accountName, - String groupName, Context context) { + private Mono> listByDatabaseAccountSinglePageAsync(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.")); @@ -300,13 +290,13 @@ private Mono> getWithResponseAsync(String res if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } - if (groupName == null) { - return Mono.error(new IllegalArgumentException("Parameter groupName is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - this.client.getApiVersion(), accountName, groupName, accept, context); + return service + .listByDatabaseAccount(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -314,17 +304,17 @@ private Mono> getWithResponseAsync(String res * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param groupName The name of the private link resource. * @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 private link resources that need to be created for a Cosmos DB account on successful completion of - * {@link Mono}. + * @return the private link resources that need to be created for a Cosmos DB account as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getAsync(String resourceGroupName, String accountName, String groupName) { - return getWithResponseAsync(resourceGroupName, accountName, groupName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByDatabaseAccountAsync(String resourceGroupName, + String accountName) { + return new PagedFlux<>(() -> listByDatabaseAccountSinglePageAsync(resourceGroupName, accountName), + nextLink -> listByDatabaseAccountNextSinglePageAsync(nextLink)); } /** @@ -332,17 +322,18 @@ public Mono getAsync(String resourceGroupName, String * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param groupName The name of the private link resource. * @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 private link resources that need to be created for a Cosmos DB account along with {@link Response}. + * @return the private link resources that need to be created for a Cosmos DB account as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String accountName, - String groupName, Context context) { - return getWithResponseAsync(resourceGroupName, accountName, groupName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByDatabaseAccountAsync(String resourceGroupName, String accountName, + Context context) { + return new PagedFlux<>(() -> listByDatabaseAccountSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listByDatabaseAccountNextSinglePageAsync(nextLink, context)); } /** @@ -350,14 +341,88 @@ public Response getWithResponse(String resourceGroupNa * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param groupName The name of the private link resource. * @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 private link resources that need to be created for a Cosmos DB account. + * @return the private link resources that need to be created for a Cosmos DB account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName) { + return new PagedIterable<>(listByDatabaseAccountAsync(resourceGroupName, accountName)); + } + + /** + * Gets the private link resources that need to be created for a Cosmos DB 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 private link resources that need to be created for a Cosmos DB account as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByDatabaseAccount(String resourceGroupName, String accountName, + Context context) { + return new PagedIterable<>(listByDatabaseAccountAsync(resourceGroupName, accountName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 private link resources that need to be created for a Cosmos DB account along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public PrivateLinkResourceInner get(String resourceGroupName, String accountName, String groupName) { - return getWithResponse(resourceGroupName, accountName, groupName, Context.NONE).getValue(); + private Mono> listByDatabaseAccountNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByDatabaseAccountNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 private link resources that need to be created for a Cosmos DB account along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByDatabaseAccountNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByDatabaseAccountNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableDatabaseAccountsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableDatabaseAccountsClientImpl.java index ea217673b707..393cf56e2b61 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableDatabaseAccountsClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableDatabaseAccountsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.cosmos.fluent.RestorableDatabaseAccountsClient; import com.azure.resourcemanager.cosmos.fluent.models.RestorableDatabaseAccountGetResultInner; -import com.azure.resourcemanager.cosmos.models.RestorableDatabaseAccountsListResult; +import com.azure.resourcemanager.cosmos.implementation.models.RestorableDatabaseAccountsListResult; import reactor.core.publisher.Mono; /** @@ -59,14 +59,23 @@ public final class RestorableDatabaseAccountsClientImpl implements RestorableDat * The interface defining all the services for CosmosDBManagementClientRestorableDatabaseAccounts to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientRestorableDatabaseAccounts") public interface RestorableDatabaseAccountsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByLocation(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("location") String location, @PathParam("instanceId") String instanceId, + @HeaderParam("Accept") String accept, Context context); + @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listByLocation(@HostParam("$host") String endpoint, + Mono> listByLocation(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @HeaderParam("Accept") String accept, Context context); @@ -74,20 +83,149 @@ Mono> listByLocation(@HostParam(" @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/restorableDatabaseAccounts") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}") + @Get("{nextLink}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getByLocation(@HostParam("$host") String endpoint, - @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, - @PathParam("location") String location, @PathParam("instanceId") String instanceId, + Mono> listByLocationNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } + /** + * Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires + * 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. + * + * @param location Cosmos DB region, with spaces between words and each word capitalized. + * @param instanceId The instanceId GUID of a restorable database account. + * @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 Azure Cosmos DB restorable database account along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getByLocationWithResponseAsync(String location, + String instanceId) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByLocation(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, instanceId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires + * 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. + * + * @param location Cosmos DB region, with spaces between words and each word capitalized. + * @param instanceId The instanceId GUID of a restorable database account. + * @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 Azure Cosmos DB restorable database account along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByLocationWithResponseAsync(String location, + String instanceId, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } + if (instanceId == null) { + return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByLocation(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), location, instanceId, accept, context); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires + * 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. + * + * @param location Cosmos DB region, with spaces between words and each word capitalized. + * @param instanceId The instanceId GUID of a restorable database account. + * @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 Azure Cosmos DB restorable database account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByLocationAsync(String location, String instanceId) { + return getByLocationWithResponseAsync(location, instanceId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires + * 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. + * + * @param location Cosmos DB region, with spaces between words and each word capitalized. + * @param instanceId The instanceId GUID of a restorable database account. + * @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 Azure Cosmos DB restorable database account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByLocationWithResponse(String location, + String instanceId, Context context) { + return getByLocationWithResponseAsync(location, instanceId, context).block(); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires + * 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. + * + * @param location Cosmos DB region, with spaces between words and each word capitalized. + * @param instanceId The instanceId GUID of a restorable database account. + * @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 Azure Cosmos DB restorable database account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public RestorableDatabaseAccountGetResultInner getByLocation(String location, String instanceId) { + return getByLocationWithResponse(location, instanceId, Context.NONE).getValue(); + } + /** * Lists all the restorable Azure Cosmos DB database accounts available under the subscription and in a region. This * call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. @@ -117,8 +255,9 @@ Mono> getByLocation(@HostParam return FluxUtil .withContext(context -> service.listByLocation(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, context)) - .>map(res -> new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -154,7 +293,7 @@ private Mono> listByLocat .listByLocation(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), location, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -170,7 +309,8 @@ private Mono> listByLocat */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listByLocationAsync(String location) { - return new PagedFlux<>(() -> listByLocationSinglePageAsync(location)); + return new PagedFlux<>(() -> listByLocationSinglePageAsync(location), + nextLink -> listByLocationNextSinglePageAsync(nextLink)); } /** @@ -187,7 +327,8 @@ public PagedFlux listByLocationAsync(St */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listByLocationAsync(String location, Context context) { - return new PagedFlux<>(() -> listByLocationSinglePageAsync(location, context)); + return new PagedFlux<>(() -> listByLocationSinglePageAsync(location, context), + nextLink -> listByLocationNextSinglePageAsync(nextLink, context)); } /** @@ -246,8 +387,9 @@ private Mono> listSingleP return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context)) - .>map(res -> new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -278,7 +420,7 @@ private Mono> listSingleP .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -292,7 +434,7 @@ private Mono> listSingleP */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync() { - return new PagedFlux<>(() -> listSinglePageAsync()); + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -308,7 +450,8 @@ public PagedFlux listAsync() { */ @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(context)); + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** @@ -342,124 +485,114 @@ public PagedIterable list(Context conte } /** - * Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires - * 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. + * Get the next page of items. * - * @param location Cosmos DB region, with spaces between words and each word capitalized. - * @param instanceId The instanceId GUID of a restorable database account. + * @param nextLink The URL to get the next list of items. * @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 Azure Cosmos DB restorable database account along with {@link Response} on successful completion of - * {@link Mono}. + * @return the List operation response, that contains the restorable database accounts and their properties along + * with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getByLocationWithResponseAsync(String location, - String instanceId) { + private Mono> + listByLocationNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } 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 (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getByLocation(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, instanceId, accept, context)) + .withContext(context -> service.listByLocationNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires - * 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. + * Get the next page of items. * - * @param location Cosmos DB region, with spaces between words and each word capitalized. - * @param instanceId The instanceId GUID of a restorable database account. + * @param nextLink The URL to get the next list of items. * @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 Azure Cosmos DB restorable database account along with {@link Response} on successful completion of - * {@link Mono}. + * @return the List operation response, that contains the restorable database accounts and their properties along + * with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getByLocationWithResponseAsync(String location, - String instanceId, Context context) { + private Mono> + listByLocationNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } 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 (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } - if (instanceId == null) { - return Mono.error(new IllegalArgumentException("Parameter instanceId is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getByLocation(this.client.getEndpoint(), this.client.getApiVersion(), - this.client.getSubscriptionId(), location, instanceId, accept, context); + return service.listByLocationNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires - * 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. + * Get the next page of items. * - * @param location Cosmos DB region, with spaces between words and each word capitalized. - * @param instanceId The instanceId GUID of a restorable database account. + * @param nextLink The URL to get the next list of items. * @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 Azure Cosmos DB restorable database account on successful completion of {@link Mono}. + * @return the List operation response, that contains the restorable database accounts and their properties along + * with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getByLocationAsync(String location, String instanceId) { - return getByLocationWithResponseAsync(location, instanceId).flatMap(res -> Mono.justOrEmpty(res.getValue())); + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires - * 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. + * Get the next page of items. * - * @param location Cosmos DB region, with spaces between words and each word capitalized. - * @param instanceId The instanceId GUID of a restorable database account. + * @param nextLink The URL to get the next list of items. * @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 Azure Cosmos DB restorable database account along with {@link Response}. - */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getByLocationWithResponse(String location, - String instanceId, Context context) { - return getByLocationWithResponseAsync(location, instanceId, context).block(); - } - - /** - * Retrieves the properties of an existing Azure Cosmos DB restorable database account. This call requires - * 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*' permission. - * - * @param location Cosmos DB region, with spaces between words and each word capitalized. - * @param instanceId The instanceId GUID of a restorable database account. - * @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 Azure Cosmos DB restorable database account. + * @return the List operation response, that contains the restorable database accounts and their properties along + * with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public RestorableDatabaseAccountGetResultInner getByLocation(String location, String instanceId) { - return getByLocationWithResponse(location, instanceId, Context.NONE).getValue(); + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableGremlinDatabasesClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableGremlinDatabasesClientImpl.java index 77bdca1b491e..e358b806e2b5 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableGremlinDatabasesClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableGremlinDatabasesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.cosmos.fluent.RestorableGremlinDatabasesClient; import com.azure.resourcemanager.cosmos.fluent.models.RestorableGremlinDatabaseGetResultInner; -import com.azure.resourcemanager.cosmos.models.RestorableGremlinDatabasesListResult; +import com.azure.resourcemanager.cosmos.implementation.models.RestorableGremlinDatabasesListResult; import reactor.core.publisher.Mono; /** @@ -59,17 +59,25 @@ public final class RestorableGremlinDatabasesClientImpl implements RestorableGre * The interface defining all the services for CosmosDBManagementClientRestorableGremlinDatabases to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientRestorableGremlinDatabases") public interface RestorableGremlinDatabasesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGremlinDatabases") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @PathParam("instanceId") String instanceId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -106,8 +114,9 @@ private Mono> listSingleP return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), location, instanceId, accept, context)) - .>map(res -> new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -148,7 +157,7 @@ private Mono> listSingleP .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), location, instanceId, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -166,7 +175,8 @@ private Mono> listSingleP */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync(String location, String instanceId) { - return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId)); + return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -186,7 +196,8 @@ public PagedFlux listAsync(String locat @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String location, String instanceId, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId, context)); + return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** @@ -226,4 +237,59 @@ public PagedIterable list(String locati Context context) { return new PagedIterable<>(listAsync(location, instanceId, context)); } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 Gremlin database events and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 Gremlin database events and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableGremlinGraphsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableGremlinGraphsClientImpl.java index 24628b2cfffe..8760113757e8 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableGremlinGraphsClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableGremlinGraphsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.cosmos.fluent.RestorableGremlinGraphsClient; import com.azure.resourcemanager.cosmos.fluent.models.RestorableGremlinGraphGetResultInner; -import com.azure.resourcemanager.cosmos.models.RestorableGremlinGraphsListResult; +import com.azure.resourcemanager.cosmos.implementation.models.RestorableGremlinGraphsListResult; import reactor.core.publisher.Mono; /** @@ -59,19 +59,27 @@ public final class RestorableGremlinGraphsClientImpl implements RestorableGremli * The interface defining all the services for CosmosDBManagementClientRestorableGremlinGraphs to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientRestorableGremlinGraphs") public interface RestorableGremlinGraphsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGraphs") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @PathParam("instanceId") String instanceId, @QueryParam("restorableGremlinDatabaseRid") String restorableGremlinDatabaseRid, @QueryParam("startTime") String startTime, @QueryParam("endTime") String endTime, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -113,7 +121,7 @@ private Mono> listSinglePage this.client.getSubscriptionId(), location, instanceId, restorableGremlinDatabaseRid, startTime, endTime, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -157,7 +165,7 @@ private Mono> listSinglePage .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), location, instanceId, restorableGremlinDatabaseRid, startTime, endTime, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -180,7 +188,8 @@ private Mono> listSinglePage public PagedFlux listAsync(String location, String instanceId, String restorableGremlinDatabaseRid, String startTime, String endTime) { return new PagedFlux<>( - () -> listSinglePageAsync(location, instanceId, restorableGremlinDatabaseRid, startTime, endTime)); + () -> listSinglePageAsync(location, instanceId, restorableGremlinDatabaseRid, startTime, endTime), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -202,7 +211,8 @@ public PagedFlux listAsync(String location final String startTime = null; final String endTime = null; return new PagedFlux<>( - () -> listSinglePageAsync(location, instanceId, restorableGremlinDatabaseRid, startTime, endTime)); + () -> listSinglePageAsync(location, instanceId, restorableGremlinDatabaseRid, startTime, endTime), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -226,7 +236,8 @@ public PagedFlux listAsync(String location private PagedFlux listAsync(String location, String instanceId, String restorableGremlinDatabaseRid, String startTime, String endTime, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(location, instanceId, restorableGremlinDatabaseRid, startTime, endTime, context)); + () -> listSinglePageAsync(location, instanceId, restorableGremlinDatabaseRid, startTime, endTime, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** @@ -273,4 +284,58 @@ public PagedIterable list(String location, return new PagedIterable<>( listAsync(location, instanceId, restorableGremlinDatabaseRid, startTime, endTime, context)); } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 Gremlin graph events and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 Gremlin graph events and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableGremlinResourcesClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableGremlinResourcesClientImpl.java index a25b4f12dbd1..cf30fa27134d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableGremlinResourcesClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableGremlinResourcesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.cosmos.fluent.RestorableGremlinResourcesClient; import com.azure.resourcemanager.cosmos.fluent.models.RestorableGremlinResourcesGetResultInner; -import com.azure.resourcemanager.cosmos.models.RestorableGremlinResourcesListResult; +import com.azure.resourcemanager.cosmos.implementation.models.RestorableGremlinResourcesListResult; import reactor.core.publisher.Mono; /** @@ -59,19 +59,27 @@ public final class RestorableGremlinResourcesClientImpl implements RestorableGre * The interface defining all the services for CosmosDBManagementClientRestorableGremlinResources to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientRestorableGremlinResources") public interface RestorableGremlinResourcesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableGremlinResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @PathParam("instanceId") String instanceId, @QueryParam("restoreLocation") String restoreLocation, @QueryParam("restoreTimestampInUtc") String restoreTimestampInUtc, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -111,8 +119,9 @@ private Mono> listSingle .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), location, instanceId, restoreLocation, restoreTimestampInUtc, accept, context)) - .>map(res -> new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -155,7 +164,7 @@ private Mono> listSingle .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), location, instanceId, restoreLocation, restoreTimestampInUtc, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -176,7 +185,8 @@ private Mono> listSingle @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync(String location, String instanceId, String restoreLocation, String restoreTimestampInUtc) { - return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId, restoreLocation, restoreTimestampInUtc)); + return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId, restoreLocation, restoreTimestampInUtc), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -196,7 +206,8 @@ public PagedFlux listAsync(String loca public PagedFlux listAsync(String location, String instanceId) { final String restoreLocation = null; final String restoreTimestampInUtc = null; - return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId, restoreLocation, restoreTimestampInUtc)); + return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId, restoreLocation, restoreTimestampInUtc), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -219,7 +230,8 @@ public PagedFlux listAsync(String loca private PagedFlux listAsync(String location, String instanceId, String restoreLocation, String restoreTimestampInUtc, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(location, instanceId, restoreLocation, restoreTimestampInUtc, context)); + () -> listSinglePageAsync(location, instanceId, restoreLocation, restoreTimestampInUtc, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** @@ -263,4 +275,59 @@ public PagedIterable list(String locat String restoreLocation, String restoreTimestampInUtc, Context context) { return new PagedIterable<>(listAsync(location, instanceId, restoreLocation, restoreTimestampInUtc, context)); } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 restorable Gremlin resources along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 restorable Gremlin resources along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableMongodbCollectionsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableMongodbCollectionsClientImpl.java index feac023b128b..d0238f068df6 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableMongodbCollectionsClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableMongodbCollectionsClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.cosmos.fluent.RestorableMongodbCollectionsClient; import com.azure.resourcemanager.cosmos.fluent.models.RestorableMongodbCollectionGetResultInner; -import com.azure.resourcemanager.cosmos.models.RestorableMongodbCollectionsListResult; +import com.azure.resourcemanager.cosmos.implementation.models.RestorableMongodbCollectionsListResult; import reactor.core.publisher.Mono; /** @@ -59,19 +59,27 @@ public final class RestorableMongodbCollectionsClientImpl implements RestorableM * The interface defining all the services for CosmosDBManagementClientRestorableMongodbCollections to be used by * the proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientRestorableMongodbCollections") public interface RestorableMongodbCollectionsService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbCollections") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @PathParam("instanceId") String instanceId, @QueryParam("restorableMongodbDatabaseRid") String restorableMongodbDatabaseRid, @QueryParam("startTime") String startTime, @QueryParam("endTime") String endTime, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -112,8 +120,9 @@ private Mono> listSingl .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), location, instanceId, restorableMongodbDatabaseRid, startTime, endTime, accept, context)) - .>map(res -> new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -157,7 +166,7 @@ private Mono> listSingl .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), location, instanceId, restorableMongodbDatabaseRid, startTime, endTime, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -180,7 +189,8 @@ private Mono> listSingl public PagedFlux listAsync(String location, String instanceId, String restorableMongodbDatabaseRid, String startTime, String endTime) { return new PagedFlux<>( - () -> listSinglePageAsync(location, instanceId, restorableMongodbDatabaseRid, startTime, endTime)); + () -> listSinglePageAsync(location, instanceId, restorableMongodbDatabaseRid, startTime, endTime), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -202,7 +212,8 @@ public PagedFlux listAsync(String loc final String startTime = null; final String endTime = null; return new PagedFlux<>( - () -> listSinglePageAsync(location, instanceId, restorableMongodbDatabaseRid, startTime, endTime)); + () -> listSinglePageAsync(location, instanceId, restorableMongodbDatabaseRid, startTime, endTime), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -226,7 +237,8 @@ public PagedFlux listAsync(String loc private PagedFlux listAsync(String location, String instanceId, String restorableMongodbDatabaseRid, String startTime, String endTime, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(location, instanceId, restorableMongodbDatabaseRid, startTime, endTime, context)); + () -> listSinglePageAsync(location, instanceId, restorableMongodbDatabaseRid, startTime, endTime, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** @@ -273,4 +285,59 @@ public PagedIterable list(String loca return new PagedIterable<>( listAsync(location, instanceId, restorableMongodbDatabaseRid, startTime, endTime, context)); } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 MongoDB collection events and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 MongoDB collection events and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableMongodbDatabasesClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableMongodbDatabasesClientImpl.java index 2da61764b835..29e4c2f188ab 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableMongodbDatabasesClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableMongodbDatabasesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.cosmos.fluent.RestorableMongodbDatabasesClient; import com.azure.resourcemanager.cosmos.fluent.models.RestorableMongodbDatabaseGetResultInner; -import com.azure.resourcemanager.cosmos.models.RestorableMongodbDatabasesListResult; +import com.azure.resourcemanager.cosmos.implementation.models.RestorableMongodbDatabasesListResult; import reactor.core.publisher.Mono; /** @@ -59,17 +59,25 @@ public final class RestorableMongodbDatabasesClientImpl implements RestorableMon * The interface defining all the services for CosmosDBManagementClientRestorableMongodbDatabases to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientRestorableMongodbDatabases") public interface RestorableMongodbDatabasesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbDatabases") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @PathParam("instanceId") String instanceId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -106,8 +114,9 @@ private Mono> listSingleP return FluxUtil .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), location, instanceId, accept, context)) - .>map(res -> new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -148,7 +157,7 @@ private Mono> listSingleP .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), location, instanceId, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -166,7 +175,8 @@ private Mono> listSingleP */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync(String location, String instanceId) { - return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId)); + return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -186,7 +196,8 @@ public PagedFlux listAsync(String locat @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String location, String instanceId, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId, context)); + return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** @@ -226,4 +237,59 @@ public PagedIterable list(String locati Context context) { return new PagedIterable<>(listAsync(location, instanceId, context)); } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 MongoDB database events and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 MongoDB database events and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableMongodbResourcesClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableMongodbResourcesClientImpl.java index d0d8133fac37..947a9cad931d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableMongodbResourcesClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableMongodbResourcesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.cosmos.fluent.RestorableMongodbResourcesClient; import com.azure.resourcemanager.cosmos.fluent.models.RestorableMongodbResourcesGetResultInner; -import com.azure.resourcemanager.cosmos.models.RestorableMongodbResourcesListResult; +import com.azure.resourcemanager.cosmos.implementation.models.RestorableMongodbResourcesListResult; import reactor.core.publisher.Mono; /** @@ -59,19 +59,27 @@ public final class RestorableMongodbResourcesClientImpl implements RestorableMon * The interface defining all the services for CosmosDBManagementClientRestorableMongodbResources to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientRestorableMongodbResources") public interface RestorableMongodbResourcesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @PathParam("instanceId") String instanceId, @QueryParam("restoreLocation") String restoreLocation, @QueryParam("restoreTimestampInUtc") String restoreTimestampInUtc, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -111,8 +119,9 @@ private Mono> listSingle .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), location, instanceId, restoreLocation, restoreTimestampInUtc, accept, context)) - .>map(res -> new PagedResponseBase<>( - res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -155,7 +164,7 @@ private Mono> listSingle .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), location, instanceId, restoreLocation, restoreTimestampInUtc, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -176,7 +185,8 @@ private Mono> listSingle @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync(String location, String instanceId, String restoreLocation, String restoreTimestampInUtc) { - return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId, restoreLocation, restoreTimestampInUtc)); + return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId, restoreLocation, restoreTimestampInUtc), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -196,7 +206,8 @@ public PagedFlux listAsync(String loca public PagedFlux listAsync(String location, String instanceId) { final String restoreLocation = null; final String restoreTimestampInUtc = null; - return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId, restoreLocation, restoreTimestampInUtc)); + return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId, restoreLocation, restoreTimestampInUtc), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -219,7 +230,8 @@ public PagedFlux listAsync(String loca private PagedFlux listAsync(String location, String instanceId, String restoreLocation, String restoreTimestampInUtc, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(location, instanceId, restoreLocation, restoreTimestampInUtc, context)); + () -> listSinglePageAsync(location, instanceId, restoreLocation, restoreTimestampInUtc, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** @@ -263,4 +275,59 @@ public PagedIterable list(String locat String restoreLocation, String restoreTimestampInUtc, Context context) { return new PagedIterable<>(listAsync(location, instanceId, restoreLocation, restoreTimestampInUtc, context)); } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 restorable MongoDB resources along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map( + res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 restorable MongoDB resources along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableSqlContainersClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableSqlContainersClientImpl.java index 8a67762ac716..2b4279fd7c9b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableSqlContainersClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableSqlContainersClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.cosmos.fluent.RestorableSqlContainersClient; import com.azure.resourcemanager.cosmos.fluent.models.RestorableSqlContainerGetResultInner; -import com.azure.resourcemanager.cosmos.models.RestorableSqlContainersListResult; +import com.azure.resourcemanager.cosmos.implementation.models.RestorableSqlContainersListResult; import reactor.core.publisher.Mono; /** @@ -59,19 +59,27 @@ public final class RestorableSqlContainersClientImpl implements RestorableSqlCon * The interface defining all the services for CosmosDBManagementClientRestorableSqlContainers to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientRestorableSqlContainers") public interface RestorableSqlContainersService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlContainers") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @PathParam("instanceId") String instanceId, @QueryParam("restorableSqlDatabaseRid") String restorableSqlDatabaseRid, @QueryParam("startTime") String startTime, @QueryParam("endTime") String endTime, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -113,7 +121,7 @@ private Mono> listSinglePage this.client.getSubscriptionId(), location, instanceId, restorableSqlDatabaseRid, startTime, endTime, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -157,7 +165,7 @@ private Mono> listSinglePage .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), location, instanceId, restorableSqlDatabaseRid, startTime, endTime, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -180,7 +188,8 @@ private Mono> listSinglePage public PagedFlux listAsync(String location, String instanceId, String restorableSqlDatabaseRid, String startTime, String endTime) { return new PagedFlux<>( - () -> listSinglePageAsync(location, instanceId, restorableSqlDatabaseRid, startTime, endTime)); + () -> listSinglePageAsync(location, instanceId, restorableSqlDatabaseRid, startTime, endTime), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -202,7 +211,8 @@ public PagedFlux listAsync(String location final String startTime = null; final String endTime = null; return new PagedFlux<>( - () -> listSinglePageAsync(location, instanceId, restorableSqlDatabaseRid, startTime, endTime)); + () -> listSinglePageAsync(location, instanceId, restorableSqlDatabaseRid, startTime, endTime), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -226,7 +236,8 @@ public PagedFlux listAsync(String location private PagedFlux listAsync(String location, String instanceId, String restorableSqlDatabaseRid, String startTime, String endTime, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(location, instanceId, restorableSqlDatabaseRid, startTime, endTime, context)); + () -> listSinglePageAsync(location, instanceId, restorableSqlDatabaseRid, startTime, endTime, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** @@ -273,4 +284,58 @@ public PagedIterable list(String location, return new PagedIterable<>( listAsync(location, instanceId, restorableSqlDatabaseRid, startTime, endTime, context)); } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 container events and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 container events and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableSqlDatabasesClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableSqlDatabasesClientImpl.java index 7e38cf935ca3..d13c6972bc9a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableSqlDatabasesClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableSqlDatabasesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.cosmos.fluent.RestorableSqlDatabasesClient; import com.azure.resourcemanager.cosmos.fluent.models.RestorableSqlDatabaseGetResultInner; -import com.azure.resourcemanager.cosmos.models.RestorableSqlDatabasesListResult; +import com.azure.resourcemanager.cosmos.implementation.models.RestorableSqlDatabasesListResult; import reactor.core.publisher.Mono; /** @@ -59,17 +59,25 @@ public final class RestorableSqlDatabasesClientImpl implements RestorableSqlData * The interface defining all the services for CosmosDBManagementClientRestorableSqlDatabases to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientRestorableSqlDatabases") public interface RestorableSqlDatabasesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlDatabases") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @PathParam("instanceId") String instanceId, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -107,7 +115,7 @@ private Mono> listSinglePageA .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), location, instanceId, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -148,7 +156,7 @@ private Mono> listSinglePageA .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), location, instanceId, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -166,7 +174,8 @@ private Mono> listSinglePageA */ @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync(String location, String instanceId) { - return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId)); + return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -186,7 +195,8 @@ public PagedFlux listAsync(String location, @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String location, String instanceId, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId, context)); + return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** @@ -226,4 +236,58 @@ public PagedIterable list(String location, Context context) { return new PagedIterable<>(listAsync(location, instanceId, context)); } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 database events and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 database events and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableSqlResourcesClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableSqlResourcesClientImpl.java index c7bc67624ea1..014b40e770ee 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableSqlResourcesClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableSqlResourcesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.cosmos.fluent.RestorableSqlResourcesClient; import com.azure.resourcemanager.cosmos.fluent.models.RestorableSqlResourcesGetResultInner; -import com.azure.resourcemanager.cosmos.models.RestorableSqlResourcesListResult; +import com.azure.resourcemanager.cosmos.implementation.models.RestorableSqlResourcesListResult; import reactor.core.publisher.Mono; /** @@ -59,19 +59,27 @@ public final class RestorableSqlResourcesClientImpl implements RestorableSqlReso * The interface defining all the services for CosmosDBManagementClientRestorableSqlResources to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientRestorableSqlResources") public interface RestorableSqlResourcesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @PathParam("instanceId") String instanceId, @QueryParam("restoreLocation") String restoreLocation, @QueryParam("restoreTimestampInUtc") String restoreTimestampInUtc, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -112,7 +120,7 @@ private Mono> listSinglePage this.client.getSubscriptionId(), location, instanceId, restoreLocation, restoreTimestampInUtc, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -155,7 +163,7 @@ private Mono> listSinglePage .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), location, instanceId, restoreLocation, restoreTimestampInUtc, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -176,7 +184,8 @@ private Mono> listSinglePage @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync(String location, String instanceId, String restoreLocation, String restoreTimestampInUtc) { - return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId, restoreLocation, restoreTimestampInUtc)); + return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId, restoreLocation, restoreTimestampInUtc), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -196,7 +205,8 @@ public PagedFlux listAsync(String location public PagedFlux listAsync(String location, String instanceId) { final String restoreLocation = null; final String restoreTimestampInUtc = null; - return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId, restoreLocation, restoreTimestampInUtc)); + return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId, restoreLocation, restoreTimestampInUtc), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -219,7 +229,8 @@ public PagedFlux listAsync(String location private PagedFlux listAsync(String location, String instanceId, String restoreLocation, String restoreTimestampInUtc, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(location, instanceId, restoreLocation, restoreTimestampInUtc, context)); + () -> listSinglePageAsync(location, instanceId, restoreLocation, restoreTimestampInUtc, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** @@ -263,4 +274,58 @@ public PagedIterable list(String location, String restoreLocation, String restoreTimestampInUtc, Context context) { return new PagedIterable<>(listAsync(location, instanceId, restoreLocation, restoreTimestampInUtc, context)); } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 restorable SQL resources along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 restorable SQL resources along with {@link PagedResponse} + * on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableTableResourcesClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableTableResourcesClientImpl.java index dfeea736f534..ad936a8c0130 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableTableResourcesClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableTableResourcesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.cosmos.fluent.RestorableTableResourcesClient; import com.azure.resourcemanager.cosmos.fluent.models.RestorableTableResourcesGetResultInner; -import com.azure.resourcemanager.cosmos.models.RestorableTableResourcesListResult; +import com.azure.resourcemanager.cosmos.implementation.models.RestorableTableResourcesListResult; import reactor.core.publisher.Mono; /** @@ -59,19 +59,27 @@ public final class RestorableTableResourcesClientImpl implements RestorableTable * The interface defining all the services for CosmosDBManagementClientRestorableTableResources to be used by the * proxy service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientRestorableTableResources") public interface RestorableTableResourcesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableTableResources") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @PathParam("instanceId") String instanceId, @QueryParam("restoreLocation") String restoreLocation, @QueryParam("restoreTimestampInUtc") String restoreTimestampInUtc, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -111,7 +119,7 @@ private Mono> listSinglePa this.client.getSubscriptionId(), location, instanceId, restoreLocation, restoreTimestampInUtc, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -153,7 +161,7 @@ private Mono> listSinglePa .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), location, instanceId, restoreLocation, restoreTimestampInUtc, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -173,7 +181,8 @@ private Mono> listSinglePa @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync(String location, String instanceId, String restoreLocation, String restoreTimestampInUtc) { - return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId, restoreLocation, restoreTimestampInUtc)); + return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId, restoreLocation, restoreTimestampInUtc), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -192,7 +201,8 @@ public PagedFlux listAsync(String locati public PagedFlux listAsync(String location, String instanceId) { final String restoreLocation = null; final String restoreTimestampInUtc = null; - return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId, restoreLocation, restoreTimestampInUtc)); + return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId, restoreLocation, restoreTimestampInUtc), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -214,7 +224,8 @@ public PagedFlux listAsync(String locati private PagedFlux listAsync(String location, String instanceId, String restoreLocation, String restoreTimestampInUtc, Context context) { return new PagedFlux<>( - () -> listSinglePageAsync(location, instanceId, restoreLocation, restoreTimestampInUtc, context)); + () -> listSinglePageAsync(location, instanceId, restoreLocation, restoreTimestampInUtc, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** @@ -256,4 +267,56 @@ public PagedIterable list(String locatio String restoreLocation, String restoreTimestampInUtc, Context context) { return new PagedIterable<>(listAsync(location, instanceId, restoreLocation, restoreTimestampInUtc, context)); } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 list of restorable table names along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 list of restorable table names along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableTablesClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableTablesClientImpl.java index f2802030e4da..c7de13f4165c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableTablesClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableTablesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -27,7 +27,7 @@ import com.azure.core.util.FluxUtil; import com.azure.resourcemanager.cosmos.fluent.RestorableTablesClient; import com.azure.resourcemanager.cosmos.fluent.models.RestorableTableGetResultInner; -import com.azure.resourcemanager.cosmos.models.RestorableTablesListResult; +import com.azure.resourcemanager.cosmos.implementation.models.RestorableTablesListResult; import reactor.core.publisher.Mono; /** @@ -59,18 +59,26 @@ public final class RestorableTablesClientImpl implements RestorableTablesClient * The interface defining all the services for CosmosDBManagementClientRestorableTables to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientRestorableTables") public interface RestorableTablesService { @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableTables") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, + Mono> list(@HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("location") String location, @PathParam("instanceId") String instanceId, @QueryParam("startTime") String startTime, @QueryParam("endTime") String endTime, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); } /** @@ -110,7 +118,7 @@ private Mono> listSinglePageAsync(S .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), location, instanceId, startTime, endTime, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -153,7 +161,7 @@ private Mono> listSinglePageAsync(S .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), location, instanceId, startTime, endTime, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -174,7 +182,8 @@ private Mono> listSinglePageAsync(S @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listAsync(String location, String instanceId, String startTime, String endTime) { - return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId, startTime, endTime)); + return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId, startTime, endTime), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -194,7 +203,8 @@ public PagedFlux listAsync(String location, Strin public PagedFlux listAsync(String location, String instanceId) { final String startTime = null; final String endTime = null; - return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId, startTime, endTime)); + return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId, startTime, endTime), + nextLink -> listNextSinglePageAsync(nextLink)); } /** @@ -216,7 +226,8 @@ public PagedFlux listAsync(String location, Strin @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listAsync(String location, String instanceId, String startTime, String endTime, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId, startTime, endTime, context)); + return new PagedFlux<>(() -> listSinglePageAsync(location, instanceId, startTime, endTime, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** @@ -260,4 +271,58 @@ public PagedIterable list(String location, String String endTime, Context context) { return new PagedIterable<>(listAsync(location, instanceId, startTime, endTime, context)); } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 Table events and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 Table events and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ServicesClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ServicesClientImpl.java index add86359beca..09f1433a1048 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ServicesClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ServicesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -33,8 +33,8 @@ import com.azure.core.util.polling.SyncPoller; import com.azure.resourcemanager.cosmos.fluent.ServicesClient; import com.azure.resourcemanager.cosmos.fluent.models.ServiceResourceInner; +import com.azure.resourcemanager.cosmos.implementation.models.ServiceResourceListResult; import com.azure.resourcemanager.cosmos.models.ServiceResourceCreateUpdateParameters; -import com.azure.resourcemanager.cosmos.models.ServiceResourceListResult; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -67,47 +67,53 @@ public final class ServicesClientImpl implements ServicesClient { * The interface defining all the services for CosmosDBManagementClientServices to be used by the proxy service to * perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientServices") public interface ServicesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> list(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("serviceName") String serviceName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> create(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("serviceName") String serviceName, @QueryParam("api-version") String apiVersion, + @PathParam("serviceName") String serviceName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ServiceResourceCreateUpdateParameters createUpdateParameters, - @HeaderParam("Accept") String accept, Context context); + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("serviceName") String serviceName, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> get(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("serviceName") String serviceName, @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) - @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/services/{serviceName}") - @ExpectedResponses({ 200, 202, 204 }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> delete(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, - @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("serviceName") String serviceName, @QueryParam("api-version") String apiVersion, + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } @@ -116,14 +122,15 @@ Mono>> delete(@HostParam("$host") String endpoint, * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. + * @param serviceName Cosmos DB service 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 status of service along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the status of service along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, - String accountName) { + public Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String serviceName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -139,12 +146,13 @@ private Mono> listSinglePageAsync(String res if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.list(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)) + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, serviceName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -153,15 +161,16 @@ private Mono> listSinglePageAsync(String res * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. + * @param serviceName Cosmos DB service 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 status of service along with {@link PagedResponse} on successful completion of {@link Mono}. + * @return the status of service along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSinglePageAsync(String resourceGroupName, String accountName, - Context context) { + private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + String serviceName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -177,13 +186,13 @@ private Mono> listSinglePageAsync(String res if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + if (serviceName == null) { + return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .list(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)); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, serviceName, accept, context); } /** @@ -191,14 +200,16 @@ private Mono> listSinglePageAsync(String res * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. + * @param serviceName Cosmos DB service 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 status of service as paginated response with {@link PagedFlux}. + * @return the status of service on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String accountName, String serviceName) { + return getWithResponseAsync(resourceGroupName, accountName, serviceName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** @@ -206,30 +217,17 @@ public PagedFlux listAsync(String resourceGroupName, Strin * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. + * @param serviceName Cosmos DB service 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 status of service as paginated response with {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listAsync(String resourceGroupName, String accountName, Context context) { - return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, context)); - } - - /** - * Gets the status of service. - * - * @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 status of service as paginated response with {@link PagedIterable}. + * @return the status of service along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName) { - return new PagedIterable<>(listAsync(resourceGroupName, accountName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, String accountName, + String serviceName, Context context) { + return getWithResponseAsync(resourceGroupName, accountName, serviceName, context).block(); } /** @@ -237,15 +235,15 @@ public PagedIterable list(String resourceGroupName, String * * @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. + * @param serviceName Cosmos DB service 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 status of service as paginated response with {@link PagedIterable}. + * @return the status of service. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable list(String resourceGroupName, String accountName, Context context) { - return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public ServiceResourceInner get(String resourceGroupName, String accountName, String serviceName) { + return getWithResponse(resourceGroupName, accountName, serviceName, Context.NONE).getValue(); } /** @@ -287,11 +285,12 @@ public Mono>> createWithResponseAsync(String resourceG } else { createUpdateParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, serviceName, this.client.getApiVersion(), createUpdateParameters, accept, context)) + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, serviceName, contentType, accept, + createUpdateParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -335,10 +334,11 @@ private Mono>> createWithResponseAsync(String resource } else { createUpdateParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.create(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, serviceName, this.client.getApiVersion(), createUpdateParameters, accept, context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, serviceName, contentType, accept, createUpdateParameters, context); } /** @@ -503,7 +503,7 @@ public ServiceResourceInner create(String resourceGroupName, String accountName, } /** - * Gets the status of service. + * Deletes service with the given serviceName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -511,10 +511,10 @@ public ServiceResourceInner create(String resourceGroupName, String accountName, * @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 status of service along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getWithResponseAsync(String resourceGroupName, String accountName, + public Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, String serviceName) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -534,15 +534,14 @@ public Mono> getWithResponseAsync(String resource if (serviceName == null) { return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, serviceName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, serviceName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the status of service. + * Deletes service with the given serviceName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -551,10 +550,10 @@ public Mono> getWithResponseAsync(String resource * @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 status of service along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getWithResponseAsync(String resourceGroupName, String accountName, + private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, String serviceName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -574,14 +573,13 @@ private Mono> getWithResponseAsync(String resourc if (serviceName == null) { return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.get(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, - serviceName, this.client.getApiVersion(), accept, context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, serviceName, context); } /** - * Gets the status of service. + * Deletes service with the given serviceName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -589,16 +587,92 @@ private Mono> getWithResponseAsync(String resourc * @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 status of service on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginDeleteAsync(String resourceGroupName, String accountName, + String serviceName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, accountName, serviceName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes service with the given serviceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param serviceName Cosmos DB service 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> beginDeleteAsync(String resourceGroupName, String accountName, + String serviceName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, accountName, serviceName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes service with the given serviceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param serviceName Cosmos DB service 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> beginDelete(String resourceGroupName, String accountName, + String serviceName) { + return this.beginDeleteAsync(resourceGroupName, accountName, serviceName).getSyncPoller(); + } + + /** + * Deletes service with the given serviceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param serviceName Cosmos DB service 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> beginDelete(String resourceGroupName, String accountName, + String serviceName, Context context) { + return this.beginDeleteAsync(resourceGroupName, accountName, serviceName, context).getSyncPoller(); + } + + /** + * Deletes service with the given serviceName. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param serviceName Cosmos DB service 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 getAsync(String resourceGroupName, String accountName, String serviceName) { - return getWithResponseAsync(resourceGroupName, accountName, serviceName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono deleteAsync(String resourceGroupName, String accountName, String serviceName) { + return beginDeleteAsync(resourceGroupName, accountName, serviceName).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Gets the status of service. + * Deletes service with the given serviceName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -607,16 +681,16 @@ public Mono getAsync(String resourceGroupName, String acco * @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 status of service along with {@link Response}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getWithResponse(String resourceGroupName, String accountName, - String serviceName, Context context) { - return getWithResponseAsync(resourceGroupName, accountName, serviceName, context).block(); + private Mono deleteAsync(String resourceGroupName, String accountName, String serviceName, Context context) { + return beginDeleteAsync(resourceGroupName, accountName, serviceName, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Gets the status of service. + * Deletes service with the given serviceName. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. @@ -624,11 +698,10 @@ public Response getWithResponse(String resourceGroupName, * @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 status of service. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ServiceResourceInner get(String resourceGroupName, String accountName, String serviceName) { - return getWithResponse(resourceGroupName, accountName, serviceName, Context.NONE).getValue(); + public void delete(String resourceGroupName, String accountName, String serviceName) { + deleteAsync(resourceGroupName, accountName, serviceName).block(); } /** @@ -637,14 +710,29 @@ public ServiceResourceInner get(String resourceGroupName, String accountName, St * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param serviceName Cosmos DB service 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) - public Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, - String serviceName) { + public void delete(String resourceGroupName, String accountName, String serviceName, Context context) { + deleteAsync(resourceGroupName, accountName, serviceName, context).block(); + } + + /** + * Gets the status of service. + * + * @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 status of service along with {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String accountName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -660,31 +748,29 @@ public Mono>> deleteWithResponseAsync(String resourceG if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } - if (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, serviceName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes service with the given serviceName. + * Gets the status of service. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param serviceName Cosmos DB service 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}. + * @return the status of service along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteWithResponseAsync(String resourceGroupName, String accountName, - String serviceName, Context context) { + private Mono> listSinglePageAsync(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.")); @@ -700,154 +786,127 @@ private Mono>> deleteWithResponseAsync(String resource if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } - if (serviceName == null) { - return Mono.error(new IllegalArgumentException("Parameter serviceName is required and cannot be null.")); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.delete(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, serviceName, this.client.getApiVersion(), accept, context); - } - - /** - * Deletes service with the given serviceName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName Cosmos DB database account name. - * @param serviceName Cosmos DB service 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> beginDeleteAsync(String resourceGroupName, String accountName, - String serviceName) { - Mono>> mono = deleteWithResponseAsync(resourceGroupName, accountName, serviceName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); - } - - /** - * Deletes service with the given serviceName. - * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName Cosmos DB database account name. - * @param serviceName Cosmos DB service 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> beginDeleteAsync(String resourceGroupName, String accountName, - String serviceName, Context context) { - context = this.client.mergeContext(context); - Mono>> mono - = deleteWithResponseAsync(resourceGroupName, accountName, serviceName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Deletes service with the given serviceName. + * Gets the status of service. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param serviceName Cosmos DB service 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. + * @return the status of service as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, - String serviceName) { - return this.beginDeleteAsync(resourceGroupName, accountName, serviceName).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName), + nextLink -> listNextSinglePageAsync(nextLink)); } /** - * Deletes service with the given serviceName. + * Gets the status of service. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param serviceName Cosmos DB service 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. + * @return the status of service as paginated response with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDelete(String resourceGroupName, String accountName, - String serviceName, Context context) { - return this.beginDeleteAsync(resourceGroupName, accountName, serviceName, context).getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String accountName, Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); } /** - * Deletes service with the given serviceName. + * Gets the status of service. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param serviceName Cosmos DB service 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. + * @return the status of service as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteAsync(String resourceGroupName, String accountName, String serviceName) { - return beginDeleteAsync(resourceGroupName, accountName, serviceName).last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName)); } /** - * Deletes service with the given serviceName. + * Gets the status of service. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param serviceName Cosmos DB service 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. + * @return the status of service as paginated response with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteAsync(String resourceGroupName, String accountName, String serviceName, Context context) { - return beginDeleteAsync(resourceGroupName, accountName, serviceName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String accountName, Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, accountName, context)); } /** - * Deletes service with the given serviceName. + * Get the next page of items. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName Cosmos DB database account name. - * @param serviceName Cosmos DB service name. + * @param nextLink The URL to get the next list of items. * @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 status of service along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String serviceName) { - deleteAsync(resourceGroupName, accountName, serviceName).block(); + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes service with the given serviceName. + * Get the next page of items. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName Cosmos DB database account name. - * @param serviceName Cosmos DB service name. + * @param nextLink The URL to get the next list of items. * @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 status of service along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void delete(String resourceGroupName, String accountName, String serviceName, Context context) { - deleteAsync(resourceGroupName, accountName, serviceName, context).block(); + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/SqlResourcesClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/SqlResourcesClientImpl.java index b0246c6855cd..dfe783b4e7ca 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/SqlResourcesClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/SqlResourcesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -35,6 +35,8 @@ 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.PhysicalPartitionStorageInfoCollectionInner; +import com.azure.resourcemanager.cosmos.fluent.models.PhysicalPartitionThroughputInfoResultInner; import com.azure.resourcemanager.cosmos.fluent.models.SqlContainerGetResultsInner; import com.azure.resourcemanager.cosmos.fluent.models.SqlDatabaseGetResultsInner; import com.azure.resourcemanager.cosmos.fluent.models.SqlRoleAssignmentGetResultsInner; @@ -43,23 +45,26 @@ 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.implementation.models.ClientEncryptionKeysListResult; +import com.azure.resourcemanager.cosmos.implementation.models.SqlContainerListResult; +import com.azure.resourcemanager.cosmos.implementation.models.SqlDatabaseListResult; +import com.azure.resourcemanager.cosmos.implementation.models.SqlRoleAssignmentListResult; +import com.azure.resourcemanager.cosmos.implementation.models.SqlRoleDefinitionListResult; +import com.azure.resourcemanager.cosmos.implementation.models.SqlStoredProcedureListResult; +import com.azure.resourcemanager.cosmos.implementation.models.SqlTriggerListResult; +import com.azure.resourcemanager.cosmos.implementation.models.SqlUserDefinedFunctionListResult; 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.MergeParameters; +import com.azure.resourcemanager.cosmos.models.RedistributeThroughputParameters; +import com.azure.resourcemanager.cosmos.models.RetrieveThroughputParameters; 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 java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -94,444 +99,563 @@ public final class SqlResourcesClientImpl implements SqlResourcesClient { * The interface defining all the services for CosmosDBManagementClientSqlResources to be used by the proxy service * to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientSqlResources") 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, + Mono> getSqlDatabase(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @PathParam("databaseName") String databaseName, @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, + Mono>> createUpdateSqlDatabase(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") SqlDatabaseCreateUpdateParameters createUpdateSqlDatabaseParameters, - @HeaderParam("Accept") String accept, Context context); + 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, + Mono>> deleteSqlDatabase(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("databaseName") String databaseName, @QueryParam("api-version") String apiVersion, - Context context); + @PathParam("databaseName") String databaseName, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getSqlDatabaseThroughput(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listSqlDatabases(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/partitionMerge") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateSqlDatabaseThroughput(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> sqlDatabasePartitionMerge(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") MergeParameters mergeParameters, + 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 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> migrateSqlDatabaseToAutoscale(@HostParam("$host") String endpoint, + Mono> getSqlDatabaseThroughput( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @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); + @PathParam("databaseName") String databaseName, @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") + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> migrateSqlDatabaseToManualThroughput(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> updateSqlDatabaseThroughput(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ThroughputSettingsUpdateParameters updateThroughputParameters, + Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers") - @ExpectedResponses({ 200 }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToAutoscale") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSqlContainers(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> migrateSqlDatabaseToAutoscale(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @PathParam("databaseName") String databaseName, @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 }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/migrateToManualThroughput") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getSqlContainer(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> migrateSqlDatabaseToManualThroughput(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @PathParam("databaseName") String databaseName, @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}") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/retrieveThroughputDistribution") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createUpdateSqlContainer(@HostParam("$host") String endpoint, + Mono>> sqlDatabaseRetrieveThroughputDistribution( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @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); + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") RetrieveThroughputParameters retrieveThroughputParameters, 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 }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/throughputSettings/default/redistributeThroughput") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteSqlContainer(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> sqlDatabaseRedistributeThroughput(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @PathParam("databaseName") String databaseName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") RedistributeThroughputParameters redistributeThroughputParameters, + 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, + Mono> getSqlContainerThroughput( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @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); + @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, + Mono>> updateSqlContainerThroughput(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") ThroughputSettingsUpdateParameters updateThroughputParameters, - @HeaderParam("Accept") String accept, Context context); + 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, + Mono>> migrateSqlContainerToAutoscale(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @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, + Mono>> migrateSqlContainerToManualThroughput(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @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 }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/retrieveThroughputDistribution") + @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listClientEncryptionKeys(@HostParam("$host") String endpoint, + Mono>> sqlContainerRetrieveThroughputDistribution( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @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); + @PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RetrieveThroughputParameters retrieveThroughputParameters, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/throughputSettings/default/redistributeThroughput") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> sqlContainerRedistributeThroughput(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") RedistributeThroughputParameters redistributeThroughputParameters, + 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, + Mono> getClientEncryptionKey( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @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); + @PathParam("clientEncryptionKeyName") String clientEncryptionKeyName, @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, + Mono>> createUpdateClientEncryptionKey(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters, + 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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, @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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName, @HeaderParam("Accept") String accept, Context context); + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createUpdateSqlContainer(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters, + 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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName, + Context context); + @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSqlStoredProcedures(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listSqlContainers(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, @HeaderParam("Accept") String accept, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/partitionMerge") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> listSqlContainerPartitionMerge(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") MergeParameters mergeParameters, Context context); + + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/retrieveContinuousBackupInformation") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> retrieveContinuousBackupInformation(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ContinuousBackupRestoreLocation location, 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, + Mono> getSqlStoredProcedure(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @PathParam("storedProcedureName") String storedProcedureName, @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, + Mono>> createUpdateSqlStoredProcedure(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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, + @PathParam("storedProcedureName") String storedProcedureName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") SqlStoredProcedureCreateUpdateParameters createUpdateSqlStoredProcedureParameters, - @HeaderParam("Accept") String accept, Context context); + 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, + Mono>> deleteSqlStoredProcedure(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @PathParam("storedProcedureName") String storedProcedureName, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/storedProcedures") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSqlUserDefinedFunctions( - @HostParam("$host") String endpoint, @PathParam("subscriptionId") String subscriptionId, + Mono> listSqlStoredProcedures(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @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, + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, + @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); + @PathParam("userDefinedFunctionName") String userDefinedFunctionName, @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, + Mono>> createUpdateSqlUserDefinedFunction(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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("Content-Type") String contentType, @HeaderParam("Accept") String accept, @BodyParam("application/json") SqlUserDefinedFunctionCreateUpdateParameters createUpdateSqlUserDefinedFunctionParameters, - @HeaderParam("Accept") String accept, Context context); + 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, + Mono>> deleteSqlUserDefinedFunction(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @PathParam("userDefinedFunctionName") String userDefinedFunctionName, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/userDefinedFunctions") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listSqlTriggers(@HostParam("$host") String endpoint, + Mono> listSqlUserDefinedFunctions( + @HostParam("endpoint") String endpoint, @QueryParam("api-version") String apiVersion, @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); + @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, + Mono> getSqlTrigger(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @PathParam("triggerName") String triggerName, @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, + Mono>> createUpdateSqlTrigger(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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, + @PathParam("triggerName") String triggerName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") SqlTriggerCreateUpdateParameters createUpdateSqlTriggerParameters, - @HeaderParam("Accept") String accept, Context context); + 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, + Mono>> deleteSqlTrigger(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @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); + @PathParam("triggerName") String triggerName, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlRoleDefinitions/{roleDefinitionId}") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/containers/{containerName}/triggers") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getSqlRoleDefinition(@HostParam("$host") String endpoint, - @PathParam("roleDefinitionId") String roleDefinitionId, @PathParam("subscriptionId") String subscriptionId, + Mono> listSqlTriggers(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("databaseName") String databaseName, @PathParam("containerName") String containerName, + @HeaderParam("Accept") String accept, 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("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("roleDefinitionId") String roleDefinitionId, @HeaderParam("Accept") String accept, + Context context); + @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, + Mono>> createUpdateSqlRoleDefinition(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, + @PathParam("roleDefinitionId") String roleDefinitionId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters, - @HeaderParam("Accept") String accept, Context context); + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "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, + Mono>> deleteSqlRoleDefinition(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("roleDefinitionId") String roleDefinitionId, 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, + Mono> listSqlRoleDefinitions(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @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, + Mono> getSqlRoleAssignment(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("roleAssignmentId") String roleAssignmentId, @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, + Mono>> createUpdateSqlRoleAssignment(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, + @PathParam("roleAssignmentId") String roleAssignmentId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters, - @HeaderParam("Accept") String accept, Context context); + Context context); - @Headers({ "Content-Type: application/json" }) + @Headers({ "Accept: application/json;q=0.9", "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, + Mono>> deleteSqlRoleAssignment(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("roleAssignmentId") String roleAssignmentId, 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, + Mono> listSqlRoleAssignments(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @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 }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) @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, + Mono> listSqlDatabasesNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listClientEncryptionKeysNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSqlContainersNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSqlStoredProceduresNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSqlUserDefinedFunctionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSqlTriggersNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSqlRoleDefinitionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listSqlRoleAssignmentsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Lists the SQL databases under an existing Azure Cosmos DB database account. + * 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 List operation response, that contains the SQL databases and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @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> listSqlDatabasesSinglePageAsync(String resourceGroupName, - String accountName) { + 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.")); @@ -547,30 +671,32 @@ private Mono> listSqlDatabasesSinglePa 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.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)) + .withContext(context -> service.getSqlDatabase(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the SQL databases under an existing Azure Cosmos DB database account. + * 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 List operation response, that contains the SQL databases and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @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> listSqlDatabasesSinglePageAsync(String resourceGroupName, - String accountName, Context context) { + 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.")); @@ -586,161 +712,13 @@ private Mono> listSqlDatabasesSinglePa 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 - .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); + return service.getSqlDatabase(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, accept, context); } /** @@ -837,11 +815,12 @@ public Mono>> createUpdateSqlDatabaseWithResponseAsync } else { createUpdateSqlDatabaseParameters.validate(); } + final String contentType = "application/json"; 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)) + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, contentType, accept, createUpdateSqlDatabaseParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -886,11 +865,12 @@ private Mono>> createUpdateSqlDatabaseWithResponseAsyn } else { createUpdateSqlDatabaseParameters.validate(); } + final String contentType = "application/json"; 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); + return service.createUpdateSqlDatabase(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, contentType, accept, + createUpdateSqlDatabaseParameters, context); } /** @@ -1096,9 +1076,8 @@ public Mono>> deleteSqlDatabaseWithResponseAsync(Strin 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)) + .withContext(context -> service.deleteSqlDatabase(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -1136,8 +1115,8 @@ private Mono>> deleteSqlDatabaseWithResponseAsync(Stri 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); + return service.deleteSqlDatabase(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, context); } /** @@ -1285,21 +1264,19 @@ public void deleteSqlDatabase(String resourceGroupName, String accountName, Stri } /** - * Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided - * name. + * 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 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}. + * @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) - public Mono> - getSqlDatabaseThroughputWithResponseAsync(String resourceGroupName, String accountName, String databaseName) { + 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.")); @@ -1315,34 +1292,30 @@ public void deleteSqlDatabase(String resourceGroupName, String accountName, Stri 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)) + .withContext(context -> service.listSqlDatabases(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .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. + * 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 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}. + * @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> getSqlDatabaseThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, Context context) { + 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.")); @@ -1358,91 +1331,101 @@ private Mono> getSqlDatabaseThroughp 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); + return service + .listSqlDatabases(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided - * name. + * 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 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}. + * @return the List operation response, that contains the SQL databases and their properties as paginated response + * with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getSqlDatabaseThroughputAsync(String resourceGroupName, - String accountName, String databaseName) { - return getSqlDatabaseThroughputWithResponseAsync(resourceGroupName, accountName, databaseName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listSqlDatabasesAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listSqlDatabasesSinglePageAsync(resourceGroupName, accountName), + nextLink -> listSqlDatabasesNextSinglePageAsync(nextLink)); } /** - * Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided - * name. + * 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 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}. + * @return the List operation response, that contains the SQL databases and their properties as paginated response + * with {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getSqlDatabaseThroughputWithResponse(String resourceGroupName, - String accountName, String databaseName, Context context) { - return getSqlDatabaseThroughputWithResponseAsync(resourceGroupName, accountName, databaseName, context).block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listSqlDatabasesAsync(String resourceGroupName, String accountName, + Context context) { + return new PagedFlux<>(() -> listSqlDatabasesSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listSqlDatabasesNextSinglePageAsync(nextLink, context)); } /** - * Gets the RUs per second of the SQL database under an existing Azure Cosmos DB database account with the provided - * name. + * 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 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. + * @return the List operation response, that contains the SQL databases and their properties as paginated response + * with {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner getSqlDatabaseThroughput(String resourceGroupName, String accountName, - String databaseName) { - return getSqlDatabaseThroughputWithResponse(resourceGroupName, accountName, databaseName, Context.NONE) - .getValue(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSqlDatabases(String resourceGroupName, String accountName) { + return new PagedIterable<>(listSqlDatabasesAsync(resourceGroupName, accountName)); } /** - * Update RUs per second of an Azure Cosmos DB SQL database. + * 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)); + } + + /** + * Merges the partitions of a 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 mergeParameters The parameters for the merge 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}. + * @return list of physical partitions and their properties returned by a merge operation 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) { + public Mono>> sqlDatabasePartitionMergeWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1461,38 +1444,38 @@ public Mono>> updateSqlDatabaseThroughputWithResponseA 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.")); + if (mergeParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter mergeParameters is required and cannot be null.")); } else { - updateThroughputParameters.validate(); + mergeParameters.validate(); } + final String contentType = "application/json"; 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)) + .withContext(context -> service.sqlDatabasePartitionMerge(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, contentType, accept, mergeParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update RUs per second of an Azure Cosmos DB SQL database. + * Merges the partitions of a 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 mergeParameters The parameters for the merge operation. * @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}. + * @return list of physical partitions and their properties returned by a merge operation 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) { + private Mono>> sqlDatabasePartitionMergeWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1511,193 +1494,202 @@ private Mono>> updateSqlDatabaseThroughputWithResponse 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.")); + if (mergeParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter mergeParameters is required and cannot be null.")); } else { - updateThroughputParameters.validate(); + mergeParameters.validate(); } + final String contentType = "application/json"; 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); + return service.sqlDatabasePartitionMerge(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, contentType, accept, + mergeParameters, context); } /** - * Update RUs per second of an Azure Cosmos DB SQL database. + * Merges the partitions of a 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 mergeParameters The parameters for the merge 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. + * @return the {@link PollerFlux} for polling of list of physical partitions and their properties returned by a + * merge operation. */ @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()); + public + PollerFlux, PhysicalPartitionStorageInfoCollectionInner> + beginSqlDatabasePartitionMergeAsync(String resourceGroupName, String accountName, String databaseName, + MergeParameters mergeParameters) { + Mono>> mono + = sqlDatabasePartitionMergeWithResponseAsync(resourceGroupName, accountName, databaseName, mergeParameters); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), PhysicalPartitionStorageInfoCollectionInner.class, + PhysicalPartitionStorageInfoCollectionInner.class, this.client.getContext()); } /** - * Update RUs per second of an Azure Cosmos DB SQL database. + * Merges the partitions of a 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 mergeParameters The parameters for the merge operation. * @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. + * @return the {@link PollerFlux} for polling of list of physical partitions and their properties returned by a + * merge operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ThroughputSettingsGetResultsInner> - beginUpdateSqlDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, - ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + private + PollerFlux, PhysicalPartitionStorageInfoCollectionInner> + beginSqlDatabasePartitionMergeAsync(String resourceGroupName, String accountName, String databaseName, + MergeParameters mergeParameters, 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); + Mono>> mono = sqlDatabasePartitionMergeWithResponseAsync(resourceGroupName, + accountName, databaseName, mergeParameters, context); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), PhysicalPartitionStorageInfoCollectionInner.class, + PhysicalPartitionStorageInfoCollectionInner.class, context); } /** - * Update RUs per second of an Azure Cosmos DB SQL database. + * Merges the partitions of a 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 mergeParameters The parameters for the merge 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. + * @return the {@link SyncPoller} for polling of list of physical partitions and their properties returned by a + * merge operation. */ @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) + public + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginSqlDatabasePartitionMerge(String resourceGroupName, String accountName, String databaseName, + MergeParameters mergeParameters) { + return this.beginSqlDatabasePartitionMergeAsync(resourceGroupName, accountName, databaseName, mergeParameters) .getSyncPoller(); } /** - * Update RUs per second of an Azure Cosmos DB SQL database. + * Merges the partitions of a 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 mergeParameters The parameters for the merge operation. * @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. + * @return the {@link SyncPoller} for polling of list of physical partitions and their properties returned by a + * merge operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateSqlDatabaseThroughput(String resourceGroupName, String accountName, String databaseName, - ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + public + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginSqlDatabasePartitionMerge(String resourceGroupName, String accountName, String databaseName, + MergeParameters mergeParameters, Context context) { return this - .beginUpdateSqlDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, - updateThroughputParameters, context) + .beginSqlDatabasePartitionMergeAsync(resourceGroupName, accountName, databaseName, mergeParameters, context) .getSyncPoller(); } /** - * Update RUs per second of an Azure Cosmos DB SQL database. + * Merges the partitions of a 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 mergeParameters The parameters for the merge 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}. + * @return list of physical partitions and their properties returned by a merge operation 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); + public Mono sqlDatabasePartitionMergeAsync(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters) { + return beginSqlDatabasePartitionMergeAsync(resourceGroupName, accountName, databaseName, mergeParameters).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Update RUs per second of an Azure Cosmos DB SQL database. + * Merges the partitions of a 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 mergeParameters The parameters for the merge operation. * @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}. + * @return list of physical partitions and their properties returned by a merge operation 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); + private Mono sqlDatabasePartitionMergeAsync(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters, Context context) { + return beginSqlDatabasePartitionMergeAsync(resourceGroupName, accountName, databaseName, mergeParameters, + context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Update RUs per second of an Azure Cosmos DB SQL database. + * Merges the partitions of a 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 mergeParameters The parameters for the merge 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. + * @return list of physical partitions and their properties returned by a merge operation. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner updateSqlDatabaseThroughput(String resourceGroupName, String accountName, - String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return updateSqlDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, - updateThroughputParameters).block(); + public PhysicalPartitionStorageInfoCollectionInner sqlDatabasePartitionMerge(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters) { + return sqlDatabasePartitionMergeAsync(resourceGroupName, accountName, databaseName, mergeParameters).block(); } /** - * Update RUs per second of an Azure Cosmos DB SQL database. + * Merges the partitions of a 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 mergeParameters The parameters for the merge operation. * @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. + * @return list of physical partitions and their properties returned by a merge operation. */ @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(); + public PhysicalPartitionStorageInfoCollectionInner sqlDatabasePartitionMerge(String resourceGroupName, + String accountName, String databaseName, MergeParameters mergeParameters, Context context) { + return sqlDatabasePartitionMergeAsync(resourceGroupName, accountName, databaseName, mergeParameters, context) + .block(); } /** - * Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale. + * 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. @@ -1705,12 +1697,12 @@ public ThroughputSettingsGetResultsInner updateSqlDatabaseThroughput(String reso * @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}. + * @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>> migrateSqlDatabaseToAutoscaleWithResponseAsync(String resourceGroupName, - String accountName, String databaseName) { + 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.")); @@ -1731,14 +1723,15 @@ public Mono>> migrateSqlDatabaseToAutoscaleWithRespons } 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)) + .withContext( + context -> service.getSqlDatabaseThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale. + * 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. @@ -1747,12 +1740,12 @@ public Mono>> migrateSqlDatabaseToAutoscaleWithRespons * @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}. + * @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>> migrateSqlDatabaseToAutoscaleWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, Context context) { + 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.")); @@ -1773,95 +1766,13 @@ private Mono>> migrateSqlDatabaseToAutoscaleWithRespon } 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(); + return service.getSqlDatabaseThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, accept, context); } /** - * Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale. + * 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. @@ -1869,17 +1780,19 @@ private Mono>> migrateSqlDatabaseToAutoscaleWithRespon * @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}. + * @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 migrateSqlDatabaseToAutoscaleAsync(String resourceGroupName, + public Mono getSqlDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName) { - return beginMigrateSqlDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName).last() - .flatMap(this.client::getLroFinalResultOrError); + return getSqlDatabaseThroughputWithResponseAsync(resourceGroupName, accountName, databaseName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale. + * 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. @@ -1888,17 +1801,18 @@ public Mono migrateSqlDatabaseToAutoscaleAsyn * @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}. + * @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) - private Mono migrateSqlDatabaseToAutoscaleAsync(String resourceGroupName, + public Response getSqlDatabaseThroughputWithResponse(String resourceGroupName, String accountName, String databaseName, Context context) { - return beginMigrateSqlDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + return getSqlDatabaseThroughputWithResponseAsync(resourceGroupName, accountName, databaseName, context).block(); } /** - * Migrate an Azure Cosmos DB SQL database from manual throughput to autoscale. + * 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. @@ -1906,38 +1820,23 @@ private Mono migrateSqlDatabaseToAutoscaleAsy * @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. + * @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 migrateSqlDatabaseToAutoscale(String resourceGroupName, String accountName, + public ThroughputSettingsGetResultsInner getSqlDatabaseThroughput(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(); + return getSqlDatabaseThroughputWithResponse(resourceGroupName, accountName, databaseName, Context.NONE) + .getValue(); } /** - * Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput. + * 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. @@ -1945,8 +1844,8 @@ public ThroughputSettingsGetResultsInner migrateSqlDatabaseToAutoscale(String re * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> migrateSqlDatabaseToManualThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName) { + 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.")); @@ -1965,20 +1864,28 @@ public Mono>> migrateSqlDatabaseToManualThroughputWith 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)) + if (updateThroughputParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter updateThroughputParameters is required and cannot be null.")); + } else { + updateThroughputParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.updateSqlDatabaseThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, contentType, accept, updateThroughputParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput. + * 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. @@ -1987,8 +1894,9 @@ public Mono>> migrateSqlDatabaseToManualThroughputWith * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> migrateSqlDatabaseToManualThroughputWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, Context context) { + 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.")); @@ -2007,18 +1915,27 @@ private Mono>> migrateSqlDatabaseToManualThroughputWit 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 contentType = "application/json"; 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); + return service.updateSqlDatabaseThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, contentType, accept, + updateThroughputParameters, context); } /** - * Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput. + * 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. @@ -2026,21 +1943,22 @@ private Mono>> migrateSqlDatabaseToManualThroughputWit */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateSqlDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, - String databaseName) { - Mono>> mono - = migrateSqlDatabaseToManualThroughputWithResponseAsync(resourceGroupName, accountName, databaseName); + 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()); } /** - * Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput. + * 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. @@ -2049,22 +1967,23 @@ private Mono>> migrateSqlDatabaseToManualThroughputWit */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) private PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateSqlDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, - String databaseName, Context context) { + beginUpdateSqlDatabaseThroughputAsync(String resourceGroupName, String accountName, String databaseName, + ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { context = this.client.mergeContext(context); - Mono>> mono = migrateSqlDatabaseToManualThroughputWithResponseAsync(resourceGroupName, - accountName, databaseName, context); + Mono>> mono = updateSqlDatabaseThroughputWithResponseAsync(resourceGroupName, + accountName, databaseName, updateThroughputParameters, 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. + * 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. @@ -2072,17 +1991,21 @@ private Mono>> migrateSqlDatabaseToManualThroughputWit */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateSqlDatabaseToManualThroughput(String resourceGroupName, String accountName, String databaseName) { - return this.beginMigrateSqlDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName) + beginUpdateSqlDatabaseThroughput(String resourceGroupName, String accountName, String databaseName, + ThroughputSettingsUpdateParameters updateThroughputParameters) { + return this + .beginUpdateSqlDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, + updateThroughputParameters) .getSyncPoller(); } /** - * Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput. + * 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. @@ -2091,37 +2014,40 @@ private Mono>> migrateSqlDatabaseToManualThroughputWit */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateSqlDatabaseToManualThroughput(String resourceGroupName, String accountName, String databaseName, - Context context) { + beginUpdateSqlDatabaseThroughput(String resourceGroupName, String accountName, String databaseName, + ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { return this - .beginMigrateSqlDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName, context) + .beginUpdateSqlDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, + updateThroughputParameters, context) .getSyncPoller(); } /** - * Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput. + * 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 migrateSqlDatabaseToManualThroughputAsync(String resourceGroupName, - String accountName, String databaseName) { - return beginMigrateSqlDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName).last() - .flatMap(this.client::getLroFinalResultOrError); + public Mono updateSqlDatabaseThroughputAsync(String resourceGroupName, + String accountName, String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return beginUpdateSqlDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, + updateThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput. + * 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. @@ -2129,36 +2055,39 @@ public Mono migrateSqlDatabaseToManualThrough * @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); + 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); } /** - * Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput. + * 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 migrateSqlDatabaseToManualThroughput(String resourceGroupName, - String accountName, String databaseName) { - return migrateSqlDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName).block(); + public ThroughputSettingsGetResultsInner updateSqlDatabaseThroughput(String resourceGroupName, String accountName, + String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return updateSqlDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, + updateThroughputParameters).block(); } /** - * Migrate an Azure Cosmos DB SQL database from autoscale to manual throughput. + * 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. @@ -2166,13 +2095,14 @@ public ThroughputSettingsGetResultsInner migrateSqlDatabaseToManualThroughput(St * @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(); + public ThroughputSettingsGetResultsInner updateSqlDatabaseThroughput(String resourceGroupName, String accountName, + String databaseName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + return updateSqlDatabaseThroughputAsync(resourceGroupName, accountName, databaseName, + updateThroughputParameters, context).block(); } /** - * Lists the SQL container under an existing Azure Cosmos DB database account. + * 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. @@ -2180,11 +2110,11 @@ public ThroughputSettingsGetResultsInner migrateSqlDatabaseToManualThroughput(St * @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}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSqlContainersSinglePageAsync(String resourceGroupName, + public Mono>> migrateSqlDatabaseToAutoscaleWithResponseAsync(String resourceGroupName, String accountName, String databaseName) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -2207,15 +2137,13 @@ private Mono> listSqlContainersSingle 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)) + context -> service.migrateSqlDatabaseToAutoscale(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the SQL container under an existing Azure Cosmos DB database account. + * 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. @@ -2224,11 +2152,11 @@ private Mono> listSqlContainersSingle * @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}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listSqlContainersSinglePageAsync(String resourceGroupName, + private Mono>> migrateSqlDatabaseToAutoscaleWithResponseAsync(String resourceGroupName, String accountName, String databaseName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -2250,15 +2178,12 @@ private Mono> listSqlContainersSingle } 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)); + return service.migrateSqlDatabaseToAutoscale(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, accept, context); } /** - * Lists the SQL container under an existing Azure Cosmos DB database account. + * 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. @@ -2266,17 +2191,20 @@ private Mono> listSqlContainersSingle * @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}. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSqlContainersAsync(String resourceGroupName, String accountName, - String databaseName) { - return new PagedFlux<>(() -> listSqlContainersSinglePageAsync(resourceGroupName, accountName, databaseName)); + @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()); } /** - * Lists the SQL container under an existing Azure Cosmos DB database account. + * 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. @@ -2285,18 +2213,22 @@ public PagedFlux listSqlContainersAsync(String reso * @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}. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSqlContainersAsync(String resourceGroupName, String accountName, - String databaseName, Context context) { - return new PagedFlux<>( - () -> listSqlContainersSinglePageAsync(resourceGroupName, accountName, databaseName, context)); + @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); } /** - * Lists the SQL container under an existing Azure Cosmos DB database account. + * 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. @@ -2304,17 +2236,17 @@ private PagedFlux listSqlContainersAsync(String res * @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}. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSqlContainers(String resourceGroupName, String accountName, - String databaseName) { - return new PagedIterable<>(listSqlContainersAsync(resourceGroupName, accountName, databaseName)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateSqlDatabaseToAutoscale(String resourceGroupName, String accountName, String databaseName) { + return this.beginMigrateSqlDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName) + .getSyncPoller(); } /** - * Lists the SQL container under an existing Azure Cosmos DB database account. + * 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. @@ -2323,180 +2255,103 @@ public PagedIterable listSqlContainers(String resou * @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}. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSqlContainers(String resourceGroupName, String accountName, - String databaseName, Context context) { - return new PagedIterable<>(listSqlContainersAsync(resourceGroupName, accountName, databaseName, context)); + @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(); } /** - * Gets the SQL container under an existing Azure Cosmos DB database account. + * 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 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}. + * @return an Azure Cosmos DB resource throughput 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())); + public Mono migrateSqlDatabaseToAutoscaleAsync(String resourceGroupName, + String accountName, String databaseName) { + return beginMigrateSqlDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Gets the SQL container under an existing Azure Cosmos DB database account. + * 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 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}. + * @return an Azure Cosmos DB resource throughput 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); + private Mono migrateSqlDatabaseToAutoscaleAsync(String resourceGroupName, + String accountName, String databaseName, Context context) { + return beginMigrateSqlDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Gets the SQL container under an existing Azure Cosmos DB database account. + * 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 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}. + * @return an Azure Cosmos DB resource throughput. */ @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())); + public ThroughputSettingsGetResultsInner migrateSqlDatabaseToAutoscale(String resourceGroupName, String accountName, + String databaseName) { + return migrateSqlDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName).block(); } /** - * Gets the SQL container under an existing Azure Cosmos DB database account. + * 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 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. + * @return an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.SINGLE) - public SqlContainerGetResultsInner getSqlContainer(String resourceGroupName, String accountName, - String databaseName, String containerName) { - return getSqlContainerWithResponse(resourceGroupName, accountName, databaseName, containerName, Context.NONE) - .getValue(); + public ThroughputSettingsGetResultsInner migrateSqlDatabaseToAutoscale(String resourceGroupName, String accountName, + String databaseName, Context context) { + return migrateSqlDatabaseToAutoscaleAsync(resourceGroupName, accountName, databaseName, context).block(); } /** - * Create or update an Azure Cosmos DB SQL container. + * 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 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}. + * @return an Azure Cosmos DB resource throughput 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) { + 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.")); @@ -2515,41 +2370,30 @@ public Mono>> createUpdateSqlContainerWithResponseAsyn 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)) + .withContext(context -> service.migrateSqlDatabaseToManualThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or update an Azure Cosmos DB SQL container. + * 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 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}. + * @return an Azure Cosmos DB resource throughput 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) { + 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.")); @@ -2568,222 +2412,188 @@ private Mono>> createUpdateSqlContainerWithResponseAsy 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); + return service.migrateSqlDatabaseToManualThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, accept, context); } /** - * Create or update an Azure Cosmos DB SQL container. + * 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 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. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ @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()); + 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()); } /** - * Create or update an Azure Cosmos DB SQL container. + * 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 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. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, SqlContainerGetResultsInner> - beginCreateUpdateSqlContainerAsync(String resourceGroupName, String accountName, String databaseName, - String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters, - Context context) { + private PollerFlux, ThroughputSettingsGetResultsInner> + beginMigrateSqlDatabaseToManualThroughputAsync(String resourceGroupName, String accountName, + String databaseName, 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); + Mono>> mono = migrateSqlDatabaseToManualThroughputWithResponseAsync(resourceGroupName, + accountName, databaseName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, context); } /** - * Create or update an Azure Cosmos DB SQL container. + * 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 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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ @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) + public SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateSqlDatabaseToManualThroughput(String resourceGroupName, String accountName, String databaseName) { + return this.beginMigrateSqlDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName) .getSyncPoller(); } /** - * Create or update an Azure Cosmos DB SQL container. + * 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 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. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, SqlContainerGetResultsInner> - beginCreateUpdateSqlContainer(String resourceGroupName, String accountName, String databaseName, - String containerName, SqlContainerCreateUpdateParameters createUpdateSqlContainerParameters, + public SyncPoller, ThroughputSettingsGetResultsInner> + beginMigrateSqlDatabaseToManualThroughput(String resourceGroupName, String accountName, String databaseName, Context context) { return this - .beginCreateUpdateSqlContainerAsync(resourceGroupName, accountName, databaseName, containerName, - createUpdateSqlContainerParameters, context) + .beginMigrateSqlDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName, context) .getSyncPoller(); } /** - * Create or update an Azure Cosmos DB SQL container. + * 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 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}. + * @return an Azure Cosmos DB resource throughput 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); + public Mono migrateSqlDatabaseToManualThroughputAsync(String resourceGroupName, + String accountName, String databaseName) { + return beginMigrateSqlDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Create or update an Azure Cosmos DB SQL container. + * 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 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}. + * @return an Azure Cosmos DB resource throughput 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); + private Mono migrateSqlDatabaseToManualThroughputAsync(String resourceGroupName, + String accountName, String databaseName, Context context) { + return beginMigrateSqlDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName, context) + .last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Create or update an Azure Cosmos DB SQL container. + * 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 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. + * @return an Azure Cosmos DB resource throughput. */ @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(); + public ThroughputSettingsGetResultsInner migrateSqlDatabaseToManualThroughput(String resourceGroupName, + String accountName, String databaseName) { + return migrateSqlDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName).block(); } /** - * Create or update an Azure Cosmos DB SQL container. + * 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 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. + * @return an Azure Cosmos DB resource throughput. */ @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(); + public ThroughputSettingsGetResultsInner migrateSqlDatabaseToManualThroughput(String resourceGroupName, + String accountName, String databaseName, Context context) { + return migrateSqlDatabaseToManualThroughputAsync(resourceGroupName, accountName, databaseName, context).block(); } /** - * Deletes an existing Azure Cosmos DB SQL container. + * Retrieve throughput distribution for 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 containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution 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 Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteSqlContainerWithResponseAsync(String resourceGroupName, - String accountName, String databaseName, String containerName) { + public Mono>> sqlDatabaseRetrieveThroughputDistributionWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2802,32 +2612,40 @@ public Mono>> deleteSqlContainerWithResponseAsync(Stri 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 (retrieveThroughputParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter retrieveThroughputParameters is required and cannot be null.")); + } else { + retrieveThroughputParameters.validate(); } + final String contentType = "application/json"; + final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.deleteSqlContainer(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, containerName, this.client.getApiVersion(), context)) + .withContext(context -> service.sqlDatabaseRetrieveThroughputDistribution(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, contentType, accept, retrieveThroughputParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes an existing Azure Cosmos DB SQL container. + * Retrieve throughput distribution for 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 containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution 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 Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@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) { + private Mono>> sqlDatabaseRetrieveThroughputDistributionWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -2846,169 +2664,496 @@ private Mono>> deleteSqlContainerWithResponseAsync(Str 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 (retrieveThroughputParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter retrieveThroughputParameters is required and cannot be null.")); + } else { + retrieveThroughputParameters.validate(); } + final String contentType = "application/json"; + final String accept = "application/json"; context = this.client.mergeContext(context); - return service.deleteSqlContainer(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, databaseName, containerName, this.client.getApiVersion(), context); + return service.sqlDatabaseRetrieveThroughputDistribution(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, contentType, accept, + retrieveThroughputParameters, context); } /** - * Deletes an existing Azure Cosmos DB SQL container. + * Retrieve throughput distribution for 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 containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution 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 long-running operation. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @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()); + public + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginSqlDatabaseRetrieveThroughputDistributionAsync(String resourceGroupName, String accountName, + String databaseName, RetrieveThroughputParameters retrieveThroughputParameters) { + Mono>> mono = sqlDatabaseRetrieveThroughputDistributionWithResponseAsync( + resourceGroupName, accountName, databaseName, retrieveThroughputParameters); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, this.client.getContext()); } /** - * Deletes an existing Azure Cosmos DB SQL container. + * Retrieve throughput distribution for 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 containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution 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 long-running operation. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteSqlContainerAsync(String resourceGroupName, - String accountName, String databaseName, String containerName, Context context) { + private + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginSqlDatabaseRetrieveThroughputDistributionAsync(String resourceGroupName, String accountName, + String databaseName, RetrieveThroughputParameters retrieveThroughputParameters, 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); + Mono>> mono = sqlDatabaseRetrieveThroughputDistributionWithResponseAsync( + resourceGroupName, accountName, databaseName, retrieveThroughputParameters, context); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, context); } /** - * Deletes an existing Azure Cosmos DB SQL container. + * Retrieve throughput distribution for 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 containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution 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 long-running operation. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @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) + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlDatabaseRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, RetrieveThroughputParameters retrieveThroughputParameters) { + return this + .beginSqlDatabaseRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + retrieveThroughputParameters) .getSyncPoller(); } /** - * Deletes an existing Azure Cosmos DB SQL container. + * Retrieve throughput distribution for 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 containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution 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 long-running operation. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @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) + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlDatabaseRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, RetrieveThroughputParameters retrieveThroughputParameters, Context context) { + return this + .beginSqlDatabaseRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + retrieveThroughputParameters, context) .getSyncPoller(); } /** - * Deletes an existing Azure Cosmos DB SQL container. + * Retrieve throughput distribution for 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 containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution 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 A {@link Mono} that completes when a successful response is received. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. */ @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); + public Mono sqlDatabaseRetrieveThroughputDistributionAsync( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters) { + return beginSqlDatabaseRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + retrieveThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes an existing Azure Cosmos DB SQL container. + * Retrieve throughput distribution for 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 containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution 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 A {@link Mono} that completes when a successful response is received. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. */ @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); + private Mono sqlDatabaseRetrieveThroughputDistributionAsync( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters, Context context) { + return beginSqlDatabaseRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + retrieveThroughputParameters, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes an existing Azure Cosmos DB SQL container. + * Retrieve throughput distribution for 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 containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution 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 PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteSqlContainer(String resourceGroupName, String accountName, String databaseName, - String containerName) { - deleteSqlContainerAsync(resourceGroupName, accountName, databaseName, containerName).block(); + public PhysicalPartitionThroughputInfoResultInner sqlDatabaseRetrieveThroughputDistribution( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters) { + return sqlDatabaseRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + retrieveThroughputParameters).block(); } /** - * Deletes an existing Azure Cosmos DB SQL container. + * Retrieve throughput distribution for 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 containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution 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 PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteSqlContainer(String resourceGroupName, String accountName, String databaseName, - String containerName, Context context) { - deleteSqlContainerAsync(resourceGroupName, accountName, databaseName, containerName, context).block(); + public PhysicalPartitionThroughputInfoResultInner sqlDatabaseRetrieveThroughputDistribution( + String resourceGroupName, String accountName, String databaseName, + RetrieveThroughputParameters retrieveThroughputParameters, Context context) { + return sqlDatabaseRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + retrieveThroughputParameters, context).block(); + } + + /** + * Redistribute throughput for 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 redistributeThroughputParameters The parameters to provide for redistributing throughput 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 PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> sqlDatabaseRedistributeThroughputWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, RedistributeThroughputParameters redistributeThroughputParameters) { + 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 (redistributeThroughputParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter redistributeThroughputParameters is required and cannot be null.")); + } else { + redistributeThroughputParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.sqlDatabaseRedistributeThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, contentType, accept, redistributeThroughputParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Redistribute throughput for 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 redistributeThroughputParameters The parameters to provide for redistributing throughput 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 PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> sqlDatabaseRedistributeThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters, 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 (redistributeThroughputParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter redistributeThroughputParameters is required and cannot be null.")); + } else { + redistributeThroughputParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.sqlDatabaseRedistributeThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, contentType, accept, + redistributeThroughputParameters, context); + } + + /** + * Redistribute throughput for 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 redistributeThroughputParameters The parameters to provide for redistributing throughput 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 PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginSqlDatabaseRedistributeThroughputAsync(String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters) { + Mono>> mono = sqlDatabaseRedistributeThroughputWithResponseAsync(resourceGroupName, + accountName, databaseName, redistributeThroughputParameters); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, this.client.getContext()); + } + + /** + * Redistribute throughput for 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 redistributeThroughputParameters The parameters to provide for redistributing throughput 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 PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginSqlDatabaseRedistributeThroughputAsync(String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = sqlDatabaseRedistributeThroughputWithResponseAsync(resourceGroupName, + accountName, databaseName, redistributeThroughputParameters, context); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, context); + } + + /** + * Redistribute throughput for 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 redistributeThroughputParameters The parameters to provide for redistributing throughput 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 PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlDatabaseRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters) { + return this + .beginSqlDatabaseRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + redistributeThroughputParameters) + .getSyncPoller(); + } + + /** + * Redistribute throughput for 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 redistributeThroughputParameters The parameters to provide for redistributing throughput 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 PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlDatabaseRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context) { + return this + .beginSqlDatabaseRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + redistributeThroughputParameters, context) + .getSyncPoller(); + } + + /** + * Redistribute throughput for 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 redistributeThroughputParameters The parameters to provide for redistributing throughput 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 PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono sqlDatabaseRedistributeThroughputAsync( + String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters) { + return beginSqlDatabaseRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + redistributeThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Redistribute throughput for 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 redistributeThroughputParameters The parameters to provide for redistributing throughput 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 PhysicalPartitionThroughputInfoResult object on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono sqlDatabaseRedistributeThroughputAsync( + String resourceGroupName, String accountName, String databaseName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context) { + return beginSqlDatabaseRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + redistributeThroughputParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Redistribute throughput for 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 redistributeThroughputParameters The parameters to provide for redistributing throughput 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 PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PhysicalPartitionThroughputInfoResultInner sqlDatabaseRedistributeThroughput(String resourceGroupName, + String accountName, String databaseName, RedistributeThroughputParameters redistributeThroughputParameters) { + return sqlDatabaseRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + redistributeThroughputParameters).block(); + } + + /** + * Redistribute throughput for 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 redistributeThroughputParameters The parameters to provide for redistributing throughput 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 PhysicalPartitionThroughputInfoResult object. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PhysicalPartitionThroughputInfoResultInner sqlDatabaseRedistributeThroughput(String resourceGroupName, + String accountName, String databaseName, RedistributeThroughputParameters redistributeThroughputParameters, + Context context) { + return sqlDatabaseRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, + redistributeThroughputParameters, context).block(); } /** @@ -3051,8 +3196,8 @@ public Mono> getSqlContainerThroughp 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)) + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, containerName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -3096,8 +3241,9 @@ private Mono> getSqlContainerThrough } 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); + return service.getSqlContainerThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, accept, + context); } /** @@ -3205,11 +3351,12 @@ public Mono>> updateSqlContainerThroughputWithResponse } else { updateThroughputParameters.validate(); } + final String contentType = "application/json"; 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)) + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, containerName, contentType, accept, updateThroughputParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -3259,11 +3406,12 @@ private Mono>> updateSqlContainerThroughputWithRespons } else { updateThroughputParameters.validate(); } + final String contentType = "application/json"; 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); + return service.updateSqlContainerThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, contentType, + accept, updateThroughputParameters, context); } /** @@ -3488,8 +3636,8 @@ public Mono>> migrateSqlContainerToAutoscaleWithRespon 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)) + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, containerName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -3533,8 +3681,9 @@ private Mono>> migrateSqlContainerToAutoscaleWithRespo } 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); + return service.migrateSqlContainerToAutoscale(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, accept, + context); } /** @@ -3747,8 +3896,8 @@ public Mono>> migrateSqlContainerToManualThroughputWit 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)) + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, containerName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -3792,8 +3941,9 @@ private Mono>> migrateSqlContainerToManualThroughputWi } 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); + return service.migrateSqlContainerToManualThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, accept, + context); } /** @@ -3968,20 +4118,24 @@ public ThroughputSettingsGetResultsInner migrateSqlContainerToManualThroughput(S } /** - * Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. + * Retrieve throughput distribution for 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 retrieveThroughputParameters The parameters to provide for retrieving throughput distribution 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 List operation response, that contains the client encryption keys and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> - listClientEncryptionKeysSinglePageAsync(String resourceGroupName, String accountName, String databaseName) { + public Mono>> sqlContainerRetrieveThroughputDistributionWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String containerName, + RetrieveThroughputParameters retrieveThroughputParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -4000,32 +4154,44 @@ public ThroughputSettingsGetResultsInner migrateSqlContainerToManualThroughput(S 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 (retrieveThroughputParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter retrieveThroughputParameters is required and cannot be null.")); + } else { + retrieveThroughputParameters.validate(); + } + final String contentType = "application/json"; 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)) + .withContext(context -> service.sqlContainerRetrieveThroughputDistribution(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, containerName, contentType, accept, retrieveThroughputParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. + * Retrieve throughput distribution for 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 retrieveThroughputParameters The parameters to provide for retrieving throughput distribution 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 List operation response, that contains the client encryption keys and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object along with {@link Response} on successful + * completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> listClientEncryptionKeysSinglePageAsync( - String resourceGroupName, String accountName, String databaseName, Context context) { + private Mono>> sqlContainerRetrieveThroughputDistributionWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String containerName, + RetrieveThroughputParameters retrieveThroughputParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -4044,262 +4210,241 @@ private Mono> listClientEncryp 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 (retrieveThroughputParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter retrieveThroughputParameters is required and cannot be null.")); + } else { + retrieveThroughputParameters.validate(); + } + final String contentType = "application/json"; 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)); + return service.sqlContainerRetrieveThroughputDistribution(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, + containerName, contentType, accept, retrieveThroughputParameters, context); } /** - * Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. + * Retrieve throughput distribution for 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 retrieveThroughputParameters The parameters to provide for retrieving throughput distribution 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 List operation response, that contains the client encryption keys and their properties as paginated - * response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listClientEncryptionKeysAsync(String resourceGroupName, - String accountName, String databaseName) { - return new PagedFlux<>( - () -> listClientEncryptionKeysSinglePageAsync(resourceGroupName, accountName, databaseName)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginSqlContainerRetrieveThroughputDistributionAsync(String resourceGroupName, String accountName, + String databaseName, String containerName, RetrieveThroughputParameters retrieveThroughputParameters) { + Mono>> mono = sqlContainerRetrieveThroughputDistributionWithResponseAsync( + resourceGroupName, accountName, databaseName, containerName, retrieveThroughputParameters); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, this.client.getContext()); } /** - * Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. + * Retrieve throughput distribution for 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 retrieveThroughputParameters The parameters to provide for retrieving throughput distribution 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 List operation response, that contains the client encryption keys and their properties as paginated - * response with {@link PagedFlux}. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listClientEncryptionKeysAsync(String resourceGroupName, - String accountName, String databaseName, Context context) { - return new PagedFlux<>( - () -> listClientEncryptionKeysSinglePageAsync(resourceGroupName, accountName, databaseName, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginSqlContainerRetrieveThroughputDistributionAsync(String resourceGroupName, String accountName, + String databaseName, String containerName, RetrieveThroughputParameters retrieveThroughputParameters, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = sqlContainerRetrieveThroughputDistributionWithResponseAsync( + resourceGroupName, accountName, databaseName, containerName, retrieveThroughputParameters, context); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, context); } /** - * Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. + * Retrieve throughput distribution for 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 retrieveThroughputParameters The parameters to provide for retrieving throughput distribution 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 List operation response, that contains the client encryption keys and their properties as paginated - * response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listClientEncryptionKeys(String resourceGroupName, - String accountName, String databaseName) { - return new PagedIterable<>(listClientEncryptionKeysAsync(resourceGroupName, accountName, databaseName)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlContainerRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, String containerName, RetrieveThroughputParameters retrieveThroughputParameters) { + return this + .beginSqlContainerRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + containerName, retrieveThroughputParameters) + .getSyncPoller(); } /** - * Lists the ClientEncryptionKeys under an existing Azure Cosmos DB SQL database. + * Retrieve throughput distribution for 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 retrieveThroughputParameters The parameters to provide for retrieving throughput distribution 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 List operation response, that contains the client encryption keys and their properties as paginated - * response with {@link PagedIterable}. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listClientEncryptionKeys(String resourceGroupName, - String accountName, String databaseName, Context context) { - return new PagedIterable<>( - listClientEncryptionKeysAsync(resourceGroupName, accountName, databaseName, context)); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlContainerRetrieveThroughputDistribution(String resourceGroupName, String accountName, + String databaseName, String containerName, RetrieveThroughputParameters retrieveThroughputParameters, + Context context) { + return this + .beginSqlContainerRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + containerName, retrieveThroughputParameters, context) + .getSyncPoller(); } /** - * Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + * Retrieve throughput distribution for 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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. + * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution 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 ClientEncryptionKey under an existing Azure Cosmos DB SQL database along with {@link Response} on - * successful completion of {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object 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())); + public Mono sqlContainerRetrieveThroughputDistributionAsync( + String resourceGroupName, String accountName, String databaseName, String containerName, + RetrieveThroughputParameters retrieveThroughputParameters) { + return beginSqlContainerRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + containerName, retrieveThroughputParameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + * Retrieve throughput distribution for 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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. + * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution 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 ClientEncryptionKey under an existing Azure Cosmos DB SQL database along with {@link Response} on - * successful completion of {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object 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); + private Mono sqlContainerRetrieveThroughputDistributionAsync( + String resourceGroupName, String accountName, String databaseName, String containerName, + RetrieveThroughputParameters retrieveThroughputParameters, Context context) { + return beginSqlContainerRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + containerName, retrieveThroughputParameters, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + * Retrieve throughput distribution for 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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. + * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution 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 ClientEncryptionKey under an existing Azure Cosmos DB SQL database on successful completion of - * {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @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())); + public PhysicalPartitionThroughputInfoResultInner sqlContainerRetrieveThroughputDistribution( + String resourceGroupName, String accountName, String databaseName, String containerName, + RetrieveThroughputParameters retrieveThroughputParameters) { + return sqlContainerRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + containerName, retrieveThroughputParameters).block(); } /** - * Gets the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. + * Retrieve throughput distribution for 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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. + * @param containerName Cosmos DB container name. + * @param retrieveThroughputParameters The parameters to provide for retrieving throughput distribution 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 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. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ClientEncryptionKeyGetResultsInner getClientEncryptionKey(String resourceGroupName, String accountName, - String databaseName, String clientEncryptionKeyName) { - return getClientEncryptionKeyWithResponse(resourceGroupName, accountName, databaseName, clientEncryptionKeyName, - Context.NONE).getValue(); + public PhysicalPartitionThroughputInfoResultInner sqlContainerRetrieveThroughputDistribution( + String resourceGroupName, String accountName, String databaseName, String containerName, + RetrieveThroughputParameters retrieveThroughputParameters, Context context) { + return sqlContainerRetrieveThroughputDistributionAsync(resourceGroupName, accountName, databaseName, + containerName, retrieveThroughputParameters, context).block(); } /** - * Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell - * (instead of directly). + * Redistribute throughput for 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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. - * @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption key. + * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput 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 client Encryption Key along with {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object 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) { + public Mono>> sqlContainerRedistributeThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String containerName, + RedistributeThroughputParameters redistributeThroughputParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -4318,43 +4463,44 @@ public Mono>> createUpdateClientEncryptionKeyWithRespo 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 (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); } - if (createUpdateClientEncryptionKeyParameters == null) { + if (redistributeThroughputParameters == null) { return Mono.error(new IllegalArgumentException( - "Parameter createUpdateClientEncryptionKeyParameters is required and cannot be null.")); + "Parameter redistributeThroughputParameters is required and cannot be null.")); } else { - createUpdateClientEncryptionKeyParameters.validate(); + redistributeThroughputParameters.validate(); } + final String contentType = "application/json"; 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)) + .withContext(context -> service.sqlContainerRedistributeThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, containerName, contentType, accept, redistributeThroughputParameters, 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). + * Redistribute throughput for 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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. - * @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption key. + * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput 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 client Encryption Key along with {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object 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) { + private Mono>> sqlContainerRedistributeThroughputWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String containerName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -4373,236 +4519,236 @@ private Mono>> createUpdateClientEncryptionKeyWithResp 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 (containerName == null) { + return Mono.error(new IllegalArgumentException("Parameter containerName is required and cannot be null.")); } - if (createUpdateClientEncryptionKeyParameters == null) { + if (redistributeThroughputParameters == null) { return Mono.error(new IllegalArgumentException( - "Parameter createUpdateClientEncryptionKeyParameters is required and cannot be null.")); + "Parameter redistributeThroughputParameters is required and cannot be null.")); } else { - createUpdateClientEncryptionKeyParameters.validate(); + redistributeThroughputParameters.validate(); } + final String contentType = "application/json"; 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); + return service.sqlContainerRedistributeThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, contentType, + accept, redistributeThroughputParameters, context); } /** - * Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell - * (instead of directly). + * Redistribute throughput for 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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. - * @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption key. + * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput 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 client Encryption Key. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @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()); + public + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginSqlContainerRedistributeThroughputAsync(String resourceGroupName, String accountName, String databaseName, + String containerName, RedistributeThroughputParameters redistributeThroughputParameters) { + Mono>> mono = sqlContainerRedistributeThroughputWithResponseAsync(resourceGroupName, + accountName, databaseName, containerName, redistributeThroughputParameters); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.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). + * Redistribute throughput for 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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. - * @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption key. + * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput 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 client Encryption Key. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ClientEncryptionKeyGetResultsInner> - beginCreateUpdateClientEncryptionKeyAsync(String resourceGroupName, String accountName, String databaseName, - String clientEncryptionKeyName, - ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters, Context context) { + private + PollerFlux, PhysicalPartitionThroughputInfoResultInner> + beginSqlContainerRedistributeThroughputAsync(String resourceGroupName, String accountName, String databaseName, + String containerName, RedistributeThroughputParameters redistributeThroughputParameters, 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); + Mono>> mono = sqlContainerRedistributeThroughputWithResponseAsync(resourceGroupName, + accountName, databaseName, containerName, redistributeThroughputParameters, context); + return this.client + .getLroResult(mono, + this.client.getHttpPipeline(), PhysicalPartitionThroughputInfoResultInner.class, + PhysicalPartitionThroughputInfoResultInner.class, context); } /** - * Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell - * (instead of directly). + * Redistribute throughput for 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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. - * @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption key. + * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput 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 client Encryption Key. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ClientEncryptionKeyGetResultsInner> - beginCreateUpdateClientEncryptionKey(String resourceGroupName, String accountName, String databaseName, - String clientEncryptionKeyName, - ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters) { + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlContainerRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + String containerName, RedistributeThroughputParameters redistributeThroughputParameters) { return this - .beginCreateUpdateClientEncryptionKeyAsync(resourceGroupName, accountName, databaseName, - clientEncryptionKeyName, createUpdateClientEncryptionKeyParameters) + .beginSqlContainerRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, containerName, + redistributeThroughputParameters) .getSyncPoller(); } /** - * Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell - * (instead of directly). + * Redistribute throughput for 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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. - * @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption key. + * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput 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 client Encryption Key. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ClientEncryptionKeyGetResultsInner> - beginCreateUpdateClientEncryptionKey(String resourceGroupName, String accountName, String databaseName, - String clientEncryptionKeyName, - ClientEncryptionKeyCreateUpdateParameters createUpdateClientEncryptionKeyParameters, Context context) { + public + SyncPoller, PhysicalPartitionThroughputInfoResultInner> + beginSqlContainerRedistributeThroughput(String resourceGroupName, String accountName, String databaseName, + String containerName, RedistributeThroughputParameters redistributeThroughputParameters, Context context) { return this - .beginCreateUpdateClientEncryptionKeyAsync(resourceGroupName, accountName, databaseName, - clientEncryptionKeyName, createUpdateClientEncryptionKeyParameters, context) + .beginSqlContainerRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, containerName, + redistributeThroughputParameters, context) .getSyncPoller(); } /** - * Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell - * (instead of directly). + * Redistribute throughput for 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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. - * @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption key. + * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput 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 client Encryption Key on successful completion of {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object 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); + public Mono sqlContainerRedistributeThroughputAsync( + String resourceGroupName, String accountName, String databaseName, String containerName, + RedistributeThroughputParameters redistributeThroughputParameters) { + return beginSqlContainerRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, containerName, + redistributeThroughputParameters).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). + * Redistribute throughput for 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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. - * @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption key. + * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput 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 client Encryption Key on successful completion of {@link Mono}. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object 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); + private Mono sqlContainerRedistributeThroughputAsync( + String resourceGroupName, String accountName, String databaseName, String containerName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context) { + return beginSqlContainerRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, containerName, + redistributeThroughputParameters, 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). + * Redistribute throughput for 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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. - * @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption key. + * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput 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 client Encryption Key. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @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(); + public PhysicalPartitionThroughputInfoResultInner sqlContainerRedistributeThroughput(String resourceGroupName, + String accountName, String databaseName, String containerName, + RedistributeThroughputParameters redistributeThroughputParameters) { + return sqlContainerRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, containerName, + redistributeThroughputParameters).block(); } /** - * Create or update a ClientEncryptionKey. This API is meant to be invoked via tools such as the Azure Powershell - * (instead of directly). + * Redistribute throughput for 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 clientEncryptionKeyName Cosmos DB ClientEncryptionKey name. - * @param createUpdateClientEncryptionKeyParameters The parameters to provide for the client encryption key. + * @param containerName Cosmos DB container name. + * @param redistributeThroughputParameters The parameters to provide for redistributing throughput 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 client Encryption Key. + * @return an Azure Cosmos DB PhysicalPartitionThroughputInfoResult object. */ @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(); + public PhysicalPartitionThroughputInfoResultInner sqlContainerRedistributeThroughput(String resourceGroupName, + String accountName, String databaseName, String containerName, + RedistributeThroughputParameters redistributeThroughputParameters, Context context) { + return sqlContainerRedistributeThroughputAsync(resourceGroupName, accountName, databaseName, containerName, + redistributeThroughputParameters, context).block(); } /** - * Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. + * 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 containerName Cosmos DB container 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 List operation response, that contains the storedProcedures and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @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> listSqlStoredProceduresSinglePageAsync( - String resourceGroupName, String accountName, String databaseName, String containerName) { + 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.")); @@ -4621,36 +4767,36 @@ private Mono> listSqlStoredProc 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 (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.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)) + .withContext(context -> service.getClientEncryptionKey(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, clientEncryptionKeyName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. + * 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 containerName Cosmos DB container 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 List operation response, that contains the storedProcedures and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @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> listSqlStoredProceduresSinglePageAsync( - String resourceGroupName, String accountName, String databaseName, String containerName, Context context) { + 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.")); @@ -4669,118 +4815,94 @@ private Mono> listSqlStoredProc 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 (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 - .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)); + return service.getClientEncryptionKey(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, clientEncryptionKeyName, + accept, context); } /** - * Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. + * 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 containerName Cosmos DB container 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 List operation response, that contains the storedProcedures and their properties as paginated - * response with {@link PagedFlux}. + * @return the ClientEncryptionKey under an existing Azure Cosmos DB SQL database on successful completion of + * {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSqlStoredProceduresAsync(String resourceGroupName, - String accountName, String databaseName, String containerName) { - return new PagedFlux<>( - () -> listSqlStoredProceduresSinglePageAsync(resourceGroupName, accountName, databaseName, containerName)); + @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())); } /** - * Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. + * 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 containerName Cosmos DB container 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 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}. + * @return the ClientEncryptionKey under an existing Azure Cosmos DB SQL database along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSqlStoredProcedures(String resourceGroupName, - String accountName, String databaseName, String containerName) { - return new PagedIterable<>( - listSqlStoredProceduresAsync(resourceGroupName, accountName, databaseName, containerName)); + @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(); } /** - * Lists the SQL storedProcedure under an existing Azure Cosmos DB database account. + * 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 containerName Cosmos DB container name. - * @param context The context to associate with this operation. + * @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 List operation response, that contains the storedProcedures and their properties as paginated - * response with {@link PagedIterable}. + * @return the ClientEncryptionKey under an existing Azure Cosmos DB SQL database. */ - @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)); + @ServiceMethod(returns = ReturnType.SINGLE) + public ClientEncryptionKeyGetResultsInner getClientEncryptionKey(String resourceGroupName, String accountName, + String databaseName, String clientEncryptionKeyName) { + return getClientEncryptionKeyWithResponse(resourceGroupName, accountName, databaseName, clientEncryptionKeyName, + Context.NONE).getValue(); } /** - * Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. + * 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 containerName Cosmos DB container name. - * @param storedProcedureName Cosmos DB storedProcedure 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 SQL storedProcedure under an existing Azure Cosmos DB database account along with {@link Response} on - * successful completion of {@link Mono}. + * @return client Encryption Key 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) { + 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.")); @@ -4799,40 +4921,43 @@ public Mono> getSqlStoredProcedureWi 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 (clientEncryptionKeyName == null) { + return Mono.error( + new IllegalArgumentException("Parameter clientEncryptionKeyName is required and cannot be null.")); } - if (storedProcedureName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storedProcedureName 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 contentType = "application/json"; 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)) + return FluxUtil.withContext(context -> service.createUpdateClientEncryptionKey(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, + clientEncryptionKeyName, contentType, accept, createUpdateClientEncryptionKeyParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. + * 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 containerName Cosmos DB container name. - * @param storedProcedureName Cosmos DB storedProcedure 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 SQL storedProcedure under an existing Azure Cosmos DB database account along with {@link Response} on - * successful completion of {@link Mono}. + * @return client Encryption Key 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) { + 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.")); @@ -4851,45 +4976,1940 @@ private Mono> getSqlStoredProcedureW 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 (clientEncryptionKeyName == null) { + return Mono.error( + new IllegalArgumentException("Parameter clientEncryptionKeyName is required and cannot be null.")); } - if (storedProcedureName == null) { - return Mono - .error(new IllegalArgumentException("Parameter storedProcedureName 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 contentType = "application/json"; 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); + return service.createUpdateClientEncryptionKey(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, clientEncryptionKeyName, + contentType, accept, createUpdateClientEncryptionKeyParameters, context); } /** - * Gets the SQL storedProcedure under an existing Azure Cosmos DB database account. + * 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 containerName Cosmos DB container name. - * @param storedProcedureName Cosmos DB storedProcedure 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 SQL storedProcedure under an existing Azure Cosmos DB database account on successful completion of - * {@link Mono}. + * @return the {@link PollerFlux} for polling of client Encryption Key. */ - @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. + @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 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.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), 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.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), 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), + nextLink -> listClientEncryptionKeysNextSinglePageAsync(nextLink)); + } + + /** + * 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), + nextLink -> listClientEncryptionKeysNextSinglePageAsync(nextLink, 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 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.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, 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.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, 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 contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createUpdateSqlContainer(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, containerName, contentType, accept, createUpdateSqlContainerParameters, 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 contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createUpdateSqlContainer(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, contentType, + accept, createUpdateSqlContainerParameters, 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.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, 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.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, 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(); + } + + /** + * 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.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), 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.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, databaseName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), 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), + nextLink -> listSqlContainersNextSinglePageAsync(nextLink)); + } + + /** + * 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), + nextLink -> listSqlContainersNextSinglePageAsync(nextLink, 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)); + } + + /** + * Merges the partitions of a 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 mergeParameters The parameters for the merge 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 list of physical partitions and their properties returned by a merge operation along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> listSqlContainerPartitionMergeWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String containerName, MergeParameters mergeParameters) { + 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 (mergeParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter mergeParameters is required and cannot be null.")); + } else { + mergeParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listSqlContainerPartitionMerge(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, containerName, contentType, accept, mergeParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Merges the partitions of a 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 mergeParameters The parameters for the merge operation. + * @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 list of physical partitions and their properties returned by a merge operation along with + * {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> listSqlContainerPartitionMergeWithResponseAsync(String resourceGroupName, + String accountName, String databaseName, String containerName, MergeParameters mergeParameters, + 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 (mergeParameters == null) { + return Mono + .error(new IllegalArgumentException("Parameter mergeParameters is required and cannot be null.")); + } else { + mergeParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listSqlContainerPartitionMerge(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, contentType, + accept, mergeParameters, context); + } + + /** + * Merges the partitions of a 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 mergeParameters The parameters for the merge 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 list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + PollerFlux, PhysicalPartitionStorageInfoCollectionInner> + beginListSqlContainerPartitionMergeAsync(String resourceGroupName, String accountName, String databaseName, + String containerName, MergeParameters mergeParameters) { + Mono>> mono = listSqlContainerPartitionMergeWithResponseAsync(resourceGroupName, + accountName, databaseName, containerName, mergeParameters); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), PhysicalPartitionStorageInfoCollectionInner.class, + PhysicalPartitionStorageInfoCollectionInner.class, this.client.getContext()); + } + + /** + * Merges the partitions of a 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 mergeParameters The parameters for the merge operation. + * @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 list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private + PollerFlux, PhysicalPartitionStorageInfoCollectionInner> + beginListSqlContainerPartitionMergeAsync(String resourceGroupName, String accountName, String databaseName, + String containerName, MergeParameters mergeParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = listSqlContainerPartitionMergeWithResponseAsync(resourceGroupName, + accountName, databaseName, containerName, mergeParameters, context); + return this.client + .getLroResult( + mono, this.client.getHttpPipeline(), PhysicalPartitionStorageInfoCollectionInner.class, + PhysicalPartitionStorageInfoCollectionInner.class, context); + } + + /** + * Merges the partitions of a 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 mergeParameters The parameters for the merge 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 list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginListSqlContainerPartitionMerge(String resourceGroupName, String accountName, String databaseName, + String containerName, MergeParameters mergeParameters) { + return this + .beginListSqlContainerPartitionMergeAsync(resourceGroupName, accountName, databaseName, containerName, + mergeParameters) + .getSyncPoller(); + } + + /** + * Merges the partitions of a 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 mergeParameters The parameters for the merge operation. + * @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 list of physical partitions and their properties returned by a + * merge operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public + SyncPoller, PhysicalPartitionStorageInfoCollectionInner> + beginListSqlContainerPartitionMerge(String resourceGroupName, String accountName, String databaseName, + String containerName, MergeParameters mergeParameters, Context context) { + return this + .beginListSqlContainerPartitionMergeAsync(resourceGroupName, accountName, databaseName, containerName, + mergeParameters, context) + .getSyncPoller(); + } + + /** + * Merges the partitions of a 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 mergeParameters The parameters for the merge 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 list of physical partitions and their properties returned by a merge operation on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono listSqlContainerPartitionMergeAsync( + String resourceGroupName, String accountName, String databaseName, String containerName, + MergeParameters mergeParameters) { + return beginListSqlContainerPartitionMergeAsync(resourceGroupName, accountName, databaseName, containerName, + mergeParameters).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Merges the partitions of a 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 mergeParameters The parameters for the merge operation. + * @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 list of physical partitions and their properties returned by a merge operation on successful completion + * of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono listSqlContainerPartitionMergeAsync( + String resourceGroupName, String accountName, String databaseName, String containerName, + MergeParameters mergeParameters, Context context) { + return beginListSqlContainerPartitionMergeAsync(resourceGroupName, accountName, databaseName, containerName, + mergeParameters, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Merges the partitions of a 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 mergeParameters The parameters for the merge 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 list of physical partitions and their properties returned by a merge operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PhysicalPartitionStorageInfoCollectionInner listSqlContainerPartitionMerge(String resourceGroupName, + String accountName, String databaseName, String containerName, MergeParameters mergeParameters) { + return listSqlContainerPartitionMergeAsync(resourceGroupName, accountName, databaseName, containerName, + mergeParameters).block(); + } + + /** + * Merges the partitions of a 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 mergeParameters The parameters for the merge operation. + * @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 list of physical partitions and their properties returned by a merge operation. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public PhysicalPartitionStorageInfoCollectionInner listSqlContainerPartitionMerge(String resourceGroupName, + String accountName, String databaseName, String containerName, MergeParameters mergeParameters, + Context context) { + return listSqlContainerPartitionMergeAsync(resourceGroupName, accountName, databaseName, containerName, + mergeParameters, context).block(); + } + + /** + * Retrieves continuous backup information for a container resource. + * + * @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 location The name of the continuous backup restore location. + * @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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> retrieveContinuousBackupInformationWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String containerName, + ContinuousBackupRestoreLocation location) { + 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } else { + location.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.retrieveContinuousBackupInformation(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, containerName, contentType, accept, location, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves continuous backup information for a container resource. + * + * @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 location The name of the continuous backup restore location. + * @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 response body along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> retrieveContinuousBackupInformationWithResponseAsync( + String resourceGroupName, String accountName, String databaseName, String containerName, + ContinuousBackupRestoreLocation location, 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 (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); + } else { + location.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.retrieveContinuousBackupInformation(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, contentType, + accept, location, context); + } + + /** + * Retrieves continuous backup information for a container resource. + * + * @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 location The name of the continuous backup restore location. + * @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, BackupInformationInner> + beginRetrieveContinuousBackupInformationAsync(String resourceGroupName, String accountName, String databaseName, + String containerName, ContinuousBackupRestoreLocation location) { + Mono>> mono = retrieveContinuousBackupInformationWithResponseAsync(resourceGroupName, + accountName, databaseName, containerName, location); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), BackupInformationInner.class, BackupInformationInner.class, + this.client.getContext()); + } + + /** + * Retrieves continuous backup information for a container resource. + * + * @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 location The name of the continuous backup restore location. + * @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, BackupInformationInner> + beginRetrieveContinuousBackupInformationAsync(String resourceGroupName, String accountName, String databaseName, + String containerName, ContinuousBackupRestoreLocation location, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = retrieveContinuousBackupInformationWithResponseAsync(resourceGroupName, + accountName, databaseName, containerName, location, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), BackupInformationInner.class, BackupInformationInner.class, context); + } + + /** + * Retrieves continuous backup information for a container resource. + * + * @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 location The name of the continuous backup restore location. + * @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, BackupInformationInner> + beginRetrieveContinuousBackupInformation(String resourceGroupName, String accountName, String databaseName, + String containerName, ContinuousBackupRestoreLocation location) { + return this + .beginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, containerName, + location) + .getSyncPoller(); + } + + /** + * Retrieves continuous backup information for a container resource. + * + * @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 location The name of the continuous backup restore location. + * @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, BackupInformationInner> + beginRetrieveContinuousBackupInformation(String resourceGroupName, String accountName, String databaseName, + String containerName, ContinuousBackupRestoreLocation location, Context context) { + return this + .beginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, containerName, + location, context) + .getSyncPoller(); + } + + /** + * Retrieves continuous backup information for a container resource. + * + * @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 location The name of the continuous backup restore location. + * @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 response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono retrieveContinuousBackupInformationAsync(String resourceGroupName, + String accountName, String databaseName, String containerName, ContinuousBackupRestoreLocation location) { + return beginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, + containerName, location).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Retrieves continuous backup information for a container resource. + * + * @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 location The name of the continuous backup restore location. + * @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 response body on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono retrieveContinuousBackupInformationAsync(String resourceGroupName, + String accountName, String databaseName, String containerName, ContinuousBackupRestoreLocation location, + Context context) { + return beginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, + containerName, location, context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Retrieves continuous backup information for a container resource. + * + * @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 location The name of the continuous backup restore location. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackupInformationInner retrieveContinuousBackupInformation(String resourceGroupName, String accountName, + String databaseName, String containerName, ContinuousBackupRestoreLocation location) { + return retrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, containerName, + location).block(); + } + + /** + * Retrieves continuous backup information for a container resource. + * + * @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 location The name of the continuous backup restore location. + * @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 response. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public BackupInformationInner retrieveContinuousBackupInformation(String resourceGroupName, String accountName, + String databaseName, String containerName, ContinuousBackupRestoreLocation location, Context context) { + return retrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, containerName, + location, 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 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.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, containerName, storedProcedureName, 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.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, + storedProcedureName, 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. @@ -4976,12 +6996,11 @@ public Mono>> createUpdateSqlStoredProcedureWithRespon } else { createUpdateSqlStoredProcedureParameters.validate(); } + final String contentType = "application/json"; 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)) + return FluxUtil.withContext(context -> service.createUpdateSqlStoredProcedure(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, + containerName, storedProcedureName, contentType, accept, createUpdateSqlStoredProcedureParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -5035,11 +7054,12 @@ private Mono>> createUpdateSqlStoredProcedureWithRespo } else { createUpdateSqlStoredProcedureParameters.validate(); } + final String contentType = "application/json"; 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); + return service.createUpdateSqlStoredProcedure(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, + storedProcedureName, contentType, accept, createUpdateSqlStoredProcedureParameters, context); } /** @@ -5283,8 +7303,8 @@ public Mono>> deleteSqlStoredProcedureWithResponseAsyn } return FluxUtil .withContext(context -> service.deleteSqlStoredProcedure(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, - storedProcedureName, this.client.getApiVersion(), context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, containerName, storedProcedureName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -5331,9 +7351,9 @@ private Mono>> deleteSqlStoredProcedureWithResponseAsy .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); + return service.deleteSqlStoredProcedure(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, + storedProcedureName, context); } /** @@ -5508,7 +7528,7 @@ public void deleteSqlStoredProcedure(String resourceGroupName, String accountNam } /** - * Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. + * 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. @@ -5517,11 +7537,11 @@ public void deleteSqlStoredProcedure(String resourceGroupName, String accountNam * @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 + * @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> listSqlUserDefinedFunctionsSinglePageAsync( + private Mono> listSqlStoredProceduresSinglePageAsync( String resourceGroupName, String accountName, String databaseName, String containerName) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -5546,16 +7566,16 @@ private Mono> listSqlUserDe } 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)) + .withContext(context -> service.listSqlStoredProcedures(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, containerName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. + * 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. @@ -5565,11 +7585,11 @@ private Mono> listSqlUserDe * @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 + * @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> listSqlUserDefinedFunctionsSinglePageAsync( + private Mono> listSqlStoredProceduresSinglePageAsync( String resourceGroupName, String accountName, String databaseName, String containerName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -5595,14 +7615,15 @@ private Mono> listSqlUserDe final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listSqlUserDefinedFunctions(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, databaseName, containerName, this.client.getApiVersion(), accept, context) + .listSqlStoredProcedures(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, accept, + context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. + * 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. @@ -5611,18 +7632,19 @@ private Mono> listSqlUserDe * @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 as paginated + * @return the List operation response, that contains the storedProcedures and their properties as paginated * response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSqlUserDefinedFunctionsAsync(String resourceGroupName, + public PagedFlux listSqlStoredProceduresAsync(String resourceGroupName, String accountName, String databaseName, String containerName) { - return new PagedFlux<>(() -> listSqlUserDefinedFunctionsSinglePageAsync(resourceGroupName, accountName, - databaseName, containerName)); + return new PagedFlux<>( + () -> listSqlStoredProceduresSinglePageAsync(resourceGroupName, accountName, databaseName, containerName), + nextLink -> listSqlStoredProceduresNextSinglePageAsync(nextLink)); } /** - * Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. + * 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. @@ -5632,18 +7654,19 @@ public PagedFlux listSqlUserDefinedFuncti * @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 as paginated + * @return the List operation response, that contains the storedProcedures and their properties as paginated * response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSqlUserDefinedFunctionsAsync(String resourceGroupName, + private PagedFlux listSqlStoredProceduresAsync(String resourceGroupName, String accountName, String databaseName, String containerName, Context context) { - return new PagedFlux<>(() -> listSqlUserDefinedFunctionsSinglePageAsync(resourceGroupName, accountName, - databaseName, containerName, context)); + return new PagedFlux<>(() -> listSqlStoredProceduresSinglePageAsync(resourceGroupName, accountName, + databaseName, containerName, context), + nextLink -> listSqlStoredProceduresNextSinglePageAsync(nextLink, context)); } /** - * Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. + * 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. @@ -5652,18 +7675,18 @@ private PagedFlux listSqlUserDefinedFunct * @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 as paginated + * @return the List operation response, that contains the storedProcedures and their properties as paginated * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSqlUserDefinedFunctions(String resourceGroupName, + public PagedIterable listSqlStoredProcedures(String resourceGroupName, String accountName, String databaseName, String containerName) { return new PagedIterable<>( - listSqlUserDefinedFunctionsAsync(resourceGroupName, accountName, databaseName, containerName)); + listSqlStoredProceduresAsync(resourceGroupName, accountName, databaseName, containerName)); } /** - * Lists the SQL userDefinedFunction under an existing Azure Cosmos DB database account. + * 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. @@ -5673,14 +7696,14 @@ public PagedIterable listSqlUserDefinedFu * @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 as paginated + * @return the List operation response, that contains the storedProcedures and their properties as paginated * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSqlUserDefinedFunctions(String resourceGroupName, + public PagedIterable listSqlStoredProcedures(String resourceGroupName, String accountName, String databaseName, String containerName, Context context) { return new PagedIterable<>( - listSqlUserDefinedFunctionsAsync(resourceGroupName, accountName, databaseName, containerName, context)); + listSqlStoredProceduresAsync(resourceGroupName, accountName, databaseName, containerName, context)); } /** @@ -5729,8 +7752,8 @@ public Mono> getSqlUserDefinedFu final String accept = "application/json"; return FluxUtil .withContext(context -> service.getSqlUserDefinedFunction(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, - userDefinedFunctionName, this.client.getApiVersion(), accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, containerName, userDefinedFunctionName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -5780,9 +7803,9 @@ private Mono> getSqlUserDefinedF } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getSqlUserDefinedFunction(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName, - this.client.getApiVersion(), accept, context); + return service.getSqlUserDefinedFunction(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, + userDefinedFunctionName, accept, context); } /** @@ -5901,12 +7924,13 @@ public Mono>> createUpdateSqlUserDefinedFunctionWithRe } else { createUpdateSqlUserDefinedFunctionParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil .withContext(context -> service.createUpdateSqlUserDefinedFunction(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, - userDefinedFunctionName, this.client.getApiVersion(), createUpdateSqlUserDefinedFunctionParameters, - accept, context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, containerName, userDefinedFunctionName, contentType, accept, + createUpdateSqlUserDefinedFunctionParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -5963,11 +7987,12 @@ private Mono>> createUpdateSqlUserDefinedFunctionWithR } else { createUpdateSqlUserDefinedFunctionParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createUpdateSqlUserDefinedFunction(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName, - this.client.getApiVersion(), createUpdateSqlUserDefinedFunctionParameters, accept, context); + return service.createUpdateSqlUserDefinedFunction(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, + userDefinedFunctionName, contentType, accept, createUpdateSqlUserDefinedFunctionParameters, context); } /** @@ -6223,8 +8248,8 @@ public Mono>> deleteSqlUserDefinedFunctionWithResponse } return FluxUtil .withContext(context -> service.deleteSqlUserDefinedFunction(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, - userDefinedFunctionName, this.client.getApiVersion(), context)) + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, containerName, userDefinedFunctionName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -6272,9 +8297,9 @@ private Mono>> deleteSqlUserDefinedFunctionWithRespons new IllegalArgumentException("Parameter userDefinedFunctionName is required and cannot be null.")); } context = this.client.mergeContext(context); - return service.deleteSqlUserDefinedFunction(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, containerName, userDefinedFunctionName, - this.client.getApiVersion(), context); + return service.deleteSqlUserDefinedFunction(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, + userDefinedFunctionName, context); } /** @@ -6451,7 +8476,7 @@ public void deleteSqlUserDefinedFunction(String resourceGroupName, String accoun } /** - * Lists the SQL trigger under an existing Azure Cosmos DB database account. + * 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. @@ -6460,12 +8485,12 @@ public void deleteSqlUserDefinedFunction(String resourceGroupName, String accoun * @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 triggers and their properties along with + * @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> listSqlTriggersSinglePageAsync(String resourceGroupName, - String accountName, String databaseName, String containerName) { + 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.")); @@ -6489,16 +8514,16 @@ private Mono> listSqlTriggersSinglePage } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listSqlTriggers(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)) + .withContext(context -> service.listSqlUserDefinedFunctions(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + databaseName, containerName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the SQL trigger under an existing Azure Cosmos DB database account. + * 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. @@ -6508,12 +8533,12 @@ private Mono> listSqlTriggersSinglePage * @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 triggers and their properties along with + * @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> listSqlTriggersSinglePageAsync(String resourceGroupName, - String accountName, String databaseName, String containerName, Context context) { + private Mono> listSqlUserDefinedFunctionsSinglePageAsync( + 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.")); @@ -6538,14 +8563,15 @@ private Mono> listSqlTriggersSinglePage final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listSqlTriggers(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, accountName, - databaseName, containerName, this.client.getApiVersion(), accept, context) + .listSqlUserDefinedFunctions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, accept, + context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Lists the SQL trigger under an existing Azure Cosmos DB database account. + * 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. @@ -6554,18 +8580,18 @@ private Mono> listSqlTriggersSinglePage * @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 triggers and their properties as paginated response with - * {@link PagedFlux}. + * @return the List operation response, that contains the userDefinedFunctions and their properties as paginated + * response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listSqlTriggersAsync(String resourceGroupName, String accountName, - String databaseName, String containerName) { - return new PagedFlux<>( - () -> listSqlTriggersSinglePageAsync(resourceGroupName, accountName, databaseName, containerName)); + public PagedFlux listSqlUserDefinedFunctionsAsync(String resourceGroupName, + String accountName, String databaseName, String containerName) { + return new PagedFlux<>(() -> listSqlUserDefinedFunctionsSinglePageAsync(resourceGroupName, accountName, + databaseName, containerName), nextLink -> listSqlUserDefinedFunctionsNextSinglePageAsync(nextLink)); } /** - * Lists the SQL trigger under an existing Azure Cosmos DB database account. + * 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. @@ -6575,18 +8601,19 @@ public PagedFlux listSqlTriggersAsync(String resource * @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 triggers and their properties as paginated response with - * {@link PagedFlux}. + * @return the List operation response, that contains the userDefinedFunctions and their properties as paginated + * response with {@link PagedFlux}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listSqlTriggersAsync(String resourceGroupName, String accountName, - String databaseName, String containerName, Context context) { - return new PagedFlux<>( - () -> listSqlTriggersSinglePageAsync(resourceGroupName, accountName, databaseName, containerName, context)); + private PagedFlux listSqlUserDefinedFunctionsAsync(String resourceGroupName, + String accountName, String databaseName, String containerName, Context context) { + return new PagedFlux<>(() -> listSqlUserDefinedFunctionsSinglePageAsync(resourceGroupName, accountName, + databaseName, containerName, context), + nextLink -> listSqlUserDefinedFunctionsNextSinglePageAsync(nextLink, context)); } /** - * Lists the SQL trigger under an existing Azure Cosmos DB database account. + * 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. @@ -6595,17 +8622,18 @@ private PagedFlux listSqlTriggersAsync(String resourc * @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 triggers and their properties as paginated response with - * {@link PagedIterable}. + * @return the List operation response, that contains the userDefinedFunctions and their properties as paginated + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSqlTriggers(String resourceGroupName, String accountName, - String databaseName, String containerName) { - return new PagedIterable<>(listSqlTriggersAsync(resourceGroupName, accountName, databaseName, containerName)); + public PagedIterable listSqlUserDefinedFunctions(String resourceGroupName, + String accountName, String databaseName, String containerName) { + return new PagedIterable<>( + listSqlUserDefinedFunctionsAsync(resourceGroupName, accountName, databaseName, containerName)); } /** - * Lists the SQL trigger under an existing Azure Cosmos DB database account. + * 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. @@ -6615,14 +8643,14 @@ public PagedIterable listSqlTriggers(String resourceG * @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 triggers and their properties as paginated response with - * {@link PagedIterable}. + * @return the List operation response, that contains the userDefinedFunctions and their properties as paginated + * response with {@link PagedIterable}. */ @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listSqlTriggers(String resourceGroupName, String accountName, - String databaseName, String containerName, Context context) { + public PagedIterable listSqlUserDefinedFunctions(String resourceGroupName, + String accountName, String databaseName, String containerName, Context context) { return new PagedIterable<>( - listSqlTriggersAsync(resourceGroupName, accountName, databaseName, containerName, context)); + listSqlUserDefinedFunctionsAsync(resourceGroupName, accountName, databaseName, containerName, context)); } /** @@ -6668,9 +8696,9 @@ public Mono> getSqlTriggerWithResponseAsync( } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getSqlTrigger(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, containerName, triggerName, this.client.getApiVersion(), - accept, context)) + .withContext(context -> service.getSqlTrigger(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, + triggerName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -6718,8 +8746,9 @@ private Mono> getSqlTriggerWithResponseAsync } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getSqlTrigger(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, databaseName, containerName, triggerName, this.client.getApiVersion(), accept, context); + return service.getSqlTrigger(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, triggerName, + accept, context); } /** @@ -6832,11 +8861,13 @@ public Mono>> createUpdateSqlTriggerWithResponseAsync( } else { createUpdateSqlTriggerParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createUpdateSqlTrigger(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, - triggerName, this.client.getApiVersion(), createUpdateSqlTriggerParameters, accept, context)) + .withContext( + context -> service.createUpdateSqlTrigger(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, + triggerName, contentType, accept, createUpdateSqlTriggerParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -6889,11 +8920,12 @@ private Mono>> createUpdateSqlTriggerWithResponseAsync } else { createUpdateSqlTriggerParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createUpdateSqlTrigger(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, containerName, triggerName, this.client.getApiVersion(), - createUpdateSqlTriggerParameters, accept, context); + return service.createUpdateSqlTrigger(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, triggerName, + contentType, accept, createUpdateSqlTriggerParameters, context); } /** @@ -7130,9 +9162,9 @@ public Mono>> deleteSqlTriggerWithResponseAsync(String return Mono.error(new IllegalArgumentException("Parameter triggerName is required and cannot be null.")); } return FluxUtil - .withContext(context -> service.deleteSqlTrigger(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, containerName, triggerName, this.client.getApiVersion(), - context)) + .withContext(context -> service.deleteSqlTrigger(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, + triggerName, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -7178,8 +9210,9 @@ private Mono>> deleteSqlTriggerWithResponseAsync(Strin return Mono.error(new IllegalArgumentException("Parameter triggerName is required and cannot be null.")); } context = this.client.mergeContext(context); - return service.deleteSqlTrigger(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, databaseName, containerName, triggerName, this.client.getApiVersion(), context); + return service.deleteSqlTrigger(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, triggerName, + context); } /** @@ -7332,23 +9365,200 @@ public void deleteSqlTrigger(String resourceGroupName, String accountName, Strin } /** - * Deletes an existing Azure Cosmos DB SQL trigger. + * Deletes an existing Azure Cosmos DB SQL trigger. + * + * @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 triggerName Cosmos DB trigger 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 deleteSqlTrigger(String resourceGroupName, String accountName, String databaseName, + String containerName, String triggerName, Context context) { + deleteSqlTriggerAsync(resourceGroupName, accountName, databaseName, containerName, triggerName, context) + .block(); + } + + /** + * Lists the SQL trigger 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 triggers and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSqlTriggersSinglePageAsync(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.listSqlTriggers(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, accept, + context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the SQL trigger 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 triggers and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSqlTriggersSinglePageAsync(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 + .listSqlTriggers(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, databaseName, containerName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists the SQL trigger 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 triggers and their properties as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listSqlTriggersAsync(String resourceGroupName, String accountName, + String databaseName, String containerName) { + return new PagedFlux<>( + () -> listSqlTriggersSinglePageAsync(resourceGroupName, accountName, databaseName, containerName), + nextLink -> listSqlTriggersNextSinglePageAsync(nextLink)); + } + + /** + * Lists the SQL trigger 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 triggers and their properties as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listSqlTriggersAsync(String resourceGroupName, String accountName, + String databaseName, String containerName, Context context) { + return new PagedFlux<>( + () -> listSqlTriggersSinglePageAsync(resourceGroupName, accountName, databaseName, containerName, context), + nextLink -> listSqlTriggersNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the SQL trigger 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 triggers and their properties as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSqlTriggers(String resourceGroupName, String accountName, + String databaseName, String containerName) { + return new PagedIterable<>(listSqlTriggersAsync(resourceGroupName, accountName, databaseName, containerName)); + } + + /** + * Lists the SQL trigger 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 triggerName Cosmos DB trigger 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 triggers and their properties as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteSqlTrigger(String resourceGroupName, String accountName, String databaseName, - String containerName, String triggerName, Context context) { - deleteSqlTriggerAsync(resourceGroupName, accountName, databaseName, containerName, triggerName, context) - .block(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listSqlTriggers(String resourceGroupName, String accountName, + String databaseName, String containerName, Context context) { + return new PagedIterable<>( + listSqlTriggersAsync(resourceGroupName, accountName, databaseName, containerName, context)); } /** @@ -7366,18 +9576,10 @@ public void deleteSqlTrigger(String resourceGroupName, String accountName, Strin @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getSqlRoleDefinitionWithResponseAsync(String roleDefinitionId, 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 (roleDefinitionId == null) { return Mono .error(new IllegalArgumentException("Parameter roleDefinitionId 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.")); @@ -7387,9 +9589,8 @@ public void deleteSqlTrigger(String resourceGroupName, String accountName, Strin } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getSqlRoleDefinition(this.client.getEndpoint(), roleDefinitionId, - this.client.getSubscriptionId(), resourceGroupName, accountName, this.client.getApiVersion(), accept, - context)) + .withContext(context -> service.getSqlRoleDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleDefinitionId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -7409,18 +9610,10 @@ public void deleteSqlTrigger(String resourceGroupName, String accountName, Strin @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getSqlRoleDefinitionWithResponseAsync( String roleDefinitionId, 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 (roleDefinitionId == null) { return Mono .error(new IllegalArgumentException("Parameter roleDefinitionId 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.")); @@ -7430,9 +9623,8 @@ private Mono> getSqlRoleDefinitionWit } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getSqlRoleDefinition(this.client.getEndpoint(), roleDefinitionId, - this.client.getSubscriptionId(), resourceGroupName, accountName, this.client.getApiVersion(), accept, - context); + return service.getSqlRoleDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleDefinitionId, accept, context); } /** @@ -7506,18 +9698,10 @@ public SqlRoleDefinitionGetResultsInner getSqlRoleDefinition(String roleDefiniti public Mono>> createUpdateSqlRoleDefinitionWithResponseAsync(String roleDefinitionId, String resourceGroupName, String accountName, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (roleDefinitionId == null) { return Mono .error(new IllegalArgumentException("Parameter roleDefinitionId 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.")); @@ -7531,11 +9715,12 @@ public Mono>> createUpdateSqlRoleDefinitionWithRespons } else { createUpdateSqlRoleDefinitionParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createUpdateSqlRoleDefinition(this.client.getEndpoint(), roleDefinitionId, - this.client.getSubscriptionId(), resourceGroupName, accountName, this.client.getApiVersion(), - createUpdateSqlRoleDefinitionParameters, accept, context)) + .withContext(context -> service.createUpdateSqlRoleDefinition(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + roleDefinitionId, contentType, accept, createUpdateSqlRoleDefinitionParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -7557,18 +9742,10 @@ public Mono>> createUpdateSqlRoleDefinitionWithRespons private Mono>> createUpdateSqlRoleDefinitionWithResponseAsync(String roleDefinitionId, String resourceGroupName, String accountName, SqlRoleDefinitionCreateUpdateParameters createUpdateSqlRoleDefinitionParameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (roleDefinitionId == null) { return Mono .error(new IllegalArgumentException("Parameter roleDefinitionId 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.")); @@ -7582,11 +9759,12 @@ private Mono>> createUpdateSqlRoleDefinitionWithRespon } else { createUpdateSqlRoleDefinitionParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createUpdateSqlRoleDefinition(this.client.getEndpoint(), roleDefinitionId, - this.client.getSubscriptionId(), resourceGroupName, accountName, this.client.getApiVersion(), - createUpdateSqlRoleDefinitionParameters, accept, context); + return service.createUpdateSqlRoleDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleDefinitionId, contentType, accept, + createUpdateSqlRoleDefinitionParameters, context); } /** @@ -7778,18 +9956,10 @@ public SqlRoleDefinitionGetResultsInner createUpdateSqlRoleDefinition(String rol @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> deleteSqlRoleDefinitionWithResponseAsync(String roleDefinitionId, 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 (roleDefinitionId == null) { return Mono .error(new IllegalArgumentException("Parameter roleDefinitionId 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.")); @@ -7797,11 +9967,10 @@ public Mono>> deleteSqlRoleDefinitionWithResponseAsync 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.deleteSqlRoleDefinition(this.client.getEndpoint(), roleDefinitionId, - this.client.getSubscriptionId(), resourceGroupName, accountName, this.client.getApiVersion(), accept, - context)) + .withContext( + context -> service.deleteSqlRoleDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleDefinitionId, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -7820,18 +9989,10 @@ public Mono>> deleteSqlRoleDefinitionWithResponseAsync @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteSqlRoleDefinitionWithResponseAsync(String roleDefinitionId, 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 (roleDefinitionId == null) { return Mono .error(new IllegalArgumentException("Parameter roleDefinitionId 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.")); @@ -7839,11 +10000,9 @@ private Mono>> deleteSqlRoleDefinitionWithResponseAsyn 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.deleteSqlRoleDefinition(this.client.getEndpoint(), roleDefinitionId, - this.client.getSubscriptionId(), resourceGroupName, accountName, this.client.getApiVersion(), accept, - context); + return service.deleteSqlRoleDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleDefinitionId, context); } /** @@ -8024,10 +10183,10 @@ public void deleteSqlRoleDefinition(String roleDefinitionId, String resourceGrou final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listSqlRoleDefinitions(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), accept, context)) + context -> service.listSqlRoleDefinitions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -8063,10 +10222,10 @@ public void deleteSqlRoleDefinition(String roleDefinitionId, String resourceGrou final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listSqlRoleDefinitions(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, this.client.getApiVersion(), accept, context) + .listSqlRoleDefinitions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -8082,7 +10241,8 @@ public void deleteSqlRoleDefinition(String roleDefinitionId, String resourceGrou @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listSqlRoleDefinitionsAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>(() -> listSqlRoleDefinitionsSinglePageAsync(resourceGroupName, accountName)); + return new PagedFlux<>(() -> listSqlRoleDefinitionsSinglePageAsync(resourceGroupName, accountName), + nextLink -> listSqlRoleDefinitionsNextSinglePageAsync(nextLink)); } /** @@ -8099,7 +10259,8 @@ public PagedFlux listSqlRoleDefinitionsAsync(S @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listSqlRoleDefinitionsAsync(String resourceGroupName, String accountName, Context context) { - return new PagedFlux<>(() -> listSqlRoleDefinitionsSinglePageAsync(resourceGroupName, accountName, context)); + return new PagedFlux<>(() -> listSqlRoleDefinitionsSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listSqlRoleDefinitionsNextSinglePageAsync(nextLink, context)); } /** @@ -8149,18 +10310,10 @@ public PagedIterable listSqlRoleDefinitions(St @ServiceMethod(returns = ReturnType.SINGLE) public Mono> getSqlRoleAssignmentWithResponseAsync(String roleAssignmentId, 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 (roleAssignmentId == null) { return Mono .error(new IllegalArgumentException("Parameter roleAssignmentId 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.")); @@ -8170,9 +10323,8 @@ public PagedIterable listSqlRoleDefinitions(St } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getSqlRoleAssignment(this.client.getEndpoint(), roleAssignmentId, - this.client.getSubscriptionId(), resourceGroupName, accountName, this.client.getApiVersion(), accept, - context)) + .withContext(context -> service.getSqlRoleAssignment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleAssignmentId, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -8191,18 +10343,10 @@ public PagedIterable listSqlRoleDefinitions(St @ServiceMethod(returns = ReturnType.SINGLE) private Mono> getSqlRoleAssignmentWithResponseAsync( String roleAssignmentId, 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 (roleAssignmentId == null) { return Mono .error(new IllegalArgumentException("Parameter roleAssignmentId 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.")); @@ -8212,9 +10356,8 @@ private Mono> getSqlRoleAssignmentWit } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getSqlRoleAssignment(this.client.getEndpoint(), roleAssignmentId, - this.client.getSubscriptionId(), resourceGroupName, accountName, this.client.getApiVersion(), accept, - context); + return service.getSqlRoleAssignment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleAssignmentId, accept, context); } /** @@ -8287,18 +10430,10 @@ public SqlRoleAssignmentGetResultsInner getSqlRoleAssignment(String roleAssignme public Mono>> createUpdateSqlRoleAssignmentWithResponseAsync(String roleAssignmentId, String resourceGroupName, String accountName, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (roleAssignmentId == null) { return Mono .error(new IllegalArgumentException("Parameter roleAssignmentId 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.")); @@ -8312,11 +10447,12 @@ public Mono>> createUpdateSqlRoleAssignmentWithRespons } else { createUpdateSqlRoleAssignmentParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createUpdateSqlRoleAssignment(this.client.getEndpoint(), roleAssignmentId, - this.client.getSubscriptionId(), resourceGroupName, accountName, this.client.getApiVersion(), - createUpdateSqlRoleAssignmentParameters, accept, context)) + .withContext(context -> service.createUpdateSqlRoleAssignment(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + roleAssignmentId, contentType, accept, createUpdateSqlRoleAssignmentParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -8337,18 +10473,10 @@ public Mono>> createUpdateSqlRoleAssignmentWithRespons private Mono>> createUpdateSqlRoleAssignmentWithResponseAsync(String roleAssignmentId, String resourceGroupName, String accountName, SqlRoleAssignmentCreateUpdateParameters createUpdateSqlRoleAssignmentParameters, Context context) { - if (this.client.getEndpoint() == null) { - return Mono.error( - new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); - } if (roleAssignmentId == null) { return Mono .error(new IllegalArgumentException("Parameter roleAssignmentId 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.")); @@ -8362,11 +10490,12 @@ private Mono>> createUpdateSqlRoleAssignmentWithRespon } else { createUpdateSqlRoleAssignmentParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createUpdateSqlRoleAssignment(this.client.getEndpoint(), roleAssignmentId, - this.client.getSubscriptionId(), resourceGroupName, accountName, this.client.getApiVersion(), - createUpdateSqlRoleAssignmentParameters, accept, context); + return service.createUpdateSqlRoleAssignment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleAssignmentId, contentType, accept, + createUpdateSqlRoleAssignmentParameters, context); } /** @@ -8558,18 +10687,10 @@ public SqlRoleAssignmentGetResultsInner createUpdateSqlRoleAssignment(String rol @ServiceMethod(returns = ReturnType.SINGLE) public Mono>> deleteSqlRoleAssignmentWithResponseAsync(String roleAssignmentId, 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 (roleAssignmentId == null) { return Mono .error(new IllegalArgumentException("Parameter roleAssignmentId 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.")); @@ -8577,11 +10698,10 @@ public Mono>> deleteSqlRoleAssignmentWithResponseAsync 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.deleteSqlRoleAssignment(this.client.getEndpoint(), roleAssignmentId, - this.client.getSubscriptionId(), resourceGroupName, accountName, this.client.getApiVersion(), accept, - context)) + .withContext( + context -> service.deleteSqlRoleAssignment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleAssignmentId, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -8600,18 +10720,10 @@ public Mono>> deleteSqlRoleAssignmentWithResponseAsync @ServiceMethod(returns = ReturnType.SINGLE) private Mono>> deleteSqlRoleAssignmentWithResponseAsync(String roleAssignmentId, 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 (roleAssignmentId == null) { return Mono .error(new IllegalArgumentException("Parameter roleAssignmentId 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.")); @@ -8619,11 +10731,9 @@ private Mono>> deleteSqlRoleAssignmentWithResponseAsyn 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.deleteSqlRoleAssignment(this.client.getEndpoint(), roleAssignmentId, - this.client.getSubscriptionId(), resourceGroupName, accountName, this.client.getApiVersion(), accept, - context); + return service.deleteSqlRoleAssignment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleAssignmentId, context); } /** @@ -8804,10 +10914,10 @@ public void deleteSqlRoleAssignment(String roleAssignmentId, String resourceGrou final String accept = "application/json"; return FluxUtil .withContext( - context -> service.listSqlRoleAssignments(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, this.client.getApiVersion(), accept, context)) + context -> service.listSqlRoleAssignments(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) .>map(res -> new PagedResponseBase<>(res.getRequest(), - res.getStatusCode(), res.getHeaders(), res.getValue().value(), null, null)) + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } @@ -8843,10 +10953,10 @@ public void deleteSqlRoleAssignment(String roleAssignmentId, String resourceGrou final String accept = "application/json"; context = this.client.mergeContext(context); return service - .listSqlRoleAssignments(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, this.client.getApiVersion(), accept, context) + .listSqlRoleAssignments(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context) .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), - res.getValue().value(), null, null)); + res.getValue().value(), res.getValue().nextLink(), null)); } /** @@ -8862,7 +10972,8 @@ public void deleteSqlRoleAssignment(String roleAssignmentId, String resourceGrou @ServiceMethod(returns = ReturnType.COLLECTION) public PagedFlux listSqlRoleAssignmentsAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>(() -> listSqlRoleAssignmentsSinglePageAsync(resourceGroupName, accountName)); + return new PagedFlux<>(() -> listSqlRoleAssignmentsSinglePageAsync(resourceGroupName, accountName), + nextLink -> listSqlRoleAssignmentsNextSinglePageAsync(nextLink)); } /** @@ -8879,7 +10990,8 @@ public PagedFlux listSqlRoleAssignmentsAsync(S @ServiceMethod(returns = ReturnType.COLLECTION) private PagedFlux listSqlRoleAssignmentsAsync(String resourceGroupName, String accountName, Context context) { - return new PagedFlux<>(() -> listSqlRoleAssignmentsSinglePageAsync(resourceGroupName, accountName, context)); + return new PagedFlux<>(() -> listSqlRoleAssignmentsSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listSqlRoleAssignmentsNextSinglePageAsync(nextLink, context)); } /** @@ -8916,283 +11028,447 @@ public PagedIterable listSqlRoleAssignments(St } /** - * Retrieves continuous backup information for a container resource. + * Get the next page of items. * - * @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 location The name of the continuous backup restore location. + * @param nextLink The URL to get the next list of items. + * @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> listSqlDatabasesNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listSqlDatabasesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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> listSqlDatabasesNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listSqlDatabasesNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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> + listClientEncryptionKeysNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listClientEncryptionKeysNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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> + listClientEncryptionKeysNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listClientEncryptionKeysNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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> listSqlContainersNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listSqlContainersNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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> listSqlContainersNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listSqlContainersNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. * @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 backup information of a resource along with {@link Response} on successful completion of {@link Mono}. + * @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) - public Mono>> retrieveContinuousBackupInformationWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, String containerName, - ContinuousBackupRestoreLocation location) { + private Mono> + listSqlStoredProceduresNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } 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 (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } else { - location.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.retrieveContinuousBackupInformation(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, databaseName, containerName, - this.client.getApiVersion(), location, accept, context)) + .withContext( + context -> service.listSqlStoredProceduresNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves continuous backup information for a container resource. + * Get the next page of items. * - * @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 location The name of the continuous backup restore location. + * @param nextLink The URL to get the next list of items. * @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 backup information of a resource along with {@link Response} on successful completion of {@link Mono}. + * @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>> retrieveContinuousBackupInformationWithResponseAsync( - String resourceGroupName, String accountName, String databaseName, String containerName, - ContinuousBackupRestoreLocation location, Context context) { + private Mono> + listSqlStoredProceduresNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } 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 (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } else { - location.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.retrieveContinuousBackupInformation(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, databaseName, containerName, this.client.getApiVersion(), location, accept, - context); + return service.listSqlStoredProceduresNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Retrieves continuous backup information for a container resource. + * Get the next page of items. * - * @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 location The name of the continuous backup restore location. + * @param nextLink The URL to get the next list of items. * @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 backup information of a resource. + * @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.LONG_RUNNING_OPERATION) - public PollerFlux, BackupInformationInner> - beginRetrieveContinuousBackupInformationAsync(String resourceGroupName, String accountName, String databaseName, - String containerName, ContinuousBackupRestoreLocation location) { - Mono>> mono = retrieveContinuousBackupInformationWithResponseAsync(resourceGroupName, - accountName, databaseName, containerName, location); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), BackupInformationInner.class, BackupInformationInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listSqlUserDefinedFunctionsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext( + context -> service.listSqlUserDefinedFunctionsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves continuous backup information for a container resource. + * Get the next page of items. * - * @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 location The name of the continuous backup restore location. + * @param nextLink The URL to get the next list of items. * @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 backup information of a resource. + * @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.LONG_RUNNING_OPERATION) - private PollerFlux, BackupInformationInner> - beginRetrieveContinuousBackupInformationAsync(String resourceGroupName, String accountName, String databaseName, - String containerName, ContinuousBackupRestoreLocation location, Context context) { + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listSqlUserDefinedFunctionsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; context = this.client.mergeContext(context); - Mono>> mono = retrieveContinuousBackupInformationWithResponseAsync(resourceGroupName, - accountName, databaseName, containerName, location, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), BackupInformationInner.class, BackupInformationInner.class, context); + return service.listSqlUserDefinedFunctionsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Retrieves continuous backup information for a container resource. + * Get the next page of items. * - * @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 location The name of the continuous backup restore location. + * @param nextLink The URL to get the next list of items. * @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 backup information of a resource. + * @return the List operation response, that contains the triggers and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BackupInformationInner> - beginRetrieveContinuousBackupInformation(String resourceGroupName, String accountName, String databaseName, - String containerName, ContinuousBackupRestoreLocation location) { - return this - .beginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, containerName, - location) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSqlTriggersNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listSqlTriggersNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves continuous backup information for a container resource. + * Get the next page of items. * - * @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 location The name of the continuous backup restore location. + * @param nextLink The URL to get the next list of items. * @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 backup information of a resource. + * @return the List operation response, that contains the triggers and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BackupInformationInner> - beginRetrieveContinuousBackupInformation(String resourceGroupName, String accountName, String databaseName, - String containerName, ContinuousBackupRestoreLocation location, Context context) { - return this - .beginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, containerName, - location, context) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSqlTriggersNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listSqlTriggersNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Retrieves continuous backup information for a container resource. + * Get the next page of items. * - * @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 location The name of the continuous backup restore location. + * @param nextLink The URL to get the next list of items. * @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 backup information of a resource on successful completion of {@link Mono}. + * @return the relevant Role Definitions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono retrieveContinuousBackupInformationAsync(String resourceGroupName, - String accountName, String databaseName, String containerName, ContinuousBackupRestoreLocation location) { - return beginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, - containerName, location).last().flatMap(this.client::getLroFinalResultOrError); + private Mono> + listSqlRoleDefinitionsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listSqlRoleDefinitionsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves continuous backup information for a container resource. + * Get the next page of items. * - * @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 location The name of the continuous backup restore location. + * @param nextLink The URL to get the next list of items. * @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 backup information of a resource on successful completion of {@link Mono}. + * @return the relevant Role Definitions along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono retrieveContinuousBackupInformationAsync(String resourceGroupName, - String accountName, String databaseName, String containerName, ContinuousBackupRestoreLocation location, - Context context) { - return beginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, - containerName, location, context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono> + listSqlRoleDefinitionsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listSqlRoleDefinitionsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Retrieves continuous backup information for a container resource. + * Get the next page of items. * - * @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 location The name of the continuous backup restore location. + * @param nextLink The URL to get the next list of items. * @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 backup information of a resource. + * @return the relevant Role Assignments along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BackupInformationInner retrieveContinuousBackupInformation(String resourceGroupName, String accountName, - String databaseName, String containerName, ContinuousBackupRestoreLocation location) { - return retrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, containerName, - location).block(); + private Mono> + listSqlRoleAssignmentsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listSqlRoleAssignmentsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves continuous backup information for a container resource. + * Get the next page of items. * - * @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 location The name of the continuous backup restore location. + * @param nextLink The URL to get the next list of items. * @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 backup information of a resource. + * @return the relevant Role Assignments along with {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BackupInformationInner retrieveContinuousBackupInformation(String resourceGroupName, String accountName, - String databaseName, String containerName, ContinuousBackupRestoreLocation location, Context context) { - return retrieveContinuousBackupInformationAsync(resourceGroupName, accountName, databaseName, containerName, - location, context).block(); + private Mono> + listSqlRoleAssignmentsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listSqlRoleAssignmentsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/TableResourcesClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/TableResourcesClientImpl.java index 160dcd7a4450..6a39adb29ebe 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/TableResourcesClientImpl.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/TableResourcesClientImpl.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.implementation; @@ -35,10 +35,14 @@ import com.azure.resourcemanager.cosmos.fluent.TableResourcesClient; import com.azure.resourcemanager.cosmos.fluent.models.BackupInformationInner; import com.azure.resourcemanager.cosmos.fluent.models.TableGetResultsInner; +import com.azure.resourcemanager.cosmos.fluent.models.TableRoleAssignmentResourceInner; +import com.azure.resourcemanager.cosmos.fluent.models.TableRoleDefinitionResourceInner; import com.azure.resourcemanager.cosmos.fluent.models.ThroughputSettingsGetResultsInner; +import com.azure.resourcemanager.cosmos.implementation.models.TableListResult; +import com.azure.resourcemanager.cosmos.implementation.models.TableRoleAssignmentListResult; +import com.azure.resourcemanager.cosmos.implementation.models.TableRoleDefinitionListResult; import com.azure.resourcemanager.cosmos.models.ContinuousBackupRestoreLocation; import com.azure.resourcemanager.cosmos.models.TableCreateUpdateParameters; -import com.azure.resourcemanager.cosmos.models.TableListResult; import com.azure.resourcemanager.cosmos.models.ThroughputSettingsUpdateParameters; import java.nio.ByteBuffer; import reactor.core.publisher.Flux; @@ -73,115 +77,211 @@ public final class TableResourcesClientImpl implements TableResourcesClient { * The interface defining all the services for CosmosDBManagementClientTableResources to be used by the proxy * service to perform REST calls. */ - @Host("{$host}") + @Host("{endpoint}") @ServiceInterface(name = "CosmosDBManagementClientTableResources") public interface TableResourcesService { @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> listTables(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getTableThroughput(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("tableName") String tableName, @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> updateTableThroughput(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("tableName") String tableName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ThroughputSettingsUpdateParameters updateThroughputParameters, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> migrateTableToAutoscale(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("tableName") String tableName, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> migrateTableToManualThroughput(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @QueryParam("api-version") String apiVersion, @HeaderParam("Accept") String accept, Context context); + @PathParam("tableName") String tableName, @HeaderParam("Accept") String accept, Context context); @Headers({ "Content-Type: application/json" }) @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getTable(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> getTable(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("tableName") String tableName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("tableName") String tableName, @HeaderParam("Accept") String accept, Context context); - @Headers({ "Content-Type: application/json" }) @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> createUpdateTable(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createUpdateTable(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("tableName") String tableName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") TableCreateUpdateParameters createUpdateTableParameters, - @HeaderParam("Accept") String accept, Context context); + @PathParam("tableName") String tableName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") TableCreateUpdateParameters createUpdateTableParameters, Context context); @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}") @ExpectedResponses({ 202, 204 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> deleteTable(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> deleteTable(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("tableName") String tableName, @QueryParam("api-version") String apiVersion, Context context); + @PathParam("tableName") String tableName, Context context); @Headers({ "Content-Type: application/json" }) - @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables") @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono> getTableThroughput(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listTables(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("tableName") String tableName, @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}/tables/{tableName}/throughputSettings/default") + @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/retrieveContinuousBackupInformation") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> updateTableThroughput(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> retrieveContinuousBackupInformation(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("tableName") String tableName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ThroughputSettingsUpdateParameters updateThroughputParameters, - @HeaderParam("Accept") String accept, Context context); + @PathParam("tableName") String tableName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") ContinuousBackupRestoreLocation location, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToAutoscale") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getTableRoleDefinition(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("roleDefinitionId") String roleDefinitionId, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> migrateTableToAutoscale(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createUpdateTableRoleDefinition(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("tableName") String tableName, @QueryParam("api-version") String apiVersion, - @HeaderParam("Accept") String accept, Context context); + @PathParam("roleDefinitionId") String roleDefinitionId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") TableRoleDefinitionResourceInner createUpdateTableRoleDefinitionParameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions/{roleDefinitionId}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteTableRoleDefinition(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("roleDefinitionId") String roleDefinitionId, Context context); @Headers({ "Content-Type: application/json" }) - @Post("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tables/{tableName}/throughputSettings/default/migrateToManualThroughput") - @ExpectedResponses({ 200, 202 }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleDefinitions") + @ExpectedResponses({ 200 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> migrateTableToManualThroughput(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono> listTableRoleDefinitions(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("tableName") String tableName, @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}/tables/{tableName}/retrieveContinuousBackupInformation") + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getTableRoleAssignment(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("roleAssignmentId") String roleAssignmentId, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId}") @ExpectedResponses({ 200, 202 }) @UnexpectedResponseExceptionType(ManagementException.class) - Mono>> retrieveContinuousBackupInformation(@HostParam("$host") String endpoint, - @PathParam("subscriptionId") String subscriptionId, + Mono>> createUpdateTableRoleAssignment(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, - @PathParam("tableName") String tableName, @QueryParam("api-version") String apiVersion, - @BodyParam("application/json") ContinuousBackupRestoreLocation location, + @PathParam("roleAssignmentId") String roleAssignmentId, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, + @BodyParam("application/json") TableRoleAssignmentResourceInner createUpdateTableRoleAssignmentParameters, + Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments/{roleAssignmentId}") + @ExpectedResponses({ 200, 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> deleteTableRoleAssignment(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @PathParam("roleAssignmentId") String roleAssignmentId, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/tableRoleAssignments") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listTableRoleAssignments(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @PathParam("accountName") String accountName, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listTablesNext(@PathParam(value = "nextLink", encoded = true) String nextLink, + @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listTableRoleDefinitionsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listTableRoleAssignmentsNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, @HeaderParam("Accept") String accept, Context context); } /** - * Lists the Tables under an existing Azure Cosmos DB database account. + * Gets the RUs per second of the Table 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 tableName Cosmos DB table 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 Table and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the RUs per second of the Table 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> listTablesSinglePageAsync(String resourceGroupName, - String accountName) { + public Mono> + getTableThroughputWithResponseAsync(String resourceGroupName, String accountName, String tableName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -197,30 +297,32 @@ private Mono> listTablesSinglePageAsync(Stri if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.listTables(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)) + .withContext(context -> service.getTableThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, tableName, accept, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Lists the Tables under an existing Azure Cosmos DB database account. + * Gets the RUs per second of the Table 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 tableName Cosmos DB table 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 Table and their properties along with - * {@link PagedResponse} on successful completion of {@link Mono}. + * @return the RUs per second of the Table 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> listTablesSinglePageAsync(String resourceGroupName, - String accountName, Context context) { + private Mono> getTableThroughputWithResponseAsync( + String resourceGroupName, String accountName, String tableName, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -236,98 +338,87 @@ private Mono> listTablesSinglePageAsync(Stri if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } + if (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } final String accept = "application/json"; context = this.client.mergeContext(context); - return service - .listTables(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)); + return service.getTableThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, tableName, accept, context); } /** - * Lists the Tables under an existing Azure Cosmos DB database account. + * Gets the RUs per second of the Table 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 tableName Cosmos DB table 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 Table and their properties as paginated response with - * {@link PagedFlux}. + * @return the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name + * on successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedFlux listTablesAsync(String resourceGroupName, String accountName) { - return new PagedFlux<>(() -> listTablesSinglePageAsync(resourceGroupName, accountName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getTableThroughputAsync(String resourceGroupName, String accountName, + String tableName) { + return getTableThroughputWithResponseAsync(resourceGroupName, accountName, tableName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Lists the Tables under an existing Azure Cosmos DB database account. + * Gets the RUs per second of the Table 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 tableName Cosmos DB table 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 Table and their properties as paginated response with - * {@link PagedFlux}. - */ - @ServiceMethod(returns = ReturnType.COLLECTION) - private PagedFlux listTablesAsync(String resourceGroupName, String accountName, - Context context) { - return new PagedFlux<>(() -> listTablesSinglePageAsync(resourceGroupName, accountName, context)); - } - - /** - * Lists the Tables 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 Table and their properties as paginated response with - * {@link PagedIterable}. + * @return the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name + * along with {@link Response}. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listTables(String resourceGroupName, String accountName) { - return new PagedIterable<>(listTablesAsync(resourceGroupName, accountName)); + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTableThroughputWithResponse(String resourceGroupName, + String accountName, String tableName, Context context) { + return getTableThroughputWithResponseAsync(resourceGroupName, accountName, tableName, context).block(); } /** - * Lists the Tables under an existing Azure Cosmos DB database account. + * Gets the RUs per second of the Table 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 context The context to associate with this operation. + * @param tableName Cosmos DB table 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 Table and their properties as paginated response with - * {@link PagedIterable}. + * @return the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided + * name. */ - @ServiceMethod(returns = ReturnType.COLLECTION) - public PagedIterable listTables(String resourceGroupName, String accountName, - Context context) { - return new PagedIterable<>(listTablesAsync(resourceGroupName, accountName, context)); + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputSettingsGetResultsInner getTableThroughput(String resourceGroupName, String accountName, + String tableName) { + return getTableThroughputWithResponse(resourceGroupName, accountName, tableName, Context.NONE).getValue(); } /** - * Gets the Tables under an existing Azure Cosmos DB database account with the provided name. + * Update RUs per second of an Azure Cosmos DB Table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. * @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 Tables under an existing Azure Cosmos DB database account with the provided name along with - * {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> getTableWithResponseAsync(String resourceGroupName, String accountName, - String tableName) { + public Mono>> updateTableThroughputWithResponseAsync(String resourceGroupName, + String accountName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -346,29 +437,39 @@ public Mono> getTableWithResponseAsync(String res if (tableName == null) { return Mono.error(new IllegalArgumentException("Parameter tableName 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 contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.getTable(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, tableName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.updateTableThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, tableName, + contentType, accept, updateThroughputParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the Tables under an existing Azure Cosmos DB database account with the provided name. + * Update RUs per second of an Azure Cosmos DB Table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. * @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 Tables under an existing Azure Cosmos DB database account with the provided name along with - * {@link Response} on successful completion of {@link Mono}. + * @return an Azure Cosmos DB resource throughput along with {@link Response} on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getTableWithResponseAsync(String resourceGroupName, String accountName, - String tableName, Context context) { + private Mono>> updateTableThroughputWithResponseAsync(String resourceGroupName, + String accountName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, + Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -387,80 +488,1439 @@ private Mono> getTableWithResponseAsync(String re if (tableName == null) { return Mono.error(new IllegalArgumentException("Parameter tableName 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 contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getTable(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, tableName, this.client.getApiVersion(), accept, context); + return service.updateTableThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, tableName, contentType, accept, + updateThroughputParameters, context); } /** - * Gets the Tables under an existing Azure Cosmos DB database account with the provided name. + * Update RUs per second of an Azure Cosmos DB Table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. * @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 Tables under an existing Azure Cosmos DB database account with the provided name on successful - * completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Mono getTableAsync(String resourceGroupName, String accountName, String tableName) { - return getTableWithResponseAsync(resourceGroupName, accountName, tableName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, ThroughputSettingsGetResultsInner> + beginUpdateTableThroughputAsync(String resourceGroupName, String accountName, String tableName, + ThroughputSettingsUpdateParameters updateThroughputParameters) { + Mono>> mono = updateTableThroughputWithResponseAsync(resourceGroupName, accountName, + tableName, updateThroughputParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, this.client.getContext()); } /** - * Gets the Tables under an existing Azure Cosmos DB database account with the provided name. + * Update RUs per second of an Azure Cosmos DB Table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. * @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 Tables under an existing Azure Cosmos DB database account with the provided name along with - * {@link Response}. + * @return the {@link PollerFlux} for polling of an Azure Cosmos DB resource throughput. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTableWithResponse(String resourceGroupName, String accountName, - String tableName, Context context) { - return getTableWithResponseAsync(resourceGroupName, accountName, tableName, context).block(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ThroughputSettingsGetResultsInner> + beginUpdateTableThroughputAsync(String resourceGroupName, String accountName, String tableName, + ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = updateTableThroughputWithResponseAsync(resourceGroupName, accountName, + tableName, updateThroughputParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, context); } /** - * Gets the Tables under an existing Azure Cosmos DB database account with the provided name. + * Update RUs per second of an Azure Cosmos DB Table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. * @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 Tables under an existing Azure Cosmos DB database account with the provided name. + * @return the {@link SyncPoller} for polling of an Azure Cosmos DB resource throughput. */ - @ServiceMethod(returns = ReturnType.SINGLE) - public TableGetResultsInner getTable(String resourceGroupName, String accountName, String tableName) { - return getTableWithResponse(resourceGroupName, accountName, tableName, Context.NONE).getValue(); + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ThroughputSettingsGetResultsInner> + beginUpdateTableThroughput(String resourceGroupName, String accountName, String tableName, + ThroughputSettingsUpdateParameters updateThroughputParameters) { + return this + .beginUpdateTableThroughputAsync(resourceGroupName, accountName, tableName, updateThroughputParameters) + .getSyncPoller(); } /** - * Create or update an Azure Cosmos DB Table. + * Update RUs per second of an Azure Cosmos DB Table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. - * @param createUpdateTableParameters The parameters to provide for the current Table. - * @throws IllegalArgumentException thrown if parameters fail the validation. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. + * @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> + beginUpdateTableThroughput(String resourceGroupName, String accountName, String tableName, + ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + return this + .beginUpdateTableThroughputAsync(resourceGroupName, accountName, tableName, updateThroughputParameters, + context) + .getSyncPoller(); + } + + /** + * Update RUs per second of an Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. + * @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 updateTableThroughputAsync(String resourceGroupName, + String accountName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return beginUpdateTableThroughputAsync(resourceGroupName, accountName, tableName, updateThroughputParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update RUs per second of an Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. + * @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 updateTableThroughputAsync(String resourceGroupName, + String accountName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, + Context context) { + return beginUpdateTableThroughputAsync(resourceGroupName, accountName, tableName, updateThroughputParameters, + context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Update RUs per second of an Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. + * @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 updateTableThroughput(String resourceGroupName, String accountName, + String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + return updateTableThroughputAsync(resourceGroupName, accountName, tableName, updateThroughputParameters) + .block(); + } + + /** + * Update RUs per second of an Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. + * @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 updateTableThroughput(String resourceGroupName, String accountName, + String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { + return updateTableThroughputAsync(resourceGroupName, accountName, tableName, updateThroughputParameters, + context).block(); + } + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table 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>> migrateTableToAutoscaleWithResponseAsync(String resourceGroupName, + String accountName, String tableName) { + 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 (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.migrateTableToAutoscale(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, tableName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table 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>> migrateTableToAutoscaleWithResponseAsync(String resourceGroupName, + String accountName, String tableName, 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 (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.migrateTableToAutoscale(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, tableName, accept, context); + } + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table 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> + beginMigrateTableToAutoscaleAsync(String resourceGroupName, String accountName, String tableName) { + Mono>> mono + = migrateTableToAutoscaleWithResponseAsync(resourceGroupName, accountName, tableName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, this.client.getContext()); + } + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table 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> + beginMigrateTableToAutoscaleAsync(String resourceGroupName, String accountName, String tableName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = migrateTableToAutoscaleWithResponseAsync(resourceGroupName, accountName, tableName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, context); + } + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table 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> + beginMigrateTableToAutoscale(String resourceGroupName, String accountName, String tableName) { + return this.beginMigrateTableToAutoscaleAsync(resourceGroupName, accountName, tableName).getSyncPoller(); + } + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table 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> + beginMigrateTableToAutoscale(String resourceGroupName, String accountName, String tableName, Context context) { + return this.beginMigrateTableToAutoscaleAsync(resourceGroupName, accountName, tableName, context) + .getSyncPoller(); + } + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table 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 migrateTableToAutoscaleAsync(String resourceGroupName, + String accountName, String tableName) { + return beginMigrateTableToAutoscaleAsync(resourceGroupName, accountName, tableName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table 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 migrateTableToAutoscaleAsync(String resourceGroupName, + String accountName, String tableName, Context context) { + return beginMigrateTableToAutoscaleAsync(resourceGroupName, accountName, tableName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table 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 migrateTableToAutoscale(String resourceGroupName, String accountName, + String tableName) { + return migrateTableToAutoscaleAsync(resourceGroupName, accountName, tableName).block(); + } + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table 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 migrateTableToAutoscale(String resourceGroupName, String accountName, + String tableName, Context context) { + return migrateTableToAutoscaleAsync(resourceGroupName, accountName, tableName, context).block(); + } + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table 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>> migrateTableToManualThroughputWithResponseAsync(String resourceGroupName, + String accountName, String tableName) { + 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 (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.migrateTableToManualThroughput(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, tableName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table 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>> migrateTableToManualThroughputWithResponseAsync(String resourceGroupName, + String accountName, String tableName, 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 (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.migrateTableToManualThroughput(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, tableName, accept, context); + } + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table 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> + beginMigrateTableToManualThroughputAsync(String resourceGroupName, String accountName, String tableName) { + Mono>> mono + = migrateTableToManualThroughputWithResponseAsync(resourceGroupName, accountName, tableName); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, this.client.getContext()); + } + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table 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> + beginMigrateTableToManualThroughputAsync(String resourceGroupName, String accountName, String tableName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = migrateTableToManualThroughputWithResponseAsync(resourceGroupName, accountName, tableName, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, + ThroughputSettingsGetResultsInner.class, context); + } + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table 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> + beginMigrateTableToManualThroughput(String resourceGroupName, String accountName, String tableName) { + return this.beginMigrateTableToManualThroughputAsync(resourceGroupName, accountName, tableName).getSyncPoller(); + } + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table 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> + beginMigrateTableToManualThroughput(String resourceGroupName, String accountName, String tableName, + Context context) { + return this.beginMigrateTableToManualThroughputAsync(resourceGroupName, accountName, tableName, context) + .getSyncPoller(); + } + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table 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 migrateTableToManualThroughputAsync(String resourceGroupName, + String accountName, String tableName) { + return beginMigrateTableToManualThroughputAsync(resourceGroupName, accountName, tableName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table 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 migrateTableToManualThroughputAsync(String resourceGroupName, + String accountName, String tableName, Context context) { + return beginMigrateTableToManualThroughputAsync(resourceGroupName, accountName, tableName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table 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 migrateTableToManualThroughput(String resourceGroupName, + String accountName, String tableName) { + return migrateTableToManualThroughputAsync(resourceGroupName, accountName, tableName).block(); + } + + /** + * Migrate an Azure Cosmos DB Table 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 tableName Cosmos DB table 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 migrateTableToManualThroughput(String resourceGroupName, + String accountName, String tableName, Context context) { + return migrateTableToManualThroughputAsync(resourceGroupName, accountName, tableName, context).block(); + } + + /** + * Gets the Tables 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 tableName Cosmos DB table 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 Tables 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> getTableWithResponseAsync(String resourceGroupName, String accountName, + String tableName) { + 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 (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getTable(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, tableName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Gets the Tables 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 tableName Cosmos DB table 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 Tables 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> getTableWithResponseAsync(String resourceGroupName, String accountName, + String tableName, 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 (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getTable(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, tableName, accept, context); + } + + /** + * Gets the Tables 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 tableName Cosmos DB table 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 Tables under an existing Azure Cosmos DB database account with the provided name on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getTableAsync(String resourceGroupName, String accountName, String tableName) { + return getTableWithResponseAsync(resourceGroupName, accountName, tableName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Gets the Tables 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 tableName Cosmos DB table 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 Tables under an existing Azure Cosmos DB database account with the provided name along with + * {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTableWithResponse(String resourceGroupName, String accountName, + String tableName, Context context) { + return getTableWithResponseAsync(resourceGroupName, accountName, tableName, context).block(); + } + + /** + * Gets the Tables 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 tableName Cosmos DB table 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 Tables under an existing Azure Cosmos DB database account with the provided name. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TableGetResultsInner getTable(String resourceGroupName, String accountName, String tableName) { + return getTableWithResponse(resourceGroupName, accountName, tableName, Context.NONE).getValue(); + } + + /** + * Create or update an Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param createUpdateTableParameters The parameters to provide for the current Table. + * @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 Table along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createUpdateTableWithResponseAsync(String resourceGroupName, + String accountName, String tableName, TableCreateUpdateParameters createUpdateTableParameters) { + 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 (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (createUpdateTableParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter createUpdateTableParameters is required and cannot be null.")); + } else { + createUpdateTableParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createUpdateTable(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, tableName, contentType, accept, + createUpdateTableParameters, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Create or update an Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param createUpdateTableParameters The parameters to provide for the current Table. + * @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 Table along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createUpdateTableWithResponseAsync(String resourceGroupName, + String accountName, String tableName, TableCreateUpdateParameters createUpdateTableParameters, + 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 (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + if (createUpdateTableParameters == null) { + return Mono.error( + new IllegalArgumentException("Parameter createUpdateTableParameters is required and cannot be null.")); + } else { + createUpdateTableParameters.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createUpdateTable(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, tableName, contentType, accept, + createUpdateTableParameters, context); + } + + /** + * Create or update an Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param createUpdateTableParameters The parameters to provide for the current Table. + * @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 Table. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, TableGetResultsInner> beginCreateUpdateTableAsync( + String resourceGroupName, String accountName, String tableName, + TableCreateUpdateParameters createUpdateTableParameters) { + Mono>> mono = createUpdateTableWithResponseAsync(resourceGroupName, accountName, + tableName, createUpdateTableParameters); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + TableGetResultsInner.class, TableGetResultsInner.class, this.client.getContext()); + } + + /** + * Create or update an Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param createUpdateTableParameters The parameters to provide for the current Table. + * @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 Table. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, TableGetResultsInner> beginCreateUpdateTableAsync( + String resourceGroupName, String accountName, String tableName, + TableCreateUpdateParameters createUpdateTableParameters, Context context) { + context = this.client.mergeContext(context); + Mono>> mono = createUpdateTableWithResponseAsync(resourceGroupName, accountName, + tableName, createUpdateTableParameters, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), + TableGetResultsInner.class, TableGetResultsInner.class, context); + } + + /** + * Create or update an Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param createUpdateTableParameters The parameters to provide for the current Table. + * @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 Table. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TableGetResultsInner> beginCreateUpdateTable( + String resourceGroupName, String accountName, String tableName, + TableCreateUpdateParameters createUpdateTableParameters) { + return this.beginCreateUpdateTableAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters) + .getSyncPoller(); + } + + /** + * Create or update an Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param createUpdateTableParameters The parameters to provide for the current Table. + * @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 Table. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, TableGetResultsInner> beginCreateUpdateTable( + String resourceGroupName, String accountName, String tableName, + TableCreateUpdateParameters createUpdateTableParameters, Context context) { + return this + .beginCreateUpdateTableAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters, + context) + .getSyncPoller(); + } + + /** + * Create or update an Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param createUpdateTableParameters The parameters to provide for the current Table. + * @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 Table on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createUpdateTableAsync(String resourceGroupName, String accountName, + String tableName, TableCreateUpdateParameters createUpdateTableParameters) { + return beginCreateUpdateTableAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters) + .last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update an Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param createUpdateTableParameters The parameters to provide for the current Table. + * @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 Table on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createUpdateTableAsync(String resourceGroupName, String accountName, + String tableName, TableCreateUpdateParameters createUpdateTableParameters, Context context) { + return beginCreateUpdateTableAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters, + context).last().flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Create or update an Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param createUpdateTableParameters The parameters to provide for the current Table. + * @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 Table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TableGetResultsInner createUpdateTable(String resourceGroupName, String accountName, String tableName, + TableCreateUpdateParameters createUpdateTableParameters) { + return createUpdateTableAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters).block(); + } + + /** + * Create or update an Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param createUpdateTableParameters The parameters to provide for the current Table. + * @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 Table. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TableGetResultsInner createUpdateTable(String resourceGroupName, String accountName, String tableName, + TableCreateUpdateParameters createUpdateTableParameters, Context context) { + return createUpdateTableAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters, context) + .block(); + } + + /** + * Deletes an existing Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table 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>> deleteTableWithResponseAsync(String resourceGroupName, String accountName, + String tableName) { + 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 (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.deleteTable(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, tableName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table 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>> deleteTableWithResponseAsync(String resourceGroupName, String accountName, + String tableName, 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 (tableName == null) { + return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.deleteTable(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, tableName, context); + } + + /** + * Deletes an existing Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table 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> beginDeleteTableAsync(String resourceGroupName, String accountName, + String tableName) { + Mono>> mono = deleteTableWithResponseAsync(resourceGroupName, accountName, tableName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table 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> beginDeleteTableAsync(String resourceGroupName, String accountName, + String tableName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteTableWithResponseAsync(resourceGroupName, accountName, tableName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table 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> beginDeleteTable(String resourceGroupName, String accountName, + String tableName) { + return this.beginDeleteTableAsync(resourceGroupName, accountName, tableName).getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table 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> beginDeleteTable(String resourceGroupName, String accountName, + String tableName, Context context) { + return this.beginDeleteTableAsync(resourceGroupName, accountName, tableName, context).getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table 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 deleteTableAsync(String resourceGroupName, String accountName, String tableName) { + return beginDeleteTableAsync(resourceGroupName, accountName, tableName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table 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 deleteTableAsync(String resourceGroupName, String accountName, String tableName, + Context context) { + return beginDeleteTableAsync(resourceGroupName, accountName, tableName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table 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 deleteTable(String resourceGroupName, String accountName, String tableName) { + deleteTableAsync(resourceGroupName, accountName, tableName).block(); + } + + /** + * Deletes an existing Azure Cosmos DB Table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table 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 deleteTable(String resourceGroupName, String accountName, String tableName, Context context) { + deleteTableAsync(resourceGroupName, accountName, tableName, context).block(); + } + + /** + * Lists the Tables 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 Table and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listTablesSinglePageAsync(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.listTables(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists the Tables 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 Table and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listTablesSinglePageAsync(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 + .listTables(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists the Tables 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 Table and their properties as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTablesAsync(String resourceGroupName, String accountName) { + return new PagedFlux<>(() -> listTablesSinglePageAsync(resourceGroupName, accountName), + nextLink -> listTablesNextSinglePageAsync(nextLink)); + } + + /** + * Lists the Tables 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 Table and their properties as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listTablesAsync(String resourceGroupName, String accountName, + Context context) { + return new PagedFlux<>(() -> listTablesSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listTablesNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists the Tables 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 Table and their properties as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTables(String resourceGroupName, String accountName) { + return new PagedIterable<>(listTablesAsync(resourceGroupName, accountName)); + } + + /** + * Lists the Tables 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 Table and their properties as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTables(String resourceGroupName, String accountName, + Context context) { + return new PagedIterable<>(listTablesAsync(resourceGroupName, accountName, context)); + } + + /** + * Retrieves continuous backup information for a table. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param tableName Cosmos DB table name. + * @param location The name of the continuous backup restore location. + * @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 Table along with {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> createUpdateTableWithResponseAsync(String resourceGroupName, - String accountName, String tableName, TableCreateUpdateParameters createUpdateTableParameters) { + public Mono>> retrieveContinuousBackupInformationWithResponseAsync( + String resourceGroupName, String accountName, String tableName, ContinuousBackupRestoreLocation location) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -479,36 +1939,36 @@ public Mono>> createUpdateTableWithResponseAsync(Strin if (tableName == null) { return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); } - if (createUpdateTableParameters == null) { - return Mono.error( - new IllegalArgumentException("Parameter createUpdateTableParameters is required and cannot be null.")); + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } else { - createUpdateTableParameters.validate(); + location.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext(context -> service.createUpdateTable(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, tableName, this.client.getApiVersion(), - createUpdateTableParameters, accept, context)) + .withContext(context -> service.retrieveContinuousBackupInformation(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, tableName, + contentType, accept, location, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Create or update an Azure Cosmos DB Table. + * Retrieves continuous backup information for a table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. - * @param createUpdateTableParameters The parameters to provide for the current Table. + * @param location The name of the continuous backup restore location. * @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 Table along with {@link Response} on successful completion of {@link Mono}. + * @return the response body along with {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> createUpdateTableWithResponseAsync(String resourceGroupName, - String accountName, String tableName, TableCreateUpdateParameters createUpdateTableParameters, + private Mono>> retrieveContinuousBackupInformationWithResponseAsync( + String resourceGroupName, String accountName, String tableName, ContinuousBackupRestoreLocation location, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( @@ -528,199 +1988,200 @@ private Mono>> createUpdateTableWithResponseAsync(Stri if (tableName == null) { return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); } - if (createUpdateTableParameters == null) { - return Mono.error( - new IllegalArgumentException("Parameter createUpdateTableParameters is required and cannot be null.")); + if (location == null) { + return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); } else { - createUpdateTableParameters.validate(); + location.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.createUpdateTable(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, tableName, this.client.getApiVersion(), createUpdateTableParameters, accept, context); + return service.retrieveContinuousBackupInformation(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, tableName, contentType, accept, location, + context); } /** - * Create or update an Azure Cosmos DB Table. + * Retrieves continuous backup information for a table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. - * @param createUpdateTableParameters The parameters to provide for the current Table. + * @param location The name of the continuous backup restore location. * @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 Table. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, TableGetResultsInner> beginCreateUpdateTableAsync( - String resourceGroupName, String accountName, String tableName, - TableCreateUpdateParameters createUpdateTableParameters) { - Mono>> mono = createUpdateTableWithResponseAsync(resourceGroupName, accountName, - tableName, createUpdateTableParameters); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - TableGetResultsInner.class, TableGetResultsInner.class, this.client.getContext()); + public PollerFlux, BackupInformationInner> + beginRetrieveContinuousBackupInformationAsync(String resourceGroupName, String accountName, String tableName, + ContinuousBackupRestoreLocation location) { + Mono>> mono + = retrieveContinuousBackupInformationWithResponseAsync(resourceGroupName, accountName, tableName, location); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), BackupInformationInner.class, BackupInformationInner.class, + this.client.getContext()); } /** - * Create or update an Azure Cosmos DB Table. + * Retrieves continuous backup information for a table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. - * @param createUpdateTableParameters The parameters to provide for the current Table. + * @param location The name of the continuous backup restore location. * @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 Table. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, TableGetResultsInner> beginCreateUpdateTableAsync( - String resourceGroupName, String accountName, String tableName, - TableCreateUpdateParameters createUpdateTableParameters, Context context) { + private PollerFlux, BackupInformationInner> + beginRetrieveContinuousBackupInformationAsync(String resourceGroupName, String accountName, String tableName, + ContinuousBackupRestoreLocation location, Context context) { context = this.client.mergeContext(context); - Mono>> mono = createUpdateTableWithResponseAsync(resourceGroupName, accountName, - tableName, createUpdateTableParameters, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), - TableGetResultsInner.class, TableGetResultsInner.class, context); + Mono>> mono = retrieveContinuousBackupInformationWithResponseAsync(resourceGroupName, + accountName, tableName, location, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), BackupInformationInner.class, BackupInformationInner.class, context); } /** - * Create or update an Azure Cosmos DB Table. + * Retrieves continuous backup information for a table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. - * @param createUpdateTableParameters The parameters to provide for the current Table. + * @param location The name of the continuous backup restore location. * @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 Table. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, TableGetResultsInner> beginCreateUpdateTable( - String resourceGroupName, String accountName, String tableName, - TableCreateUpdateParameters createUpdateTableParameters) { - return this.beginCreateUpdateTableAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters) + public SyncPoller, BackupInformationInner> + beginRetrieveContinuousBackupInformation(String resourceGroupName, String accountName, String tableName, + ContinuousBackupRestoreLocation location) { + return this.beginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, tableName, location) .getSyncPoller(); } /** - * Create or update an Azure Cosmos DB Table. + * Retrieves continuous backup information for a table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. - * @param createUpdateTableParameters The parameters to provide for the current Table. + * @param location The name of the continuous backup restore location. * @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 Table. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, TableGetResultsInner> beginCreateUpdateTable( - String resourceGroupName, String accountName, String tableName, - TableCreateUpdateParameters createUpdateTableParameters, Context context) { + public SyncPoller, BackupInformationInner> + beginRetrieveContinuousBackupInformation(String resourceGroupName, String accountName, String tableName, + ContinuousBackupRestoreLocation location, Context context) { return this - .beginCreateUpdateTableAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters, - context) + .beginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, tableName, location, context) .getSyncPoller(); } /** - * Create or update an Azure Cosmos DB Table. + * Retrieves continuous backup information for a table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. - * @param createUpdateTableParameters The parameters to provide for the current Table. + * @param location The name of the continuous backup restore location. * @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 Table on successful completion of {@link Mono}. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono createUpdateTableAsync(String resourceGroupName, String accountName, - String tableName, TableCreateUpdateParameters createUpdateTableParameters) { - return beginCreateUpdateTableAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters) - .last() + public Mono retrieveContinuousBackupInformationAsync(String resourceGroupName, + String accountName, String tableName, ContinuousBackupRestoreLocation location) { + return beginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, tableName, location).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Create or update an Azure Cosmos DB Table. + * Retrieves continuous backup information for a table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. - * @param createUpdateTableParameters The parameters to provide for the current Table. + * @param location The name of the continuous backup restore location. * @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 Table on successful completion of {@link Mono}. + * @return the response body on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono createUpdateTableAsync(String resourceGroupName, String accountName, - String tableName, TableCreateUpdateParameters createUpdateTableParameters, Context context) { - return beginCreateUpdateTableAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters, + private Mono retrieveContinuousBackupInformationAsync(String resourceGroupName, + String accountName, String tableName, ContinuousBackupRestoreLocation location, Context context) { + return beginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, tableName, location, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Create or update an Azure Cosmos DB Table. + * Retrieves continuous backup information for a table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. - * @param createUpdateTableParameters The parameters to provide for the current Table. + * @param location The name of the continuous backup restore location. * @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 Table. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public TableGetResultsInner createUpdateTable(String resourceGroupName, String accountName, String tableName, - TableCreateUpdateParameters createUpdateTableParameters) { - return createUpdateTableAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters).block(); + public BackupInformationInner retrieveContinuousBackupInformation(String resourceGroupName, String accountName, + String tableName, ContinuousBackupRestoreLocation location) { + return retrieveContinuousBackupInformationAsync(resourceGroupName, accountName, tableName, location).block(); } /** - * Create or update an Azure Cosmos DB Table. + * Retrieves continuous backup information for a table. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. * @param tableName Cosmos DB table name. - * @param createUpdateTableParameters The parameters to provide for the current Table. + * @param location The name of the continuous backup restore location. * @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 Table. + * @return the response. */ @ServiceMethod(returns = ReturnType.SINGLE) - public TableGetResultsInner createUpdateTable(String resourceGroupName, String accountName, String tableName, - TableCreateUpdateParameters createUpdateTableParameters, Context context) { - return createUpdateTableAsync(resourceGroupName, accountName, tableName, createUpdateTableParameters, context) + public BackupInformationInner retrieveContinuousBackupInformation(String resourceGroupName, String accountName, + String tableName, ContinuousBackupRestoreLocation location, Context context) { + return retrieveContinuousBackupInformationAsync(resourceGroupName, accountName, tableName, location, context) .block(); } /** - * Deletes an existing Azure Cosmos DB Table. + * Retrieves the properties of an existing Azure Cosmos DB Table Role Definition with the given Id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleDefinitionId The GUID for the Role Definition. * @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}. + * @return parameters to create and update an Azure Cosmos DB Table Role Definition along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> deleteTableWithResponseAsync(String resourceGroupName, String accountName, - String tableName) { + public Mono> + getTableRoleDefinitionWithResponseAsync(String resourceGroupName, String accountName, String roleDefinitionId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -736,30 +2197,184 @@ public Mono>> deleteTableWithResponseAsync(String reso if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + if (roleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getTableRoleDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleDefinitionId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Table Role Definition with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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 parameters to create and update an Azure Cosmos DB Table Role Definition along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getTableRoleDefinitionWithResponseAsync( + String resourceGroupName, String accountName, String roleDefinitionId, 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 (roleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getTableRoleDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleDefinitionId, accept, context); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Table Role Definition with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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 parameters to create and update an Azure Cosmos DB Table Role Definition on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getTableRoleDefinitionAsync(String resourceGroupName, + String accountName, String roleDefinitionId) { + return getTableRoleDefinitionWithResponseAsync(resourceGroupName, accountName, roleDefinitionId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Table Role Definition with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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 parameters to create and update an Azure Cosmos DB Table Role Definition along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getTableRoleDefinitionWithResponse(String resourceGroupName, + String accountName, String roleDefinitionId, Context context) { + return getTableRoleDefinitionWithResponseAsync(resourceGroupName, accountName, roleDefinitionId, context) + .block(); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Table Role Definition with the given Id. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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 parameters to create and update an Azure Cosmos DB Table Role Definition. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public TableRoleDefinitionResourceInner getTableRoleDefinition(String resourceGroupName, String accountName, + String roleDefinitionId) { + return getTableRoleDefinitionWithResponse(resourceGroupName, accountName, roleDefinitionId, Context.NONE) + .getValue(); + } + + /** + * Creates or updates an Azure Cosmos DB Table Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateTableRoleDefinitionParameters The properties required to create or update a Role Definition. + * @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 parameters to create and update an Azure Cosmos DB Table Role Definition along with {@link Response} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createUpdateTableRoleDefinitionWithResponseAsync(String resourceGroupName, + String accountName, String roleDefinitionId, + TableRoleDefinitionResourceInner createUpdateTableRoleDefinitionParameters) { + 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 (roleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); + } + if (createUpdateTableRoleDefinitionParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateTableRoleDefinitionParameters is required and cannot be null.")); + } else { + createUpdateTableRoleDefinitionParameters.validate(); } + final String contentType = "application/json"; + final String accept = "application/json"; return FluxUtil - .withContext(context -> service.deleteTable(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, tableName, this.client.getApiVersion(), context)) + .withContext(context -> service.createUpdateTableRoleDefinition(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + roleDefinitionId, contentType, accept, createUpdateTableRoleDefinitionParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Deletes an existing Azure Cosmos DB Table. + * Creates or updates an Azure Cosmos DB Table Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateTableRoleDefinitionParameters The properties required to create or update a Role Definition. * @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}. + * @return parameters to create and update an Azure Cosmos DB Table Role Definition along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> deleteTableWithResponseAsync(String resourceGroupName, String accountName, - String tableName, Context context) { + private Mono>> createUpdateTableRoleDefinitionWithResponseAsync(String resourceGroupName, + String accountName, String roleDefinitionId, + TableRoleDefinitionResourceInner createUpdateTableRoleDefinitionParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -775,172 +2390,219 @@ private Mono>> deleteTableWithResponseAsync(String res if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + if (roleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); + } + if (createUpdateTableRoleDefinitionParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateTableRoleDefinitionParameters is required and cannot be null.")); + } else { + createUpdateTableRoleDefinitionParameters.validate(); } + final String contentType = "application/json"; + final String accept = "application/json"; context = this.client.mergeContext(context); - return service.deleteTable(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, tableName, this.client.getApiVersion(), context); + return service.createUpdateTableRoleDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleDefinitionId, contentType, accept, + createUpdateTableRoleDefinitionParameters, context); } /** - * Deletes an existing Azure Cosmos DB Table. + * Creates or updates an Azure Cosmos DB Table Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateTableRoleDefinitionParameters The properties required to create or update a Role Definition. * @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. + * @return the {@link PollerFlux} for polling of parameters to create and update an Azure Cosmos DB Table Role + * Definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, Void> beginDeleteTableAsync(String resourceGroupName, String accountName, - String tableName) { - Mono>> mono = deleteTableWithResponseAsync(resourceGroupName, accountName, tableName); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - this.client.getContext()); + public PollerFlux, TableRoleDefinitionResourceInner> + beginCreateUpdateTableRoleDefinitionAsync(String resourceGroupName, String accountName, String roleDefinitionId, + TableRoleDefinitionResourceInner createUpdateTableRoleDefinitionParameters) { + Mono>> mono = createUpdateTableRoleDefinitionWithResponseAsync(resourceGroupName, + accountName, roleDefinitionId, createUpdateTableRoleDefinitionParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), TableRoleDefinitionResourceInner.class, + TableRoleDefinitionResourceInner.class, this.client.getContext()); } /** - * Deletes an existing Azure Cosmos DB Table. + * Creates or updates an Azure Cosmos DB Table Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateTableRoleDefinitionParameters The properties required to create or update a Role Definition. * @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. + * @return the {@link PollerFlux} for polling of parameters to create and update an Azure Cosmos DB Table Role + * Definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, Void> beginDeleteTableAsync(String resourceGroupName, String accountName, - String tableName, Context context) { + private PollerFlux, TableRoleDefinitionResourceInner> + beginCreateUpdateTableRoleDefinitionAsync(String resourceGroupName, String accountName, String roleDefinitionId, + TableRoleDefinitionResourceInner createUpdateTableRoleDefinitionParameters, Context context) { context = this.client.mergeContext(context); - Mono>> mono - = deleteTableWithResponseAsync(resourceGroupName, accountName, tableName, context); - return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, - context); + Mono>> mono = createUpdateTableRoleDefinitionWithResponseAsync(resourceGroupName, + accountName, roleDefinitionId, createUpdateTableRoleDefinitionParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), TableRoleDefinitionResourceInner.class, + TableRoleDefinitionResourceInner.class, context); } /** - * Deletes an existing Azure Cosmos DB Table. + * Creates or updates an Azure Cosmos DB Table Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateTableRoleDefinitionParameters The properties required to create or update a Role Definition. * @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. + * @return the {@link SyncPoller} for polling of parameters to create and update an Azure Cosmos DB Table Role + * Definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteTable(String resourceGroupName, String accountName, - String tableName) { - return this.beginDeleteTableAsync(resourceGroupName, accountName, tableName).getSyncPoller(); + public SyncPoller, TableRoleDefinitionResourceInner> + beginCreateUpdateTableRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId, + TableRoleDefinitionResourceInner createUpdateTableRoleDefinitionParameters) { + return this + .beginCreateUpdateTableRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, + createUpdateTableRoleDefinitionParameters) + .getSyncPoller(); } /** - * Deletes an existing Azure Cosmos DB Table. + * Creates or updates an Azure Cosmos DB Table Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateTableRoleDefinitionParameters The properties required to create or update a Role Definition. * @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. + * @return the {@link SyncPoller} for polling of parameters to create and update an Azure Cosmos DB Table Role + * Definition. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, Void> beginDeleteTable(String resourceGroupName, String accountName, - String tableName, Context context) { - return this.beginDeleteTableAsync(resourceGroupName, accountName, tableName, context).getSyncPoller(); + public SyncPoller, TableRoleDefinitionResourceInner> + beginCreateUpdateTableRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId, + TableRoleDefinitionResourceInner createUpdateTableRoleDefinitionParameters, Context context) { + return this + .beginCreateUpdateTableRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, + createUpdateTableRoleDefinitionParameters, context) + .getSyncPoller(); } /** - * Deletes an existing Azure Cosmos DB Table. + * Creates or updates an Azure Cosmos DB Table Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateTableRoleDefinitionParameters The properties required to create or update a Role Definition. * @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. + * @return parameters to create and update an Azure Cosmos DB Table Role Definition on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono deleteTableAsync(String resourceGroupName, String accountName, String tableName) { - return beginDeleteTableAsync(resourceGroupName, accountName, tableName).last() - .flatMap(this.client::getLroFinalResultOrError); + public Mono createUpdateTableRoleDefinitionAsync(String resourceGroupName, + String accountName, String roleDefinitionId, + TableRoleDefinitionResourceInner createUpdateTableRoleDefinitionParameters) { + return beginCreateUpdateTableRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, + createUpdateTableRoleDefinitionParameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes an existing Azure Cosmos DB Table. + * Creates or updates an Azure Cosmos DB Table Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateTableRoleDefinitionParameters The properties required to create or update a Role Definition. * @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. + * @return parameters to create and update an Azure Cosmos DB Table Role Definition on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono deleteTableAsync(String resourceGroupName, String accountName, String tableName, - Context context) { - return beginDeleteTableAsync(resourceGroupName, accountName, tableName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono createUpdateTableRoleDefinitionAsync(String resourceGroupName, + String accountName, String roleDefinitionId, + TableRoleDefinitionResourceInner createUpdateTableRoleDefinitionParameters, Context context) { + return beginCreateUpdateTableRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, + createUpdateTableRoleDefinitionParameters, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Deletes an existing Azure Cosmos DB Table. + * Creates or updates an Azure Cosmos DB Table Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateTableRoleDefinitionParameters The properties required to create or update a Role Definition. * @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 parameters to create and update an Azure Cosmos DB Table Role Definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteTable(String resourceGroupName, String accountName, String tableName) { - deleteTableAsync(resourceGroupName, accountName, tableName).block(); + public TableRoleDefinitionResourceInner createUpdateTableRoleDefinition(String resourceGroupName, + String accountName, String roleDefinitionId, + TableRoleDefinitionResourceInner createUpdateTableRoleDefinitionParameters) { + return createUpdateTableRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, + createUpdateTableRoleDefinitionParameters).block(); } /** - * Deletes an existing Azure Cosmos DB Table. + * Creates or updates an Azure Cosmos DB Table Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleDefinitionId The GUID for the Role Definition. + * @param createUpdateTableRoleDefinitionParameters The properties required to create or update a Role Definition. * @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 parameters to create and update an Azure Cosmos DB Table Role Definition. */ @ServiceMethod(returns = ReturnType.SINGLE) - public void deleteTable(String resourceGroupName, String accountName, String tableName, Context context) { - deleteTableAsync(resourceGroupName, accountName, tableName, context).block(); + public TableRoleDefinitionResourceInner createUpdateTableRoleDefinition(String resourceGroupName, + String accountName, String roleDefinitionId, + TableRoleDefinitionResourceInner createUpdateTableRoleDefinitionParameters, Context context) { + return createUpdateTableRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, + createUpdateTableRoleDefinitionParameters, context).block(); } /** - * Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. + * Deletes an existing Azure Cosmos DB Table Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleDefinitionId The GUID for the Role Definition. * @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 Table under an existing Azure Cosmos DB database account with the provided name - * along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono> - getTableThroughputWithResponseAsync(String resourceGroupName, String accountName, String tableName) { + public Mono>> deleteTableRoleDefinitionWithResponseAsync(String resourceGroupName, + String accountName, String roleDefinitionId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -956,33 +2618,32 @@ public void deleteTable(String resourceGroupName, String accountName, String tab if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + if (roleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); } - final String accept = "application/json"; return FluxUtil .withContext( - context -> service.getTableThroughput(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, tableName, this.client.getApiVersion(), accept, context)) + context -> service.deleteTableRoleDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleDefinitionId, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. + * Deletes an existing Azure Cosmos DB Table Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleDefinitionId The GUID for the Role Definition. * @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 Table under an existing Azure Cosmos DB database account with the provided name - * along with {@link Response} on successful completion of {@link Mono}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono> getTableThroughputWithResponseAsync( - String resourceGroupName, String accountName, String tableName, Context context) { + private Mono>> deleteTableRoleDefinitionWithResponseAsync(String resourceGroupName, + String accountName, String roleDefinitionId, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -998,87 +2659,177 @@ private Mono> getTableThroughputWith if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + if (roleDefinitionId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleDefinitionId is required and cannot be null.")); } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.getTableThroughput(this.client.getEndpoint(), this.client.getSubscriptionId(), resourceGroupName, - accountName, tableName, this.client.getApiVersion(), accept, context); + return service.deleteTableRoleDefinition(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleDefinitionId, context); } /** - * Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. + * Deletes an existing Azure Cosmos DB Table Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleDefinitionId The GUID for the Role Definition. * @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 Table under an existing Azure Cosmos DB database account with the provided name - * on successful completion of {@link Mono}. + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginDeleteTableRoleDefinitionAsync(String resourceGroupName, + String accountName, String roleDefinitionId) { + Mono>> mono + = deleteTableRoleDefinitionWithResponseAsync(resourceGroupName, accountName, roleDefinitionId); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing Azure Cosmos DB Table Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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> beginDeleteTableRoleDefinitionAsync(String resourceGroupName, + String accountName, String roleDefinitionId, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteTableRoleDefinitionWithResponseAsync(resourceGroupName, accountName, roleDefinitionId, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing Azure Cosmos DB Table Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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> beginDeleteTableRoleDefinition(String resourceGroupName, + String accountName, String roleDefinitionId) { + return this.beginDeleteTableRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId) + .getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB Table Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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> beginDeleteTableRoleDefinition(String resourceGroupName, + String accountName, String roleDefinitionId, Context context) { + return this.beginDeleteTableRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, context) + .getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB Table Role Definition. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param accountName Cosmos DB database account name. + * @param roleDefinitionId The GUID for the Role Definition. + * @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 getTableThroughputAsync(String resourceGroupName, String accountName, - String tableName) { - return getTableThroughputWithResponseAsync(resourceGroupName, accountName, tableName) - .flatMap(res -> Mono.justOrEmpty(res.getValue())); + public Mono deleteTableRoleDefinitionAsync(String resourceGroupName, String accountName, + String roleDefinitionId) { + return beginDeleteTableRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. + * Deletes an existing Azure Cosmos DB Table Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleDefinitionId The GUID for the Role Definition. * @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 Table under an existing Azure Cosmos DB database account with the provided name - * along with {@link Response}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Response getTableThroughputWithResponse(String resourceGroupName, - String accountName, String tableName, Context context) { - return getTableThroughputWithResponseAsync(resourceGroupName, accountName, tableName, context).block(); + private Mono deleteTableRoleDefinitionAsync(String resourceGroupName, String accountName, + String roleDefinitionId, Context context) { + return beginDeleteTableRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, context).last() + .flatMap(this.client::getLroFinalResultOrError); } /** - * Gets the RUs per second of the Table under an existing Azure Cosmos DB database account with the provided name. + * Deletes an existing Azure Cosmos DB Table Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleDefinitionId The GUID for the Role Definition. * @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 Table under an existing Azure Cosmos DB database account with the provided - * name. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner getTableThroughput(String resourceGroupName, String accountName, - String tableName) { - return getTableThroughputWithResponse(resourceGroupName, accountName, tableName, Context.NONE).getValue(); + public void deleteTableRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId) { + deleteTableRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId).block(); } /** - * Update RUs per second of an Azure Cosmos DB Table. + * Deletes an existing Azure Cosmos DB Table Role Definition. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. + * @param roleDefinitionId The GUID for the Role Definition. + * @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) - public Mono>> updateTableThroughputWithResponseAsync(String resourceGroupName, - String accountName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters) { + public void deleteTableRoleDefinition(String resourceGroupName, String accountName, String roleDefinitionId, + Context context) { + deleteTableRoleDefinitionAsync(resourceGroupName, accountName, roleDefinitionId, context).block(); + } + + /** + * Retrieves the list of all Azure Cosmos DB Table Role Definitions. + * + * @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 response of a TableRoleDefinitionResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listTableRoleDefinitionsSinglePageAsync(String resourceGroupName, String accountName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1094,41 +2845,31 @@ public Mono>> updateTableThroughputWithResponseAsync(S if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName 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.updateTableThroughput(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, tableName, this.client.getApiVersion(), - updateThroughputParameters, accept, context)) + .withContext( + context -> service.listTableRoleDefinitions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update RUs per second of an Azure Cosmos DB Table. + * Retrieves the list of all Azure Cosmos DB Table Role Definitions. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. * @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}. + * @return the response of a TableRoleDefinitionResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> updateTableThroughputWithResponseAsync(String resourceGroupName, - String accountName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, - Context context) { + private Mono> + listTableRoleDefinitionsSinglePageAsync(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.")); @@ -1144,209 +2885,243 @@ private Mono>> updateTableThroughputWithResponseAsync( if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName 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.updateTableThroughput(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, tableName, this.client.getApiVersion(), updateThroughputParameters, accept, - context); + return service + .listTableRoleDefinitions(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Update RUs per second of an Azure Cosmos DB Table. + * Retrieves the list of all Azure Cosmos DB Table Role Definitions. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. * @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. + * @return the response of a TableRoleDefinitionResource list operation as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, ThroughputSettingsGetResultsInner> - beginUpdateTableThroughputAsync(String resourceGroupName, String accountName, String tableName, - ThroughputSettingsUpdateParameters updateThroughputParameters) { - Mono>> mono = updateTableThroughputWithResponseAsync(resourceGroupName, accountName, - tableName, updateThroughputParameters); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, this.client.getContext()); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTableRoleDefinitionsAsync(String resourceGroupName, + String accountName) { + return new PagedFlux<>(() -> listTableRoleDefinitionsSinglePageAsync(resourceGroupName, accountName), + nextLink -> listTableRoleDefinitionsNextSinglePageAsync(nextLink)); + } + + /** + * Retrieves the list of all Azure Cosmos DB Table Role Definitions. + * + * @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 response of a TableRoleDefinitionResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listTableRoleDefinitionsAsync(String resourceGroupName, + String accountName, Context context) { + return new PagedFlux<>(() -> listTableRoleDefinitionsSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listTableRoleDefinitionsNextSinglePageAsync(nextLink, context)); } /** - * Update RUs per second of an Azure Cosmos DB Table. + * Retrieves the list of all Azure Cosmos DB Table Role Definitions. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. - * @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. + * @return the response of a TableRoleDefinitionResource list operation as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ThroughputSettingsGetResultsInner> - beginUpdateTableThroughputAsync(String resourceGroupName, String accountName, String tableName, - ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = updateTableThroughputWithResponseAsync(resourceGroupName, accountName, - tableName, updateThroughputParameters, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTableRoleDefinitions(String resourceGroupName, + String accountName) { + return new PagedIterable<>(listTableRoleDefinitionsAsync(resourceGroupName, accountName)); } /** - * Update RUs per second of an Azure Cosmos DB Table. + * Retrieves the list of all Azure Cosmos DB Table Role Definitions. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. + * @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. + * @return the response of a TableRoleDefinitionResource list operation as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateTableThroughput(String resourceGroupName, String accountName, String tableName, - ThroughputSettingsUpdateParameters updateThroughputParameters) { - return this - .beginUpdateTableThroughputAsync(resourceGroupName, accountName, tableName, updateThroughputParameters) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTableRoleDefinitions(String resourceGroupName, + String accountName, Context context) { + return new PagedIterable<>(listTableRoleDefinitionsAsync(resourceGroupName, accountName, context)); } /** - * Update RUs per second of an Azure Cosmos DB Table. + * Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given Id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. - * @param context The context to associate with this operation. + * @param roleAssignmentId The GUID for the Role Assignment. * @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. + * @return parameters to create and update an Azure Cosmos DB Table Role Assignment along with {@link Response} on + * successful completion of {@link Mono}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginUpdateTableThroughput(String resourceGroupName, String accountName, String tableName, - ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { - return this - .beginUpdateTableThroughputAsync(resourceGroupName, accountName, tableName, updateThroughputParameters, - context) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> + getTableRoleAssignmentWithResponseAsync(String resourceGroupName, String accountName, String roleAssignmentId) { + 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 (roleAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.getTableRoleAssignment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleAssignmentId, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Update RUs per second of an Azure Cosmos DB Table. + * Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given Id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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}. + * @return parameters to create and update an Azure Cosmos DB Table Role Assignment along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono updateTableThroughputAsync(String resourceGroupName, - String accountName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return beginUpdateTableThroughputAsync(resourceGroupName, accountName, tableName, updateThroughputParameters) - .last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono> getTableRoleAssignmentWithResponseAsync( + String resourceGroupName, String accountName, String roleAssignmentId, 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 (roleAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getTableRoleAssignment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleAssignmentId, accept, context); } /** - * Update RUs per second of an Azure Cosmos DB Table. + * Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given Id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. - * @param context The context to associate with this operation. + * @param roleAssignmentId The GUID for the Role Assignment. * @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}. + * @return parameters to create and update an Azure Cosmos DB Table Role Assignment on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono updateTableThroughputAsync(String resourceGroupName, - String accountName, String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, - Context context) { - return beginUpdateTableThroughputAsync(resourceGroupName, accountName, tableName, updateThroughputParameters, - context).last().flatMap(this.client::getLroFinalResultOrError); + public Mono getTableRoleAssignmentAsync(String resourceGroupName, + String accountName, String roleAssignmentId) { + return getTableRoleAssignmentWithResponseAsync(resourceGroupName, accountName, roleAssignmentId) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); } /** - * Update RUs per second of an Azure Cosmos DB Table. + * Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given Id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. + * @param roleAssignmentId The GUID for the Role Assignment. + * @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. + * @return parameters to create and update an Azure Cosmos DB Table Role Assignment along with {@link Response}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner updateTableThroughput(String resourceGroupName, String accountName, - String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters) { - return updateTableThroughputAsync(resourceGroupName, accountName, tableName, updateThroughputParameters) + public Response getTableRoleAssignmentWithResponse(String resourceGroupName, + String accountName, String roleAssignmentId, Context context) { + return getTableRoleAssignmentWithResponseAsync(resourceGroupName, accountName, roleAssignmentId, context) .block(); } /** - * Update RUs per second of an Azure Cosmos DB Table. + * Retrieves the properties of an existing Azure Cosmos DB Table Role Assignment with the given Id. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param updateThroughputParameters The parameters to provide for the RUs per second of the current Table. - * @param context The context to associate with this operation. + * @param roleAssignmentId The GUID for the Role Assignment. * @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. + * @return parameters to create and update an Azure Cosmos DB Table Role Assignment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner updateTableThroughput(String resourceGroupName, String accountName, - String tableName, ThroughputSettingsUpdateParameters updateThroughputParameters, Context context) { - return updateTableThroughputAsync(resourceGroupName, accountName, tableName, updateThroughputParameters, - context).block(); + public TableRoleAssignmentResourceInner getTableRoleAssignment(String resourceGroupName, String accountName, + String roleAssignmentId) { + return getTableRoleAssignmentWithResponse(resourceGroupName, accountName, roleAssignmentId, Context.NONE) + .getValue(); } /** - * Migrate an Azure Cosmos DB Table from manual throughput to autoscale. + * Creates or updates an Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateTableRoleAssignmentParameters The properties required to create or update a Role Assignment. * @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}. + * @return parameters to create and update an Azure Cosmos DB Table Role Assignment along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> migrateTableToAutoscaleWithResponseAsync(String resourceGroupName, - String accountName, String tableName) { + public Mono>> createUpdateTableRoleAssignmentWithResponseAsync(String resourceGroupName, + String accountName, String roleAssignmentId, + TableRoleAssignmentResourceInner createUpdateTableRoleAssignmentParameters) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1362,33 +3137,43 @@ public Mono>> migrateTableToAutoscaleWithResponseAsync if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + if (roleAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); + } + if (createUpdateTableRoleAssignmentParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateTableRoleAssignmentParameters is required and cannot be null.")); + } else { + createUpdateTableRoleAssignmentParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; return FluxUtil - .withContext( - context -> service.migrateTableToAutoscale(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, tableName, this.client.getApiVersion(), accept, context)) + .withContext(context -> service.createUpdateTableRoleAssignment(this.client.getEndpoint(), + this.client.getApiVersion(), this.client.getSubscriptionId(), resourceGroupName, accountName, + roleAssignmentId, contentType, accept, createUpdateTableRoleAssignmentParameters, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Migrate an Azure Cosmos DB Table from manual throughput to autoscale. + * Creates or updates an Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateTableRoleAssignmentParameters The properties required to create or update a Role Assignment. * @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}. + * @return parameters to create and update an Azure Cosmos DB Table Role Assignment along with {@link Response} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> migrateTableToAutoscaleWithResponseAsync(String resourceGroupName, - String accountName, String tableName, Context context) { + private Mono>> createUpdateTableRoleAssignmentWithResponseAsync(String resourceGroupName, + String accountName, String roleAssignmentId, + TableRoleAssignmentResourceInner createUpdateTableRoleAssignmentParameters, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1404,183 +3189,219 @@ private Mono>> migrateTableToAutoscaleWithResponseAsyn if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + if (roleAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); + } + if (createUpdateTableRoleAssignmentParameters == null) { + return Mono.error(new IllegalArgumentException( + "Parameter createUpdateTableRoleAssignmentParameters is required and cannot be null.")); + } else { + createUpdateTableRoleAssignmentParameters.validate(); } + final String contentType = "application/json"; final String accept = "application/json"; context = this.client.mergeContext(context); - return service.migrateTableToAutoscale(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, tableName, this.client.getApiVersion(), accept, context); + return service.createUpdateTableRoleAssignment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleAssignmentId, contentType, accept, + createUpdateTableRoleAssignmentParameters, context); } /** - * Migrate an Azure Cosmos DB Table from manual throughput to autoscale. + * Creates or updates an Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateTableRoleAssignmentParameters The properties required to create or update a Role Assignment. * @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. + * @return the {@link PollerFlux} for polling of parameters to create and update an Azure Cosmos DB Table Role + * Assignment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateTableToAutoscaleAsync(String resourceGroupName, String accountName, String tableName) { - Mono>> mono - = migrateTableToAutoscaleWithResponseAsync(resourceGroupName, accountName, tableName); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, this.client.getContext()); + public PollerFlux, TableRoleAssignmentResourceInner> + beginCreateUpdateTableRoleAssignmentAsync(String resourceGroupName, String accountName, String roleAssignmentId, + TableRoleAssignmentResourceInner createUpdateTableRoleAssignmentParameters) { + Mono>> mono = createUpdateTableRoleAssignmentWithResponseAsync(resourceGroupName, + accountName, roleAssignmentId, createUpdateTableRoleAssignmentParameters); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), TableRoleAssignmentResourceInner.class, + TableRoleAssignmentResourceInner.class, this.client.getContext()); } /** - * Migrate an Azure Cosmos DB Table from manual throughput to autoscale. + * Creates or updates an Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateTableRoleAssignmentParameters The properties required to create or update a Role Assignment. * @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. + * @return the {@link PollerFlux} for polling of parameters to create and update an Azure Cosmos DB Table Role + * Assignment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateTableToAutoscaleAsync(String resourceGroupName, String accountName, String tableName, - Context context) { + private PollerFlux, TableRoleAssignmentResourceInner> + beginCreateUpdateTableRoleAssignmentAsync(String resourceGroupName, String accountName, String roleAssignmentId, + TableRoleAssignmentResourceInner createUpdateTableRoleAssignmentParameters, Context context) { context = this.client.mergeContext(context); - Mono>> mono - = migrateTableToAutoscaleWithResponseAsync(resourceGroupName, accountName, tableName, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, context); + Mono>> mono = createUpdateTableRoleAssignmentWithResponseAsync(resourceGroupName, + accountName, roleAssignmentId, createUpdateTableRoleAssignmentParameters, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), TableRoleAssignmentResourceInner.class, + TableRoleAssignmentResourceInner.class, context); } /** - * Migrate an Azure Cosmos DB Table from manual throughput to autoscale. + * Creates or updates an Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateTableRoleAssignmentParameters The properties required to create or update a Role Assignment. * @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. + * @return the {@link SyncPoller} for polling of parameters to create and update an Azure Cosmos DB Table Role + * Assignment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateTableToAutoscale(String resourceGroupName, String accountName, String tableName) { - return this.beginMigrateTableToAutoscaleAsync(resourceGroupName, accountName, tableName).getSyncPoller(); + public SyncPoller, TableRoleAssignmentResourceInner> + beginCreateUpdateTableRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId, + TableRoleAssignmentResourceInner createUpdateTableRoleAssignmentParameters) { + return this + .beginCreateUpdateTableRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, + createUpdateTableRoleAssignmentParameters) + .getSyncPoller(); } /** - * Migrate an Azure Cosmos DB Table from manual throughput to autoscale. + * Creates or updates an Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateTableRoleAssignmentParameters The properties required to create or update a Role Assignment. * @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. + * @return the {@link SyncPoller} for polling of parameters to create and update an Azure Cosmos DB Table Role + * Assignment. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateTableToAutoscale(String resourceGroupName, String accountName, String tableName, Context context) { - return this.beginMigrateTableToAutoscaleAsync(resourceGroupName, accountName, tableName, context) + public SyncPoller, TableRoleAssignmentResourceInner> + beginCreateUpdateTableRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId, + TableRoleAssignmentResourceInner createUpdateTableRoleAssignmentParameters, Context context) { + return this + .beginCreateUpdateTableRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, + createUpdateTableRoleAssignmentParameters, context) .getSyncPoller(); } /** - * Migrate an Azure Cosmos DB Table from manual throughput to autoscale. + * Creates or updates an Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateTableRoleAssignmentParameters The properties required to create or update a Role Assignment. * @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}. + * @return parameters to create and update an Azure Cosmos DB Table Role Assignment on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono migrateTableToAutoscaleAsync(String resourceGroupName, - String accountName, String tableName) { - return beginMigrateTableToAutoscaleAsync(resourceGroupName, accountName, tableName).last() - .flatMap(this.client::getLroFinalResultOrError); + public Mono createUpdateTableRoleAssignmentAsync(String resourceGroupName, + String accountName, String roleAssignmentId, + TableRoleAssignmentResourceInner createUpdateTableRoleAssignmentParameters) { + return beginCreateUpdateTableRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, + createUpdateTableRoleAssignmentParameters).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Migrate an Azure Cosmos DB Table from manual throughput to autoscale. + * Creates or updates an Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateTableRoleAssignmentParameters The properties required to create or update a Role Assignment. * @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}. + * @return parameters to create and update an Azure Cosmos DB Table Role Assignment on successful completion of + * {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono migrateTableToAutoscaleAsync(String resourceGroupName, - String accountName, String tableName, Context context) { - return beginMigrateTableToAutoscaleAsync(resourceGroupName, accountName, tableName, context).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono createUpdateTableRoleAssignmentAsync(String resourceGroupName, + String accountName, String roleAssignmentId, + TableRoleAssignmentResourceInner createUpdateTableRoleAssignmentParameters, Context context) { + return beginCreateUpdateTableRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, + createUpdateTableRoleAssignmentParameters, context).last().flatMap(this.client::getLroFinalResultOrError); } /** - * Migrate an Azure Cosmos DB Table from manual throughput to autoscale. + * Creates or updates an Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateTableRoleAssignmentParameters The properties required to create or update a Role Assignment. * @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. + * @return parameters to create and update an Azure Cosmos DB Table Role Assignment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner migrateTableToAutoscale(String resourceGroupName, String accountName, - String tableName) { - return migrateTableToAutoscaleAsync(resourceGroupName, accountName, tableName).block(); + public TableRoleAssignmentResourceInner createUpdateTableRoleAssignment(String resourceGroupName, + String accountName, String roleAssignmentId, + TableRoleAssignmentResourceInner createUpdateTableRoleAssignmentParameters) { + return createUpdateTableRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, + createUpdateTableRoleAssignmentParameters).block(); } /** - * Migrate an Azure Cosmos DB Table from manual throughput to autoscale. + * Creates or updates an Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. + * @param createUpdateTableRoleAssignmentParameters The properties required to create or update a Role Assignment. * @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. + * @return parameters to create and update an Azure Cosmos DB Table Role Assignment. */ @ServiceMethod(returns = ReturnType.SINGLE) - public ThroughputSettingsGetResultsInner migrateTableToAutoscale(String resourceGroupName, String accountName, - String tableName, Context context) { - return migrateTableToAutoscaleAsync(resourceGroupName, accountName, tableName, context).block(); + public TableRoleAssignmentResourceInner createUpdateTableRoleAssignment(String resourceGroupName, + String accountName, String roleAssignmentId, + TableRoleAssignmentResourceInner createUpdateTableRoleAssignmentParameters, Context context) { + return createUpdateTableRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, + createUpdateTableRoleAssignmentParameters, context).block(); } /** - * Migrate an Azure Cosmos DB Table from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. * @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}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> migrateTableToManualThroughputWithResponseAsync(String resourceGroupName, - String accountName, String tableName) { + public Mono>> deleteTableRoleAssignmentWithResponseAsync(String resourceGroupName, + String accountName, String roleAssignmentId) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1596,33 +3417,32 @@ public Mono>> migrateTableToManualThroughputWithRespon if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + if (roleAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); } - final String accept = "application/json"; return FluxUtil - .withContext(context -> service.migrateTableToManualThroughput(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, tableName, this.client.getApiVersion(), - accept, context)) + .withContext( + context -> service.deleteTableRoleAssignment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleAssignmentId, context)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Migrate an Azure Cosmos DB Table from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. * @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}. + * @return the {@link Response} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> migrateTableToManualThroughputWithResponseAsync(String resourceGroupName, - String accountName, String tableName, Context context) { + private Mono>> deleteTableRoleAssignmentWithResponseAsync(String resourceGroupName, + String accountName, String roleAssignmentId, Context context) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1638,184 +3458,177 @@ private Mono>> migrateTableToManualThroughputWithRespo if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); + if (roleAssignmentId == null) { + return Mono + .error(new IllegalArgumentException("Parameter roleAssignmentId is required and cannot be null.")); } - final String accept = "application/json"; context = this.client.mergeContext(context); - return service.migrateTableToManualThroughput(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, tableName, this.client.getApiVersion(), accept, context); + return service.deleteTableRoleAssignment(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, roleAssignmentId, context); } /** - * Migrate an Azure Cosmos DB Table from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. * @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> - beginMigrateTableToManualThroughputAsync(String resourceGroupName, String accountName, String tableName) { - Mono>> mono - = migrateTableToManualThroughputWithResponseAsync(resourceGroupName, accountName, tableName); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, this.client.getContext()); + * @return the {@link PollerFlux} for polling of long-running operation. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, Void> beginDeleteTableRoleAssignmentAsync(String resourceGroupName, + String accountName, String roleAssignmentId) { + Mono>> mono + = deleteTableRoleAssignmentWithResponseAsync(resourceGroupName, accountName, roleAssignmentId); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); } /** - * Migrate an Azure Cosmos DB Table from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. * @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. + * @return the {@link PollerFlux} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, ThroughputSettingsGetResultsInner> - beginMigrateTableToManualThroughputAsync(String resourceGroupName, String accountName, String tableName, - Context context) { + private PollerFlux, Void> beginDeleteTableRoleAssignmentAsync(String resourceGroupName, + String accountName, String roleAssignmentId, Context context) { context = this.client.mergeContext(context); Mono>> mono - = migrateTableToManualThroughputWithResponseAsync(resourceGroupName, accountName, tableName, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), ThroughputSettingsGetResultsInner.class, - ThroughputSettingsGetResultsInner.class, context); + = deleteTableRoleAssignmentWithResponseAsync(resourceGroupName, accountName, roleAssignmentId, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); } /** - * Migrate an Azure Cosmos DB Table from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. * @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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateTableToManualThroughput(String resourceGroupName, String accountName, String tableName) { - return this.beginMigrateTableToManualThroughputAsync(resourceGroupName, accountName, tableName).getSyncPoller(); + public SyncPoller, Void> beginDeleteTableRoleAssignment(String resourceGroupName, + String accountName, String roleAssignmentId) { + return this.beginDeleteTableRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId) + .getSyncPoller(); } /** - * Migrate an Azure Cosmos DB Table from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. * @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. + * @return the {@link SyncPoller} for polling of long-running operation. */ @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, ThroughputSettingsGetResultsInner> - beginMigrateTableToManualThroughput(String resourceGroupName, String accountName, String tableName, - Context context) { - return this.beginMigrateTableToManualThroughputAsync(resourceGroupName, accountName, tableName, context) + public SyncPoller, Void> beginDeleteTableRoleAssignment(String resourceGroupName, + String accountName, String roleAssignmentId, Context context) { + return this.beginDeleteTableRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, context) .getSyncPoller(); } /** - * Migrate an Azure Cosmos DB Table from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. * @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}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono migrateTableToManualThroughputAsync(String resourceGroupName, - String accountName, String tableName) { - return beginMigrateTableToManualThroughputAsync(resourceGroupName, accountName, tableName).last() + public Mono deleteTableRoleAssignmentAsync(String resourceGroupName, String accountName, + String roleAssignmentId) { + return beginDeleteTableRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Migrate an Azure Cosmos DB Table from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. * @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}. + * @return A {@link Mono} that completes when a successful response is received. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono migrateTableToManualThroughputAsync(String resourceGroupName, - String accountName, String tableName, Context context) { - return beginMigrateTableToManualThroughputAsync(resourceGroupName, accountName, tableName, context).last() + private Mono deleteTableRoleAssignmentAsync(String resourceGroupName, String accountName, + String roleAssignmentId, Context context) { + return beginDeleteTableRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, context).last() .flatMap(this.client::getLroFinalResultOrError); } /** - * Migrate an Azure Cosmos DB Table from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. * @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 migrateTableToManualThroughput(String resourceGroupName, - String accountName, String tableName) { - return migrateTableToManualThroughputAsync(resourceGroupName, accountName, tableName).block(); + public void deleteTableRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId) { + deleteTableRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId).block(); } /** - * Migrate an Azure Cosmos DB Table from autoscale to manual throughput. + * Deletes an existing Azure Cosmos DB Table Role Assignment. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. + * @param roleAssignmentId The GUID for the Role Assignment. * @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 migrateTableToManualThroughput(String resourceGroupName, - String accountName, String tableName, Context context) { - return migrateTableToManualThroughputAsync(resourceGroupName, accountName, tableName, context).block(); + public void deleteTableRoleAssignment(String resourceGroupName, String accountName, String roleAssignmentId, + Context context) { + deleteTableRoleAssignmentAsync(resourceGroupName, accountName, roleAssignmentId, context).block(); } /** - * Retrieves continuous backup information for a table. + * Retrieves the list of all Azure Cosmos DB Table Role Assignments. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param location The name of the continuous backup restore location. * @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 backup information of a resource along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a TableRoleAssignmentResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono>> retrieveContinuousBackupInformationWithResponseAsync( - String resourceGroupName, String accountName, String tableName, ContinuousBackupRestoreLocation location) { + private Mono> + listTableRoleAssignmentsSinglePageAsync(String resourceGroupName, String accountName) { if (this.client.getEndpoint() == null) { return Mono.error( new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); @@ -1831,39 +3644,31 @@ public Mono>> retrieveContinuousBackupInformationWithR if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } else { - location.validate(); - } final String accept = "application/json"; return FluxUtil - .withContext(context -> service.retrieveContinuousBackupInformation(this.client.getEndpoint(), - this.client.getSubscriptionId(), resourceGroupName, accountName, tableName, this.client.getApiVersion(), - location, accept, context)) + .withContext( + context -> service.listTableRoleAssignments(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves continuous backup information for a table. + * Retrieves the list of all Azure Cosmos DB Table Role Assignments. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param location The name of the continuous backup restore location. * @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 backup information of a resource along with {@link Response} on successful completion of {@link Mono}. + * @return the response of a TableRoleAssignmentResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono>> retrieveContinuousBackupInformationWithResponseAsync( - String resourceGroupName, String accountName, String tableName, ContinuousBackupRestoreLocation location, - Context context) { + private Mono> + listTableRoleAssignmentsSinglePageAsync(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.")); @@ -1879,183 +3684,252 @@ private Mono>> retrieveContinuousBackupInformationWith if (accountName == null) { return Mono.error(new IllegalArgumentException("Parameter accountName is required and cannot be null.")); } - if (tableName == null) { - return Mono.error(new IllegalArgumentException("Parameter tableName is required and cannot be null.")); - } - if (location == null) { - return Mono.error(new IllegalArgumentException("Parameter location is required and cannot be null.")); - } else { - location.validate(); - } final String accept = "application/json"; context = this.client.mergeContext(context); - return service.retrieveContinuousBackupInformation(this.client.getEndpoint(), this.client.getSubscriptionId(), - resourceGroupName, accountName, tableName, this.client.getApiVersion(), location, accept, context); + return service + .listTableRoleAssignments(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accountName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Retrieves continuous backup information for a table. + * Retrieves the list of all Azure Cosmos DB Table Role Assignments. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param location The name of the continuous backup restore location. * @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 backup information of a resource. + * @return the response of a TableRoleAssignmentResource list operation as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public PollerFlux, BackupInformationInner> - beginRetrieveContinuousBackupInformationAsync(String resourceGroupName, String accountName, String tableName, - ContinuousBackupRestoreLocation location) { - Mono>> mono - = retrieveContinuousBackupInformationWithResponseAsync(resourceGroupName, accountName, tableName, location); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), BackupInformationInner.class, BackupInformationInner.class, - this.client.getContext()); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listTableRoleAssignmentsAsync(String resourceGroupName, + String accountName) { + return new PagedFlux<>(() -> listTableRoleAssignmentsSinglePageAsync(resourceGroupName, accountName), + nextLink -> listTableRoleAssignmentsNextSinglePageAsync(nextLink)); } /** - * Retrieves continuous backup information for a table. + * Retrieves the list of all Azure Cosmos DB Table Role Assignments. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param location The name of the continuous backup restore location. * @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 backup information of a resource. + * @return the response of a TableRoleAssignmentResource list operation as paginated response with + * {@link PagedFlux}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - private PollerFlux, BackupInformationInner> - beginRetrieveContinuousBackupInformationAsync(String resourceGroupName, String accountName, String tableName, - ContinuousBackupRestoreLocation location, Context context) { - context = this.client.mergeContext(context); - Mono>> mono = retrieveContinuousBackupInformationWithResponseAsync(resourceGroupName, - accountName, tableName, location, context); - return this.client.getLroResult(mono, - this.client.getHttpPipeline(), BackupInformationInner.class, BackupInformationInner.class, context); + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listTableRoleAssignmentsAsync(String resourceGroupName, + String accountName, Context context) { + return new PagedFlux<>(() -> listTableRoleAssignmentsSinglePageAsync(resourceGroupName, accountName, context), + nextLink -> listTableRoleAssignmentsNextSinglePageAsync(nextLink, context)); } /** - * Retrieves continuous backup information for a table. + * Retrieves the list of all Azure Cosmos DB Table Role Assignments. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param location The name of the continuous backup restore location. * @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 backup information of a resource. + * @return the response of a TableRoleAssignmentResource list operation as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BackupInformationInner> - beginRetrieveContinuousBackupInformation(String resourceGroupName, String accountName, String tableName, - ContinuousBackupRestoreLocation location) { - return this.beginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, tableName, location) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTableRoleAssignments(String resourceGroupName, + String accountName) { + return new PagedIterable<>(listTableRoleAssignmentsAsync(resourceGroupName, accountName)); } /** - * Retrieves continuous backup information for a table. + * Retrieves the list of all Azure Cosmos DB Table Role Assignments. * * @param resourceGroupName The name of the resource group. The name is case insensitive. * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param location The name of the continuous backup restore location. * @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 backup information of a resource. + * @return the response of a TableRoleAssignmentResource list operation as paginated response with + * {@link PagedIterable}. */ - @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) - public SyncPoller, BackupInformationInner> - beginRetrieveContinuousBackupInformation(String resourceGroupName, String accountName, String tableName, - ContinuousBackupRestoreLocation location, Context context) { - return this - .beginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, tableName, location, context) - .getSyncPoller(); + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listTableRoleAssignments(String resourceGroupName, + String accountName, Context context) { + return new PagedIterable<>(listTableRoleAssignmentsAsync(resourceGroupName, accountName, context)); } /** - * Retrieves continuous backup information for a table. + * Get the next page of items. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param location The name of the continuous backup restore location. + * @param nextLink The URL to get the next list of items. * @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 backup information of a resource on successful completion of {@link Mono}. + * @return the List operation response, that contains the Table and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public Mono retrieveContinuousBackupInformationAsync(String resourceGroupName, - String accountName, String tableName, ContinuousBackupRestoreLocation location) { - return beginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, tableName, location).last() - .flatMap(this.client::getLroFinalResultOrError); + private Mono> listTablesNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listTablesNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves continuous backup information for a table. + * Get the next page of items. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param location The name of the continuous backup restore location. + * @param nextLink The URL to get the next list of items. * @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 backup information of a resource on successful completion of {@link Mono}. + * @return the List operation response, that contains the Table and their properties along with + * {@link PagedResponse} on successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - private Mono retrieveContinuousBackupInformationAsync(String resourceGroupName, - String accountName, String tableName, ContinuousBackupRestoreLocation location, Context context) { - return beginRetrieveContinuousBackupInformationAsync(resourceGroupName, accountName, tableName, location, - context).last().flatMap(this.client::getLroFinalResultOrError); + private Mono> listTablesNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listTablesNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } /** - * Retrieves continuous backup information for a table. + * Get the next page of items. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param location The name of the continuous backup restore location. + * @param nextLink The URL to get the next list of items. * @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 backup information of a resource. + * @return the response of a TableRoleDefinitionResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BackupInformationInner retrieveContinuousBackupInformation(String resourceGroupName, String accountName, - String tableName, ContinuousBackupRestoreLocation location) { - return retrieveContinuousBackupInformationAsync(resourceGroupName, accountName, tableName, location).block(); + private Mono> + listTableRoleDefinitionsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listTableRoleDefinitionsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); } /** - * Retrieves continuous backup information for a table. + * Get the next page of items. * - * @param resourceGroupName The name of the resource group. The name is case insensitive. - * @param accountName Cosmos DB database account name. - * @param tableName Cosmos DB table name. - * @param location The name of the continuous backup restore location. + * @param nextLink The URL to get the next list of items. * @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 backup information of a resource. + * @return the response of a TableRoleDefinitionResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. */ @ServiceMethod(returns = ReturnType.SINGLE) - public BackupInformationInner retrieveContinuousBackupInformation(String resourceGroupName, String accountName, - String tableName, ContinuousBackupRestoreLocation location, Context context) { - return retrieveContinuousBackupInformationAsync(resourceGroupName, accountName, tableName, location, context) - .block(); + private Mono> + listTableRoleDefinitionsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listTableRoleDefinitionsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a TableRoleAssignmentResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listTableRoleAssignmentsNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listTableRoleAssignmentsNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a TableRoleAssignmentResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listTableRoleAssignmentsNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listTableRoleAssignmentsNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); } } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolAccountsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolAccountsClientImpl.java new file mode 100644 index 000000000000..294c370a4ae2 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolAccountsClientImpl.java @@ -0,0 +1,740 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.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.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.ThroughputPoolAccountsClient; +import com.azure.resourcemanager.cosmos.fluent.models.ThroughputPoolAccountResourceInner; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ThroughputPoolAccountsClient. + */ +public final class ThroughputPoolAccountsClientImpl implements ThroughputPoolAccountsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ThroughputPoolAccountsService service; + + /** + * The service client containing this operation class. + */ + private final CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of ThroughputPoolAccountsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ThroughputPoolAccountsClientImpl(CosmosDBManagementClientImpl client) { + this.service = RestProxy.create(ThroughputPoolAccountsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CosmosDBManagementClientThroughputPoolAccounts to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CosmosDBManagementClientThroughputPoolAccounts") + public interface ThroughputPoolAccountsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> get(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("throughputPoolName") String throughputPoolName, + @PathParam("throughputPoolAccountName") String throughputPoolAccountName, + @HeaderParam("Accept") String accept, Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> create(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("throughputPoolName") String throughputPoolName, + @PathParam("throughputPoolAccountName") String throughputPoolAccountName, + @HeaderParam("Content-Type") String contentType, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ThroughputPoolAccountResourceInner body, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts/{throughputPoolAccountName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("throughputPoolName") String throughputPoolName, + @PathParam("throughputPoolAccountName") String throughputPoolAccountName, Context context); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @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 Throughputpool Account along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getWithResponseAsync(String resourceGroupName, + String throughputPoolName, String throughputPoolAccountName) { + 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 (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + if (throughputPoolAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter throughputPoolAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.get(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, throughputPoolName, throughputPoolAccountName, + accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @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 Throughputpool Account along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getWithResponseAsync(String resourceGroupName, + String throughputPoolName, String throughputPoolAccountName, 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 (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + if (throughputPoolAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter throughputPoolAccountName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.get(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, throughputPoolName, throughputPoolAccountName, accept, context); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @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 Throughputpool Account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getAsync(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName) { + return getWithResponseAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @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 Throughputpool Account along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getWithResponse(String resourceGroupName, + String throughputPoolName, String throughputPoolAccountName, Context context) { + return getWithResponseAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName, context).block(); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @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 Throughputpool Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputPoolAccountResourceInner get(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName) { + return getWithResponse(resourceGroupName, throughputPoolName, throughputPoolAccountName, Context.NONE) + .getValue(); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @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 Throughputpool Account along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createWithResponseAsync(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName, ThroughputPoolAccountResourceInner body) { + 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 (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + if (throughputPoolAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter throughputPoolAccountName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.create(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, throughputPoolName, throughputPoolAccountName, + contentType, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @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 Throughputpool Account along with {@link Response} on successful completion of + * {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createWithResponseAsync(String resourceGroupName, + String throughputPoolName, String throughputPoolAccountName, ThroughputPoolAccountResourceInner body, + 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 (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + if (throughputPoolAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter throughputPoolAccountName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.create(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, throughputPoolName, throughputPoolAccountName, contentType, accept, body, context); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @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 Throughputpool Account. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, ThroughputPoolAccountResourceInner> + beginCreateAsync(String resourceGroupName, String throughputPoolName, String throughputPoolAccountName, + ThroughputPoolAccountResourceInner body) { + Mono>> mono + = createWithResponseAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputPoolAccountResourceInner.class, + ThroughputPoolAccountResourceInner.class, this.client.getContext()); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @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 Throughputpool Account. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ThroughputPoolAccountResourceInner> + beginCreateAsync(String resourceGroupName, String throughputPoolName, String throughputPoolAccountName, + ThroughputPoolAccountResourceInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createWithResponseAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputPoolAccountResourceInner.class, + ThroughputPoolAccountResourceInner.class, context); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @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 Throughputpool Account. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ThroughputPoolAccountResourceInner> beginCreate( + String resourceGroupName, String throughputPoolName, String throughputPoolAccountName, + ThroughputPoolAccountResourceInner body) { + return this.beginCreateAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName, body) + .getSyncPoller(); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @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 Throughputpool Account. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ThroughputPoolAccountResourceInner> beginCreate( + String resourceGroupName, String throughputPoolName, String throughputPoolAccountName, + ThroughputPoolAccountResourceInner body, Context context) { + return this.beginCreateAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName, body, context) + .getSyncPoller(); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @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 Throughputpool Account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createAsync(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName, ThroughputPoolAccountResourceInner body) { + return beginCreateAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @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 Throughputpool Account on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createAsync(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName, ThroughputPoolAccountResourceInner body, Context context) { + return beginCreateAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @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 Throughputpool Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputPoolAccountResourceInner create(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName, ThroughputPoolAccountResourceInner body) { + return createAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName, body).block(); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @param body The parameters to provide for the current ThroughputPoolAccount. + * @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 Throughputpool Account. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputPoolAccountResourceInner create(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName, ThroughputPoolAccountResourceInner body, Context context) { + return createAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName, body, context).block(); + } + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @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>> deleteWithResponseAsync(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName) { + 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 (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + if (throughputPoolAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter throughputPoolAccountName is required and cannot be null.")); + } + return FluxUtil.withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, throughputPoolName, throughputPoolAccountName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @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>> deleteWithResponseAsync(String resourceGroupName, + String throughputPoolName, String throughputPoolAccountName, 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 (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + if (throughputPoolAccountName == null) { + return Mono.error( + new IllegalArgumentException("Parameter throughputPoolAccountName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, throughputPoolName, throughputPoolAccountName, context); + } + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @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> beginDeleteAsync(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName) { + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @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> beginDeleteAsync(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = deleteWithResponseAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @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> beginDelete(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName) { + return this.beginDeleteAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName).getSyncPoller(); + } + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @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> beginDelete(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName, Context context) { + return this.beginDeleteAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName, context) + .getSyncPoller(); + } + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @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 deleteAsync(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName) { + return beginDeleteAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @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 deleteAsync(String resourceGroupName, String throughputPoolName, + String throughputPoolAccountName, Context context) { + return beginDeleteAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @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 delete(String resourceGroupName, String throughputPoolName, String throughputPoolAccountName) { + deleteAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName).block(); + } + + /** + * Removes an existing Azure Cosmos DB database account from a throughput pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param throughputPoolAccountName Cosmos DB global database account in a Throughput Pool. + * @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 delete(String resourceGroupName, String throughputPoolName, String throughputPoolAccountName, + Context context) { + deleteAsync(resourceGroupName, throughputPoolName, throughputPoolAccountName, context).block(); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolAccountsOperationsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolAccountsOperationsClientImpl.java new file mode 100644 index 000000000000..ac2e1b88a774 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolAccountsOperationsClientImpl.java @@ -0,0 +1,287 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation; + +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.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.cosmos.fluent.ThroughputPoolAccountsOperationsClient; +import com.azure.resourcemanager.cosmos.fluent.models.ThroughputPoolAccountResourceInner; +import com.azure.resourcemanager.cosmos.implementation.models.ThroughputPoolAccountsListResult; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ThroughputPoolAccountsOperationsClient. + */ +public final class ThroughputPoolAccountsOperationsClientImpl implements ThroughputPoolAccountsOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ThroughputPoolAccountsOperationsService service; + + /** + * The service client containing this operation class. + */ + private final CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of ThroughputPoolAccountsOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ThroughputPoolAccountsOperationsClientImpl(CosmosDBManagementClientImpl client) { + this.service = RestProxy.create(ThroughputPoolAccountsOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CosmosDBManagementClientThroughputPoolAccountsOperations to be used + * by the proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CosmosDBManagementClientThroughputPoolAccountsOperations") + public interface ThroughputPoolAccountsOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}/throughputPoolAccounts") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("throughputPoolName") String throughputPoolName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * Lists all the Azure Cosmos DB accounts available under the subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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 response of a ThroughputPoolAccountResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String throughputPoolName) { + 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 (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, throughputPoolName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the Azure Cosmos DB accounts available under the subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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 response of a ThroughputPoolAccountResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(String resourceGroupName, + String throughputPoolName, 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 (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, throughputPoolName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all the Azure Cosmos DB accounts available under the subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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 response of a ThroughputPoolAccountResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync(String resourceGroupName, + String throughputPoolName) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, throughputPoolName), + nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the Azure Cosmos DB accounts available under the subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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 response of a ThroughputPoolAccountResource list operation as paginated response with + * {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(String resourceGroupName, String throughputPoolName, + Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(resourceGroupName, throughputPoolName, context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the Azure Cosmos DB accounts available under the subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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 response of a ThroughputPoolAccountResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String throughputPoolName) { + return new PagedIterable<>(listAsync(resourceGroupName, throughputPoolName)); + } + + /** + * Lists all the Azure Cosmos DB accounts available under the subscription. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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 response of a ThroughputPoolAccountResource list operation as paginated response with + * {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(String resourceGroupName, String throughputPoolName, + Context context) { + return new PagedIterable<>(listAsync(resourceGroupName, throughputPoolName, context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a ThroughputPoolAccountResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a ThroughputPoolAccountResource list operation along with {@link PagedResponse} on + * successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolsClientImpl.java new file mode 100644 index 000000000000..8e8495a33f93 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolsClientImpl.java @@ -0,0 +1,948 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec 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.Patch; +import com.azure.core.annotation.PathParam; +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.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.ThroughputPoolsClient; +import com.azure.resourcemanager.cosmos.fluent.models.ThroughputPoolResourceInner; +import com.azure.resourcemanager.cosmos.models.ThroughputPoolUpdate; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsDelete; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsGet; +import java.nio.ByteBuffer; +import reactor.core.publisher.Flux; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ThroughputPoolsClient. + */ +public final class ThroughputPoolsClientImpl + implements InnerSupportsGet, InnerSupportsDelete, ThroughputPoolsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ThroughputPoolsService service; + + /** + * The service client containing this operation class. + */ + private final CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of ThroughputPoolsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ThroughputPoolsClientImpl(CosmosDBManagementClientImpl client) { + this.service + = RestProxy.create(ThroughputPoolsService.class, client.getHttpPipeline(), client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CosmosDBManagementClientThroughputPools to be used by the proxy + * service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CosmosDBManagementClientThroughputPools") + public interface ThroughputPoolsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> getByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("throughputPoolName") String throughputPoolName, @HeaderParam("Accept") String accept, + Context context); + + @Put("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}") + @ExpectedResponses({ 200, 201 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> createOrUpdate(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("throughputPoolName") String throughputPoolName, @HeaderParam("Content-Type") String contentType, + @HeaderParam("Accept") String accept, @BodyParam("application/json") ThroughputPoolResourceInner body, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Patch("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}") + @ExpectedResponses({ 200, 202 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> update(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("throughputPoolName") String throughputPoolName, @HeaderParam("Accept") String accept, + @BodyParam("application/json") ThroughputPoolUpdate body, Context context); + + @Headers({ "Accept: application/json;q=0.9", "Content-Type: application/json" }) + @Delete("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools/{throughputPoolName}") + @ExpectedResponses({ 202, 204 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono>> delete(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, + @PathParam("throughputPoolName") String throughputPoolName, Context context); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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 Throughputpool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String throughputPoolName) { + 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 (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, throughputPoolName, accept, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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 Throughputpool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> getByResourceGroupWithResponseAsync(String resourceGroupName, + String throughputPoolName, 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 (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.getByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, throughputPoolName, accept, context); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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 Throughputpool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono getByResourceGroupAsync(String resourceGroupName, + String throughputPoolName) { + return getByResourceGroupWithResponseAsync(resourceGroupName, throughputPoolName) + .flatMap(res -> Mono.justOrEmpty(res.getValue())); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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 Throughputpool along with {@link Response}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Response getByResourceGroupWithResponse(String resourceGroupName, + String throughputPoolName, Context context) { + return getByResourceGroupWithResponseAsync(resourceGroupName, throughputPoolName, context).block(); + } + + /** + * Retrieves the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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 Throughputpool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputPoolResourceInner getByResourceGroup(String resourceGroupName, String throughputPoolName) { + return getByResourceGroupWithResponse(resourceGroupName, throughputPoolName, Context.NONE).getValue(); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @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 Throughputpool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String throughputPoolName, ThroughputPoolResourceInner body) { + 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 (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, throughputPoolName, contentType, accept, body, + context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @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 Throughputpool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> createOrUpdateWithResponseAsync(String resourceGroupName, + String throughputPoolName, ThroughputPoolResourceInner body, 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 (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + if (body == null) { + return Mono.error(new IllegalArgumentException("Parameter body is required and cannot be null.")); + } else { + body.validate(); + } + final String contentType = "application/json"; + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.createOrUpdate(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, throughputPoolName, contentType, accept, body, context); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @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 Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, ThroughputPoolResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String throughputPoolName, ThroughputPoolResourceInner body) { + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, throughputPoolName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputPoolResourceInner.class, ThroughputPoolResourceInner.class, + this.client.getContext()); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @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 Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ThroughputPoolResourceInner> beginCreateOrUpdateAsync( + String resourceGroupName, String throughputPoolName, ThroughputPoolResourceInner body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = createOrUpdateWithResponseAsync(resourceGroupName, throughputPoolName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputPoolResourceInner.class, ThroughputPoolResourceInner.class, + context); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @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 Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ThroughputPoolResourceInner> + beginCreateOrUpdate(String resourceGroupName, String throughputPoolName, ThroughputPoolResourceInner body) { + return this.beginCreateOrUpdateAsync(resourceGroupName, throughputPoolName, body).getSyncPoller(); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @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 Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ThroughputPoolResourceInner> beginCreateOrUpdate( + String resourceGroupName, String throughputPoolName, ThroughputPoolResourceInner body, Context context) { + return this.beginCreateOrUpdateAsync(resourceGroupName, throughputPoolName, body, context).getSyncPoller(); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @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 Throughputpool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono createOrUpdateAsync(String resourceGroupName, String throughputPoolName, + ThroughputPoolResourceInner body) { + return beginCreateOrUpdateAsync(resourceGroupName, throughputPoolName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @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 Throughputpool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono createOrUpdateAsync(String resourceGroupName, String throughputPoolName, + ThroughputPoolResourceInner body, Context context) { + return beginCreateOrUpdateAsync(resourceGroupName, throughputPoolName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @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 Throughputpool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputPoolResourceInner createOrUpdate(String resourceGroupName, String throughputPoolName, + ThroughputPoolResourceInner body) { + return createOrUpdateAsync(resourceGroupName, throughputPoolName, body).block(); + } + + /** + * Creates or updates an Azure Cosmos DB ThroughputPool account. The "Update" method is preferred when performing + * updates on an account. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current ThroughputPool. + * @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 Throughputpool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputPoolResourceInner createOrUpdate(String resourceGroupName, String throughputPoolName, + ThroughputPoolResourceInner body, Context context) { + return createOrUpdateAsync(resourceGroupName, throughputPoolName, body, context).block(); + } + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current Throughput Pool. + * @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 Throughputpool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono>> updateWithResponseAsync(String resourceGroupName, String throughputPoolName, + ThroughputPoolUpdate body) { + 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 (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.update(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, throughputPoolName, accept, body, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current Throughput Pool. + * @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 Throughputpool along with {@link Response} on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono>> updateWithResponseAsync(String resourceGroupName, + String throughputPoolName, ThroughputPoolUpdate body, 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 (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + if (body != null) { + body.validate(); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.update(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, throughputPoolName, accept, body, context); + } + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current Throughput Pool. + * @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 Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, ThroughputPoolResourceInner> + beginUpdateAsync(String resourceGroupName, String throughputPoolName, ThroughputPoolUpdate body) { + Mono>> mono = updateWithResponseAsync(resourceGroupName, throughputPoolName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputPoolResourceInner.class, ThroughputPoolResourceInner.class, + this.client.getContext()); + } + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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 Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public PollerFlux, ThroughputPoolResourceInner> + beginUpdateAsync(String resourceGroupName, String throughputPoolName) { + final ThroughputPoolUpdate body = null; + Mono>> mono = updateWithResponseAsync(resourceGroupName, throughputPoolName, body); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputPoolResourceInner.class, ThroughputPoolResourceInner.class, + this.client.getContext()); + } + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current Throughput Pool. + * @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 Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + private PollerFlux, ThroughputPoolResourceInner> beginUpdateAsync( + String resourceGroupName, String throughputPoolName, ThroughputPoolUpdate body, Context context) { + context = this.client.mergeContext(context); + Mono>> mono + = updateWithResponseAsync(resourceGroupName, throughputPoolName, body, context); + return this.client.getLroResult(mono, + this.client.getHttpPipeline(), ThroughputPoolResourceInner.class, ThroughputPoolResourceInner.class, + context); + } + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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 Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ThroughputPoolResourceInner> + beginUpdate(String resourceGroupName, String throughputPoolName) { + final ThroughputPoolUpdate body = null; + return this.beginUpdateAsync(resourceGroupName, throughputPoolName, body).getSyncPoller(); + } + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current Throughput Pool. + * @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 Throughputpool. + */ + @ServiceMethod(returns = ReturnType.LONG_RUNNING_OPERATION) + public SyncPoller, ThroughputPoolResourceInner> + beginUpdate(String resourceGroupName, String throughputPoolName, ThroughputPoolUpdate body, Context context) { + return this.beginUpdateAsync(resourceGroupName, throughputPoolName, body, context).getSyncPoller(); + } + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current Throughput Pool. + * @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 Throughputpool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync(String resourceGroupName, String throughputPoolName, + ThroughputPoolUpdate body) { + return beginUpdateAsync(resourceGroupName, throughputPoolName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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 Throughputpool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public Mono updateAsync(String resourceGroupName, String throughputPoolName) { + final ThroughputPoolUpdate body = null; + return beginUpdateAsync(resourceGroupName, throughputPoolName, body).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current Throughput Pool. + * @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 Throughputpool on successful completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono updateAsync(String resourceGroupName, String throughputPoolName, + ThroughputPoolUpdate body, Context context) { + return beginUpdateAsync(resourceGroupName, throughputPoolName, body, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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 Throughputpool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputPoolResourceInner update(String resourceGroupName, String throughputPoolName) { + final ThroughputPoolUpdate body = null; + return updateAsync(resourceGroupName, throughputPoolName, body).block(); + } + + /** + * Updates the properties of an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool name. + * @param body The parameters to provide for the current Throughput Pool. + * @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 Throughputpool. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + public ThroughputPoolResourceInner update(String resourceGroupName, String throughputPoolName, + ThroughputPoolUpdate body, Context context) { + return updateAsync(resourceGroupName, throughputPoolName, body, context).block(); + } + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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>> deleteWithResponseAsync(String resourceGroupName, + String throughputPoolName) { + 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 (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + return FluxUtil + .withContext(context -> service.delete(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, throughputPoolName, context)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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>> deleteWithResponseAsync(String resourceGroupName, + String throughputPoolName, 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 (throughputPoolName == null) { + return Mono + .error(new IllegalArgumentException("Parameter throughputPoolName is required and cannot be null.")); + } + context = this.client.mergeContext(context); + return service.delete(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), + resourceGroupName, throughputPoolName, context); + } + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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> beginDeleteAsync(String resourceGroupName, String throughputPoolName) { + Mono>> mono = deleteWithResponseAsync(resourceGroupName, throughputPoolName); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + this.client.getContext()); + } + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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> beginDeleteAsync(String resourceGroupName, String throughputPoolName, + Context context) { + context = this.client.mergeContext(context); + Mono>> mono = deleteWithResponseAsync(resourceGroupName, throughputPoolName, context); + return this.client.getLroResult(mono, this.client.getHttpPipeline(), Void.class, Void.class, + context); + } + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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> beginDelete(String resourceGroupName, String throughputPoolName) { + return this.beginDeleteAsync(resourceGroupName, throughputPoolName).getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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> beginDelete(String resourceGroupName, String throughputPoolName, + Context context) { + return this.beginDeleteAsync(resourceGroupName, throughputPoolName, context).getSyncPoller(); + } + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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 deleteAsync(String resourceGroupName, String throughputPoolName) { + return beginDeleteAsync(resourceGroupName, throughputPoolName).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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 deleteAsync(String resourceGroupName, String throughputPoolName, Context context) { + return beginDeleteAsync(resourceGroupName, throughputPoolName, context).last() + .flatMap(this.client::getLroFinalResultOrError); + } + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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 delete(String resourceGroupName, String throughputPoolName) { + deleteAsync(resourceGroupName, throughputPoolName).block(); + } + + /** + * Deletes an existing Azure Cosmos DB Throughput Pool. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @param throughputPoolName Cosmos DB Throughput Pool 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 delete(String resourceGroupName, String throughputPoolName, Context context) { + deleteAsync(resourceGroupName, throughputPoolName, context).block(); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolsOperationsClientImpl.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolsOperationsClientImpl.java new file mode 100644 index 000000000000..81f078930576 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolsOperationsClientImpl.java @@ -0,0 +1,447 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation; + +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.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.util.Context; +import com.azure.core.util.FluxUtil; +import com.azure.resourcemanager.cosmos.fluent.ThroughputPoolsOperationsClient; +import com.azure.resourcemanager.cosmos.fluent.models.ThroughputPoolResourceInner; +import com.azure.resourcemanager.cosmos.implementation.models.ThroughputPoolsListResult; +import com.azure.resourcemanager.resources.fluentcore.collection.InnerSupportsListing; +import reactor.core.publisher.Mono; + +/** + * An instance of this class provides access to all the operations defined in ThroughputPoolsOperationsClient. + */ +public final class ThroughputPoolsOperationsClientImpl + implements InnerSupportsListing, ThroughputPoolsOperationsClient { + /** + * The proxy service used to perform REST calls. + */ + private final ThroughputPoolsOperationsService service; + + /** + * The service client containing this operation class. + */ + private final CosmosDBManagementClientImpl client; + + /** + * Initializes an instance of ThroughputPoolsOperationsClientImpl. + * + * @param client the instance of the service client containing this operation class. + */ + ThroughputPoolsOperationsClientImpl(CosmosDBManagementClientImpl client) { + this.service = RestProxy.create(ThroughputPoolsOperationsService.class, client.getHttpPipeline(), + client.getSerializerAdapter()); + this.client = client; + } + + /** + * The interface defining all the services for CosmosDBManagementClientThroughputPoolsOperations to be used by the + * proxy service to perform REST calls. + */ + @Host("{endpoint}") + @ServiceInterface(name = "CosmosDBManagementClientThroughputPoolsOperations") + public interface ThroughputPoolsOperationsService { + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/throughputPools") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroup(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @PathParam("resourceGroupName") String resourceGroupName, @HeaderParam("Accept") String accept, + Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("/subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/throughputPools") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> list(@HostParam("endpoint") String endpoint, + @QueryParam("api-version") String apiVersion, @PathParam("subscriptionId") String subscriptionId, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listByResourceGroupNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + + @Headers({ "Content-Type: application/json" }) + @Get("{nextLink}") + @ExpectedResponses({ 200 }) + @UnexpectedResponseExceptionType(ManagementException.class) + Mono> listNext( + @PathParam(value = "nextLink", encoded = true) String nextLink, @HostParam("endpoint") String endpoint, + @HeaderParam("Accept") String accept, Context context); + } + + /** + * List all the ThroughputPools in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 response of a ThroughputPoolResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName) { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * List all the ThroughputPools in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 response of a ThroughputPoolResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> + listByResourceGroupSinglePageAsync(String resourceGroupName, 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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .listByResourceGroup(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), resourceGroupName, accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * List all the ThroughputPools in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 response of a ThroughputPoolResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listByResourceGroupAsync(String resourceGroupName) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink)); + } + + /** + * List all the ThroughputPools in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 response of a ThroughputPoolResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listByResourceGroupAsync(String resourceGroupName, Context context) { + return new PagedFlux<>(() -> listByResourceGroupSinglePageAsync(resourceGroupName, context), + nextLink -> listByResourceGroupNextSinglePageAsync(nextLink, context)); + } + + /** + * List all the ThroughputPools in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 response of a ThroughputPoolResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName)); + } + + /** + * List all the ThroughputPools in a given resource group. + * + * @param resourceGroupName The name of the resource group. The name is case insensitive. + * @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 response of a ThroughputPoolResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable listByResourceGroup(String resourceGroupName, Context context) { + return new PagedIterable<>(listByResourceGroupAsync(resourceGroupName, context)); + } + + /** + * Lists all the Azure Cosmos DB Throughput Pools available under the subscription. + * + * @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 response of a ThroughputPoolResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync() { + 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.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext(context -> service.list(this.client.getEndpoint(), this.client.getApiVersion(), + this.client.getSubscriptionId(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Lists all the Azure Cosmos DB Throughput Pools available under the subscription. + * + * @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 response of a ThroughputPoolResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listSinglePageAsync(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.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service + .list(this.client.getEndpoint(), this.client.getApiVersion(), this.client.getSubscriptionId(), accept, + context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Lists all the Azure Cosmos DB Throughput Pools available under the subscription. + * + * @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 response of a ThroughputPoolResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedFlux listAsync() { + return new PagedFlux<>(() -> listSinglePageAsync(), nextLink -> listNextSinglePageAsync(nextLink)); + } + + /** + * Lists all the Azure Cosmos DB Throughput Pools available under the subscription. + * + * @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 response of a ThroughputPoolResource list operation as paginated response with {@link PagedFlux}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + private PagedFlux listAsync(Context context) { + return new PagedFlux<>(() -> listSinglePageAsync(context), + nextLink -> listNextSinglePageAsync(nextLink, context)); + } + + /** + * Lists all the Azure Cosmos DB Throughput Pools available under the subscription. + * + * @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 response of a ThroughputPoolResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list() { + return new PagedIterable<>(listAsync()); + } + + /** + * Lists all the Azure Cosmos DB Throughput Pools available under the subscription. + * + * @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 response of a ThroughputPoolResource list operation as paginated response with {@link PagedIterable}. + */ + @ServiceMethod(returns = ReturnType.COLLECTION) + public PagedIterable list(Context context) { + return new PagedIterable<>(listAsync(context)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a ThroughputPoolResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil + .withContext( + context -> service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a ThroughputPoolResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listByResourceGroupNextSinglePageAsync(String nextLink, + Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listByResourceGroupNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a ThroughputPoolResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + return FluxUtil.withContext(context -> service.listNext(nextLink, this.client.getEndpoint(), accept, context)) + .>map(res -> new PagedResponseBase<>(res.getRequest(), + res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)) + .contextWrite(context -> context.putAll(FluxUtil.toReactorContext(this.client.getContext()).readOnly())); + } + + /** + * Get the next page of items. + * + * @param nextLink The URL to get the next list of items. + * @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 response of a ThroughputPoolResource list operation along with {@link PagedResponse} on successful + * completion of {@link Mono}. + */ + @ServiceMethod(returns = ReturnType.SINGLE) + private Mono> listNextSinglePageAsync(String nextLink, Context context) { + if (nextLink == null) { + return Mono.error(new IllegalArgumentException("Parameter nextLink is required and cannot be null.")); + } + if (this.client.getEndpoint() == null) { + return Mono.error( + new IllegalArgumentException("Parameter this.client.getEndpoint() is required and cannot be null.")); + } + final String accept = "application/json"; + context = this.client.mergeContext(context); + return service.listNext(nextLink, this.client.getEndpoint(), accept, context) + .map(res -> new PagedResponseBase<>(res.getRequest(), res.getStatusCode(), res.getHeaders(), + res.getValue().value(), res.getValue().nextLink(), null)); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraKeyspaceListResult.java similarity index 81% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraKeyspaceListResult.java index 22bc9fb658fb..3afd042a3f31 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraKeyspaceListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class CassandraKeyspaceListResult implements JsonSerializable value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of CassandraKeyspaceListResult class. */ - public CassandraKeyspaceListResult() { + private CassandraKeyspaceListResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -77,6 +92,8 @@ public static CassandraKeyspaceListResult fromJson(JsonReader jsonReader) throws List value = reader.readArray(reader1 -> CassandraKeyspaceGetResultsInner.fromJson(reader1)); deserializedCassandraKeyspaceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCassandraKeyspaceListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraRoleAssignmentListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraRoleAssignmentListResult.java new file mode 100644 index 000000000000..9bee9af6637e --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraRoleAssignmentListResult.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.fluent.models.CassandraRoleAssignmentResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a CassandraRoleAssignmentResource list operation. + */ +@Immutable +public final class CassandraRoleAssignmentListResult implements JsonSerializable { + /* + * The CassandraRoleAssignmentResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of CassandraRoleAssignmentListResult class. + */ + private CassandraRoleAssignmentListResult() { + } + + /** + * Get the value property: The CassandraRoleAssignmentResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model CassandraRoleAssignmentListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CassandraRoleAssignmentListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CassandraRoleAssignmentListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CassandraRoleAssignmentListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CassandraRoleAssignmentListResult. + */ + public static CassandraRoleAssignmentListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CassandraRoleAssignmentListResult deserializedCassandraRoleAssignmentListResult + = new CassandraRoleAssignmentListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> CassandraRoleAssignmentResourceInner.fromJson(reader1)); + deserializedCassandraRoleAssignmentListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCassandraRoleAssignmentListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCassandraRoleAssignmentListResult; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraRoleDefinitionListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraRoleDefinitionListResult.java new file mode 100644 index 000000000000..96366fb213d7 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraRoleDefinitionListResult.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.fluent.models.CassandraRoleDefinitionResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a CassandraRoleDefinitionResource list operation. + */ +@Immutable +public final class CassandraRoleDefinitionListResult implements JsonSerializable { + /* + * The CassandraRoleDefinitionResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of CassandraRoleDefinitionListResult class. + */ + private CassandraRoleDefinitionListResult() { + } + + /** + * Get the value property: The CassandraRoleDefinitionResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model CassandraRoleDefinitionListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CassandraRoleDefinitionListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CassandraRoleDefinitionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CassandraRoleDefinitionListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CassandraRoleDefinitionListResult. + */ + public static CassandraRoleDefinitionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CassandraRoleDefinitionListResult deserializedCassandraRoleDefinitionListResult + = new CassandraRoleDefinitionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> CassandraRoleDefinitionResourceInner.fromJson(reader1)); + deserializedCassandraRoleDefinitionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCassandraRoleDefinitionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCassandraRoleDefinitionListResult; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraTableListResult.java similarity index 81% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraTableListResult.java index 4b64bf84bc2c..e8dce8ed0473 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraTableListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class CassandraTableListResult implements JsonSerializable value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of CassandraTableListResult class. */ - public CassandraTableListResult() { + private CassandraTableListResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -77,6 +92,8 @@ public static CassandraTableListResult fromJson(JsonReader jsonReader) throws IO List value = reader.readArray(reader1 -> CassandraTableGetResultsInner.fromJson(reader1)); deserializedCassandraTableListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCassandraTableListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraViewListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraViewListResult.java new file mode 100644 index 000000000000..5fd76faf730b --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraViewListResult.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.fluent.models.CassandraViewGetResultsInner; +import java.io.IOException; +import java.util.List; + +/** + * The List operation response, that contains the Cassandra views and their properties. + */ +@Immutable +public final class CassandraViewListResult implements JsonSerializable { + /* + * List of Cassandra views and their properties. + */ + private List value; + + /* + * The nextLink property. + */ + private String nextLink; + + /** + * Creates an instance of CassandraViewListResult class. + */ + private CassandraViewListResult() { + } + + /** + * Get the value property: List of Cassandra views and their properties. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CassandraViewListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CassandraViewListResult if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the CassandraViewListResult. + */ + public static CassandraViewListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CassandraViewListResult deserializedCassandraViewListResult = new CassandraViewListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> CassandraViewGetResultsInner.fromJson(reader1)); + deserializedCassandraViewListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCassandraViewListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCassandraViewListResult; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ChaosFaultListResponse.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ChaosFaultListResponse.java new file mode 100644 index 000000000000..e67adc0bd857 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ChaosFaultListResponse.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.fluent.models.ChaosFaultResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * Chaos Fault List Response. + */ +@Immutable +public final class ChaosFaultListResponse implements JsonSerializable { + /* + * The chaosFaultResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ChaosFaultListResponse class. + */ + private ChaosFaultListResponse() { + } + + /** + * Get the value property: The chaosFaultResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model ChaosFaultListResponse")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ChaosFaultListResponse.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ChaosFaultListResponse from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ChaosFaultListResponse if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ChaosFaultListResponse. + */ + public static ChaosFaultListResponse fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ChaosFaultListResponse deserializedChaosFaultListResponse = new ChaosFaultListResponse(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ChaosFaultResourceInner.fromJson(reader1)); + deserializedChaosFaultListResponse.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedChaosFaultListResponse.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedChaosFaultListResponse; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionKeysListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ClientEncryptionKeysListResult.java similarity index 81% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionKeysListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ClientEncryptionKeysListResult.java index 61a933ec3901..1a02f9bdb81c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionKeysListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ClientEncryptionKeysListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class ClientEncryptionKeysListResult implements JsonSerializable value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of ClientEncryptionKeysListResult class. */ - public ClientEncryptionKeysListResult() { + private ClientEncryptionKeysListResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -78,6 +93,8 @@ public static ClientEncryptionKeysListResult fromJson(JsonReader jsonReader) thr List value = reader.readArray(reader1 -> ClientEncryptionKeyGetResultsInner.fromJson(reader1)); deserializedClientEncryptionKeysListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedClientEncryptionKeysListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CopyJobFeedResults.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CopyJobFeedResults.java new file mode 100644 index 000000000000..aa461ac91554 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CopyJobFeedResults.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.fluent.models.CopyJobGetResultsInner; +import java.io.IOException; +import java.util.List; + +/** + * The List operation response, that contains the Copy Jobs and their properties. + */ +@Immutable +public final class CopyJobFeedResults implements JsonSerializable { + /* + * The CopyJobGetResults items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of CopyJobFeedResults class. + */ + private CopyJobFeedResults() { + } + + /** + * Get the value property: The CopyJobGetResults items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model CopyJobFeedResults")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CopyJobFeedResults.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CopyJobFeedResults from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CopyJobFeedResults if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CopyJobFeedResults. + */ + public static CopyJobFeedResults fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CopyJobFeedResults deserializedCopyJobFeedResults = new CopyJobFeedResults(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> CopyJobGetResultsInner.fromJson(reader1)); + deserializedCopyJobFeedResults.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedCopyJobFeedResults.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCopyJobFeedResults; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/DataTransferJobFeedResults.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/DataTransferJobFeedResults.java new file mode 100644 index 000000000000..5784da634f1f --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/DataTransferJobFeedResults.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.fluent.models.DataTransferJobGetResultsInner; +import java.io.IOException; +import java.util.List; + +/** + * The List operation response, that contains the Data Transfer jobs and their properties. + */ +@Immutable +public final class DataTransferJobFeedResults implements JsonSerializable { + /* + * The DataTransferJobGetResults items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of DataTransferJobFeedResults class. + */ + private DataTransferJobFeedResults() { + } + + /** + * Get the value property: The DataTransferJobGetResults items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model DataTransferJobFeedResults")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataTransferJobFeedResults.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataTransferJobFeedResults from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataTransferJobFeedResults if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataTransferJobFeedResults. + */ + public static DataTransferJobFeedResults fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataTransferJobFeedResults deserializedDataTransferJobFeedResults = new DataTransferJobFeedResults(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> DataTransferJobGetResultsInner.fromJson(reader1)); + deserializedDataTransferJobFeedResults.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDataTransferJobFeedResults.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDataTransferJobFeedResults; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountsListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/DatabaseAccountsListResult.java similarity index 81% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountsListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/DatabaseAccountsListResult.java index 81c2f0d38ca8..d5176b4d0ac5 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountsListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/DatabaseAccountsListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class DatabaseAccountsListResult implements JsonSerializable value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of DatabaseAccountsListResult class. */ - public DatabaseAccountsListResult() { + private DatabaseAccountsListResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -77,6 +92,8 @@ public static DatabaseAccountsListResult fromJson(JsonReader jsonReader) throws List value = reader.readArray(reader1 -> DatabaseAccountGetResultsInner.fromJson(reader1)); deserializedDatabaseAccountsListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedDatabaseAccountsListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/FleetAnalyticsListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/FleetAnalyticsListResult.java new file mode 100644 index 000000000000..d0393d87596d --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/FleetAnalyticsListResult.java @@ -0,0 +1,113 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.fluent.models.FleetAnalyticsResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a FleetAnalyticsResource list operation. + */ +@Immutable +public final class FleetAnalyticsListResult implements JsonSerializable { + /* + * The FleetAnalyticsResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of FleetAnalyticsListResult class. + */ + private FleetAnalyticsListResult() { + } + + /** + * Get the value property: The FleetAnalyticsResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model FleetAnalyticsListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(FleetAnalyticsListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of FleetAnalyticsListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of FleetAnalyticsListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the FleetAnalyticsListResult. + */ + public static FleetAnalyticsListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + FleetAnalyticsListResult deserializedFleetAnalyticsListResult = new FleetAnalyticsListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> FleetAnalyticsResourceInner.fromJson(reader1)); + deserializedFleetAnalyticsListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedFleetAnalyticsListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedFleetAnalyticsListResult; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/FleetListResult.java similarity index 72% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/FleetListResult.java index 8689e0f5085a..bc8e0ab93e2b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/FleetListResult.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,28 +15,28 @@ import java.util.List; /** - * The response of the List operation that contains the fleets and their properties. + * The response of a FleetResource list operation. */ @Immutable public final class FleetListResult implements JsonSerializable { /* - * List of fleets and their properties. + * The FleetResource items on this page */ private List value; /* - * The link used to get the next page of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of FleetListResult class. */ - public FleetListResult() { + private FleetListResult() { } /** - * Get the value property: List of fleets and their properties. + * Get the value property: The FleetResource items on this page. * * @return the value value. */ @@ -44,7 +45,7 @@ public List value() { } /** - * Get the nextLink property: The link used to get the next page of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -58,17 +59,24 @@ public String nextLink() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model FleetListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(FleetListResult.class); + /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -78,6 +86,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of FleetListResult if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the FleetListResult. */ public static FleetListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetspaceAccountListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/FleetspaceAccountListResult.java similarity index 72% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetspaceAccountListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/FleetspaceAccountListResult.java index 64aa2d35d168..e4a207324807 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetspaceAccountListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/FleetspaceAccountListResult.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,28 +15,28 @@ import java.util.List; /** - * The List operation response, that contains the global database accounts and their properties. + * The response of a FleetspaceAccountResource list operation. */ @Immutable public final class FleetspaceAccountListResult implements JsonSerializable { /* - * List of global database accounts in a fleetspace and their properties. + * The FleetspaceAccountResource items on this page */ private List value; /* - * The link used to get the next page of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of FleetspaceAccountListResult class. */ - public FleetspaceAccountListResult() { + private FleetspaceAccountListResult() { } /** - * Get the value property: List of global database accounts in a fleetspace and their properties. + * Get the value property: The FleetspaceAccountResource items on this page. * * @return the value value. */ @@ -44,7 +45,7 @@ public List value() { } /** - * Get the nextLink property: The link used to get the next page of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -58,17 +59,25 @@ public String nextLink() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model FleetspaceAccountListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(FleetspaceAccountListResult.class); + /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -78,6 +87,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of FleetspaceAccountListResult if the JsonReader was pointing to an instance of it, or null * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the FleetspaceAccountListResult. */ public static FleetspaceAccountListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetspaceListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/FleetspaceListResult.java similarity index 72% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetspaceListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/FleetspaceListResult.java index 6a1fa84c79a7..f3af0fa59047 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetspaceListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/FleetspaceListResult.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,28 +15,28 @@ import java.util.List; /** - * The response of the List operation that contains the fleetspaces and their properties. + * The response of a FleetspaceResource list operation. */ @Immutable public final class FleetspaceListResult implements JsonSerializable { /* - * List of fleetspaces and their properties. + * The FleetspaceResource items on this page */ private List value; /* - * The link used to get the next page of results. + * The link to the next page of items */ private String nextLink; /** * Creates an instance of FleetspaceListResult class. */ - public FleetspaceListResult() { + private FleetspaceListResult() { } /** - * Get the value property: List of fleetspaces and their properties. + * Get the value property: The FleetspaceResource items on this page. * * @return the value value. */ @@ -44,7 +45,7 @@ public List value() { } /** - * Get the nextLink property: The link used to get the next page of results. + * Get the nextLink property: The link to the next page of items. * * @return the nextLink value. */ @@ -58,17 +59,24 @@ public String nextLink() { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model FleetspaceListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(FleetspaceListResult.class); + /** * {@inheritDoc} */ @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -78,6 +86,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of FleetspaceListResult if the JsonReader was pointing to an instance of it, or null if it * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the FleetspaceListResult. */ public static FleetspaceListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GraphResourcesListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GraphResourcesListResult.java new file mode 100644 index 000000000000..ab33782f2004 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GraphResourcesListResult.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.fluent.models.GraphResourceGetResultsInner; +import java.io.IOException; +import java.util.List; + +/** + * The List operation response, that contains the Graph resource and their properties. + */ +@Immutable +public final class GraphResourcesListResult implements JsonSerializable { + /* + * List of Graph resource and their properties. + */ + private List value; + + /* + * The nextLink property. + */ + private String nextLink; + + /** + * Creates an instance of GraphResourcesListResult class. + */ + private GraphResourcesListResult() { + } + + /** + * Get the value property: List of Graph resource and their properties. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphResourcesListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphResourcesListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GraphResourcesListResult. + */ + public static GraphResourcesListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphResourcesListResult deserializedGraphResourcesListResult = new GraphResourcesListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> GraphResourceGetResultsInner.fromJson(reader1)); + deserializedGraphResourcesListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedGraphResourcesListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGraphResourcesListResult; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GremlinDatabaseListResult.java similarity index 81% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GremlinDatabaseListResult.java index 27312645bfbc..1e4189f7a00f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GremlinDatabaseListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class GremlinDatabaseListResult implements JsonSerializable value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of GremlinDatabaseListResult class. */ - public GremlinDatabaseListResult() { + private GremlinDatabaseListResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -77,6 +92,8 @@ public static GremlinDatabaseListResult fromJson(JsonReader jsonReader) throws I List value = reader.readArray(reader1 -> GremlinDatabaseGetResultsInner.fromJson(reader1)); deserializedGremlinDatabaseListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedGremlinDatabaseListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GremlinGraphListResult.java similarity index 81% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GremlinGraphListResult.java index a1e707ad7abd..7cd31583eecb 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GremlinGraphListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class GremlinGraphListResult implements JsonSerializable value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of GremlinGraphListResult class. */ - public GremlinGraphListResult() { + private GremlinGraphListResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -77,6 +92,8 @@ public static GremlinGraphListResult fromJson(JsonReader jsonReader) throws IOEx List value = reader.readArray(reader1 -> GremlinGraphGetResultsInner.fromJson(reader1)); deserializedGremlinGraphListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedGremlinGraphListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GremlinRoleAssignmentListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GremlinRoleAssignmentListResult.java new file mode 100644 index 000000000000..fda3c504c458 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GremlinRoleAssignmentListResult.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.fluent.models.GremlinRoleAssignmentResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a GremlinRoleAssignmentResource list operation. + */ +@Immutable +public final class GremlinRoleAssignmentListResult implements JsonSerializable { + /* + * The GremlinRoleAssignmentResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of GremlinRoleAssignmentListResult class. + */ + private GremlinRoleAssignmentListResult() { + } + + /** + * Get the value property: The GremlinRoleAssignmentResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model GremlinRoleAssignmentListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GremlinRoleAssignmentListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GremlinRoleAssignmentListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GremlinRoleAssignmentListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GremlinRoleAssignmentListResult. + */ + public static GremlinRoleAssignmentListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GremlinRoleAssignmentListResult deserializedGremlinRoleAssignmentListResult + = new GremlinRoleAssignmentListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> GremlinRoleAssignmentResourceInner.fromJson(reader1)); + deserializedGremlinRoleAssignmentListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedGremlinRoleAssignmentListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGremlinRoleAssignmentListResult; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GremlinRoleDefinitionListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GremlinRoleDefinitionListResult.java new file mode 100644 index 000000000000..6696472d5b14 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GremlinRoleDefinitionListResult.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.fluent.models.GremlinRoleDefinitionResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a GremlinRoleDefinitionResource list operation. + */ +@Immutable +public final class GremlinRoleDefinitionListResult implements JsonSerializable { + /* + * The GremlinRoleDefinitionResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of GremlinRoleDefinitionListResult class. + */ + private GremlinRoleDefinitionListResult() { + } + + /** + * Get the value property: The GremlinRoleDefinitionResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model GremlinRoleDefinitionListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GremlinRoleDefinitionListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GremlinRoleDefinitionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GremlinRoleDefinitionListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GremlinRoleDefinitionListResult. + */ + public static GremlinRoleDefinitionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GremlinRoleDefinitionListResult deserializedGremlinRoleDefinitionListResult + = new GremlinRoleDefinitionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> GremlinRoleDefinitionResourceInner.fromJson(reader1)); + deserializedGremlinRoleDefinitionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedGremlinRoleDefinitionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGremlinRoleDefinitionListResult; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListBackups.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListBackups.java new file mode 100644 index 000000000000..fee3bce83a92 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListBackups.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.fluent.models.BackupResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * List of restorable backups for a Cassandra cluster. + */ +@Immutable +public final class ListBackups implements JsonSerializable { + /* + * Container for array of backups. + */ + private List value; + + /* + * The nextLink property. + */ + private String nextLink; + + /** + * Creates an instance of ListBackups class. + */ + private ListBackups() { + } + + /** + * Get the value property: Container for array of backups. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListBackups from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListBackups if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ListBackups. + */ + public static ListBackups fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListBackups deserializedListBackups = new ListBackups(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> BackupResourceInner.fromJson(reader1)); + deserializedListBackups.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListBackups.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListBackups; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ListClusters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListClusters.java similarity index 80% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ListClusters.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListClusters.java index a72c23008c52..505fd0a1c0d5 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ListClusters.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListClusters.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,17 +16,22 @@ /** * List of managed Cassandra clusters. */ -@Fluent +@Immutable public final class ListClusters implements JsonSerializable { /* * Container for the array of clusters. */ private List value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of ListClusters class. */ - public ListClusters() { + private ListClusters() { } /** @@ -39,14 +44,12 @@ public List value() { } /** - * Set the value property: Container for the array of clusters. + * Get the nextLink property: The nextLink property. * - * @param value the value value to set. - * @return the ListClusters object itself. + * @return the nextLink value. */ - public ListClusters withValue(List value) { - this.value = value; - return this; + public String nextLink() { + return this.nextLink; } /** @@ -67,6 +70,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -89,6 +93,8 @@ public static ListClusters fromJson(JsonReader jsonReader) throws IOException { List value = reader.readArray(reader1 -> ClusterResourceInner.fromJson(reader1)); deserializedListClusters.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListClusters.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListCommands.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListCommands.java new file mode 100644 index 000000000000..cb569f52258e --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListCommands.java @@ -0,0 +1,105 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.fluent.models.CommandPublicResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * List of commands for cluster. + */ +@Immutable +public final class ListCommands implements JsonSerializable { + /* + * Container for array of commands. + */ + private List value; + + /* + * The nextLink property. + */ + private String nextLink; + + /** + * Creates an instance of ListCommands class. + */ + private ListCommands() { + } + + /** + * Get the value property: Container for array of commands. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListCommands from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListCommands if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ListCommands. + */ + public static ListCommands fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListCommands deserializedListCommands = new ListCommands(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> CommandPublicResourceInner.fromJson(reader1)); + deserializedListCommands.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListCommands.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListCommands; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ListDataCenters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListDataCenters.java similarity index 80% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ListDataCenters.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListDataCenters.java index c8922c82dba1..b101bfd7c0fe 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ListDataCenters.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListDataCenters.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class ListDataCenters implements JsonSerializable */ private List value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of ListDataCenters class. */ - public ListDataCenters() { + private ListDataCenters() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -77,6 +92,8 @@ public static ListDataCenters fromJson(JsonReader jsonReader) throws IOException List value = reader.readArray(reader1 -> DataCenterResourceInner.fromJson(reader1)); deserializedListDataCenters.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListDataCenters.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListGarnetClusters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListGarnetClusters.java new file mode 100644 index 000000000000..7e74f8753580 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListGarnetClusters.java @@ -0,0 +1,106 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.fluent.models.GarnetClusterResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * List of Garnet clusters. + */ +@Immutable +public final class ListGarnetClusters implements JsonSerializable { + /* + * Container for the array of clusters. + */ + private List value; + + /* + * The link used to get the next page of results. + */ + private String nextLink; + + /** + * Creates an instance of ListGarnetClusters class. + */ + private ListGarnetClusters() { + } + + /** + * Get the value property: Container for the array of clusters. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link used to get the next page of results. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() != null) { + value().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ListGarnetClusters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ListGarnetClusters if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ListGarnetClusters. + */ + public static ListGarnetClusters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ListGarnetClusters deserializedListGarnetClusters = new ListGarnetClusters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> GarnetClusterResourceInner.fromJson(reader1)); + deserializedListGarnetClusters.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedListGarnetClusters.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedListGarnetClusters; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/LocationListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/LocationListResult.java similarity index 81% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/LocationListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/LocationListResult.java index 2cb8bc2c9542..42988c1d3f83 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/LocationListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/LocationListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class LocationListResult implements JsonSerializable value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of LocationListResult class. */ - public LocationListResult() { + private LocationListResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -77,6 +92,8 @@ public static LocationListResult fromJson(JsonReader jsonReader) throws IOExcept List value = reader.readArray(reader1 -> LocationGetResultInner.fromJson(reader1)); deserializedLocationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedLocationListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MetricDefinitionsListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MetricDefinitionsListResult.java similarity index 81% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MetricDefinitionsListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MetricDefinitionsListResult.java index c4dc9e69d696..cbaa35c6e1c4 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MetricDefinitionsListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MetricDefinitionsListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class MetricDefinitionsListResult implements JsonSerializable value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of MetricDefinitionsListResult class. */ - public MetricDefinitionsListResult() { + private MetricDefinitionsListResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -77,6 +92,8 @@ public static MetricDefinitionsListResult fromJson(JsonReader jsonReader) throws List value = reader.readArray(reader1 -> MetricDefinitionInner.fromJson(reader1)); deserializedMetricDefinitionsListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMetricDefinitionsListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MetricListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MetricListResult.java similarity index 80% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MetricListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MetricListResult.java index 5bd0f03c394e..90fbe26d7c17 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MetricListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MetricListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class MetricListResult implements JsonSerializable value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of MetricListResult class. */ - public MetricListResult() { + private MetricListResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -76,6 +91,8 @@ public static MetricListResult fromJson(JsonReader jsonReader) throws IOExceptio if ("value".equals(fieldName)) { List value = reader.readArray(reader1 -> MetricInner.fromJson(reader1)); deserializedMetricListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMetricListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoDBCollectionListResult.java similarity index 81% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoDBCollectionListResult.java index 14702b31f80d..26a8815b5a28 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoDBCollectionListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class MongoDBCollectionListResult implements JsonSerializable value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of MongoDBCollectionListResult class. */ - public MongoDBCollectionListResult() { + private MongoDBCollectionListResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -77,6 +92,8 @@ public static MongoDBCollectionListResult fromJson(JsonReader jsonReader) throws List value = reader.readArray(reader1 -> MongoDBCollectionGetResultsInner.fromJson(reader1)); deserializedMongoDBCollectionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMongoDBCollectionListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoDBDatabaseListResult.java similarity index 81% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoDBDatabaseListResult.java index c11bc44d8448..e9c2453050d5 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoDBDatabaseListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class MongoDBDatabaseListResult implements JsonSerializable value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of MongoDBDatabaseListResult class. */ - public MongoDBDatabaseListResult() { + private MongoDBDatabaseListResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -77,6 +92,8 @@ public static MongoDBDatabaseListResult fromJson(JsonReader jsonReader) throws I List value = reader.readArray(reader1 -> MongoDBDatabaseGetResultsInner.fromJson(reader1)); deserializedMongoDBDatabaseListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMongoDBDatabaseListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoMIRoleAssignmentListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoMIRoleAssignmentListResult.java new file mode 100644 index 000000000000..665e9d9b1d08 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoMIRoleAssignmentListResult.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.fluent.models.MongoMIRoleAssignmentResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a MongoMIRoleAssignmentResource list operation. + */ +@Immutable +public final class MongoMIRoleAssignmentListResult implements JsonSerializable { + /* + * The MongoMIRoleAssignmentResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of MongoMIRoleAssignmentListResult class. + */ + private MongoMIRoleAssignmentListResult() { + } + + /** + * Get the value property: The MongoMIRoleAssignmentResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model MongoMIRoleAssignmentListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoMIRoleAssignmentListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoMIRoleAssignmentListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoMIRoleAssignmentListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MongoMIRoleAssignmentListResult. + */ + public static MongoMIRoleAssignmentListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoMIRoleAssignmentListResult deserializedMongoMIRoleAssignmentListResult + = new MongoMIRoleAssignmentListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> MongoMIRoleAssignmentResourceInner.fromJson(reader1)); + deserializedMongoMIRoleAssignmentListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMongoMIRoleAssignmentListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoMIRoleAssignmentListResult; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoMIRoleDefinitionListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoMIRoleDefinitionListResult.java new file mode 100644 index 000000000000..250950de9b40 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoMIRoleDefinitionListResult.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.fluent.models.MongoMIRoleDefinitionResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a MongoMIRoleDefinitionResource list operation. + */ +@Immutable +public final class MongoMIRoleDefinitionListResult implements JsonSerializable { + /* + * The MongoMIRoleDefinitionResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of MongoMIRoleDefinitionListResult class. + */ + private MongoMIRoleDefinitionListResult() { + } + + /** + * Get the value property: The MongoMIRoleDefinitionResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model MongoMIRoleDefinitionListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoMIRoleDefinitionListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoMIRoleDefinitionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoMIRoleDefinitionListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MongoMIRoleDefinitionListResult. + */ + public static MongoMIRoleDefinitionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoMIRoleDefinitionListResult deserializedMongoMIRoleDefinitionListResult + = new MongoMIRoleDefinitionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> MongoMIRoleDefinitionResourceInner.fromJson(reader1)); + deserializedMongoMIRoleDefinitionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMongoMIRoleDefinitionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoMIRoleDefinitionListResult; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRoleDefinitionListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoRoleDefinitionListResult.java similarity index 81% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRoleDefinitionListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoRoleDefinitionListResult.java index b8a6ba9fcb8a..ead8bdea25f3 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRoleDefinitionListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoRoleDefinitionListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class MongoRoleDefinitionListResult implements JsonSerializable value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of MongoRoleDefinitionListResult class. */ - public MongoRoleDefinitionListResult() { + private MongoRoleDefinitionListResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -78,6 +93,8 @@ public static MongoRoleDefinitionListResult fromJson(JsonReader jsonReader) thro List value = reader.readArray(reader1 -> MongoRoleDefinitionGetResultsInner.fromJson(reader1)); deserializedMongoRoleDefinitionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMongoRoleDefinitionListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoUserDefinitionListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoUserDefinitionListResult.java similarity index 81% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoUserDefinitionListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoUserDefinitionListResult.java index 65f11ba67758..38e68e21d388 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoUserDefinitionListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoUserDefinitionListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class MongoUserDefinitionListResult implements JsonSerializable value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of MongoUserDefinitionListResult class. */ - public MongoUserDefinitionListResult() { + private MongoUserDefinitionListResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -78,6 +93,8 @@ public static MongoUserDefinitionListResult fromJson(JsonReader jsonReader) thro List value = reader.readArray(reader1 -> MongoUserDefinitionGetResultsInner.fromJson(reader1)); deserializedMongoUserDefinitionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedMongoUserDefinitionListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/NetworkSecurityPerimeterConfigurationListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/NetworkSecurityPerimeterConfigurationListResult.java new file mode 100644 index 000000000000..7cb45c302535 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/NetworkSecurityPerimeterConfigurationListResult.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.fluent.models.NetworkSecurityPerimeterConfigurationInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a NetworkSecurityPerimeterConfiguration list operation. + */ +@Immutable +public final class NetworkSecurityPerimeterConfigurationListResult + implements JsonSerializable { + /* + * The NetworkSecurityPerimeterConfiguration items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of NetworkSecurityPerimeterConfigurationListResult class. + */ + private NetworkSecurityPerimeterConfigurationListResult() { + } + + /** + * Get the value property: The NetworkSecurityPerimeterConfiguration items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model NetworkSecurityPerimeterConfigurationListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NetworkSecurityPerimeterConfigurationListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityPerimeterConfigurationListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityPerimeterConfigurationListResult if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NetworkSecurityPerimeterConfigurationListResult. + */ + public static NetworkSecurityPerimeterConfigurationListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityPerimeterConfigurationListResult deserializedNetworkSecurityPerimeterConfigurationListResult + = new NetworkSecurityPerimeterConfigurationListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> NetworkSecurityPerimeterConfigurationInner.fromJson(reader1)); + deserializedNetworkSecurityPerimeterConfigurationListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityPerimeterConfigurationListResult; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NotebookWorkspaceListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/NotebookWorkspaceListResult.java similarity index 80% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NotebookWorkspaceListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/NotebookWorkspaceListResult.java index 31b8cebda8f7..9095000b7fee 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NotebookWorkspaceListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/NotebookWorkspaceListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,17 +16,22 @@ /** * A list of notebook workspace resources. */ -@Fluent +@Immutable public final class NotebookWorkspaceListResult implements JsonSerializable { /* * Array of notebook workspace resources */ private List value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of NotebookWorkspaceListResult class. */ - public NotebookWorkspaceListResult() { + private NotebookWorkspaceListResult() { } /** @@ -39,14 +44,12 @@ public List value() { } /** - * Set the value property: Array of notebook workspace resources. + * Get the nextLink property: The nextLink property. * - * @param value the value value to set. - * @return the NotebookWorkspaceListResult object itself. + * @return the nextLink value. */ - public NotebookWorkspaceListResult withValue(List value) { - this.value = value; - return this; + public String nextLink() { + return this.nextLink; } /** @@ -67,6 +70,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -89,6 +93,8 @@ public static NotebookWorkspaceListResult fromJson(JsonReader jsonReader) throws List value = reader.readArray(reader1 -> NotebookWorkspaceInner.fromJson(reader1)); deserializedNotebookWorkspaceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedNotebookWorkspaceListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/OperationListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/OperationListResult.java similarity index 78% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/OperationListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/OperationListResult.java index 35d37ad22733..331d61367cc5 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/OperationListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/OperationListResult.java @@ -1,10 +1,11 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -17,7 +18,7 @@ * Result of the request to list Resource Provider operations. It contains a list of operations and a URL link to get * the next set of results. */ -@Fluent +@Immutable public final class OperationListResult implements JsonSerializable { /* * List of operations supported by the Resource Provider. @@ -32,7 +33,7 @@ public final class OperationListResult implements JsonSerializable value() { return this.value; } - /** - * Set the value property: List of operations supported by the Resource Provider. - * - * @param value the value value to set. - * @return the OperationListResult object itself. - */ - public OperationListResult withValue(List value) { - this.value = value; - return this; - } - /** * Get the nextLink property: URL to get the next set of operation list results if there are any. * @@ -64,28 +54,22 @@ public String nextLink() { return this.nextLink; } - /** - * Set the nextLink property: URL to get the next set of operation list results if there are any. - * - * @param nextLink the nextLink value to set. - * @return the OperationListResult object itself. - */ - public OperationListResult withNextLink(String nextLink) { - this.nextLink = nextLink; - return this; - } - /** * Validates the instance. * * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { - if (value() != null) { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property value in model OperationListResult")); + } else { value().forEach(e -> e.validate()); } } + private static final ClientLogger LOGGER = new ClientLogger(OperationListResult.class); + /** * {@inheritDoc} */ @@ -103,6 +87,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of OperationListResult if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the OperationListResult. */ public static OperationListResult fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PartitionMetricListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/PartitionMetricListResult.java similarity index 81% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PartitionMetricListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/PartitionMetricListResult.java index f4249488e865..83ee24f24e44 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PartitionMetricListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/PartitionMetricListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class PartitionMetricListResult implements JsonSerializable value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of PartitionMetricListResult class. */ - public PartitionMetricListResult() { + private PartitionMetricListResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -77,6 +92,8 @@ public static PartitionMetricListResult fromJson(JsonReader jsonReader) throws I List value = reader.readArray(reader1 -> PartitionMetricInner.fromJson(reader1)); deserializedPartitionMetricListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPartitionMetricListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PartitionUsagesResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/PartitionUsagesResult.java similarity index 81% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PartitionUsagesResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/PartitionUsagesResult.java index bbf7f2701b61..1434ad6886b6 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PartitionUsagesResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/PartitionUsagesResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class PartitionUsagesResult implements JsonSerializable value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of PartitionUsagesResult class. */ - public PartitionUsagesResult() { + private PartitionUsagesResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -77,6 +92,8 @@ public static PartitionUsagesResult fromJson(JsonReader jsonReader) throws IOExc List value = reader.readArray(reader1 -> PartitionUsageInner.fromJson(reader1)); deserializedPartitionUsagesResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPartitionUsagesResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PercentileMetricListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/PercentileMetricListResult.java similarity index 81% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PercentileMetricListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/PercentileMetricListResult.java index e352bdf906d5..30352626f035 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PercentileMetricListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/PercentileMetricListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class PercentileMetricListResult implements JsonSerializable value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of PercentileMetricListResult class. */ - public PercentileMetricListResult() { + private PercentileMetricListResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -77,6 +92,8 @@ public static PercentileMetricListResult fromJson(JsonReader jsonReader) throws List value = reader.readArray(reader1 -> PercentileMetricInner.fromJson(reader1)); deserializedPercentileMetricListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPercentileMetricListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PrivateEndpointConnectionListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/PrivateEndpointConnectionListResult.java similarity index 81% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PrivateEndpointConnectionListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/PrivateEndpointConnectionListResult.java index 1d854a9916be..c9334dfbe803 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PrivateEndpointConnectionListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/PrivateEndpointConnectionListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * A list of private endpoint connections. */ -@Fluent +@Immutable public final class PrivateEndpointConnectionListResult implements JsonSerializable { /* @@ -24,10 +24,15 @@ public final class PrivateEndpointConnectionListResult */ private List value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of PrivateEndpointConnectionListResult class. */ - public PrivateEndpointConnectionListResult() { + private PrivateEndpointConnectionListResult() { } /** @@ -40,14 +45,12 @@ public List value() { } /** - * Set the value property: Array of private endpoint connections. + * Get the nextLink property: The nextLink property. * - * @param value the value value to set. - * @return the PrivateEndpointConnectionListResult object itself. + * @return the nextLink value. */ - public PrivateEndpointConnectionListResult withValue(List value) { - this.value = value; - return this; + public String nextLink() { + return this.nextLink; } /** @@ -68,6 +71,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -91,6 +95,8 @@ public static PrivateEndpointConnectionListResult fromJson(JsonReader jsonReader List value = reader.readArray(reader1 -> PrivateEndpointConnectionInner.fromJson(reader1)); deserializedPrivateEndpointConnectionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPrivateEndpointConnectionListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PrivateLinkResourceListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/PrivateLinkResourceListResult.java similarity index 81% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PrivateLinkResourceListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/PrivateLinkResourceListResult.java index 0b8f45cb042e..029f157e507b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PrivateLinkResourceListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/PrivateLinkResourceListResult.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -16,17 +16,22 @@ /** * A list of private link resources. */ -@Fluent +@Immutable public final class PrivateLinkResourceListResult implements JsonSerializable { /* * Array of private link resources */ private List value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of PrivateLinkResourceListResult class. */ - public PrivateLinkResourceListResult() { + private PrivateLinkResourceListResult() { } /** @@ -39,14 +44,12 @@ public List value() { } /** - * Set the value property: Array of private link resources. + * Get the nextLink property: The nextLink property. * - * @param value the value value to set. - * @return the PrivateLinkResourceListResult object itself. + * @return the nextLink value. */ - public PrivateLinkResourceListResult withValue(List value) { - this.value = value; - return this; + public String nextLink() { + return this.nextLink; } /** @@ -67,6 +70,7 @@ public void validate() { public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -90,6 +94,8 @@ public static PrivateLinkResourceListResult fromJson(JsonReader jsonReader) thro List value = reader.readArray(reader1 -> PrivateLinkResourceInner.fromJson(reader1)); deserializedPrivateLinkResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedPrivateLinkResourceListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableDatabaseAccountsListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableDatabaseAccountsListResult.java similarity index 82% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableDatabaseAccountsListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableDatabaseAccountsListResult.java index 42add7d442d6..03264cda80cc 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableDatabaseAccountsListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableDatabaseAccountsListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -24,10 +24,15 @@ public final class RestorableDatabaseAccountsListResult */ private List value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of RestorableDatabaseAccountsListResult class. */ - public RestorableDatabaseAccountsListResult() { + private RestorableDatabaseAccountsListResult() { } /** @@ -39,6 +44,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -56,6 +70,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -79,6 +94,8 @@ public static RestorableDatabaseAccountsListResult fromJson(JsonReader jsonReade List value = reader.readArray(reader1 -> RestorableDatabaseAccountGetResultInner.fromJson(reader1)); deserializedRestorableDatabaseAccountsListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRestorableDatabaseAccountsListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableGremlinDatabasesListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableGremlinDatabasesListResult.java similarity index 82% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableGremlinDatabasesListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableGremlinDatabasesListResult.java index f9a0d97136d9..efcd523ab68a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableGremlinDatabasesListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableGremlinDatabasesListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -24,10 +24,15 @@ public final class RestorableGremlinDatabasesListResult */ private List value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of RestorableGremlinDatabasesListResult class. */ - public RestorableGremlinDatabasesListResult() { + private RestorableGremlinDatabasesListResult() { } /** @@ -39,6 +44,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -56,6 +70,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -79,6 +94,8 @@ public static RestorableGremlinDatabasesListResult fromJson(JsonReader jsonReade List value = reader.readArray(reader1 -> RestorableGremlinDatabaseGetResultInner.fromJson(reader1)); deserializedRestorableGremlinDatabasesListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRestorableGremlinDatabasesListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableGremlinGraphsListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableGremlinGraphsListResult.java similarity index 82% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableGremlinGraphsListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableGremlinGraphsListResult.java index 599bae97a5c6..81d9d92b4012 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableGremlinGraphsListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableGremlinGraphsListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class RestorableGremlinGraphsListResult implements JsonSerializable */ private List value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of RestorableGremlinGraphsListResult class. */ - public RestorableGremlinGraphsListResult() { + private RestorableGremlinGraphsListResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -78,6 +93,8 @@ public static RestorableGremlinGraphsListResult fromJson(JsonReader jsonReader) List value = reader.readArray(reader1 -> RestorableGremlinGraphGetResultInner.fromJson(reader1)); deserializedRestorableGremlinGraphsListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRestorableGremlinGraphsListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableGremlinResourcesListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableGremlinResourcesListResult.java similarity index 82% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableGremlinResourcesListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableGremlinResourcesListResult.java index 9ac648810d1b..a84baf52d443 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableGremlinResourcesListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableGremlinResourcesListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -24,10 +24,15 @@ public final class RestorableGremlinResourcesListResult */ private List value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of RestorableGremlinResourcesListResult class. */ - public RestorableGremlinResourcesListResult() { + private RestorableGremlinResourcesListResult() { } /** @@ -39,6 +44,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -56,6 +70,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -79,6 +94,8 @@ public static RestorableGremlinResourcesListResult fromJson(JsonReader jsonReade List value = reader.readArray(reader1 -> RestorableGremlinResourcesGetResultInner.fromJson(reader1)); deserializedRestorableGremlinResourcesListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRestorableGremlinResourcesListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableMongodbCollectionsListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableMongodbCollectionsListResult.java similarity index 82% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableMongodbCollectionsListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableMongodbCollectionsListResult.java index b7818ffd815f..4a115d44f4d6 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableMongodbCollectionsListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableMongodbCollectionsListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -24,10 +24,15 @@ public final class RestorableMongodbCollectionsListResult */ private List value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of RestorableMongodbCollectionsListResult class. */ - public RestorableMongodbCollectionsListResult() { + private RestorableMongodbCollectionsListResult() { } /** @@ -39,6 +44,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -56,6 +70,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -79,6 +94,8 @@ public static RestorableMongodbCollectionsListResult fromJson(JsonReader jsonRea List value = reader.readArray(reader1 -> RestorableMongodbCollectionGetResultInner.fromJson(reader1)); deserializedRestorableMongodbCollectionsListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRestorableMongodbCollectionsListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableMongodbDatabasesListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableMongodbDatabasesListResult.java similarity index 82% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableMongodbDatabasesListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableMongodbDatabasesListResult.java index 7fdcbc839d32..b350fae0503e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableMongodbDatabasesListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableMongodbDatabasesListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -24,10 +24,15 @@ public final class RestorableMongodbDatabasesListResult */ private List value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of RestorableMongodbDatabasesListResult class. */ - public RestorableMongodbDatabasesListResult() { + private RestorableMongodbDatabasesListResult() { } /** @@ -39,6 +44,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -56,6 +70,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -79,6 +94,8 @@ public static RestorableMongodbDatabasesListResult fromJson(JsonReader jsonReade List value = reader.readArray(reader1 -> RestorableMongodbDatabaseGetResultInner.fromJson(reader1)); deserializedRestorableMongodbDatabasesListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRestorableMongodbDatabasesListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableMongodbResourcesListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableMongodbResourcesListResult.java similarity index 82% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableMongodbResourcesListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableMongodbResourcesListResult.java index b8371be9e402..0b3b64c1f88d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableMongodbResourcesListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableMongodbResourcesListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -24,10 +24,15 @@ public final class RestorableMongodbResourcesListResult */ private List value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of RestorableMongodbResourcesListResult class. */ - public RestorableMongodbResourcesListResult() { + private RestorableMongodbResourcesListResult() { } /** @@ -39,6 +44,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -56,6 +70,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -79,6 +94,8 @@ public static RestorableMongodbResourcesListResult fromJson(JsonReader jsonReade List value = reader.readArray(reader1 -> RestorableMongodbResourcesGetResultInner.fromJson(reader1)); deserializedRestorableMongodbResourcesListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRestorableMongodbResourcesListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlContainersListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableSqlContainersListResult.java similarity index 82% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlContainersListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableSqlContainersListResult.java index a0e8303c9b61..b25be1d510b5 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlContainersListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableSqlContainersListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class RestorableSqlContainersListResult implements JsonSerializable */ private List value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of RestorableSqlContainersListResult class. */ - public RestorableSqlContainersListResult() { + private RestorableSqlContainersListResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -78,6 +93,8 @@ public static RestorableSqlContainersListResult fromJson(JsonReader jsonReader) List value = reader.readArray(reader1 -> RestorableSqlContainerGetResultInner.fromJson(reader1)); deserializedRestorableSqlContainersListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRestorableSqlContainersListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlDatabasesListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableSqlDatabasesListResult.java similarity index 81% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlDatabasesListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableSqlDatabasesListResult.java index 3bc1a0c306c5..13f858706759 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlDatabasesListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableSqlDatabasesListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class RestorableSqlDatabasesListResult implements JsonSerializable< */ private List value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of RestorableSqlDatabasesListResult class. */ - public RestorableSqlDatabasesListResult() { + private RestorableSqlDatabasesListResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -78,6 +93,8 @@ public static RestorableSqlDatabasesListResult fromJson(JsonReader jsonReader) t List value = reader.readArray(reader1 -> RestorableSqlDatabaseGetResultInner.fromJson(reader1)); deserializedRestorableSqlDatabasesListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRestorableSqlDatabasesListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlResourcesListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableSqlResourcesListResult.java similarity index 82% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlResourcesListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableSqlResourcesListResult.java index 46a0b13fdbfb..902428c8f96b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlResourcesListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableSqlResourcesListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class RestorableSqlResourcesListResult implements JsonSerializable< */ private List value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of RestorableSqlResourcesListResult class. */ - public RestorableSqlResourcesListResult() { + private RestorableSqlResourcesListResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -78,6 +93,8 @@ public static RestorableSqlResourcesListResult fromJson(JsonReader jsonReader) t List value = reader.readArray(reader1 -> RestorableSqlResourcesGetResultInner.fromJson(reader1)); deserializedRestorableSqlResourcesListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRestorableSqlResourcesListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableTableResourcesListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableTableResourcesListResult.java similarity index 81% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableTableResourcesListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableTableResourcesListResult.java index 4e7e72ef333f..159a34ae85d5 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableTableResourcesListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableTableResourcesListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class RestorableTableResourcesListResult implements JsonSerializabl */ private List value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of RestorableTableResourcesListResult class. */ - public RestorableTableResourcesListResult() { + private RestorableTableResourcesListResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -78,6 +93,8 @@ public static RestorableTableResourcesListResult fromJson(JsonReader jsonReader) List value = reader.readArray(reader1 -> RestorableTableResourcesGetResultInner.fromJson(reader1)); deserializedRestorableTableResourcesListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRestorableTableResourcesListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableTablesListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableTablesListResult.java similarity index 81% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableTablesListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableTablesListResult.java index f311ebb3db18..670719ba8f81 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableTablesListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableTablesListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class RestorableTablesListResult implements JsonSerializable value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of RestorableTablesListResult class. */ - public RestorableTablesListResult() { + private RestorableTablesListResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -77,6 +92,8 @@ public static RestorableTablesListResult fromJson(JsonReader jsonReader) throws List value = reader.readArray(reader1 -> RestorableTableGetResultInner.fromJson(reader1)); deserializedRestorableTablesListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedRestorableTablesListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServiceResourceListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ServiceResourceListResult.java similarity index 81% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServiceResourceListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ServiceResourceListResult.java index 6ba2bd226d7b..fbca0968a819 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServiceResourceListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ServiceResourceListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class ServiceResourceListResult implements JsonSerializable value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of ServiceResourceListResult class. */ - public ServiceResourceListResult() { + private ServiceResourceListResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -77,6 +92,8 @@ public static ServiceResourceListResult fromJson(JsonReader jsonReader) throws I List value = reader.readArray(reader1 -> ServiceResourceInner.fromJson(reader1)); deserializedServiceResourceListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedServiceResourceListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlContainerListResult.java similarity index 81% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlContainerListResult.java index ae6b58a372fe..b232f80832b0 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlContainerListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class SqlContainerListResult implements JsonSerializable value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of SqlContainerListResult class. */ - public SqlContainerListResult() { + private SqlContainerListResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -77,6 +92,8 @@ public static SqlContainerListResult fromJson(JsonReader jsonReader) throws IOEx List value = reader.readArray(reader1 -> SqlContainerGetResultsInner.fromJson(reader1)); deserializedSqlContainerListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSqlContainerListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlDatabaseListResult.java similarity index 81% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlDatabaseListResult.java index 2eebdf2f6240..41385fbe4cf6 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlDatabaseListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class SqlDatabaseListResult implements JsonSerializable value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of SqlDatabaseListResult class. */ - public SqlDatabaseListResult() { + private SqlDatabaseListResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -77,6 +92,8 @@ public static SqlDatabaseListResult fromJson(JsonReader jsonReader) throws IOExc List value = reader.readArray(reader1 -> SqlDatabaseGetResultsInner.fromJson(reader1)); deserializedSqlDatabaseListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSqlDatabaseListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlRoleAssignmentListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlRoleAssignmentListResult.java similarity index 81% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlRoleAssignmentListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlRoleAssignmentListResult.java index 2ac8d297f5ef..e5d5975544e5 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlRoleAssignmentListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlRoleAssignmentListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class SqlRoleAssignmentListResult implements JsonSerializable value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of SqlRoleAssignmentListResult class. */ - public SqlRoleAssignmentListResult() { + private SqlRoleAssignmentListResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -77,6 +92,8 @@ public static SqlRoleAssignmentListResult fromJson(JsonReader jsonReader) throws List value = reader.readArray(reader1 -> SqlRoleAssignmentGetResultsInner.fromJson(reader1)); deserializedSqlRoleAssignmentListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSqlRoleAssignmentListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlRoleDefinitionListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlRoleDefinitionListResult.java similarity index 81% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlRoleDefinitionListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlRoleDefinitionListResult.java index 74552362ef61..a4bac9f2ed1a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlRoleDefinitionListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlRoleDefinitionListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class SqlRoleDefinitionListResult implements JsonSerializable value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of SqlRoleDefinitionListResult class. */ - public SqlRoleDefinitionListResult() { + private SqlRoleDefinitionListResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -77,6 +92,8 @@ public static SqlRoleDefinitionListResult fromJson(JsonReader jsonReader) throws List value = reader.readArray(reader1 -> SqlRoleDefinitionGetResultsInner.fromJson(reader1)); deserializedSqlRoleDefinitionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSqlRoleDefinitionListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlStoredProcedureListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlStoredProcedureListResult.java similarity index 81% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlStoredProcedureListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlStoredProcedureListResult.java index 3af0a5143642..6b2a86ad79f7 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlStoredProcedureListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlStoredProcedureListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class SqlStoredProcedureListResult implements JsonSerializable value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of SqlStoredProcedureListResult class. */ - public SqlStoredProcedureListResult() { + private SqlStoredProcedureListResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -77,6 +92,8 @@ public static SqlStoredProcedureListResult fromJson(JsonReader jsonReader) throw List value = reader.readArray(reader1 -> SqlStoredProcedureGetResultsInner.fromJson(reader1)); deserializedSqlStoredProcedureListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSqlStoredProcedureListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlTriggerListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlTriggerListResult.java similarity index 81% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlTriggerListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlTriggerListResult.java index 1ddce30d1895..14272c508a18 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlTriggerListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlTriggerListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class SqlTriggerListResult implements JsonSerializable value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of SqlTriggerListResult class. */ - public SqlTriggerListResult() { + private SqlTriggerListResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -77,6 +92,8 @@ public static SqlTriggerListResult fromJson(JsonReader jsonReader) throws IOExce List value = reader.readArray(reader1 -> SqlTriggerGetResultsInner.fromJson(reader1)); deserializedSqlTriggerListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSqlTriggerListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlUserDefinedFunctionListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlUserDefinedFunctionListResult.java similarity index 82% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlUserDefinedFunctionListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlUserDefinedFunctionListResult.java index 8a5a36cb1960..7bd04d138e65 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlUserDefinedFunctionListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlUserDefinedFunctionListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class SqlUserDefinedFunctionListResult implements JsonSerializable< */ private List value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of SqlUserDefinedFunctionListResult class. */ - public SqlUserDefinedFunctionListResult() { + private SqlUserDefinedFunctionListResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -78,6 +93,8 @@ public static SqlUserDefinedFunctionListResult fromJson(JsonReader jsonReader) t List value = reader.readArray(reader1 -> SqlUserDefinedFunctionGetResultsInner.fromJson(reader1)); deserializedSqlUserDefinedFunctionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedSqlUserDefinedFunctionListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/TableListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/TableListResult.java similarity index 80% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/TableListResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/TableListResult.java index 7b179445fa3f..d70aea0a4a03 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/TableListResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/TableListResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class TableListResult implements JsonSerializable */ private List value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of TableListResult class. */ - public TableListResult() { + private TableListResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -77,6 +92,8 @@ public static TableListResult fromJson(JsonReader jsonReader) throws IOException List value = reader.readArray(reader1 -> TableGetResultsInner.fromJson(reader1)); deserializedTableListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedTableListResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/TableRoleAssignmentListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/TableRoleAssignmentListResult.java new file mode 100644 index 000000000000..26bf2bff6e6c --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/TableRoleAssignmentListResult.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.fluent.models.TableRoleAssignmentResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a TableRoleAssignmentResource list operation. + */ +@Immutable +public final class TableRoleAssignmentListResult implements JsonSerializable { + /* + * The TableRoleAssignmentResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of TableRoleAssignmentListResult class. + */ + private TableRoleAssignmentListResult() { + } + + /** + * Get the value property: The TableRoleAssignmentResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model TableRoleAssignmentListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TableRoleAssignmentListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TableRoleAssignmentListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TableRoleAssignmentListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TableRoleAssignmentListResult. + */ + public static TableRoleAssignmentListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TableRoleAssignmentListResult deserializedTableRoleAssignmentListResult + = new TableRoleAssignmentListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> TableRoleAssignmentResourceInner.fromJson(reader1)); + deserializedTableRoleAssignmentListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedTableRoleAssignmentListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTableRoleAssignmentListResult; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/TableRoleDefinitionListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/TableRoleDefinitionListResult.java new file mode 100644 index 000000000000..dae0c1e38ed3 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/TableRoleDefinitionListResult.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.fluent.models.TableRoleDefinitionResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a TableRoleDefinitionResource list operation. + */ +@Immutable +public final class TableRoleDefinitionListResult implements JsonSerializable { + /* + * The TableRoleDefinitionResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of TableRoleDefinitionListResult class. + */ + private TableRoleDefinitionListResult() { + } + + /** + * Get the value property: The TableRoleDefinitionResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model TableRoleDefinitionListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(TableRoleDefinitionListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of TableRoleDefinitionListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of TableRoleDefinitionListResult if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the TableRoleDefinitionListResult. + */ + public static TableRoleDefinitionListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + TableRoleDefinitionListResult deserializedTableRoleDefinitionListResult + = new TableRoleDefinitionListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> TableRoleDefinitionResourceInner.fromJson(reader1)); + deserializedTableRoleDefinitionListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedTableRoleDefinitionListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedTableRoleDefinitionListResult; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ThroughputPoolAccountsListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ThroughputPoolAccountsListResult.java new file mode 100644 index 000000000000..84952d2cca32 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ThroughputPoolAccountsListResult.java @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.fluent.models.ThroughputPoolAccountResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a ThroughputPoolAccountResource list operation. + */ +@Immutable +public final class ThroughputPoolAccountsListResult implements JsonSerializable { + /* + * The ThroughputPoolAccountResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ThroughputPoolAccountsListResult class. + */ + private ThroughputPoolAccountsListResult() { + } + + /** + * Get the value property: The ThroughputPoolAccountResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property value in model ThroughputPoolAccountsListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ThroughputPoolAccountsListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ThroughputPoolAccountsListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThroughputPoolAccountsListResult if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ThroughputPoolAccountsListResult. + */ + public static ThroughputPoolAccountsListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThroughputPoolAccountsListResult deserializedThroughputPoolAccountsListResult + = new ThroughputPoolAccountsListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ThroughputPoolAccountResourceInner.fromJson(reader1)); + deserializedThroughputPoolAccountsListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedThroughputPoolAccountsListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedThroughputPoolAccountsListResult; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ThroughputPoolsListResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ThroughputPoolsListResult.java new file mode 100644 index 000000000000..043496e9b893 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ThroughputPoolsListResult.java @@ -0,0 +1,114 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.implementation.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.fluent.models.ThroughputPoolResourceInner; +import java.io.IOException; +import java.util.List; + +/** + * The response of a ThroughputPoolResource list operation. + */ +@Immutable +public final class ThroughputPoolsListResult implements JsonSerializable { + /* + * The ThroughputPoolResource items on this page + */ + private List value; + + /* + * The link to the next page of items + */ + private String nextLink; + + /** + * Creates an instance of ThroughputPoolsListResult class. + */ + private ThroughputPoolsListResult() { + } + + /** + * Get the value property: The ThroughputPoolResource items on this page. + * + * @return the value value. + */ + public List value() { + return this.value; + } + + /** + * Get the nextLink property: The link to the next page of items. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (value() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property value in model ThroughputPoolsListResult")); + } else { + value().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(ThroughputPoolsListResult.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("value", this.value, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("nextLink", this.nextLink); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ThroughputPoolsListResult from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThroughputPoolsListResult if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ThroughputPoolsListResult. + */ + public static ThroughputPoolsListResult fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThroughputPoolsListResult deserializedThroughputPoolsListResult = new ThroughputPoolsListResult(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("value".equals(fieldName)) { + List value + = reader.readArray(reader1 -> ThroughputPoolResourceInner.fromJson(reader1)); + deserializedThroughputPoolsListResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedThroughputPoolsListResult.nextLink = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedThroughputPoolsListResult; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/UsagesResult.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/UsagesResult.java similarity index 80% rename from sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/UsagesResult.java rename to sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/UsagesResult.java index 54b5ad212852..49e093ac3dbc 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/UsagesResult.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/implementation/models/UsagesResult.java @@ -1,8 +1,8 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. -package com.azure.resourcemanager.cosmos.models; +package com.azure.resourcemanager.cosmos.implementation.models; import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; @@ -23,10 +23,15 @@ public final class UsagesResult implements JsonSerializable { */ private List value; + /* + * The nextLink property. + */ + private String nextLink; + /** * Creates an instance of UsagesResult class. */ - public UsagesResult() { + private UsagesResult() { } /** @@ -38,6 +43,15 @@ public List value() { return this.value; } + /** + * Get the nextLink property: The nextLink property. + * + * @return the nextLink value. + */ + public String nextLink() { + return this.nextLink; + } + /** * Validates the instance. * @@ -55,6 +69,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("nextLink", this.nextLink); return jsonWriter.writeEndObject(); } @@ -76,6 +91,8 @@ public static UsagesResult fromJson(JsonReader jsonReader) throws IOException { if ("value".equals(fieldName)) { List value = reader.readArray(reader1 -> UsageInner.fromJson(reader1)); deserializedUsagesResult.value = value; + } else if ("nextLink".equals(fieldName)) { + deserializedUsagesResult.nextLink = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccessRule.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccessRule.java new file mode 100644 index 000000000000..5eb2f430ccc6 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccessRule.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Access rule in a network security perimeter configuration profile. + */ +@Immutable +public final class AccessRule implements JsonSerializable { + /* + * Name of the access rule + */ + private String name; + + /* + * The properties property. + */ + private AccessRuleProperties properties; + + /** + * Creates an instance of AccessRule class. + */ + private AccessRule() { + } + + /** + * Get the name property: Name of the access rule. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the properties property: The properties property. + * + * @return the properties value. + */ + public AccessRuleProperties properties() { + return this.properties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessRule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessRule if the JsonReader was pointing to an instance of it, or null if it was pointing + * to JSON null. + * @throws IOException If an error occurs while reading the AccessRule. + */ + public static AccessRule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessRule deserializedAccessRule = new AccessRule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedAccessRule.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedAccessRule.properties = AccessRuleProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedAccessRule; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccessRuleDirection.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccessRuleDirection.java new file mode 100644 index 000000000000..15592950f906 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccessRuleDirection.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Direction of Access Rule. + */ +public final class AccessRuleDirection extends ExpandableStringEnum { + /** + * Applies to inbound network traffic to the secured resources. + */ + public static final AccessRuleDirection INBOUND = fromString("Inbound"); + + /** + * Applies to outbound network traffic from the secured resources. + */ + public static final AccessRuleDirection OUTBOUND = fromString("Outbound"); + + /** + * Creates a new instance of AccessRuleDirection value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AccessRuleDirection() { + } + + /** + * Creates or finds a AccessRuleDirection from its string representation. + * + * @param name a name to look for. + * @return the corresponding AccessRuleDirection. + */ + public static AccessRuleDirection fromString(String name) { + return fromString(name, AccessRuleDirection.class); + } + + /** + * Gets known AccessRuleDirection values. + * + * @return known AccessRuleDirection values. + */ + public static Collection values() { + return values(AccessRuleDirection.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccessRuleProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccessRuleProperties.java new file mode 100644 index 000000000000..a31e9cd14985 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccessRuleProperties.java @@ -0,0 +1,203 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Properties of Access Rule. + */ +@Immutable +public final class AccessRuleProperties implements JsonSerializable { + /* + * The direction property. + */ + private AccessRuleDirection direction; + + /* + * Address prefixes in the CIDR format for inbound rules + */ + private List addressPrefixes; + + /* + * Subscriptions for inbound rules + */ + private List subscriptions; + + /* + * Network security perimeters for inbound rules + */ + private List networkSecurityPerimeters; + + /* + * Fully qualified domain names (FQDN) for outbound rules + */ + private List fullyQualifiedDomainNames; + + /* + * Email addresses for outbound rules + */ + private List emailAddresses; + + /* + * Phone numbers for outbound rules + */ + private List phoneNumbers; + + /** + * Creates an instance of AccessRuleProperties class. + */ + private AccessRuleProperties() { + } + + /** + * Get the direction property: The direction property. + * + * @return the direction value. + */ + public AccessRuleDirection direction() { + return this.direction; + } + + /** + * Get the addressPrefixes property: Address prefixes in the CIDR format for inbound rules. + * + * @return the addressPrefixes value. + */ + public List addressPrefixes() { + return this.addressPrefixes; + } + + /** + * Get the subscriptions property: Subscriptions for inbound rules. + * + * @return the subscriptions value. + */ + public List subscriptions() { + return this.subscriptions; + } + + /** + * Get the networkSecurityPerimeters property: Network security perimeters for inbound rules. + * + * @return the networkSecurityPerimeters value. + */ + public List networkSecurityPerimeters() { + return this.networkSecurityPerimeters; + } + + /** + * Get the fullyQualifiedDomainNames property: Fully qualified domain names (FQDN) for outbound rules. + * + * @return the fullyQualifiedDomainNames value. + */ + public List fullyQualifiedDomainNames() { + return this.fullyQualifiedDomainNames; + } + + /** + * Get the emailAddresses property: Email addresses for outbound rules. + * + * @return the emailAddresses value. + */ + public List emailAddresses() { + return this.emailAddresses; + } + + /** + * Get the phoneNumbers property: Phone numbers for outbound rules. + * + * @return the phoneNumbers value. + */ + public List phoneNumbers() { + return this.phoneNumbers; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (subscriptions() != null) { + subscriptions().forEach(e -> e.validate()); + } + if (networkSecurityPerimeters() != null) { + networkSecurityPerimeters().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("direction", this.direction == null ? null : this.direction.toString()); + jsonWriter.writeArrayField("addressPrefixes", this.addressPrefixes, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("subscriptions", this.subscriptions, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("networkSecurityPerimeters", this.networkSecurityPerimeters, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("fullyQualifiedDomainNames", this.fullyQualifiedDomainNames, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("emailAddresses", this.emailAddresses, + (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("phoneNumbers", this.phoneNumbers, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessRuleProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessRuleProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccessRuleProperties. + */ + public static AccessRuleProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessRuleProperties deserializedAccessRuleProperties = new AccessRuleProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("direction".equals(fieldName)) { + deserializedAccessRuleProperties.direction = AccessRuleDirection.fromString(reader.getString()); + } else if ("addressPrefixes".equals(fieldName)) { + List addressPrefixes = reader.readArray(reader1 -> reader1.getString()); + deserializedAccessRuleProperties.addressPrefixes = addressPrefixes; + } else if ("subscriptions".equals(fieldName)) { + List subscriptions + = reader.readArray(reader1 -> AccessRulePropertiesSubscription.fromJson(reader1)); + deserializedAccessRuleProperties.subscriptions = subscriptions; + } else if ("networkSecurityPerimeters".equals(fieldName)) { + List networkSecurityPerimeters + = reader.readArray(reader1 -> NetworkSecurityPerimeter.fromJson(reader1)); + deserializedAccessRuleProperties.networkSecurityPerimeters = networkSecurityPerimeters; + } else if ("fullyQualifiedDomainNames".equals(fieldName)) { + List fullyQualifiedDomainNames = reader.readArray(reader1 -> reader1.getString()); + deserializedAccessRuleProperties.fullyQualifiedDomainNames = fullyQualifiedDomainNames; + } else if ("emailAddresses".equals(fieldName)) { + List emailAddresses = reader.readArray(reader1 -> reader1.getString()); + deserializedAccessRuleProperties.emailAddresses = emailAddresses; + } else if ("phoneNumbers".equals(fieldName)) { + List phoneNumbers = reader.readArray(reader1 -> reader1.getString()); + deserializedAccessRuleProperties.phoneNumbers = phoneNumbers; + } else { + reader.skipChildren(); + } + } + + return deserializedAccessRuleProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccessRulePropertiesSubscription.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccessRulePropertiesSubscription.java new file mode 100644 index 000000000000..5ffd7cc565c6 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccessRulePropertiesSubscription.java @@ -0,0 +1,85 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The AccessRulePropertiesSubscription model. + */ +@Immutable +public final class AccessRulePropertiesSubscription implements JsonSerializable { + /* + * The fully qualified Azure resource ID of the subscription e.g. + * ('/subscriptions/00000000-0000-0000-0000-000000000000') + */ + private String id; + + /** + * Creates an instance of AccessRulePropertiesSubscription class. + */ + private AccessRulePropertiesSubscription() { + } + + /** + * Get the id property: The fully qualified Azure resource ID of the subscription e.g. + * ('/subscriptions/00000000-0000-0000-0000-000000000000'). + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AccessRulePropertiesSubscription from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AccessRulePropertiesSubscription if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the AccessRulePropertiesSubscription. + */ + public static AccessRulePropertiesSubscription fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AccessRulePropertiesSubscription deserializedAccessRulePropertiesSubscription + = new AccessRulePropertiesSubscription(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedAccessRulePropertiesSubscription.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAccessRulePropertiesSubscription; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccountKeyMetadata.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccountKeyMetadata.java index 452e0ba7dc94..38a52b7234f9 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccountKeyMetadata.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AccountKeyMetadata.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -27,7 +27,7 @@ public final class AccountKeyMetadata implements JsonSerializable { + /** + * Active implies the virtual machines of the cluster are allocated. + */ + public static final AllocationState ACTIVE = fromString("Active"); + + /** + * Deallocated implies virtual machines and resources are deallocated. + */ + public static final AllocationState DEALLOCATED = fromString("Deallocated"); + + /** + * Creates a new instance of AllocationState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AllocationState() { + } + + /** + * Creates or finds a AllocationState from its string representation. + * + * @param name a name to look for. + * @return the corresponding AllocationState. + */ + public static AllocationState fromString(String name) { + return fromString(name, AllocationState.class); + } + + /** + * Gets known AllocationState values. + * + * @return known AllocationState values. + */ + public static Collection values() { + return values(AllocationState.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AnalyticalStorageConfiguration.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AnalyticalStorageConfiguration.java index 9409179960b3..4a27d6faad9a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AnalyticalStorageConfiguration.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AnalyticalStorageConfiguration.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AnalyticalStorageSchemaType.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AnalyticalStorageSchemaType.java index bd600abf3fb6..ba5883b2a96e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AnalyticalStorageSchemaType.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AnalyticalStorageSchemaType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ApiProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ApiProperties.java index 268e9f277634..2a008a2a8a84 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ApiProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ApiProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ApiType.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ApiType.java index 05871de95b3d..fb4cf0e9f206 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ApiType.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ApiType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ArmProxyResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ArmProxyResource.java index 2b493bff706b..a4f6c909e2f0 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ArmProxyResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ArmProxyResource.java @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; import com.azure.core.annotation.Immutable; -import com.azure.core.management.ProxyResource; import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; @@ -16,21 +16,21 @@ * tags. */ @Immutable -public class ArmProxyResource extends ProxyResource { +public class ArmProxyResource implements JsonSerializable { /* - * The type of the resource. + * The unique resource identifier of the database account. */ - private String type; + private String id; /* - * The name of the resource. + * The name of the database account. */ private String name; /* - * Fully qualified resource Id for the resource. + * The type of Azure resource. */ - private String id; + private String type; /** * Creates an instance of ArmProxyResource class. @@ -39,33 +39,63 @@ public ArmProxyResource() { } /** - * Get the type property: The type of the resource. + * Get the id property: The unique resource identifier of the database account. * - * @return the type value. + * @return the id value. */ - @Override - public String type() { - return this.type; + public String id() { + return this.id; + } + + /** + * Set the id property: The unique resource identifier of the database account. + * + * @param id the id value to set. + * @return the ArmProxyResource object itself. + */ + ArmProxyResource withId(String id) { + this.id = id; + return this; } /** - * Get the name property: The name of the resource. + * Get the name property: The name of the database account. * * @return the name value. */ - @Override public String name() { return this.name; } /** - * Get the id property: Fully qualified resource Id for the resource. + * Set the name property: The name of the database account. * - * @return the id value. + * @param name the name value to set. + * @return the ArmProxyResource object itself. */ - @Override - public String id() { - return this.id; + ArmProxyResource withName(String name) { + this.name = name; + return this; + } + + /** + * Get the type property: The type of Azure resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of Azure resource. + * + * @param type the type value to set. + * @return the ArmProxyResource object itself. + */ + ArmProxyResource withType(String type) { + this.type = type; + return this; } /** @@ -91,7 +121,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ArmProxyResource if the JsonReader was pointing to an instance of it, or null if it was * pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the ArmProxyResource. */ public static ArmProxyResource fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ArmResourceProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ArmResourceProperties.java index 1f2365bfd06f..c0e8b9c02c0f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ArmResourceProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ArmResourceProperties.java @@ -1,12 +1,12 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; import com.azure.core.annotation.Fluent; -import com.azure.core.management.Resource; import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; @@ -16,21 +16,40 @@ * The core properties of ARM resources. */ @Fluent -public class ArmResourceProperties extends Resource { +public class ArmResourceProperties implements JsonSerializable { /* - * The type of the resource. + * The unique resource identifier of the ARM resource. */ - private String type; + private String id; /* - * The name of the resource. + * The name of the ARM resource. */ private String name; /* - * Fully qualified resource Id for the resource. + * The type of Azure resource. */ - private String id; + private String type; + + /* + * The location of the resource group to which the resource belongs. + */ + private String location; + + /* + * Tags are a list of key-value pairs that describe the resource. These tags can be used in viewing and grouping + * this resource (across resource groups). A maximum of 15 tags can be provided for a resource. Each tag must have a + * key no greater than 128 characters and value no greater than 256 characters. For example, the default experience + * for a template type is set with "defaultExperience": "Cassandra". Current "defaultExperience" values also include + * "Table", "Graph", "DocumentDB", and "MongoDB". + */ + private Map tags; + + /* + * Identity for the resource. + */ + private ManagedServiceIdentity identity; /** * Creates an instance of ArmResourceProperties class. @@ -39,50 +58,130 @@ public ArmResourceProperties() { } /** - * Get the type property: The type of the resource. + * Get the id property: The unique resource identifier of the ARM resource. * - * @return the type value. + * @return the id value. */ - @Override - public String type() { - return this.type; + public String id() { + return this.id; } /** - * Get the name property: The name of the resource. + * Set the id property: The unique resource identifier of the ARM resource. + * + * @param id the id value to set. + * @return the ArmResourceProperties object itself. + */ + ArmResourceProperties withId(String id) { + this.id = id; + return this; + } + + /** + * Get the name property: The name of the ARM resource. * * @return the name value. */ - @Override public String name() { return this.name; } /** - * Get the id property: Fully qualified resource Id for the resource. + * Set the name property: The name of the ARM resource. * - * @return the id value. + * @param name the name value to set. + * @return the ArmResourceProperties object itself. */ - @Override - public String id() { - return this.id; + ArmResourceProperties withName(String name) { + this.name = name; + return this; } /** - * {@inheritDoc} + * Get the type property: The type of Azure resource. + * + * @return the type value. + */ + public String type() { + return this.type; + } + + /** + * Set the type property: The type of Azure resource. + * + * @param type the type value to set. + * @return the ArmResourceProperties object itself. + */ + ArmResourceProperties withType(String type) { + this.type = type; + return this; + } + + /** + * Get the location property: The location of the resource group to which the resource belongs. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Set the location property: The location of the resource group to which the resource belongs. + * + * @param location the location value to set. + * @return the ArmResourceProperties object itself. */ - @Override public ArmResourceProperties withLocation(String location) { - super.withLocation(location); + this.location = location; return this; } /** - * {@inheritDoc} + * Get the tags property: Tags are a list of key-value pairs that describe the resource. These tags can be used in + * viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. + * Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, + * the default experience for a template type is set with "defaultExperience": "Cassandra". Current + * "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". + * + * @return the tags value. + */ + public Map tags() { + return this.tags; + } + + /** + * Set the tags property: Tags are a list of key-value pairs that describe the resource. These tags can be used in + * viewing and grouping this resource (across resource groups). A maximum of 15 tags can be provided for a resource. + * Each tag must have a key no greater than 128 characters and value no greater than 256 characters. For example, + * the default experience for a template type is set with "defaultExperience": "Cassandra". Current + * "defaultExperience" values also include "Table", "Graph", "DocumentDB", and "MongoDB". + * + * @param tags the tags value to set. + * @return the ArmResourceProperties object itself. */ - @Override public ArmResourceProperties withTags(Map tags) { - super.withTags(tags); + this.tags = tags; + return this; + } + + /** + * Get the identity property: Identity for the resource. + * + * @return the identity value. + */ + public ManagedServiceIdentity identity() { + return this.identity; + } + + /** + * Set the identity property: Identity for the resource. + * + * @param identity the identity value to set. + * @return the ArmResourceProperties object itself. + */ + public ArmResourceProperties withIdentity(ManagedServiceIdentity identity) { + this.identity = identity; return this; } @@ -92,6 +191,9 @@ public ArmResourceProperties withTags(Map tags) { * @throws IllegalArgumentException thrown if the instance is not valid. */ public void validate() { + if (identity() != null) { + identity().validate(); + } } /** @@ -100,8 +202,9 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("location", location()); - jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeStringField("location", this.location); + jsonWriter.writeMapField("tags", this.tags, (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", this.identity); return jsonWriter.writeEndObject(); } @@ -111,7 +214,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of ArmResourceProperties if the JsonReader was pointing to an instance of it, or null if it * was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the ArmResourceProperties. */ public static ArmResourceProperties fromJson(JsonReader jsonReader) throws IOException { @@ -128,10 +230,12 @@ public static ArmResourceProperties fromJson(JsonReader jsonReader) throws IOExc } else if ("type".equals(fieldName)) { deserializedArmResourceProperties.type = reader.getString(); } else if ("location".equals(fieldName)) { - deserializedArmResourceProperties.withLocation(reader.getString()); + deserializedArmResourceProperties.location = reader.getString(); } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); - deserializedArmResourceProperties.withTags(tags); + deserializedArmResourceProperties.tags = tags; + } else if ("identity".equals(fieldName)) { + deserializedArmResourceProperties.identity = ManagedServiceIdentity.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AuthenticationMethod.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AuthenticationMethod.java index 2b1c9c96c9eb..73661ee393be 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AuthenticationMethod.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AuthenticationMethod.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AuthenticationMethodLdapProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AuthenticationMethodLdapProperties.java index 03e80aa64bca..01373ce2d005 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AuthenticationMethodLdapProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AuthenticationMethodLdapProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AutoReplicate.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AutoReplicate.java new file mode 100644 index 000000000000..8af315e34ff0 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AutoReplicate.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The form of AutoReplicate that is being used by this cluster. + */ +public final class AutoReplicate extends ExpandableStringEnum { + /** + * Static value None for AutoReplicate. + */ + public static final AutoReplicate NONE = fromString("None"); + + /** + * Static value SystemKeyspaces for AutoReplicate. + */ + public static final AutoReplicate SYSTEM_KEYSPACES = fromString("SystemKeyspaces"); + + /** + * Static value AllKeyspaces for AutoReplicate. + */ + public static final AutoReplicate ALL_KEYSPACES = fromString("AllKeyspaces"); + + /** + * Creates a new instance of AutoReplicate value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public AutoReplicate() { + } + + /** + * Creates or finds a AutoReplicate from its string representation. + * + * @param name a name to look for. + * @return the corresponding AutoReplicate. + */ + public static AutoReplicate fromString(String name) { + return fromString(name, AutoReplicate.class); + } + + /** + * Gets known AutoReplicate values. + * + * @return known AutoReplicate values. + */ + public static Collection values() { + return values(AutoReplicate.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AutoUpgradePolicyResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AutoUpgradePolicyResource.java index a9321526f61c..f35fa1e2479f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AutoUpgradePolicyResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AutoUpgradePolicyResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AutoscaleSettings.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AutoscaleSettings.java index d9a6d0d77082..68a36f4616f9 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AutoscaleSettings.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AutoscaleSettings.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AutoscaleSettingsResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AutoscaleSettingsResource.java index e23f3c3e4464..72721d2b8a7e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AutoscaleSettingsResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AutoscaleSettingsResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AzureBlobContainer.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AzureBlobContainer.java new file mode 100644 index 000000000000..d3e3c667140a --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AzureBlobContainer.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An Azure Blob container. + */ +@Fluent +public final class AzureBlobContainer implements JsonSerializable { + /* + * Azure Blob container. + */ + private String containerName; + + /** + * Creates an instance of AzureBlobContainer class. + */ + public AzureBlobContainer() { + } + + /** + * Get the containerName property: Azure Blob container. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: Azure Blob container. + * + * @param containerName the containerName value to set. + * @return the AzureBlobContainer object itself. + */ + public AzureBlobContainer withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (containerName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property containerName in model AzureBlobContainer")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AzureBlobContainer.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("containerName", this.containerName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureBlobContainer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureBlobContainer if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AzureBlobContainer. + */ + public static AzureBlobContainer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureBlobContainer deserializedAzureBlobContainer = new AzureBlobContainer(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("containerName".equals(fieldName)) { + deserializedAzureBlobContainer.containerName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureBlobContainer; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AzureBlobDataTransferDataSourceSink.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AzureBlobDataTransferDataSourceSink.java new file mode 100644 index 000000000000..7f3f43209307 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AzureBlobDataTransferDataSourceSink.java @@ -0,0 +1,150 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An Azure Blob Storage data source/sink. + */ +@Fluent +public final class AzureBlobDataTransferDataSourceSink extends DataTransferDataSourceSink { + /* + * The component property. + */ + private DataTransferComponent component = DataTransferComponent.AZURE_BLOB_STORAGE; + + /* + * The containerName property. + */ + private String containerName; + + /* + * The endpointUrl property. + */ + private String endpointUrl; + + /** + * Creates an instance of AzureBlobDataTransferDataSourceSink class. + */ + public AzureBlobDataTransferDataSourceSink() { + } + + /** + * Get the component property: The component property. + * + * @return the component value. + */ + @Override + public DataTransferComponent component() { + return this.component; + } + + /** + * Get the containerName property: The containerName property. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: The containerName property. + * + * @param containerName the containerName value to set. + * @return the AzureBlobDataTransferDataSourceSink object itself. + */ + public AzureBlobDataTransferDataSourceSink withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Get the endpointUrl property: The endpointUrl property. + * + * @return the endpointUrl value. + */ + public String endpointUrl() { + return this.endpointUrl; + } + + /** + * Set the endpointUrl property: The endpointUrl property. + * + * @param endpointUrl the endpointUrl value to set. + * @return the AzureBlobDataTransferDataSourceSink object itself. + */ + public AzureBlobDataTransferDataSourceSink withEndpointUrl(String endpointUrl) { + this.endpointUrl = endpointUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (containerName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property containerName in model AzureBlobDataTransferDataSourceSink")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AzureBlobDataTransferDataSourceSink.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("containerName", this.containerName); + jsonWriter.writeStringField("component", this.component == null ? null : this.component.toString()); + jsonWriter.writeStringField("endpointUrl", this.endpointUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureBlobDataTransferDataSourceSink from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureBlobDataTransferDataSourceSink if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AzureBlobDataTransferDataSourceSink. + */ + public static AzureBlobDataTransferDataSourceSink fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureBlobDataTransferDataSourceSink deserializedAzureBlobDataTransferDataSourceSink + = new AzureBlobDataTransferDataSourceSink(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("containerName".equals(fieldName)) { + deserializedAzureBlobDataTransferDataSourceSink.containerName = reader.getString(); + } else if ("component".equals(fieldName)) { + deserializedAzureBlobDataTransferDataSourceSink.component + = DataTransferComponent.fromString(reader.getString()); + } else if ("endpointUrl".equals(fieldName)) { + deserializedAzureBlobDataTransferDataSourceSink.endpointUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureBlobDataTransferDataSourceSink; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AzureBlobSourceSinkDetails.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AzureBlobSourceSinkDetails.java new file mode 100644 index 000000000000..9df9584ff996 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AzureBlobSourceSinkDetails.java @@ -0,0 +1,102 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * An Azure Blob Storage data source/sink. + */ +@Fluent +public final class AzureBlobSourceSinkDetails implements JsonSerializable { + /* + * Azure Blob container endpoint. + */ + private String endpointUrl; + + /** + * Creates an instance of AzureBlobSourceSinkDetails class. + */ + public AzureBlobSourceSinkDetails() { + } + + /** + * Get the endpointUrl property: Azure Blob container endpoint. + * + * @return the endpointUrl value. + */ + public String endpointUrl() { + return this.endpointUrl; + } + + /** + * Set the endpointUrl property: Azure Blob container endpoint. + * + * @param endpointUrl the endpointUrl value to set. + * @return the AzureBlobSourceSinkDetails object itself. + */ + public AzureBlobSourceSinkDetails withEndpointUrl(String endpointUrl) { + this.endpointUrl = endpointUrl; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (endpointUrl() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property endpointUrl in model AzureBlobSourceSinkDetails")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(AzureBlobSourceSinkDetails.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("endpointUrl", this.endpointUrl); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of AzureBlobSourceSinkDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of AzureBlobSourceSinkDetails if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the AzureBlobSourceSinkDetails. + */ + public static AzureBlobSourceSinkDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + AzureBlobSourceSinkDetails deserializedAzureBlobSourceSinkDetails = new AzureBlobSourceSinkDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("endpointUrl".equals(fieldName)) { + deserializedAzureBlobSourceSinkDetails.endpointUrl = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedAzureBlobSourceSinkDetails; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AzureConnectionType.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AzureConnectionType.java index 08c7cad95973..54848794005e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AzureConnectionType.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/AzureConnectionType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BackupPolicy.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BackupPolicy.java index fd055cd68dd7..6864a6076500 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BackupPolicy.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BackupPolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BackupPolicyMigrationState.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BackupPolicyMigrationState.java index c75b79f0fbfc..6378ec891165 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BackupPolicyMigrationState.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BackupPolicyMigrationState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BackupPolicyMigrationStatus.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BackupPolicyMigrationStatus.java index 2c47abcfaafe..d4599d7917b9 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BackupPolicyMigrationStatus.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BackupPolicyMigrationStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BackupPolicyType.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BackupPolicyType.java index d21f09bbeca2..46cbf77cb4e8 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BackupPolicyType.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BackupPolicyType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BackupSchedule.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BackupSchedule.java new file mode 100644 index 000000000000..7846bed13846 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BackupSchedule.java @@ -0,0 +1,151 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The BackupSchedule model. + */ +@Fluent +public final class BackupSchedule implements JsonSerializable { + /* + * The unique identifier of backup schedule. + */ + private String scheduleName; + + /* + * The cron expression that defines when you want to back up your data. + */ + private String cronExpression; + + /* + * The retention period (hours) of the backups. If you want to retain data forever, set retention to 0. + */ + private Integer retentionInHours; + + /** + * Creates an instance of BackupSchedule class. + */ + public BackupSchedule() { + } + + /** + * Get the scheduleName property: The unique identifier of backup schedule. + * + * @return the scheduleName value. + */ + public String scheduleName() { + return this.scheduleName; + } + + /** + * Set the scheduleName property: The unique identifier of backup schedule. + * + * @param scheduleName the scheduleName value to set. + * @return the BackupSchedule object itself. + */ + public BackupSchedule withScheduleName(String scheduleName) { + this.scheduleName = scheduleName; + return this; + } + + /** + * Get the cronExpression property: The cron expression that defines when you want to back up your data. + * + * @return the cronExpression value. + */ + public String cronExpression() { + return this.cronExpression; + } + + /** + * Set the cronExpression property: The cron expression that defines when you want to back up your data. + * + * @param cronExpression the cronExpression value to set. + * @return the BackupSchedule object itself. + */ + public BackupSchedule withCronExpression(String cronExpression) { + this.cronExpression = cronExpression; + return this; + } + + /** + * Get the retentionInHours property: The retention period (hours) of the backups. If you want to retain data + * forever, set retention to 0. + * + * @return the retentionInHours value. + */ + public Integer retentionInHours() { + return this.retentionInHours; + } + + /** + * Set the retentionInHours property: The retention period (hours) of the backups. If you want to retain data + * forever, set retention to 0. + * + * @param retentionInHours the retentionInHours value to set. + * @return the BackupSchedule object itself. + */ + public BackupSchedule withRetentionInHours(Integer retentionInHours) { + this.retentionInHours = retentionInHours; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("scheduleName", this.scheduleName); + jsonWriter.writeStringField("cronExpression", this.cronExpression); + jsonWriter.writeNumberField("retentionInHours", this.retentionInHours); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BackupSchedule from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BackupSchedule if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BackupSchedule. + */ + public static BackupSchedule fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BackupSchedule deserializedBackupSchedule = new BackupSchedule(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("scheduleName".equals(fieldName)) { + deserializedBackupSchedule.scheduleName = reader.getString(); + } else if ("cronExpression".equals(fieldName)) { + deserializedBackupSchedule.cronExpression = reader.getString(); + } else if ("retentionInHours".equals(fieldName)) { + deserializedBackupSchedule.retentionInHours = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedBackupSchedule; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BackupState.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BackupState.java new file mode 100644 index 000000000000..3a3ec4e66dfd --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BackupState.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The current state of the backup. + */ +public final class BackupState extends ExpandableStringEnum { + /** + * Static value Initiated for BackupState. + */ + public static final BackupState INITIATED = fromString("Initiated"); + + /** + * Static value InProgress for BackupState. + */ + public static final BackupState IN_PROGRESS = fromString("InProgress"); + + /** + * Static value Succeeded for BackupState. + */ + public static final BackupState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Failed for BackupState. + */ + public static final BackupState FAILED = fromString("Failed"); + + /** + * Creates a new instance of BackupState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public BackupState() { + } + + /** + * Creates or finds a BackupState from its string representation. + * + * @param name a name to look for. + * @return the corresponding BackupState. + */ + public static BackupState fromString(String name) { + return fromString(name, BackupState.class); + } + + /** + * Gets known BackupState values. + * + * @return known BackupState values. + */ + public static Collection values() { + return values(BackupState.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BackupStorageRedundancy.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BackupStorageRedundancy.java index d05a24fa18db..d7fa4a2f9388 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BackupStorageRedundancy.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BackupStorageRedundancy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BaseCopyJobProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BaseCopyJobProperties.java new file mode 100644 index 000000000000..c119d4862a91 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BaseCopyJobProperties.java @@ -0,0 +1,117 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Base copy job properties. + */ +@Immutable +public class BaseCopyJobProperties implements JsonSerializable { + /* + * Copy Job Type + */ + private CopyJobType jobType = CopyJobType.fromString("BaseCopyJobProperties"); + + /** + * Creates an instance of BaseCopyJobProperties class. + */ + public BaseCopyJobProperties() { + } + + /** + * Get the jobType property: Copy Job Type. + * + * @return the jobType value. + */ + public CopyJobType jobType() { + return this.jobType; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("jobType", this.jobType == null ? null : this.jobType.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BaseCopyJobProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BaseCopyJobProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the BaseCopyJobProperties. + */ + public static BaseCopyJobProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("jobType".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("CassandraRUToCassandraRU".equals(discriminatorValue)) { + return CassandraRUToCassandraRUCopyJobProperties.fromJson(readerToUse.reset()); + } else if ("AzureBlobStorageToCassandraRU".equals(discriminatorValue)) { + return BlobToCassandraRUCopyJobProperties.fromJson(readerToUse.reset()); + } else if ("CassandraRUToAzureBlobStorage".equals(discriminatorValue)) { + return CassandraRUToBlobCopyJobProperties.fromJson(readerToUse.reset()); + } else if ("MongoRUToMongoRU".equals(discriminatorValue)) { + return MongoRUToMongoRUCopyJobProperties.fromJson(readerToUse.reset()); + } else if ("MongoRUToMongoVCore".equals(discriminatorValue)) { + return MongoRUToMongoVCoreCopyJobProperties.fromJson(readerToUse.reset()); + } else if ("NoSqlRUToNoSqlRU".equals(discriminatorValue)) { + return NoSqlRUToNoSqlRUCopyJobProperties.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static BaseCopyJobProperties fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BaseCopyJobProperties deserializedBaseCopyJobProperties = new BaseCopyJobProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobType".equals(fieldName)) { + deserializedBaseCopyJobProperties.jobType = CopyJobType.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedBaseCopyJobProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BaseCopyJobTask.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BaseCopyJobTask.java new file mode 100644 index 000000000000..0725a801e25a --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BaseCopyJobTask.java @@ -0,0 +1,119 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties of a Copy Job Task. + */ +@Immutable +public class BaseCopyJobTask implements JsonSerializable { + /* + * Task level Total Count. + */ + private Long totalCount; + + /* + * Task level Processed Count. + */ + private Long processedCount; + + /** + * Creates an instance of BaseCopyJobTask class. + */ + public BaseCopyJobTask() { + } + + /** + * Get the totalCount property: Task level Total Count. + * + * @return the totalCount value. + */ + public Long totalCount() { + return this.totalCount; + } + + /** + * Set the totalCount property: Task level Total Count. + * + * @param totalCount the totalCount value to set. + * @return the BaseCopyJobTask object itself. + */ + BaseCopyJobTask withTotalCount(Long totalCount) { + this.totalCount = totalCount; + return this; + } + + /** + * Get the processedCount property: Task level Processed Count. + * + * @return the processedCount value. + */ + public Long processedCount() { + return this.processedCount; + } + + /** + * Set the processedCount property: Task level Processed Count. + * + * @param processedCount the processedCount value to set. + * @return the BaseCopyJobTask object itself. + */ + BaseCopyJobTask withProcessedCount(Long processedCount) { + this.processedCount = processedCount; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BaseCopyJobTask from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BaseCopyJobTask if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the BaseCopyJobTask. + */ + public static BaseCopyJobTask fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BaseCopyJobTask deserializedBaseCopyJobTask = new BaseCopyJobTask(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("totalCount".equals(fieldName)) { + deserializedBaseCopyJobTask.totalCount = reader.getNullable(JsonReader::getLong); + } else if ("processedCount".equals(fieldName)) { + deserializedBaseCopyJobTask.processedCount = reader.getNullable(JsonReader::getLong); + } else { + reader.skipChildren(); + } + } + + return deserializedBaseCopyJobTask; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BlobToCassandraRUCopyJobProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BlobToCassandraRUCopyJobProperties.java new file mode 100644 index 000000000000..66ea84405135 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BlobToCassandraRUCopyJobProperties.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Source Azure Blob Storage to Destination Cassandra copy job properties. + */ +@Fluent +public final class BlobToCassandraRUCopyJobProperties extends BaseCopyJobProperties { + /* + * Copy Job Type + */ + private CopyJobType jobType = CopyJobType.AZURE_BLOB_STORAGE_TO_CASSANDRA_RU; + + /* + * Azure Storage container DataStore details + */ + private AzureBlobSourceSinkDetails sourceDetails; + + /* + * Destination Cassandra DataStore details + */ + private CosmosDBSourceSinkDetails destinationDetails; + + /* + * Copy Job tasks. + */ + private List tasks; + + /** + * Creates an instance of BlobToCassandraRUCopyJobProperties class. + */ + public BlobToCassandraRUCopyJobProperties() { + } + + /** + * Get the jobType property: Copy Job Type. + * + * @return the jobType value. + */ + @Override + public CopyJobType jobType() { + return this.jobType; + } + + /** + * Get the sourceDetails property: Azure Storage container DataStore details. + * + * @return the sourceDetails value. + */ + public AzureBlobSourceSinkDetails sourceDetails() { + return this.sourceDetails; + } + + /** + * Set the sourceDetails property: Azure Storage container DataStore details. + * + * @param sourceDetails the sourceDetails value to set. + * @return the BlobToCassandraRUCopyJobProperties object itself. + */ + public BlobToCassandraRUCopyJobProperties withSourceDetails(AzureBlobSourceSinkDetails sourceDetails) { + this.sourceDetails = sourceDetails; + return this; + } + + /** + * Get the destinationDetails property: Destination Cassandra DataStore details. + * + * @return the destinationDetails value. + */ + public CosmosDBSourceSinkDetails destinationDetails() { + return this.destinationDetails; + } + + /** + * Set the destinationDetails property: Destination Cassandra DataStore details. + * + * @param destinationDetails the destinationDetails value to set. + * @return the BlobToCassandraRUCopyJobProperties object itself. + */ + public BlobToCassandraRUCopyJobProperties withDestinationDetails(CosmosDBSourceSinkDetails destinationDetails) { + this.destinationDetails = destinationDetails; + return this; + } + + /** + * Get the tasks property: Copy Job tasks. + * + * @return the tasks value. + */ + public List tasks() { + return this.tasks; + } + + /** + * Set the tasks property: Copy Job tasks. + * + * @param tasks the tasks value to set. + * @return the BlobToCassandraRUCopyJobProperties object itself. + */ + public BlobToCassandraRUCopyJobProperties withTasks(List tasks) { + this.tasks = tasks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (sourceDetails() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sourceDetails in model BlobToCassandraRUCopyJobProperties")); + } else { + sourceDetails().validate(); + } + if (destinationDetails() != null) { + destinationDetails().validate(); + } + if (tasks() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property tasks in model BlobToCassandraRUCopyJobProperties")); + } else { + tasks().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BlobToCassandraRUCopyJobProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("sourceDetails", this.sourceDetails); + jsonWriter.writeArrayField("tasks", this.tasks, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("jobType", this.jobType == null ? null : this.jobType.toString()); + jsonWriter.writeJsonField("destinationDetails", this.destinationDetails); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobToCassandraRUCopyJobProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobToCassandraRUCopyJobProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BlobToCassandraRUCopyJobProperties. + */ + public static BlobToCassandraRUCopyJobProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobToCassandraRUCopyJobProperties deserializedBlobToCassandraRUCopyJobProperties + = new BlobToCassandraRUCopyJobProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceDetails".equals(fieldName)) { + deserializedBlobToCassandraRUCopyJobProperties.sourceDetails + = AzureBlobSourceSinkDetails.fromJson(reader); + } else if ("tasks".equals(fieldName)) { + List tasks + = reader.readArray(reader1 -> BlobToCassandraRUCopyJobTask.fromJson(reader1)); + deserializedBlobToCassandraRUCopyJobProperties.tasks = tasks; + } else if ("jobType".equals(fieldName)) { + deserializedBlobToCassandraRUCopyJobProperties.jobType = CopyJobType.fromString(reader.getString()); + } else if ("destinationDetails".equals(fieldName)) { + deserializedBlobToCassandraRUCopyJobProperties.destinationDetails + = CosmosDBSourceSinkDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBlobToCassandraRUCopyJobProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BlobToCassandraRUCopyJobTask.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BlobToCassandraRUCopyJobTask.java new file mode 100644 index 000000000000..fe69adf7e156 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/BlobToCassandraRUCopyJobTask.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The BlobToCassandraRUCopyJobTask model. + */ +@Fluent +public final class BlobToCassandraRUCopyJobTask extends BaseCopyJobTask { + /* + * Source Azure Blob container + */ + private AzureBlobContainer source; + + /* + * Destination Cassandra table + */ + private CosmosDBCassandraTable destination; + + /* + * Task level Processed Count. + */ + private Long processedCount; + + /* + * Task level Total Count. + */ + private Long totalCount; + + /** + * Creates an instance of BlobToCassandraRUCopyJobTask class. + */ + public BlobToCassandraRUCopyJobTask() { + } + + /** + * Get the source property: Source Azure Blob container. + * + * @return the source value. + */ + public AzureBlobContainer source() { + return this.source; + } + + /** + * Set the source property: Source Azure Blob container. + * + * @param source the source value to set. + * @return the BlobToCassandraRUCopyJobTask object itself. + */ + public BlobToCassandraRUCopyJobTask withSource(AzureBlobContainer source) { + this.source = source; + return this; + } + + /** + * Get the destination property: Destination Cassandra table. + * + * @return the destination value. + */ + public CosmosDBCassandraTable destination() { + return this.destination; + } + + /** + * Set the destination property: Destination Cassandra table. + * + * @param destination the destination value to set. + * @return the BlobToCassandraRUCopyJobTask object itself. + */ + public BlobToCassandraRUCopyJobTask withDestination(CosmosDBCassandraTable destination) { + this.destination = destination; + return this; + } + + /** + * Get the processedCount property: Task level Processed Count. + * + * @return the processedCount value. + */ + @Override + public Long processedCount() { + return this.processedCount; + } + + /** + * Get the totalCount property: Task level Total Count. + * + * @return the totalCount value. + */ + @Override + public Long totalCount() { + return this.totalCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (source() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property source in model BlobToCassandraRUCopyJobTask")); + } else { + source().validate(); + } + if (destination() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property destination in model BlobToCassandraRUCopyJobTask")); + } else { + destination().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(BlobToCassandraRUCopyJobTask.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("source", this.source); + jsonWriter.writeJsonField("destination", this.destination); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of BlobToCassandraRUCopyJobTask from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of BlobToCassandraRUCopyJobTask if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the BlobToCassandraRUCopyJobTask. + */ + public static BlobToCassandraRUCopyJobTask fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + BlobToCassandraRUCopyJobTask deserializedBlobToCassandraRUCopyJobTask = new BlobToCassandraRUCopyJobTask(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("totalCount".equals(fieldName)) { + deserializedBlobToCassandraRUCopyJobTask.totalCount = reader.getNullable(JsonReader::getLong); + } else if ("processedCount".equals(fieldName)) { + deserializedBlobToCassandraRUCopyJobTask.processedCount = reader.getNullable(JsonReader::getLong); + } else if ("source".equals(fieldName)) { + deserializedBlobToCassandraRUCopyJobTask.source = AzureBlobContainer.fromJson(reader); + } else if ("destination".equals(fieldName)) { + deserializedBlobToCassandraRUCopyJobTask.destination = CosmosDBCassandraTable.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedBlobToCassandraRUCopyJobTask; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Capability.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Capability.java index d6421d16a433..78f20a9f1351 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Capability.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Capability.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Capacity.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Capacity.java index c3d7f82e68c9..ccd8b64962c3 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Capacity.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Capacity.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CapacityMode.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CapacityMode.java new file mode 100644 index 000000000000..8320a12b24d1 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CapacityMode.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Indicates the capacity mode of the account. + */ +public final class CapacityMode extends ExpandableStringEnum { + /** + * Static value None for CapacityMode. + */ + public static final CapacityMode NONE = fromString("None"); + + /** + * Static value Provisioned for CapacityMode. + */ + public static final CapacityMode PROVISIONED = fromString("Provisioned"); + + /** + * Static value Serverless for CapacityMode. + */ + public static final CapacityMode SERVERLESS = fromString("Serverless"); + + /** + * Creates a new instance of CapacityMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CapacityMode() { + } + + /** + * Creates or finds a CapacityMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding CapacityMode. + */ + public static CapacityMode fromString(String name) { + return fromString(name, CapacityMode.class); + } + + /** + * Gets known CapacityMode values. + * + * @return known CapacityMode values. + */ + public static Collection values() { + return values(CapacityMode.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CapacityModeChangeTransitionState.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CapacityModeChangeTransitionState.java new file mode 100644 index 000000000000..858a2eab6ea3 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CapacityModeChangeTransitionState.java @@ -0,0 +1,214 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.CoreUtils; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * The transition state information related capacity mode change with update request. + */ +@Fluent +public final class CapacityModeChangeTransitionState implements JsonSerializable { + /* + * The transition status of capacity mode. + */ + private CapacityModeTransitionStatus capacityModeTransitionStatus; + + /* + * Indicates the current capacity mode of the account. + */ + private CapacityMode currentCapacityMode; + + /* + * Indicates the previous capacity mode of the account before successful transition. + */ + private CapacityMode previousCapacityMode; + + /* + * Begin time in UTC of the capacity mode change. + */ + private OffsetDateTime capacityModeTransitionBeginTimestamp; + + /* + * End time in UTC of the capacity mode change. + */ + private OffsetDateTime capacityModeTransitionEndTimestamp; + + /* + * End time in UTC of the last successful capacity mode change. + */ + private OffsetDateTime capacityModeLastSuccessfulTransitionEndTimestamp; + + /** + * Creates an instance of CapacityModeChangeTransitionState class. + */ + public CapacityModeChangeTransitionState() { + } + + /** + * Get the capacityModeTransitionStatus property: The transition status of capacity mode. + * + * @return the capacityModeTransitionStatus value. + */ + public CapacityModeTransitionStatus capacityModeTransitionStatus() { + return this.capacityModeTransitionStatus; + } + + /** + * Set the capacityModeTransitionStatus property: The transition status of capacity mode. + * + * @param capacityModeTransitionStatus the capacityModeTransitionStatus value to set. + * @return the CapacityModeChangeTransitionState object itself. + */ + public CapacityModeChangeTransitionState + withCapacityModeTransitionStatus(CapacityModeTransitionStatus capacityModeTransitionStatus) { + this.capacityModeTransitionStatus = capacityModeTransitionStatus; + return this; + } + + /** + * Get the currentCapacityMode property: Indicates the current capacity mode of the account. + * + * @return the currentCapacityMode value. + */ + public CapacityMode currentCapacityMode() { + return this.currentCapacityMode; + } + + /** + * Set the currentCapacityMode property: Indicates the current capacity mode of the account. + * + * @param currentCapacityMode the currentCapacityMode value to set. + * @return the CapacityModeChangeTransitionState object itself. + */ + public CapacityModeChangeTransitionState withCurrentCapacityMode(CapacityMode currentCapacityMode) { + this.currentCapacityMode = currentCapacityMode; + return this; + } + + /** + * Get the previousCapacityMode property: Indicates the previous capacity mode of the account before successful + * transition. + * + * @return the previousCapacityMode value. + */ + public CapacityMode previousCapacityMode() { + return this.previousCapacityMode; + } + + /** + * Set the previousCapacityMode property: Indicates the previous capacity mode of the account before successful + * transition. + * + * @param previousCapacityMode the previousCapacityMode value to set. + * @return the CapacityModeChangeTransitionState object itself. + */ + public CapacityModeChangeTransitionState withPreviousCapacityMode(CapacityMode previousCapacityMode) { + this.previousCapacityMode = previousCapacityMode; + return this; + } + + /** + * Get the capacityModeTransitionBeginTimestamp property: Begin time in UTC of the capacity mode change. + * + * @return the capacityModeTransitionBeginTimestamp value. + */ + public OffsetDateTime capacityModeTransitionBeginTimestamp() { + return this.capacityModeTransitionBeginTimestamp; + } + + /** + * Get the capacityModeTransitionEndTimestamp property: End time in UTC of the capacity mode change. + * + * @return the capacityModeTransitionEndTimestamp value. + */ + public OffsetDateTime capacityModeTransitionEndTimestamp() { + return this.capacityModeTransitionEndTimestamp; + } + + /** + * Get the capacityModeLastSuccessfulTransitionEndTimestamp property: End time in UTC of the last successful + * capacity mode change. + * + * @return the capacityModeLastSuccessfulTransitionEndTimestamp value. + */ + public OffsetDateTime capacityModeLastSuccessfulTransitionEndTimestamp() { + return this.capacityModeLastSuccessfulTransitionEndTimestamp; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("capacityModeTransitionStatus", + this.capacityModeTransitionStatus == null ? null : this.capacityModeTransitionStatus.toString()); + jsonWriter.writeStringField("currentCapacityMode", + this.currentCapacityMode == null ? null : this.currentCapacityMode.toString()); + jsonWriter.writeStringField("previousCapacityMode", + this.previousCapacityMode == null ? null : this.previousCapacityMode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CapacityModeChangeTransitionState from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CapacityModeChangeTransitionState if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CapacityModeChangeTransitionState. + */ + public static CapacityModeChangeTransitionState fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CapacityModeChangeTransitionState deserializedCapacityModeChangeTransitionState + = new CapacityModeChangeTransitionState(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("capacityModeTransitionStatus".equals(fieldName)) { + deserializedCapacityModeChangeTransitionState.capacityModeTransitionStatus + = CapacityModeTransitionStatus.fromString(reader.getString()); + } else if ("currentCapacityMode".equals(fieldName)) { + deserializedCapacityModeChangeTransitionState.currentCapacityMode + = CapacityMode.fromString(reader.getString()); + } else if ("previousCapacityMode".equals(fieldName)) { + deserializedCapacityModeChangeTransitionState.previousCapacityMode + = CapacityMode.fromString(reader.getString()); + } else if ("capacityModeTransitionBeginTimestamp".equals(fieldName)) { + deserializedCapacityModeChangeTransitionState.capacityModeTransitionBeginTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("capacityModeTransitionEndTimestamp".equals(fieldName)) { + deserializedCapacityModeChangeTransitionState.capacityModeTransitionEndTimestamp = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("capacityModeLastSuccessfulTransitionEndTimestamp".equals(fieldName)) { + deserializedCapacityModeChangeTransitionState.capacityModeLastSuccessfulTransitionEndTimestamp + = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else { + reader.skipChildren(); + } + } + + return deserializedCapacityModeChangeTransitionState; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CapacityModeTransitionStatus.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CapacityModeTransitionStatus.java new file mode 100644 index 000000000000..91aec5ade1cb --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CapacityModeTransitionStatus.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The transition status of capacity mode. + */ +public final class CapacityModeTransitionStatus extends ExpandableStringEnum { + /** + * Static value Invalid for CapacityModeTransitionStatus. + */ + public static final CapacityModeTransitionStatus INVALID = fromString("Invalid"); + + /** + * Static value Initialized for CapacityModeTransitionStatus. + */ + public static final CapacityModeTransitionStatus INITIALIZED = fromString("Initialized"); + + /** + * Static value InProgress for CapacityModeTransitionStatus. + */ + public static final CapacityModeTransitionStatus IN_PROGRESS = fromString("InProgress"); + + /** + * Static value Completed for CapacityModeTransitionStatus. + */ + public static final CapacityModeTransitionStatus COMPLETED = fromString("Completed"); + + /** + * Static value Failed for CapacityModeTransitionStatus. + */ + public static final CapacityModeTransitionStatus FAILED = fromString("Failed"); + + /** + * Creates a new instance of CapacityModeTransitionStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CapacityModeTransitionStatus() { + } + + /** + * Creates or finds a CapacityModeTransitionStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding CapacityModeTransitionStatus. + */ + public static CapacityModeTransitionStatus fromString(String name) { + return fromString(name, CapacityModeTransitionStatus.class); + } + + /** + * Gets known CapacityModeTransitionStatus values. + * + * @return known CapacityModeTransitionStatus values. + */ + public static Collection values() { + return values(CapacityModeTransitionStatus.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraClusterPublicStatusDataCentersItem.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraClusterPublicStatusDataCentersItem.java index c6f4b63f4e59..8ac4e7072054 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraClusterPublicStatusDataCentersItem.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraClusterPublicStatusDataCentersItem.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The CassandraClusterPublicStatusDataCentersItem model. */ -@Fluent +@Immutable public final class CassandraClusterPublicStatusDataCentersItem implements JsonSerializable { /* @@ -36,7 +36,7 @@ public final class CassandraClusterPublicStatusDataCentersItem /** * Creates an instance of CassandraClusterPublicStatusDataCentersItem class. */ - public CassandraClusterPublicStatusDataCentersItem() { + private CassandraClusterPublicStatusDataCentersItem() { } /** @@ -48,17 +48,6 @@ public String name() { return this.name; } - /** - * Set the name property: The name of this Datacenter. - * - * @param name the name value to set. - * @return the CassandraClusterPublicStatusDataCentersItem object itself. - */ - public CassandraClusterPublicStatusDataCentersItem withName(String name) { - this.name = name; - return this; - } - /** * Get the seedNodes property: A list of all seed nodes in the cluster, managed and unmanaged. * @@ -68,17 +57,6 @@ public List seedNodes() { return this.seedNodes; } - /** - * Set the seedNodes property: A list of all seed nodes in the cluster, managed and unmanaged. - * - * @param seedNodes the seedNodes value to set. - * @return the CassandraClusterPublicStatusDataCentersItem object itself. - */ - public CassandraClusterPublicStatusDataCentersItem withSeedNodes(List seedNodes) { - this.seedNodes = seedNodes; - return this; - } - /** * Get the nodes property: The nodes property. * @@ -88,18 +66,6 @@ public List nodes() { return this.nodes; } - /** - * Set the nodes property: The nodes property. - * - * @param nodes the nodes value to set. - * @return the CassandraClusterPublicStatusDataCentersItem object itself. - */ - public CassandraClusterPublicStatusDataCentersItem - withNodes(List nodes) { - this.nodes = nodes; - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraClusterPublicStatusDataCentersItemNode.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraClusterPublicStatusDataCentersItemNode.java index f9979d0636ff..517168b08d31 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraClusterPublicStatusDataCentersItemNode.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraClusterPublicStatusDataCentersItemNode.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The CassandraClusterPublicStatusDataCentersItemNode model. */ -@Fluent +@Immutable public final class CassandraClusterPublicStatusDataCentersItemNode implements JsonSerializable { /* @@ -106,10 +106,15 @@ public final class CassandraClusterPublicStatusDataCentersItemNode */ private Double cpuUsage; + /* + * If node has been updated to latest model + */ + private Boolean isLatestModel; + /** * Creates an instance of CassandraClusterPublicStatusDataCentersItemNode class. */ - public CassandraClusterPublicStatusDataCentersItemNode() { + private CassandraClusterPublicStatusDataCentersItemNode() { } /** @@ -121,17 +126,6 @@ public String address() { return this.address; } - /** - * Set the address property: The node's IP address. - * - * @param address the address value to set. - * @return the CassandraClusterPublicStatusDataCentersItemNode object itself. - */ - public CassandraClusterPublicStatusDataCentersItemNode withAddress(String address) { - this.address = address; - return this; - } - /** * Get the state property: The state of the node in Cassandra ring. * @@ -141,17 +135,6 @@ public NodeState state() { return this.state; } - /** - * Set the state property: The state of the node in Cassandra ring. - * - * @param state the state value to set. - * @return the CassandraClusterPublicStatusDataCentersItemNode object itself. - */ - public CassandraClusterPublicStatusDataCentersItemNode withState(NodeState state) { - this.state = state; - return this; - } - /** * Get the status property: The status property. * @@ -161,17 +144,6 @@ public String status() { return this.status; } - /** - * Set the status property: The status property. - * - * @param status the status value to set. - * @return the CassandraClusterPublicStatusDataCentersItemNode object itself. - */ - public CassandraClusterPublicStatusDataCentersItemNode withStatus(String status) { - this.status = status; - return this; - } - /** * Get the cassandraProcessStatus property: Cassandra service status on this node. * @@ -181,17 +153,6 @@ public String cassandraProcessStatus() { return this.cassandraProcessStatus; } - /** - * Set the cassandraProcessStatus property: Cassandra service status on this node. - * - * @param cassandraProcessStatus the cassandraProcessStatus value to set. - * @return the CassandraClusterPublicStatusDataCentersItemNode object itself. - */ - public CassandraClusterPublicStatusDataCentersItemNode withCassandraProcessStatus(String cassandraProcessStatus) { - this.cassandraProcessStatus = cassandraProcessStatus; - return this; - } - /** * Get the load property: The amount of file system data in the data directory (e.g., 47.66 kB), excluding all * content in the snapshots subdirectories. Because all SSTable data files are included, any data that is not @@ -203,19 +164,6 @@ public String load() { return this.load; } - /** - * Set the load property: The amount of file system data in the data directory (e.g., 47.66 kB), excluding all - * content in the snapshots subdirectories. Because all SSTable data files are included, any data that is not - * cleaned up (such as TTL-expired cells or tombstones) is counted. - * - * @param load the load value to set. - * @return the CassandraClusterPublicStatusDataCentersItemNode object itself. - */ - public CassandraClusterPublicStatusDataCentersItemNode withLoad(String load) { - this.load = load; - return this; - } - /** * Get the tokens property: List of tokens this node covers. * @@ -225,17 +173,6 @@ public List tokens() { return this.tokens; } - /** - * Set the tokens property: List of tokens this node covers. - * - * @param tokens the tokens value to set. - * @return the CassandraClusterPublicStatusDataCentersItemNode object itself. - */ - public CassandraClusterPublicStatusDataCentersItemNode withTokens(List tokens) { - this.tokens = tokens; - return this; - } - /** * Get the size property: The size property. * @@ -245,17 +182,6 @@ public Integer size() { return this.size; } - /** - * Set the size property: The size property. - * - * @param size the size value to set. - * @return the CassandraClusterPublicStatusDataCentersItemNode object itself. - */ - public CassandraClusterPublicStatusDataCentersItemNode withSize(Integer size) { - this.size = size; - return this; - } - /** * Get the hostId property: The network ID of the node. * @@ -265,17 +191,6 @@ public String hostId() { return this.hostId; } - /** - * Set the hostId property: The network ID of the node. - * - * @param hostId the hostId value to set. - * @return the CassandraClusterPublicStatusDataCentersItemNode object itself. - */ - public CassandraClusterPublicStatusDataCentersItemNode withHostId(String hostId) { - this.hostId = hostId; - return this; - } - /** * Get the rack property: The rack this node is part of. * @@ -285,17 +200,6 @@ public String rack() { return this.rack; } - /** - * Set the rack property: The rack this node is part of. - * - * @param rack the rack value to set. - * @return the CassandraClusterPublicStatusDataCentersItemNode object itself. - */ - public CassandraClusterPublicStatusDataCentersItemNode withRack(String rack) { - this.rack = rack; - return this; - } - /** * Get the timestamp property: The timestamp when these statistics were captured. * @@ -305,17 +209,6 @@ public String timestamp() { return this.timestamp; } - /** - * Set the timestamp property: The timestamp when these statistics were captured. - * - * @param timestamp the timestamp value to set. - * @return the CassandraClusterPublicStatusDataCentersItemNode object itself. - */ - public CassandraClusterPublicStatusDataCentersItemNode withTimestamp(String timestamp) { - this.timestamp = timestamp; - return this; - } - /** * Get the diskUsedKB property: The amount of disk used, in kB, of the directory /var/lib/cassandra. * @@ -325,17 +218,6 @@ public Long diskUsedKB() { return this.diskUsedKB; } - /** - * Set the diskUsedKB property: The amount of disk used, in kB, of the directory /var/lib/cassandra. - * - * @param diskUsedKB the diskUsedKB value to set. - * @return the CassandraClusterPublicStatusDataCentersItemNode object itself. - */ - public CassandraClusterPublicStatusDataCentersItemNode withDiskUsedKB(Long diskUsedKB) { - this.diskUsedKB = diskUsedKB; - return this; - } - /** * Get the diskFreeKB property: The amount of disk free, in kB, of the directory /var/lib/cassandra. * @@ -345,17 +227,6 @@ public Long diskFreeKB() { return this.diskFreeKB; } - /** - * Set the diskFreeKB property: The amount of disk free, in kB, of the directory /var/lib/cassandra. - * - * @param diskFreeKB the diskFreeKB value to set. - * @return the CassandraClusterPublicStatusDataCentersItemNode object itself. - */ - public CassandraClusterPublicStatusDataCentersItemNode withDiskFreeKB(Long diskFreeKB) { - this.diskFreeKB = diskFreeKB; - return this; - } - /** * Get the memoryUsedKB property: Used memory (calculated as total - free - buffers - cache), in kB. * @@ -365,17 +236,6 @@ public Long memoryUsedKB() { return this.memoryUsedKB; } - /** - * Set the memoryUsedKB property: Used memory (calculated as total - free - buffers - cache), in kB. - * - * @param memoryUsedKB the memoryUsedKB value to set. - * @return the CassandraClusterPublicStatusDataCentersItemNode object itself. - */ - public CassandraClusterPublicStatusDataCentersItemNode withMemoryUsedKB(Long memoryUsedKB) { - this.memoryUsedKB = memoryUsedKB; - return this; - } - /** * Get the memoryBuffersAndCachedKB property: Memory used by kernel buffers (Buffers in /proc/meminfo) and page * cache and slabs (Cached and SReclaimable in /proc/meminfo), in kB. @@ -386,18 +246,6 @@ public Long memoryBuffersAndCachedKB() { return this.memoryBuffersAndCachedKB; } - /** - * Set the memoryBuffersAndCachedKB property: Memory used by kernel buffers (Buffers in /proc/meminfo) and page - * cache and slabs (Cached and SReclaimable in /proc/meminfo), in kB. - * - * @param memoryBuffersAndCachedKB the memoryBuffersAndCachedKB value to set. - * @return the CassandraClusterPublicStatusDataCentersItemNode object itself. - */ - public CassandraClusterPublicStatusDataCentersItemNode withMemoryBuffersAndCachedKB(Long memoryBuffersAndCachedKB) { - this.memoryBuffersAndCachedKB = memoryBuffersAndCachedKB; - return this; - } - /** * Get the memoryFreeKB property: Unused memory (MemFree and SwapFree in /proc/meminfo), in kB. * @@ -407,17 +255,6 @@ public Long memoryFreeKB() { return this.memoryFreeKB; } - /** - * Set the memoryFreeKB property: Unused memory (MemFree and SwapFree in /proc/meminfo), in kB. - * - * @param memoryFreeKB the memoryFreeKB value to set. - * @return the CassandraClusterPublicStatusDataCentersItemNode object itself. - */ - public CassandraClusterPublicStatusDataCentersItemNode withMemoryFreeKB(Long memoryFreeKB) { - this.memoryFreeKB = memoryFreeKB; - return this; - } - /** * Get the memoryTotalKB property: Total installed memory (MemTotal and SwapTotal in /proc/meminfo), in kB. * @@ -427,17 +264,6 @@ public Long memoryTotalKB() { return this.memoryTotalKB; } - /** - * Set the memoryTotalKB property: Total installed memory (MemTotal and SwapTotal in /proc/meminfo), in kB. - * - * @param memoryTotalKB the memoryTotalKB value to set. - * @return the CassandraClusterPublicStatusDataCentersItemNode object itself. - */ - public CassandraClusterPublicStatusDataCentersItemNode withMemoryTotalKB(Long memoryTotalKB) { - this.memoryTotalKB = memoryTotalKB; - return this; - } - /** * Get the cpuUsage property: A float representing the current system-wide CPU utilization as a percentage. * @@ -448,14 +274,12 @@ public Double cpuUsage() { } /** - * Set the cpuUsage property: A float representing the current system-wide CPU utilization as a percentage. + * Get the isLatestModel property: If node has been updated to latest model. * - * @param cpuUsage the cpuUsage value to set. - * @return the CassandraClusterPublicStatusDataCentersItemNode object itself. + * @return the isLatestModel value. */ - public CassandraClusterPublicStatusDataCentersItemNode withCpuUsage(Double cpuUsage) { - this.cpuUsage = cpuUsage; - return this; + public Boolean isLatestModel() { + return this.isLatestModel; } /** @@ -489,6 +313,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeNumberField("memoryFreeKB", this.memoryFreeKB); jsonWriter.writeNumberField("memoryTotalKB", this.memoryTotalKB); jsonWriter.writeNumberField("cpuUsage", this.cpuUsage); + jsonWriter.writeBooleanField("isLatestModel", this.isLatestModel); return jsonWriter.writeEndObject(); } @@ -553,6 +378,9 @@ public static CassandraClusterPublicStatusDataCentersItemNode fromJson(JsonReade } else if ("cpuUsage".equals(fieldName)) { deserializedCassandraClusterPublicStatusDataCentersItemNode.cpuUsage = reader.getNullable(JsonReader::getDouble); + } else if ("isLatestModel".equals(fieldName)) { + deserializedCassandraClusterPublicStatusDataCentersItemNode.isLatestModel + = reader.getNullable(JsonReader::getBoolean); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraError.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraError.java index 6300845ee2c8..67726d5bb256 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraError.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraError.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceCreateUpdateParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceCreateUpdateParameters.java index dab999d94060..9d91fe75b17b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceCreateUpdateParameters.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceCreateUpdateParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -24,17 +24,17 @@ public final class CassandraKeyspaceCreateUpdateParameters extends ArmResourcePr private CassandraKeyspaceCreateUpdateProperties innerProperties = new CassandraKeyspaceCreateUpdateProperties(); /* - * The type of the resource. + * The type of Azure resource. */ private String type; /* - * The name of the resource. + * The name of the ARM resource. */ private String name; /* - * Fully qualified resource Id for the resource. + * The unique resource identifier of the ARM resource. */ private String id; @@ -54,7 +54,7 @@ private CassandraKeyspaceCreateUpdateProperties innerProperties() { } /** - * Get the type property: The type of the resource. + * Get the type property: The type of Azure resource. * * @return the type value. */ @@ -64,7 +64,7 @@ public String type() { } /** - * Get the name property: The name of the resource. + * Get the name property: The name of the ARM resource. * * @return the name value. */ @@ -74,7 +74,7 @@ public String name() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the id property: The unique resource identifier of the ARM resource. * * @return the id value. */ @@ -101,6 +101,15 @@ public CassandraKeyspaceCreateUpdateParameters withTags(Map tags return this; } + /** + * {@inheritDoc} + */ + @Override + public CassandraKeyspaceCreateUpdateParameters withIdentity(ManagedServiceIdentity identity) { + super.withIdentity(identity); + return this; + } + /** * Get the resource property: The standard JSON format of a Cassandra keyspace. * @@ -163,6 +172,9 @@ public void validate() { } else { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(CassandraKeyspaceCreateUpdateParameters.class); @@ -175,6 +187,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", identity()); jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -207,6 +220,9 @@ public static CassandraKeyspaceCreateUpdateParameters fromJson(JsonReader jsonRe } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedCassandraKeyspaceCreateUpdateParameters.withTags(tags); + } else if ("identity".equals(fieldName)) { + deserializedCassandraKeyspaceCreateUpdateParameters + .withIdentity(ManagedServiceIdentity.fromJson(reader)); } else if ("properties".equals(fieldName)) { deserializedCassandraKeyspaceCreateUpdateParameters.innerProperties = CassandraKeyspaceCreateUpdateProperties.fromJson(reader); diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceGetPropertiesOptions.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceGetPropertiesOptions.java index 33e66d6410ba..4bbc8e9fced9 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceGetPropertiesOptions.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceGetPropertiesOptions.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -13,30 +13,44 @@ /** * The CassandraKeyspaceGetPropertiesOptions model. */ -@Fluent +@Immutable public final class CassandraKeyspaceGetPropertiesOptions extends OptionsResource { + /* + * Specifies the Autoscale settings. + */ + private AutoscaleSettings autoscaleSettings; + + /* + * Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when + * retrieving offer details. + */ + private Integer throughput; + /** * Creates an instance of CassandraKeyspaceGetPropertiesOptions class. */ - public CassandraKeyspaceGetPropertiesOptions() { + private CassandraKeyspaceGetPropertiesOptions() { } /** - * {@inheritDoc} + * Get the autoscaleSettings property: Specifies the Autoscale settings. + * + * @return the autoscaleSettings value. */ @Override - public CassandraKeyspaceGetPropertiesOptions withThroughput(Integer throughput) { - super.withThroughput(throughput); - return this; + public AutoscaleSettings autoscaleSettings() { + return this.autoscaleSettings; } /** - * {@inheritDoc} + * Get the throughput property: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the + * ThroughputSetting resource when retrieving offer details. + * + * @return the throughput value. */ @Override - public CassandraKeyspaceGetPropertiesOptions withAutoscaleSettings(AutoscaleSettings autoscaleSettings) { - super.withAutoscaleSettings(autoscaleSettings); - return this; + public Integer throughput() { + return this.throughput; } /** @@ -79,11 +93,11 @@ public static CassandraKeyspaceGetPropertiesOptions fromJson(JsonReader jsonRead reader.nextToken(); if ("throughput".equals(fieldName)) { - deserializedCassandraKeyspaceGetPropertiesOptions - .withThroughput(reader.getNullable(JsonReader::getInt)); + deserializedCassandraKeyspaceGetPropertiesOptions.throughput + = reader.getNullable(JsonReader::getInt); } else if ("autoscaleSettings".equals(fieldName)) { - deserializedCassandraKeyspaceGetPropertiesOptions - .withAutoscaleSettings(AutoscaleSettings.fromJson(reader)); + deserializedCassandraKeyspaceGetPropertiesOptions.autoscaleSettings + = AutoscaleSettings.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceGetPropertiesResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceGetPropertiesResource.java index 2777eb5fd642..bd2726c1473a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceGetPropertiesResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceGetPropertiesResource.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * The CassandraKeyspaceGetPropertiesResource model. */ -@Fluent +@Immutable public final class CassandraKeyspaceGetPropertiesResource extends CassandraKeyspaceResource { /* * A system generated property. A unique identifier. @@ -34,7 +34,7 @@ public final class CassandraKeyspaceGetPropertiesResource extends CassandraKeysp /** * Creates an instance of CassandraKeyspaceGetPropertiesResource class. */ - public CassandraKeyspaceGetPropertiesResource() { + private CassandraKeyspaceGetPropertiesResource() { } /** @@ -65,15 +65,6 @@ public String etag() { return this.etag; } - /** - * {@inheritDoc} - */ - @Override - public CassandraKeyspaceGetPropertiesResource withId(String id) { - super.withId(id); - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceResource.java index 816fefce5a1d..c1781c37cbfb 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraPartitionKey.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraPartitionKey.java index 64ce6ba093d5..ef58d196ba70 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraPartitionKey.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraPartitionKey.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToBlobCopyJobProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToBlobCopyJobProperties.java new file mode 100644 index 000000000000..6498231fb887 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToBlobCopyJobProperties.java @@ -0,0 +1,194 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Source Cassandra to Destination Azure Blob Storage copy job properties. + */ +@Fluent +public final class CassandraRUToBlobCopyJobProperties extends BaseCopyJobProperties { + /* + * Copy Job Type + */ + private CopyJobType jobType = CopyJobType.CASSANDRA_RUTO_AZURE_BLOB_STORAGE; + + /* + * Source Cassandra DataStore details + */ + private CosmosDBSourceSinkDetails sourceDetails; + + /* + * Destination Cassandra DataStore details + */ + private AzureBlobSourceSinkDetails destinationDetails; + + /* + * Copy Job tasks. + */ + private List tasks; + + /** + * Creates an instance of CassandraRUToBlobCopyJobProperties class. + */ + public CassandraRUToBlobCopyJobProperties() { + } + + /** + * Get the jobType property: Copy Job Type. + * + * @return the jobType value. + */ + @Override + public CopyJobType jobType() { + return this.jobType; + } + + /** + * Get the sourceDetails property: Source Cassandra DataStore details. + * + * @return the sourceDetails value. + */ + public CosmosDBSourceSinkDetails sourceDetails() { + return this.sourceDetails; + } + + /** + * Set the sourceDetails property: Source Cassandra DataStore details. + * + * @param sourceDetails the sourceDetails value to set. + * @return the CassandraRUToBlobCopyJobProperties object itself. + */ + public CassandraRUToBlobCopyJobProperties withSourceDetails(CosmosDBSourceSinkDetails sourceDetails) { + this.sourceDetails = sourceDetails; + return this; + } + + /** + * Get the destinationDetails property: Destination Cassandra DataStore details. + * + * @return the destinationDetails value. + */ + public AzureBlobSourceSinkDetails destinationDetails() { + return this.destinationDetails; + } + + /** + * Set the destinationDetails property: Destination Cassandra DataStore details. + * + * @param destinationDetails the destinationDetails value to set. + * @return the CassandraRUToBlobCopyJobProperties object itself. + */ + public CassandraRUToBlobCopyJobProperties withDestinationDetails(AzureBlobSourceSinkDetails destinationDetails) { + this.destinationDetails = destinationDetails; + return this; + } + + /** + * Get the tasks property: Copy Job tasks. + * + * @return the tasks value. + */ + public List tasks() { + return this.tasks; + } + + /** + * Set the tasks property: Copy Job tasks. + * + * @param tasks the tasks value to set. + * @return the CassandraRUToBlobCopyJobProperties object itself. + */ + public CassandraRUToBlobCopyJobProperties withTasks(List tasks) { + this.tasks = tasks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (sourceDetails() != null) { + sourceDetails().validate(); + } + if (destinationDetails() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property destinationDetails in model CassandraRUToBlobCopyJobProperties")); + } else { + destinationDetails().validate(); + } + if (tasks() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property tasks in model CassandraRUToBlobCopyJobProperties")); + } else { + tasks().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CassandraRUToBlobCopyJobProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("destinationDetails", this.destinationDetails); + jsonWriter.writeArrayField("tasks", this.tasks, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("jobType", this.jobType == null ? null : this.jobType.toString()); + jsonWriter.writeJsonField("sourceDetails", this.sourceDetails); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CassandraRUToBlobCopyJobProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CassandraRUToBlobCopyJobProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CassandraRUToBlobCopyJobProperties. + */ + public static CassandraRUToBlobCopyJobProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CassandraRUToBlobCopyJobProperties deserializedCassandraRUToBlobCopyJobProperties + = new CassandraRUToBlobCopyJobProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("destinationDetails".equals(fieldName)) { + deserializedCassandraRUToBlobCopyJobProperties.destinationDetails + = AzureBlobSourceSinkDetails.fromJson(reader); + } else if ("tasks".equals(fieldName)) { + List tasks + = reader.readArray(reader1 -> CassandraRUToBlobCopyJobTask.fromJson(reader1)); + deserializedCassandraRUToBlobCopyJobProperties.tasks = tasks; + } else if ("jobType".equals(fieldName)) { + deserializedCassandraRUToBlobCopyJobProperties.jobType = CopyJobType.fromString(reader.getString()); + } else if ("sourceDetails".equals(fieldName)) { + deserializedCassandraRUToBlobCopyJobProperties.sourceDetails + = CosmosDBSourceSinkDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCassandraRUToBlobCopyJobProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToBlobCopyJobTask.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToBlobCopyJobTask.java new file mode 100644 index 000000000000..aebb1488a6a0 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToBlobCopyJobTask.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The CassandraRUToBlobCopyJobTask model. + */ +@Fluent +public final class CassandraRUToBlobCopyJobTask extends BaseCopyJobTask { + /* + * Source Cassandra table + */ + private CosmosDBCassandraTable source; + + /* + * Destination Azure Blob container + */ + private AzureBlobContainer destination; + + /* + * Task level Processed Count. + */ + private Long processedCount; + + /* + * Task level Total Count. + */ + private Long totalCount; + + /** + * Creates an instance of CassandraRUToBlobCopyJobTask class. + */ + public CassandraRUToBlobCopyJobTask() { + } + + /** + * Get the source property: Source Cassandra table. + * + * @return the source value. + */ + public CosmosDBCassandraTable source() { + return this.source; + } + + /** + * Set the source property: Source Cassandra table. + * + * @param source the source value to set. + * @return the CassandraRUToBlobCopyJobTask object itself. + */ + public CassandraRUToBlobCopyJobTask withSource(CosmosDBCassandraTable source) { + this.source = source; + return this; + } + + /** + * Get the destination property: Destination Azure Blob container. + * + * @return the destination value. + */ + public AzureBlobContainer destination() { + return this.destination; + } + + /** + * Set the destination property: Destination Azure Blob container. + * + * @param destination the destination value to set. + * @return the CassandraRUToBlobCopyJobTask object itself. + */ + public CassandraRUToBlobCopyJobTask withDestination(AzureBlobContainer destination) { + this.destination = destination; + return this; + } + + /** + * Get the processedCount property: Task level Processed Count. + * + * @return the processedCount value. + */ + @Override + public Long processedCount() { + return this.processedCount; + } + + /** + * Get the totalCount property: Task level Total Count. + * + * @return the totalCount value. + */ + @Override + public Long totalCount() { + return this.totalCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (source() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property source in model CassandraRUToBlobCopyJobTask")); + } else { + source().validate(); + } + if (destination() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property destination in model CassandraRUToBlobCopyJobTask")); + } else { + destination().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CassandraRUToBlobCopyJobTask.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("source", this.source); + jsonWriter.writeJsonField("destination", this.destination); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CassandraRUToBlobCopyJobTask from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CassandraRUToBlobCopyJobTask if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CassandraRUToBlobCopyJobTask. + */ + public static CassandraRUToBlobCopyJobTask fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CassandraRUToBlobCopyJobTask deserializedCassandraRUToBlobCopyJobTask = new CassandraRUToBlobCopyJobTask(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("totalCount".equals(fieldName)) { + deserializedCassandraRUToBlobCopyJobTask.totalCount = reader.getNullable(JsonReader::getLong); + } else if ("processedCount".equals(fieldName)) { + deserializedCassandraRUToBlobCopyJobTask.processedCount = reader.getNullable(JsonReader::getLong); + } else if ("source".equals(fieldName)) { + deserializedCassandraRUToBlobCopyJobTask.source = CosmosDBCassandraTable.fromJson(reader); + } else if ("destination".equals(fieldName)) { + deserializedCassandraRUToBlobCopyJobTask.destination = AzureBlobContainer.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCassandraRUToBlobCopyJobTask; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToCassandraRUCopyJobProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToCassandraRUCopyJobProperties.java new file mode 100644 index 000000000000..4499f240b6f3 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToCassandraRUCopyJobProperties.java @@ -0,0 +1,192 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Source Cassandra to Destination Cassandra copy job properties. + */ +@Fluent +public final class CassandraRUToCassandraRUCopyJobProperties extends BaseCopyJobProperties { + /* + * Copy Job Type + */ + private CopyJobType jobType = CopyJobType.CASSANDRA_RUTO_CASSANDRA_RU; + + /* + * Source Cassandra DataStore details + */ + private CosmosDBSourceSinkDetails sourceDetails; + + /* + * Destination Cassandra DataStore details + */ + private CosmosDBSourceSinkDetails destinationDetails; + + /* + * Copy Job tasks. + */ + private List tasks; + + /** + * Creates an instance of CassandraRUToCassandraRUCopyJobProperties class. + */ + public CassandraRUToCassandraRUCopyJobProperties() { + } + + /** + * Get the jobType property: Copy Job Type. + * + * @return the jobType value. + */ + @Override + public CopyJobType jobType() { + return this.jobType; + } + + /** + * Get the sourceDetails property: Source Cassandra DataStore details. + * + * @return the sourceDetails value. + */ + public CosmosDBSourceSinkDetails sourceDetails() { + return this.sourceDetails; + } + + /** + * Set the sourceDetails property: Source Cassandra DataStore details. + * + * @param sourceDetails the sourceDetails value to set. + * @return the CassandraRUToCassandraRUCopyJobProperties object itself. + */ + public CassandraRUToCassandraRUCopyJobProperties withSourceDetails(CosmosDBSourceSinkDetails sourceDetails) { + this.sourceDetails = sourceDetails; + return this; + } + + /** + * Get the destinationDetails property: Destination Cassandra DataStore details. + * + * @return the destinationDetails value. + */ + public CosmosDBSourceSinkDetails destinationDetails() { + return this.destinationDetails; + } + + /** + * Set the destinationDetails property: Destination Cassandra DataStore details. + * + * @param destinationDetails the destinationDetails value to set. + * @return the CassandraRUToCassandraRUCopyJobProperties object itself. + */ + public CassandraRUToCassandraRUCopyJobProperties + withDestinationDetails(CosmosDBSourceSinkDetails destinationDetails) { + this.destinationDetails = destinationDetails; + return this; + } + + /** + * Get the tasks property: Copy Job tasks. + * + * @return the tasks value. + */ + public List tasks() { + return this.tasks; + } + + /** + * Set the tasks property: Copy Job tasks. + * + * @param tasks the tasks value to set. + * @return the CassandraRUToCassandraRUCopyJobProperties object itself. + */ + public CassandraRUToCassandraRUCopyJobProperties withTasks(List tasks) { + this.tasks = tasks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (sourceDetails() != null) { + sourceDetails().validate(); + } + if (destinationDetails() != null) { + destinationDetails().validate(); + } + if (tasks() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property tasks in model CassandraRUToCassandraRUCopyJobProperties")); + } else { + tasks().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CassandraRUToCassandraRUCopyJobProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("tasks", this.tasks, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("jobType", this.jobType == null ? null : this.jobType.toString()); + jsonWriter.writeJsonField("sourceDetails", this.sourceDetails); + jsonWriter.writeJsonField("destinationDetails", this.destinationDetails); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CassandraRUToCassandraRUCopyJobProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CassandraRUToCassandraRUCopyJobProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CassandraRUToCassandraRUCopyJobProperties. + */ + public static CassandraRUToCassandraRUCopyJobProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CassandraRUToCassandraRUCopyJobProperties deserializedCassandraRUToCassandraRUCopyJobProperties + = new CassandraRUToCassandraRUCopyJobProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tasks".equals(fieldName)) { + List tasks + = reader.readArray(reader1 -> CassandraRUToCassandraRUCopyJobTask.fromJson(reader1)); + deserializedCassandraRUToCassandraRUCopyJobProperties.tasks = tasks; + } else if ("jobType".equals(fieldName)) { + deserializedCassandraRUToCassandraRUCopyJobProperties.jobType + = CopyJobType.fromString(reader.getString()); + } else if ("sourceDetails".equals(fieldName)) { + deserializedCassandraRUToCassandraRUCopyJobProperties.sourceDetails + = CosmosDBSourceSinkDetails.fromJson(reader); + } else if ("destinationDetails".equals(fieldName)) { + deserializedCassandraRUToCassandraRUCopyJobProperties.destinationDetails + = CosmosDBSourceSinkDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCassandraRUToCassandraRUCopyJobProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToCassandraRUCopyJobTask.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToCassandraRUCopyJobTask.java new file mode 100644 index 000000000000..9c987b2a437a --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToCassandraRUCopyJobTask.java @@ -0,0 +1,177 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The CassandraRUToCassandraRUCopyJobTask model. + */ +@Fluent +public final class CassandraRUToCassandraRUCopyJobTask extends BaseCopyJobTask { + /* + * Source Cassandra table + */ + private CosmosDBCassandraTable source; + + /* + * Destination Cassandra table + */ + private CosmosDBCassandraTable destination; + + /* + * Task level Processed Count. + */ + private Long processedCount; + + /* + * Task level Total Count. + */ + private Long totalCount; + + /** + * Creates an instance of CassandraRUToCassandraRUCopyJobTask class. + */ + public CassandraRUToCassandraRUCopyJobTask() { + } + + /** + * Get the source property: Source Cassandra table. + * + * @return the source value. + */ + public CosmosDBCassandraTable source() { + return this.source; + } + + /** + * Set the source property: Source Cassandra table. + * + * @param source the source value to set. + * @return the CassandraRUToCassandraRUCopyJobTask object itself. + */ + public CassandraRUToCassandraRUCopyJobTask withSource(CosmosDBCassandraTable source) { + this.source = source; + return this; + } + + /** + * Get the destination property: Destination Cassandra table. + * + * @return the destination value. + */ + public CosmosDBCassandraTable destination() { + return this.destination; + } + + /** + * Set the destination property: Destination Cassandra table. + * + * @param destination the destination value to set. + * @return the CassandraRUToCassandraRUCopyJobTask object itself. + */ + public CassandraRUToCassandraRUCopyJobTask withDestination(CosmosDBCassandraTable destination) { + this.destination = destination; + return this; + } + + /** + * Get the processedCount property: Task level Processed Count. + * + * @return the processedCount value. + */ + @Override + public Long processedCount() { + return this.processedCount; + } + + /** + * Get the totalCount property: Task level Total Count. + * + * @return the totalCount value. + */ + @Override + public Long totalCount() { + return this.totalCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (source() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property source in model CassandraRUToCassandraRUCopyJobTask")); + } else { + source().validate(); + } + if (destination() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property destination in model CassandraRUToCassandraRUCopyJobTask")); + } else { + destination().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CassandraRUToCassandraRUCopyJobTask.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("source", this.source); + jsonWriter.writeJsonField("destination", this.destination); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CassandraRUToCassandraRUCopyJobTask from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CassandraRUToCassandraRUCopyJobTask if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CassandraRUToCassandraRUCopyJobTask. + */ + public static CassandraRUToCassandraRUCopyJobTask fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CassandraRUToCassandraRUCopyJobTask deserializedCassandraRUToCassandraRUCopyJobTask + = new CassandraRUToCassandraRUCopyJobTask(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("totalCount".equals(fieldName)) { + deserializedCassandraRUToCassandraRUCopyJobTask.totalCount + = reader.getNullable(JsonReader::getLong); + } else if ("processedCount".equals(fieldName)) { + deserializedCassandraRUToCassandraRUCopyJobTask.processedCount + = reader.getNullable(JsonReader::getLong); + } else if ("source".equals(fieldName)) { + deserializedCassandraRUToCassandraRUCopyJobTask.source = CosmosDBCassandraTable.fromJson(reader); + } else if ("destination".equals(fieldName)) { + deserializedCassandraRUToCassandraRUCopyJobTask.destination + = CosmosDBCassandraTable.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCassandraRUToCassandraRUCopyJobTask; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraSchema.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraSchema.java index 4fee04422df5..7f28941f6810 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraSchema.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraSchema.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableCreateUpdateParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableCreateUpdateParameters.java index 0a3f46f8c6c3..429f08ae9dc2 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableCreateUpdateParameters.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableCreateUpdateParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -24,17 +24,17 @@ public final class CassandraTableCreateUpdateParameters extends ArmResourcePrope private CassandraTableCreateUpdateProperties innerProperties = new CassandraTableCreateUpdateProperties(); /* - * The type of the resource. + * The type of Azure resource. */ private String type; /* - * The name of the resource. + * The name of the ARM resource. */ private String name; /* - * Fully qualified resource Id for the resource. + * The unique resource identifier of the ARM resource. */ private String id; @@ -54,7 +54,7 @@ private CassandraTableCreateUpdateProperties innerProperties() { } /** - * Get the type property: The type of the resource. + * Get the type property: The type of Azure resource. * * @return the type value. */ @@ -64,7 +64,7 @@ public String type() { } /** - * Get the name property: The name of the resource. + * Get the name property: The name of the ARM resource. * * @return the name value. */ @@ -74,7 +74,7 @@ public String name() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the id property: The unique resource identifier of the ARM resource. * * @return the id value. */ @@ -101,6 +101,15 @@ public CassandraTableCreateUpdateParameters withTags(Map tags) { return this; } + /** + * {@inheritDoc} + */ + @Override + public CassandraTableCreateUpdateParameters withIdentity(ManagedServiceIdentity identity) { + super.withIdentity(identity); + return this; + } + /** * Get the resource property: The standard JSON format of a Cassandra table. * @@ -163,6 +172,9 @@ public void validate() { } else { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(CassandraTableCreateUpdateParameters.class); @@ -175,6 +187,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", identity()); jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -207,6 +220,9 @@ public static CassandraTableCreateUpdateParameters fromJson(JsonReader jsonReade } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedCassandraTableCreateUpdateParameters.withTags(tags); + } else if ("identity".equals(fieldName)) { + deserializedCassandraTableCreateUpdateParameters + .withIdentity(ManagedServiceIdentity.fromJson(reader)); } else if ("properties".equals(fieldName)) { deserializedCassandraTableCreateUpdateParameters.innerProperties = CassandraTableCreateUpdateProperties.fromJson(reader); diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableGetPropertiesOptions.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableGetPropertiesOptions.java index 342ec5712b37..db5539d28936 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableGetPropertiesOptions.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableGetPropertiesOptions.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -13,30 +13,44 @@ /** * The CassandraTableGetPropertiesOptions model. */ -@Fluent +@Immutable public final class CassandraTableGetPropertiesOptions extends OptionsResource { + /* + * Specifies the Autoscale settings. + */ + private AutoscaleSettings autoscaleSettings; + + /* + * Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when + * retrieving offer details. + */ + private Integer throughput; + /** * Creates an instance of CassandraTableGetPropertiesOptions class. */ - public CassandraTableGetPropertiesOptions() { + private CassandraTableGetPropertiesOptions() { } /** - * {@inheritDoc} + * Get the autoscaleSettings property: Specifies the Autoscale settings. + * + * @return the autoscaleSettings value. */ @Override - public CassandraTableGetPropertiesOptions withThroughput(Integer throughput) { - super.withThroughput(throughput); - return this; + public AutoscaleSettings autoscaleSettings() { + return this.autoscaleSettings; } /** - * {@inheritDoc} + * Get the throughput property: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the + * ThroughputSetting resource when retrieving offer details. + * + * @return the throughput value. */ @Override - public CassandraTableGetPropertiesOptions withAutoscaleSettings(AutoscaleSettings autoscaleSettings) { - super.withAutoscaleSettings(autoscaleSettings); - return this; + public Integer throughput() { + return this.throughput; } /** @@ -79,11 +93,10 @@ public static CassandraTableGetPropertiesOptions fromJson(JsonReader jsonReader) reader.nextToken(); if ("throughput".equals(fieldName)) { - deserializedCassandraTableGetPropertiesOptions - .withThroughput(reader.getNullable(JsonReader::getInt)); + deserializedCassandraTableGetPropertiesOptions.throughput = reader.getNullable(JsonReader::getInt); } else if ("autoscaleSettings".equals(fieldName)) { - deserializedCassandraTableGetPropertiesOptions - .withAutoscaleSettings(AutoscaleSettings.fromJson(reader)); + deserializedCassandraTableGetPropertiesOptions.autoscaleSettings + = AutoscaleSettings.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableGetPropertiesResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableGetPropertiesResource.java index 3584c93502ae..31b9cd82a34e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableGetPropertiesResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableGetPropertiesResource.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * The CassandraTableGetPropertiesResource model. */ -@Fluent +@Immutable public final class CassandraTableGetPropertiesResource extends CassandraTableResource { /* * A system generated property. A unique identifier. @@ -34,7 +34,7 @@ public final class CassandraTableGetPropertiesResource extends CassandraTableRes /** * Creates an instance of CassandraTableGetPropertiesResource class. */ - public CassandraTableGetPropertiesResource() { + private CassandraTableGetPropertiesResource() { } /** @@ -65,42 +65,6 @@ public String etag() { return this.etag; } - /** - * {@inheritDoc} - */ - @Override - public CassandraTableGetPropertiesResource withId(String id) { - super.withId(id); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CassandraTableGetPropertiesResource withDefaultTtl(Integer defaultTtl) { - super.withDefaultTtl(defaultTtl); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CassandraTableGetPropertiesResource withSchema(CassandraSchema schema) { - super.withSchema(schema); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public CassandraTableGetPropertiesResource withAnalyticalStorageTtl(Integer analyticalStorageTtl) { - super.withAnalyticalStorageTtl(analyticalStorageTtl); - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableResource.java index 8a689c36e6ec..b3aec25fc483 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewCreateUpdateParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewCreateUpdateParameters.java new file mode 100644 index 000000000000..35eba5b26df9 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewCreateUpdateParameters.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.fluent.models.CassandraViewCreateUpdateProperties; +import java.io.IOException; +import java.util.Map; + +/** + * Parameters to create and update Cosmos DB Cassandra view. + */ +@Fluent +public final class CassandraViewCreateUpdateParameters extends ArmResourceProperties { + /* + * Properties to create and update Azure Cosmos DB Cassandra view. + */ + private CassandraViewCreateUpdateProperties innerProperties = new CassandraViewCreateUpdateProperties(); + + /* + * The type of Azure resource. + */ + private String type; + + /* + * The name of the ARM resource. + */ + private String name; + + /* + * The unique resource identifier of the ARM resource. + */ + private String id; + + /** + * Creates an instance of CassandraViewCreateUpdateParameters class. + */ + public CassandraViewCreateUpdateParameters() { + } + + /** + * Get the innerProperties property: Properties to create and update Azure Cosmos DB Cassandra view. + * + * @return the innerProperties value. + */ + private CassandraViewCreateUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the type property: The type of Azure resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the ARM resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: The unique resource identifier of the ARM resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public CassandraViewCreateUpdateParameters withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CassandraViewCreateUpdateParameters withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public CassandraViewCreateUpdateParameters withIdentity(ManagedServiceIdentity identity) { + super.withIdentity(identity); + return this; + } + + /** + * Get the resource property: The standard JSON format of a Cassandra view. + * + * @return the resource value. + */ + public CassandraViewResource resource() { + return this.innerProperties() == null ? null : this.innerProperties().resource(); + } + + /** + * Set the resource property: The standard JSON format of a Cassandra view. + * + * @param resource the resource value to set. + * @return the CassandraViewCreateUpdateParameters object itself. + */ + public CassandraViewCreateUpdateParameters withResource(CassandraViewResource resource) { + if (this.innerProperties() == null) { + this.innerProperties = new CassandraViewCreateUpdateProperties(); + } + this.innerProperties().withResource(resource); + return this; + } + + /** + * Get the options property: A key-value pair of options to be applied for the request. This corresponds to the + * headers sent with the request. + * + * @return the options value. + */ + public CreateUpdateOptions options() { + return this.innerProperties() == null ? null : this.innerProperties().options(); + } + + /** + * Set the options property: A key-value pair of options to be applied for the request. This corresponds to the + * headers sent with the request. + * + * @param options the options value to set. + * @return the CassandraViewCreateUpdateParameters object itself. + */ + public CassandraViewCreateUpdateParameters withOptions(CreateUpdateOptions options) { + if (this.innerProperties() == null) { + this.innerProperties = new CassandraViewCreateUpdateProperties(); + } + this.innerProperties().withOptions(options); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model CassandraViewCreateUpdateParameters")); + } else { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CassandraViewCreateUpdateParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", identity()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CassandraViewCreateUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CassandraViewCreateUpdateParameters if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CassandraViewCreateUpdateParameters. + */ + public static CassandraViewCreateUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CassandraViewCreateUpdateParameters deserializedCassandraViewCreateUpdateParameters + = new CassandraViewCreateUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCassandraViewCreateUpdateParameters.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCassandraViewCreateUpdateParameters.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCassandraViewCreateUpdateParameters.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedCassandraViewCreateUpdateParameters.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedCassandraViewCreateUpdateParameters.withTags(tags); + } else if ("identity".equals(fieldName)) { + deserializedCassandraViewCreateUpdateParameters + .withIdentity(ManagedServiceIdentity.fromJson(reader)); + } else if ("properties".equals(fieldName)) { + deserializedCassandraViewCreateUpdateParameters.innerProperties + = CassandraViewCreateUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCassandraViewCreateUpdateParameters; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewGetPropertiesOptions.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewGetPropertiesOptions.java new file mode 100644 index 000000000000..2e9565755a96 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewGetPropertiesOptions.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The CassandraViewGetPropertiesOptions model. + */ +@Immutable +public final class CassandraViewGetPropertiesOptions extends OptionsResource { + /* + * Specifies the Autoscale settings. + */ + private AutoscaleSettings autoscaleSettings; + + /* + * Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when + * retrieving offer details. + */ + private Integer throughput; + + /** + * Creates an instance of CassandraViewGetPropertiesOptions class. + */ + private CassandraViewGetPropertiesOptions() { + } + + /** + * Get the autoscaleSettings property: Specifies the Autoscale settings. + * + * @return the autoscaleSettings value. + */ + @Override + public AutoscaleSettings autoscaleSettings() { + return this.autoscaleSettings; + } + + /** + * Get the throughput property: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the + * ThroughputSetting resource when retrieving offer details. + * + * @return the throughput value. + */ + @Override + public Integer throughput() { + return this.throughput; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (autoscaleSettings() != null) { + autoscaleSettings().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("throughput", throughput()); + jsonWriter.writeJsonField("autoscaleSettings", autoscaleSettings()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CassandraViewGetPropertiesOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CassandraViewGetPropertiesOptions if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CassandraViewGetPropertiesOptions. + */ + public static CassandraViewGetPropertiesOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CassandraViewGetPropertiesOptions deserializedCassandraViewGetPropertiesOptions + = new CassandraViewGetPropertiesOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("throughput".equals(fieldName)) { + deserializedCassandraViewGetPropertiesOptions.throughput = reader.getNullable(JsonReader::getInt); + } else if ("autoscaleSettings".equals(fieldName)) { + deserializedCassandraViewGetPropertiesOptions.autoscaleSettings + = AutoscaleSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCassandraViewGetPropertiesOptions; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewGetPropertiesResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewGetPropertiesResource.java new file mode 100644 index 000000000000..80429737f9d4 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewGetPropertiesResource.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The CassandraViewGetPropertiesResource model. + */ +@Immutable +public final class CassandraViewGetPropertiesResource extends CassandraViewResource { + /* + * A system generated property. A unique identifier. + */ + private String rid; + + /* + * A system generated property that denotes the last updated timestamp of the resource. + */ + private Float ts; + + /* + * A system generated property representing the resource etag required for optimistic concurrency control. + */ + private String etag; + + /** + * Creates an instance of CassandraViewGetPropertiesResource class. + */ + private CassandraViewGetPropertiesResource() { + } + + /** + * Get the rid property: A system generated property. A unique identifier. + * + * @return the rid value. + */ + public String rid() { + return this.rid; + } + + /** + * Get the ts property: A system generated property that denotes the last updated timestamp of the resource. + * + * @return the ts value. + */ + public Float ts() { + return this.ts; + } + + /** + * Get the etag property: A system generated property representing the resource etag required for optimistic + * concurrency control. + * + * @return the etag value. + */ + public String etag() { + return this.etag; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (id() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property id in model CassandraViewGetPropertiesResource")); + } + if (viewDefinition() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property viewDefinition in model CassandraViewGetPropertiesResource")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CassandraViewGetPropertiesResource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + jsonWriter.writeStringField("viewDefinition", viewDefinition()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CassandraViewGetPropertiesResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CassandraViewGetPropertiesResource if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CassandraViewGetPropertiesResource. + */ + public static CassandraViewGetPropertiesResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CassandraViewGetPropertiesResource deserializedCassandraViewGetPropertiesResource + = new CassandraViewGetPropertiesResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCassandraViewGetPropertiesResource.withId(reader.getString()); + } else if ("viewDefinition".equals(fieldName)) { + deserializedCassandraViewGetPropertiesResource.withViewDefinition(reader.getString()); + } else if ("_rid".equals(fieldName)) { + deserializedCassandraViewGetPropertiesResource.rid = reader.getString(); + } else if ("_ts".equals(fieldName)) { + deserializedCassandraViewGetPropertiesResource.ts = reader.getNullable(JsonReader::getFloat); + } else if ("_etag".equals(fieldName)) { + deserializedCassandraViewGetPropertiesResource.etag = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCassandraViewGetPropertiesResource; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewResource.java new file mode 100644 index 000000000000..3bed32022878 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewResource.java @@ -0,0 +1,134 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Cosmos DB Cassandra view resource object. + */ +@Fluent +public class CassandraViewResource implements JsonSerializable { + /* + * Name of the Cosmos DB Cassandra view + */ + private String id; + + /* + * View Definition of the Cosmos DB Cassandra view + */ + private String viewDefinition; + + /** + * Creates an instance of CassandraViewResource class. + */ + public CassandraViewResource() { + } + + /** + * Get the id property: Name of the Cosmos DB Cassandra view. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Name of the Cosmos DB Cassandra view. + * + * @param id the id value to set. + * @return the CassandraViewResource object itself. + */ + public CassandraViewResource withId(String id) { + this.id = id; + return this; + } + + /** + * Get the viewDefinition property: View Definition of the Cosmos DB Cassandra view. + * + * @return the viewDefinition value. + */ + public String viewDefinition() { + return this.viewDefinition; + } + + /** + * Set the viewDefinition property: View Definition of the Cosmos DB Cassandra view. + * + * @param viewDefinition the viewDefinition value to set. + * @return the CassandraViewResource object itself. + */ + public CassandraViewResource withViewDefinition(String viewDefinition) { + this.viewDefinition = viewDefinition; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property id in model CassandraViewResource")); + } + if (viewDefinition() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property viewDefinition in model CassandraViewResource")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CassandraViewResource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("viewDefinition", this.viewDefinition); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CassandraViewResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CassandraViewResource if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CassandraViewResource. + */ + public static CassandraViewResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CassandraViewResource deserializedCassandraViewResource = new CassandraViewResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCassandraViewResource.id = reader.getString(); + } else if ("viewDefinition".equals(fieldName)) { + deserializedCassandraViewResource.viewDefinition = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCassandraViewResource; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Certificate.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Certificate.java index 314fc9d8c034..7fdc5fb8acb2 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Certificate.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Certificate.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionIncludedPath.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionIncludedPath.java index 5f7cfd667a67..e446f65e673b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionIncludedPath.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionIncludedPath.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionKeyCreateUpdateParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionKeyCreateUpdateParameters.java index 2df99570d1a3..8fc96d091bbc 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionKeyCreateUpdateParameters.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionKeyCreateUpdateParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionKeyGetPropertiesResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionKeyGetPropertiesResource.java index 6a90d21e4e7f..1dca4fa8362e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionKeyGetPropertiesResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionKeyGetPropertiesResource.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -13,7 +13,7 @@ /** * The ClientEncryptionKeyGetPropertiesResource model. */ -@Fluent +@Immutable public final class ClientEncryptionKeyGetPropertiesResource extends ClientEncryptionKeyResource { /* * A system generated property. A unique identifier. @@ -33,7 +33,7 @@ public final class ClientEncryptionKeyGetPropertiesResource extends ClientEncryp /** * Creates an instance of ClientEncryptionKeyGetPropertiesResource class. */ - public ClientEncryptionKeyGetPropertiesResource() { + private ClientEncryptionKeyGetPropertiesResource() { } /** @@ -64,42 +64,6 @@ public String etag() { return this.etag; } - /** - * {@inheritDoc} - */ - @Override - public ClientEncryptionKeyGetPropertiesResource withId(String id) { - super.withId(id); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ClientEncryptionKeyGetPropertiesResource withEncryptionAlgorithm(String encryptionAlgorithm) { - super.withEncryptionAlgorithm(encryptionAlgorithm); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ClientEncryptionKeyGetPropertiesResource withWrappedDataEncryptionKey(byte[] wrappedDataEncryptionKey) { - super.withWrappedDataEncryptionKey(wrappedDataEncryptionKey); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ClientEncryptionKeyGetPropertiesResource withKeyWrapMetadata(KeyWrapMetadata keyWrapMetadata) { - super.withKeyWrapMetadata(keyWrapMetadata); - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionKeyResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionKeyResource.java index 92b18488e60f..8410c435aef5 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionKeyResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionKeyResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionPolicy.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionPolicy.java index 59bfa1a07391..b05293feb941 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionPolicy.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionPolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClusterKey.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClusterKey.java index cbdb8434e275..0509dd3408e3 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClusterKey.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClusterKey.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClusterResourceProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClusterResourceProperties.java index e25e6bb48da3..f172e65d6088 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClusterResourceProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClusterResourceProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -73,6 +73,11 @@ public final class ClusterResourceProperties implements JsonSerializable seedNodes; + /* + * List of the data center names for unmanaged data centers in this cluster to be included in auto-replication. + */ + private List externalDataCenters; + /* * (Deprecated) Number of hours to wait between taking a backup of the cluster. */ @@ -120,18 +130,38 @@ public final class ClusterResourceProperties implements JsonSerializable extensions; + + /* + * List of backup schedules that define when you want to back up your data. + */ + private List backupSchedules; + + /* + * How the nodes in the cluster react to scheduled events + */ + private ScheduledEventStrategy scheduledEventStrategy; + /* * How to connect to the azure services needed for running the cluster */ private AzureConnectionType azureConnectionMethod; /* - * If the Connection Method is VPN, this is the Id of the private link resource that the datacenters need to connect + * If the Connection Method is Vpn, this is the Id of the private link resource that the datacenters need to connect * to. */ private String privateLinkResourceId; @@ -348,6 +378,26 @@ public ClusterResourceProperties withRepairEnabled(Boolean repairEnabled) { return this; } + /** + * Get the autoReplicate property: The form of AutoReplicate that is being used by this cluster. + * + * @return the autoReplicate value. + */ + public AutoReplicate autoReplicate() { + return this.autoReplicate; + } + + /** + * Set the autoReplicate property: The form of AutoReplicate that is being used by this cluster. + * + * @param autoReplicate the autoReplicate value to set. + * @return the ClusterResourceProperties object itself. + */ + public ClusterResourceProperties withAutoReplicate(AutoReplicate autoReplicate) { + this.autoReplicate = autoReplicate; + return this; + } + /** * Get the clientCertificates property: List of TLS certificates used to authorize clients connecting to the * cluster. All connections are TLS encrypted whether clientCertificates is set or not, but if clientCertificates is @@ -441,6 +491,28 @@ public List seedNodes() { return this.seedNodes; } + /** + * Get the externalDataCenters property: List of the data center names for unmanaged data centers in this cluster to + * be included in auto-replication. + * + * @return the externalDataCenters value. + */ + public List externalDataCenters() { + return this.externalDataCenters; + } + + /** + * Set the externalDataCenters property: List of the data center names for unmanaged data centers in this cluster to + * be included in auto-replication. + * + * @param externalDataCenters the externalDataCenters value to set. + * @return the ClusterResourceProperties object itself. + */ + public ClusterResourceProperties withExternalDataCenters(List externalDataCenters) { + this.externalDataCenters = externalDataCenters; + return this; + } + /** * Get the hoursBetweenBackups property: (Deprecated) Number of hours to wait between taking a backup of the * cluster. @@ -503,6 +575,28 @@ public ClusterResourceProperties withCassandraAuditLoggingEnabled(Boolean cassan return this; } + /** + * Get the clusterType property: Type of the cluster. If set to Production, some operations might not be permitted + * on cluster. + * + * @return the clusterType value. + */ + public ClusterType clusterType() { + return this.clusterType; + } + + /** + * Set the clusterType property: Type of the cluster. If set to Production, some operations might not be permitted + * on cluster. + * + * @param clusterType the clusterType value to set. + * @return the ClusterResourceProperties object itself. + */ + public ClusterResourceProperties withClusterType(ClusterType clusterType) { + this.clusterType = clusterType; + return this; + } + /** * Get the provisionError property: Error related to resource provisioning. * @@ -523,6 +617,66 @@ public ClusterResourceProperties withProvisionError(CassandraError provisionErro return this; } + /** + * Get the extensions property: Extensions to be added or updated on cluster. + * + * @return the extensions value. + */ + public List extensions() { + return this.extensions; + } + + /** + * Set the extensions property: Extensions to be added or updated on cluster. + * + * @param extensions the extensions value to set. + * @return the ClusterResourceProperties object itself. + */ + public ClusterResourceProperties withExtensions(List extensions) { + this.extensions = extensions; + return this; + } + + /** + * Get the backupSchedules property: List of backup schedules that define when you want to back up your data. + * + * @return the backupSchedules value. + */ + public List backupSchedules() { + return this.backupSchedules; + } + + /** + * Set the backupSchedules property: List of backup schedules that define when you want to back up your data. + * + * @param backupSchedules the backupSchedules value to set. + * @return the ClusterResourceProperties object itself. + */ + public ClusterResourceProperties withBackupSchedules(List backupSchedules) { + this.backupSchedules = backupSchedules; + return this; + } + + /** + * Get the scheduledEventStrategy property: How the nodes in the cluster react to scheduled events. + * + * @return the scheduledEventStrategy value. + */ + public ScheduledEventStrategy scheduledEventStrategy() { + return this.scheduledEventStrategy; + } + + /** + * Set the scheduledEventStrategy property: How the nodes in the cluster react to scheduled events. + * + * @param scheduledEventStrategy the scheduledEventStrategy value to set. + * @return the ClusterResourceProperties object itself. + */ + public ClusterResourceProperties withScheduledEventStrategy(ScheduledEventStrategy scheduledEventStrategy) { + this.scheduledEventStrategy = scheduledEventStrategy; + return this; + } + /** * Get the azureConnectionMethod property: How to connect to the azure services needed for running the cluster. * @@ -544,7 +698,7 @@ public ClusterResourceProperties withAzureConnectionMethod(AzureConnectionType a } /** - * Get the privateLinkResourceId property: If the Connection Method is VPN, this is the Id of the private link + * Get the privateLinkResourceId property: If the Connection Method is Vpn, this is the Id of the private link * resource that the datacenters need to connect to. * * @return the privateLinkResourceId value. @@ -580,6 +734,9 @@ public void validate() { if (provisionError() != null) { provisionError().validate(); } + if (backupSchedules() != null) { + backupSchedules().forEach(e -> e.validate()); + } } /** @@ -599,16 +756,25 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStringField("initialCassandraAdminPassword", this.initialCassandraAdminPassword); jsonWriter.writeJsonField("prometheusEndpoint", this.prometheusEndpoint); jsonWriter.writeBooleanField("repairEnabled", this.repairEnabled); + jsonWriter.writeStringField("autoReplicate", this.autoReplicate == null ? null : this.autoReplicate.toString()); jsonWriter.writeArrayField("clientCertificates", this.clientCertificates, (writer, element) -> writer.writeJson(element)); jsonWriter.writeArrayField("externalGossipCertificates", this.externalGossipCertificates, (writer, element) -> writer.writeJson(element)); jsonWriter.writeArrayField("externalSeedNodes", this.externalSeedNodes, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("externalDataCenters", this.externalDataCenters, + (writer, element) -> writer.writeString(element)); jsonWriter.writeNumberField("hoursBetweenBackups", this.hoursBetweenBackups); jsonWriter.writeBooleanField("deallocated", this.deallocated); jsonWriter.writeBooleanField("cassandraAuditLoggingEnabled", this.cassandraAuditLoggingEnabled); + jsonWriter.writeStringField("clusterType", this.clusterType == null ? null : this.clusterType.toString()); jsonWriter.writeJsonField("provisionError", this.provisionError); + jsonWriter.writeArrayField("extensions", this.extensions, (writer, element) -> writer.writeString(element)); + jsonWriter.writeArrayField("backupSchedules", this.backupSchedules, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("scheduledEventStrategy", + this.scheduledEventStrategy == null ? null : this.scheduledEventStrategy.toString()); jsonWriter.writeStringField("azureConnectionMethod", this.azureConnectionMethod == null ? null : this.azureConnectionMethod.toString()); return jsonWriter.writeEndObject(); @@ -649,6 +815,8 @@ public static ClusterResourceProperties fromJson(JsonReader jsonReader) throws I deserializedClusterResourceProperties.prometheusEndpoint = SeedNode.fromJson(reader); } else if ("repairEnabled".equals(fieldName)) { deserializedClusterResourceProperties.repairEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("autoReplicate".equals(fieldName)) { + deserializedClusterResourceProperties.autoReplicate = AutoReplicate.fromString(reader.getString()); } else if ("clientCertificates".equals(fieldName)) { List clientCertificates = reader.readArray(reader1 -> Certificate.fromJson(reader1)); deserializedClusterResourceProperties.clientCertificates = clientCertificates; @@ -665,6 +833,9 @@ public static ClusterResourceProperties fromJson(JsonReader jsonReader) throws I } else if ("seedNodes".equals(fieldName)) { List seedNodes = reader.readArray(reader1 -> SeedNode.fromJson(reader1)); deserializedClusterResourceProperties.seedNodes = seedNodes; + } else if ("externalDataCenters".equals(fieldName)) { + List externalDataCenters = reader.readArray(reader1 -> reader1.getString()); + deserializedClusterResourceProperties.externalDataCenters = externalDataCenters; } else if ("hoursBetweenBackups".equals(fieldName)) { deserializedClusterResourceProperties.hoursBetweenBackups = reader.getNullable(JsonReader::getInt); } else if ("deallocated".equals(fieldName)) { @@ -672,8 +843,20 @@ public static ClusterResourceProperties fromJson(JsonReader jsonReader) throws I } else if ("cassandraAuditLoggingEnabled".equals(fieldName)) { deserializedClusterResourceProperties.cassandraAuditLoggingEnabled = reader.getNullable(JsonReader::getBoolean); + } else if ("clusterType".equals(fieldName)) { + deserializedClusterResourceProperties.clusterType = ClusterType.fromString(reader.getString()); } else if ("provisionError".equals(fieldName)) { deserializedClusterResourceProperties.provisionError = CassandraError.fromJson(reader); + } else if ("extensions".equals(fieldName)) { + List extensions = reader.readArray(reader1 -> reader1.getString()); + deserializedClusterResourceProperties.extensions = extensions; + } else if ("backupSchedules".equals(fieldName)) { + List backupSchedules + = reader.readArray(reader1 -> BackupSchedule.fromJson(reader1)); + deserializedClusterResourceProperties.backupSchedules = backupSchedules; + } else if ("scheduledEventStrategy".equals(fieldName)) { + deserializedClusterResourceProperties.scheduledEventStrategy + = ScheduledEventStrategy.fromString(reader.getString()); } else if ("azureConnectionMethod".equals(fieldName)) { deserializedClusterResourceProperties.azureConnectionMethod = AzureConnectionType.fromString(reader.getString()); diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClusterType.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClusterType.java new file mode 100644 index 000000000000..88f29bdf4b39 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ClusterType.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of the cluster. If set to Production, some operations might not be permitted on cluster. + */ +public final class ClusterType extends ExpandableStringEnum { + /** + * Static value Production for ClusterType. + */ + public static final ClusterType PRODUCTION = fromString("Production"); + + /** + * Static value NonProduction for ClusterType. + */ + public static final ClusterType NON_PRODUCTION = fromString("NonProduction"); + + /** + * Creates a new instance of ClusterType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ClusterType() { + } + + /** + * Creates or finds a ClusterType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ClusterType. + */ + public static ClusterType fromString(String name) { + return fromString(name, ClusterType.class); + } + + /** + * Gets known ClusterType values. + * + * @return known ClusterType values. + */ + public static Collection values() { + return values(ClusterType.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Column.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Column.java index 3a5eac75b33e..6252a17b3f6b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Column.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Column.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CommandAsyncPostBody.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CommandAsyncPostBody.java new file mode 100644 index 000000000000..944ff7ec007d --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CommandAsyncPostBody.java @@ -0,0 +1,223 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Specification of which command to run where. + */ +@Fluent +public final class CommandAsyncPostBody implements JsonSerializable { + /* + * The command which should be run + */ + private String command; + + /* + * The arguments for the command to be run + */ + private Object arguments; + + /* + * IP address of the cassandra host to run the command on + */ + private String host; + + /* + * If true, stops cassandra before executing the command and then start it again + */ + private Boolean cassandraStopStart; + + /* + * If true, allows the command to *write* to the cassandra directory, otherwise read-only. + */ + private Boolean readWrite; + + /** + * Creates an instance of CommandAsyncPostBody class. + */ + public CommandAsyncPostBody() { + } + + /** + * Get the command property: The command which should be run. + * + * @return the command value. + */ + public String command() { + return this.command; + } + + /** + * Set the command property: The command which should be run. + * + * @param command the command value to set. + * @return the CommandAsyncPostBody object itself. + */ + public CommandAsyncPostBody withCommand(String command) { + this.command = command; + return this; + } + + /** + * Get the arguments property: The arguments for the command to be run. + * + * @return the arguments value. + */ + public Object arguments() { + return this.arguments; + } + + /** + * Set the arguments property: The arguments for the command to be run. + * + * @param arguments the arguments value to set. + * @return the CommandAsyncPostBody object itself. + */ + public CommandAsyncPostBody withArguments(Object arguments) { + this.arguments = arguments; + return this; + } + + /** + * Get the host property: IP address of the cassandra host to run the command on. + * + * @return the host value. + */ + public String host() { + return this.host; + } + + /** + * Set the host property: IP address of the cassandra host to run the command on. + * + * @param host the host value to set. + * @return the CommandAsyncPostBody object itself. + */ + public CommandAsyncPostBody withHost(String host) { + this.host = host; + return this; + } + + /** + * Get the cassandraStopStart property: If true, stops cassandra before executing the command and then start it + * again. + * + * @return the cassandraStopStart value. + */ + public Boolean cassandraStopStart() { + return this.cassandraStopStart; + } + + /** + * Set the cassandraStopStart property: If true, stops cassandra before executing the command and then start it + * again. + * + * @param cassandraStopStart the cassandraStopStart value to set. + * @return the CommandAsyncPostBody object itself. + */ + public CommandAsyncPostBody withCassandraStopStart(Boolean cassandraStopStart) { + this.cassandraStopStart = cassandraStopStart; + return this; + } + + /** + * Get the readWrite property: If true, allows the command to *write* to the cassandra directory, otherwise + * read-only. + * + * @return the readWrite value. + */ + public Boolean readWrite() { + return this.readWrite; + } + + /** + * Set the readWrite property: If true, allows the command to *write* to the cassandra directory, otherwise + * read-only. + * + * @param readWrite the readWrite value to set. + * @return the CommandAsyncPostBody object itself. + */ + public CommandAsyncPostBody withReadWrite(Boolean readWrite) { + this.readWrite = readWrite; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (command() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property command in model CommandAsyncPostBody")); + } + if (host() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property host in model CommandAsyncPostBody")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CommandAsyncPostBody.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("command", this.command); + jsonWriter.writeStringField("host", this.host); + if (this.arguments != null) { + jsonWriter.writeUntypedField("arguments", this.arguments); + } + jsonWriter.writeBooleanField("cassandra-stop-start", this.cassandraStopStart); + jsonWriter.writeBooleanField("readWrite", this.readWrite); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CommandAsyncPostBody from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CommandAsyncPostBody if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CommandAsyncPostBody. + */ + public static CommandAsyncPostBody fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CommandAsyncPostBody deserializedCommandAsyncPostBody = new CommandAsyncPostBody(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("command".equals(fieldName)) { + deserializedCommandAsyncPostBody.command = reader.getString(); + } else if ("host".equals(fieldName)) { + deserializedCommandAsyncPostBody.host = reader.getString(); + } else if ("arguments".equals(fieldName)) { + deserializedCommandAsyncPostBody.arguments = reader.readUntyped(); + } else if ("cassandra-stop-start".equals(fieldName)) { + deserializedCommandAsyncPostBody.cassandraStopStart = reader.getNullable(JsonReader::getBoolean); + } else if ("readWrite".equals(fieldName)) { + deserializedCommandAsyncPostBody.readWrite = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedCommandAsyncPostBody; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CommandPostBody.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CommandPostBody.java index 250a3a2dbf85..dc69d4989d21 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CommandPostBody.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CommandPostBody.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CommandStatus.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CommandStatus.java new file mode 100644 index 000000000000..e8a5f0efc24d --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CommandStatus.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Status of the command. + */ +public final class CommandStatus extends ExpandableStringEnum { + /** + * Static value Done for CommandStatus. + */ + public static final CommandStatus DONE = fromString("Done"); + + /** + * Static value Running for CommandStatus. + */ + public static final CommandStatus RUNNING = fromString("Running"); + + /** + * Static value Enqueue for CommandStatus. + */ + public static final CommandStatus ENQUEUE = fromString("Enqueue"); + + /** + * Static value Processing for CommandStatus. + */ + public static final CommandStatus PROCESSING = fromString("Processing"); + + /** + * Static value Finished for CommandStatus. + */ + public static final CommandStatus FINISHED = fromString("Finished"); + + /** + * Static value Failed for CommandStatus. + */ + public static final CommandStatus FAILED = fromString("Failed"); + + /** + * Creates a new instance of CommandStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CommandStatus() { + } + + /** + * Creates or finds a CommandStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding CommandStatus. + */ + public static CommandStatus fromString(String name) { + return fromString(name, CommandStatus.class); + } + + /** + * Gets known CommandStatus values. + * + * @return known CommandStatus values. + */ + public static Collection values() { + return values(CommandStatus.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CompositePath.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CompositePath.java index 3ccb9d02301e..f5253eec8ac3 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CompositePath.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CompositePath.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CompositePathSortOrder.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CompositePathSortOrder.java index 6ab7a9807187..95c1843922e1 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CompositePathSortOrder.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CompositePathSortOrder.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ComputedProperty.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ComputedProperty.java index 42359e0f8a04..40c3a10513a5 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ComputedProperty.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ComputedProperty.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ConflictResolutionMode.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ConflictResolutionMode.java index 3ccd52652a81..41c78241587c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ConflictResolutionMode.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ConflictResolutionMode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ConflictResolutionPolicy.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ConflictResolutionPolicy.java index c234d036c931..ed3cf5c862b4 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ConflictResolutionPolicy.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ConflictResolutionPolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ConnectionError.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ConnectionError.java index 8edf8beba897..5948940eba58 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ConnectionError.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ConnectionError.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * The ConnectionError model. */ -@Fluent +@Immutable public final class ConnectionError implements JsonSerializable { /* * The kind of connection error that occurred. @@ -44,7 +44,7 @@ public final class ConnectionError implements JsonSerializable /** * Creates an instance of ConnectionError class. */ - public ConnectionError() { + private ConnectionError() { } /** @@ -56,17 +56,6 @@ public ConnectionState connectionState() { return this.connectionState; } - /** - * Set the connectionState property: The kind of connection error that occurred. - * - * @param connectionState the connectionState value to set. - * @return the ConnectionError object itself. - */ - public ConnectionError withConnectionState(ConnectionState connectionState) { - this.connectionState = connectionState; - return this; - } - /** * Get the iPFrom property: The IP of host that originated the failed connection. * @@ -76,17 +65,6 @@ public String iPFrom() { return this.iPFrom; } - /** - * Set the iPFrom property: The IP of host that originated the failed connection. - * - * @param iPFrom the iPFrom value to set. - * @return the ConnectionError object itself. - */ - public ConnectionError withIPFrom(String iPFrom) { - this.iPFrom = iPFrom; - return this; - } - /** * Get the iPTo property: The IP that the connection attempted to reach. * @@ -96,17 +74,6 @@ public String iPTo() { return this.iPTo; } - /** - * Set the iPTo property: The IP that the connection attempted to reach. - * - * @param iPTo the iPTo value to set. - * @return the ConnectionError object itself. - */ - public ConnectionError withIPTo(String iPTo) { - this.iPTo = iPTo; - return this; - } - /** * Get the port property: The TCP port the connection was attempted on. * @@ -116,17 +83,6 @@ public Integer port() { return this.port; } - /** - * Set the port property: The TCP port the connection was attempted on. - * - * @param port the port value to set. - * @return the ConnectionError object itself. - */ - public ConnectionError withPort(Integer port) { - this.port = port; - return this; - } - /** * Get the exception property: Detailed error message about the failed connection. * @@ -136,17 +92,6 @@ public String exception() { return this.exception; } - /** - * Set the exception property: Detailed error message about the failed connection. - * - * @param exception the exception value to set. - * @return the ConnectionError object itself. - */ - public ConnectionError withException(String exception) { - this.exception = exception; - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ConnectionState.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ConnectionState.java index 9b3edde0d2d1..b839337d7f55 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ConnectionState.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ConnectionState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ConnectorOffer.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ConnectorOffer.java index e9d81ced16c4..735d66ec4c31 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ConnectorOffer.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ConnectorOffer.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ConsistencyPolicy.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ConsistencyPolicy.java index 4067d7f3df45..d7f150d85715 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ConsistencyPolicy.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ConsistencyPolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ContainerPartitionKey.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ContainerPartitionKey.java index 6231d713b1ed..b6df40ee652e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ContainerPartitionKey.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ContainerPartitionKey.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ContinuousBackupInformation.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ContinuousBackupInformation.java index b30e58af5b41..1e0bd0b0c487 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ContinuousBackupInformation.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ContinuousBackupInformation.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * Information about the status of continuous backups. */ -@Fluent +@Immutable public final class ContinuousBackupInformation implements JsonSerializable { /* * The latest restorable timestamp for a resource. @@ -24,7 +24,7 @@ public final class ContinuousBackupInformation implements JsonSerializable { /* - * Enum to indicate type of Continuous backup mode + * Enum to indicate type of Continuos backup mode */ private ContinuousTier tier; @@ -28,7 +28,7 @@ public ContinuousModeProperties() { } /** - * Get the tier property: Enum to indicate type of Continuous backup mode. + * Get the tier property: Enum to indicate type of Continuos backup mode. * * @return the tier value. */ @@ -37,7 +37,7 @@ public ContinuousTier tier() { } /** - * Set the tier property: Enum to indicate type of Continuous backup mode. + * Set the tier property: Enum to indicate type of Continuos backup mode. * * @param tier the tier value to set. * @return the ContinuousModeProperties object itself. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ContinuousTier.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ContinuousTier.java index 4a1ba1bafef1..f85a9cd0352c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ContinuousTier.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ContinuousTier.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobMode.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobMode.java new file mode 100644 index 000000000000..4f9dbf085e30 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobMode.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Mode of job execution. + */ +public final class CopyJobMode extends ExpandableStringEnum { + /** + * Static value Offline for CopyJobMode. + */ + public static final CopyJobMode OFFLINE = fromString("Offline"); + + /** + * Static value Online for CopyJobMode. + */ + public static final CopyJobMode ONLINE = fromString("Online"); + + /** + * Creates a new instance of CopyJobMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CopyJobMode() { + } + + /** + * Creates or finds a CopyJobMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding CopyJobMode. + */ + public static CopyJobMode fromString(String name) { + return fromString(name, CopyJobMode.class); + } + + /** + * Gets known CopyJobMode values. + * + * @return known CopyJobMode values. + */ + public static Collection values() { + return values(CopyJobMode.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobProperties.java new file mode 100644 index 000000000000..ec93ebd6e333 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobProperties.java @@ -0,0 +1,260 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.core.util.CoreUtils; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.time.OffsetDateTime; + +/** + * The properties of a Copy Job. + */ +@Fluent +public final class CopyJobProperties implements JsonSerializable { + /* + * Job Properties + */ + private BaseCopyJobProperties jobProperties; + + /* + * Job Status + */ + private CopyJobStatus status; + + /* + * Processed Count + */ + private Long processedCount; + + /* + * Total Count + */ + private Long totalCount; + + /* + * Last Updated Time (ISO-8601 format) + */ + private OffsetDateTime lastUpdatedUtcTime; + + /* + * Worker count + */ + private Integer workerCount; + + /* + * Error response for Faulted job + */ + private ManagementError error; + + /* + * Total Duration of Job + */ + private String duration; + + /* + * Mode of job execution + */ + private CopyJobMode mode; + + /** + * Creates an instance of CopyJobProperties class. + */ + public CopyJobProperties() { + } + + /** + * Get the jobProperties property: Job Properties. + * + * @return the jobProperties value. + */ + public BaseCopyJobProperties jobProperties() { + return this.jobProperties; + } + + /** + * Set the jobProperties property: Job Properties. + * + * @param jobProperties the jobProperties value to set. + * @return the CopyJobProperties object itself. + */ + public CopyJobProperties withJobProperties(BaseCopyJobProperties jobProperties) { + this.jobProperties = jobProperties; + return this; + } + + /** + * Get the status property: Job Status. + * + * @return the status value. + */ + public CopyJobStatus status() { + return this.status; + } + + /** + * Get the processedCount property: Processed Count. + * + * @return the processedCount value. + */ + public Long processedCount() { + return this.processedCount; + } + + /** + * Get the totalCount property: Total Count. + * + * @return the totalCount value. + */ + public Long totalCount() { + return this.totalCount; + } + + /** + * Get the lastUpdatedUtcTime property: Last Updated Time (ISO-8601 format). + * + * @return the lastUpdatedUtcTime value. + */ + public OffsetDateTime lastUpdatedUtcTime() { + return this.lastUpdatedUtcTime; + } + + /** + * Get the workerCount property: Worker count. + * + * @return the workerCount value. + */ + public Integer workerCount() { + return this.workerCount; + } + + /** + * Set the workerCount property: Worker count. + * + * @param workerCount the workerCount value to set. + * @return the CopyJobProperties object itself. + */ + public CopyJobProperties withWorkerCount(Integer workerCount) { + this.workerCount = workerCount; + return this; + } + + /** + * Get the error property: Error response for Faulted job. + * + * @return the error value. + */ + public ManagementError error() { + return this.error; + } + + /** + * Get the duration property: Total Duration of Job. + * + * @return the duration value. + */ + public String duration() { + return this.duration; + } + + /** + * Get the mode property: Mode of job execution. + * + * @return the mode value. + */ + public CopyJobMode mode() { + return this.mode; + } + + /** + * Set the mode property: Mode of job execution. + * + * @param mode the mode value to set. + * @return the CopyJobProperties object itself. + */ + public CopyJobProperties withMode(CopyJobMode mode) { + this.mode = mode; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (jobProperties() == null) { + throw LOGGER.atError() + .log( + new IllegalArgumentException("Missing required property jobProperties in model CopyJobProperties")); + } else { + jobProperties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CopyJobProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("jobProperties", this.jobProperties); + jsonWriter.writeNumberField("workerCount", this.workerCount); + jsonWriter.writeStringField("mode", this.mode == null ? null : this.mode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CopyJobProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CopyJobProperties if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CopyJobProperties. + */ + public static CopyJobProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CopyJobProperties deserializedCopyJobProperties = new CopyJobProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("jobProperties".equals(fieldName)) { + deserializedCopyJobProperties.jobProperties = BaseCopyJobProperties.fromJson(reader); + } else if ("status".equals(fieldName)) { + deserializedCopyJobProperties.status = CopyJobStatus.fromString(reader.getString()); + } else if ("processedCount".equals(fieldName)) { + deserializedCopyJobProperties.processedCount = reader.getNullable(JsonReader::getLong); + } else if ("totalCount".equals(fieldName)) { + deserializedCopyJobProperties.totalCount = reader.getNullable(JsonReader::getLong); + } else if ("lastUpdatedUtcTime".equals(fieldName)) { + deserializedCopyJobProperties.lastUpdatedUtcTime = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); + } else if ("workerCount".equals(fieldName)) { + deserializedCopyJobProperties.workerCount = reader.getNullable(JsonReader::getInt); + } else if ("error".equals(fieldName)) { + deserializedCopyJobProperties.error = ManagementError.fromJson(reader); + } else if ("duration".equals(fieldName)) { + deserializedCopyJobProperties.duration = reader.getString(); + } else if ("mode".equals(fieldName)) { + deserializedCopyJobProperties.mode = CopyJobMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedCopyJobProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobStatus.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobStatus.java new file mode 100644 index 000000000000..854462526cee --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobStatus.java @@ -0,0 +1,76 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Job Status. + */ +public final class CopyJobStatus extends ExpandableStringEnum { + /** + * Static value Pending for CopyJobStatus. + */ + public static final CopyJobStatus PENDING = fromString("Pending"); + + /** + * Static value Partitioning for CopyJobStatus. + */ + public static final CopyJobStatus PARTITIONING = fromString("Partitioning"); + + /** + * Static value Running for CopyJobStatus. + */ + public static final CopyJobStatus RUNNING = fromString("Running"); + + /** + * Static value Paused for CopyJobStatus. + */ + public static final CopyJobStatus PAUSED = fromString("Paused"); + + /** + * Static value Completed for CopyJobStatus. + */ + public static final CopyJobStatus COMPLETED = fromString("Completed"); + + /** + * Static value Faulted for CopyJobStatus. + */ + public static final CopyJobStatus FAULTED = fromString("Faulted"); + + /** + * Static value Cancelled for CopyJobStatus. + */ + public static final CopyJobStatus CANCELLED = fromString("Cancelled"); + + /** + * Creates a new instance of CopyJobStatus value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CopyJobStatus() { + } + + /** + * Creates or finds a CopyJobStatus from its string representation. + * + * @param name a name to look for. + * @return the corresponding CopyJobStatus. + */ + public static CopyJobStatus fromString(String name) { + return fromString(name, CopyJobStatus.class); + } + + /** + * Gets known CopyJobStatus values. + * + * @return known CopyJobStatus values. + */ + public static Collection values() { + return values(CopyJobStatus.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobType.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobType.java new file mode 100644 index 000000000000..526971be2d7b --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobType.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Copy Job Type. + */ +public final class CopyJobType extends ExpandableStringEnum { + /** + * Static value CassandraRUToCassandraRU for CopyJobType. + */ + public static final CopyJobType CASSANDRA_RUTO_CASSANDRA_RU = fromString("CassandraRUToCassandraRU"); + + /** + * Static value CassandraRUToAzureBlobStorage for CopyJobType. + */ + public static final CopyJobType CASSANDRA_RUTO_AZURE_BLOB_STORAGE = fromString("CassandraRUToAzureBlobStorage"); + + /** + * Static value AzureBlobStorageToCassandraRU for CopyJobType. + */ + public static final CopyJobType AZURE_BLOB_STORAGE_TO_CASSANDRA_RU = fromString("AzureBlobStorageToCassandraRU"); + + /** + * Static value MongoRUToMongoRU for CopyJobType. + */ + public static final CopyJobType MONGO_RUTO_MONGO_RU = fromString("MongoRUToMongoRU"); + + /** + * Static value MongoRUToMongoVCore for CopyJobType. + */ + public static final CopyJobType MONGO_RUTO_MONGO_VCORE = fromString("MongoRUToMongoVCore"); + + /** + * Static value NoSqlRUToNoSqlRU for CopyJobType. + */ + public static final CopyJobType NO_SQL_RUTO_NO_SQL_RU = fromString("NoSqlRUToNoSqlRU"); + + /** + * Creates a new instance of CopyJobType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public CopyJobType() { + } + + /** + * Creates or finds a CopyJobType from its string representation. + * + * @param name a name to look for. + * @return the corresponding CopyJobType. + */ + public static CopyJobType fromString(String name) { + return fromString(name, CopyJobType.class); + } + + /** + * Gets known CopyJobType values. + * + * @return known CopyJobType values. + */ + public static Collection values() { + return values(CopyJobType.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CorsPolicy.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CorsPolicy.java index ada5adf91798..f3d1b5bd6eb3 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CorsPolicy.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CorsPolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosCassandraDataTransferDataSourceSink.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosCassandraDataTransferDataSourceSink.java new file mode 100644 index 000000000000..2e0fe6823dbd --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosCassandraDataTransferDataSourceSink.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A CosmosDB Cassandra API data source/sink. + */ +@Fluent +public final class CosmosCassandraDataTransferDataSourceSink extends DataTransferDataSourceSink { + /* + * The component property. + */ + private DataTransferComponent component = DataTransferComponent.COSMOS_DBCASSANDRA; + + /* + * The remoteAccountName property. + */ + private String remoteAccountName; + + /* + * The keyspaceName property. + */ + private String keyspaceName; + + /* + * The tableName property. + */ + private String tableName; + + /** + * Creates an instance of CosmosCassandraDataTransferDataSourceSink class. + */ + public CosmosCassandraDataTransferDataSourceSink() { + } + + /** + * Get the component property: The component property. + * + * @return the component value. + */ + @Override + public DataTransferComponent component() { + return this.component; + } + + /** + * Get the remoteAccountName property: The remoteAccountName property. + * + * @return the remoteAccountName value. + */ + public String remoteAccountName() { + return this.remoteAccountName; + } + + /** + * Set the remoteAccountName property: The remoteAccountName property. + * + * @param remoteAccountName the remoteAccountName value to set. + * @return the CosmosCassandraDataTransferDataSourceSink object itself. + */ + public CosmosCassandraDataTransferDataSourceSink withRemoteAccountName(String remoteAccountName) { + this.remoteAccountName = remoteAccountName; + return this; + } + + /** + * Get the keyspaceName property: The keyspaceName property. + * + * @return the keyspaceName value. + */ + public String keyspaceName() { + return this.keyspaceName; + } + + /** + * Set the keyspaceName property: The keyspaceName property. + * + * @param keyspaceName the keyspaceName value to set. + * @return the CosmosCassandraDataTransferDataSourceSink object itself. + */ + public CosmosCassandraDataTransferDataSourceSink withKeyspaceName(String keyspaceName) { + this.keyspaceName = keyspaceName; + return this; + } + + /** + * Get the tableName property: The tableName property. + * + * @return the tableName value. + */ + public String tableName() { + return this.tableName; + } + + /** + * Set the tableName property: The tableName property. + * + * @param tableName the tableName value to set. + * @return the CosmosCassandraDataTransferDataSourceSink object itself. + */ + public CosmosCassandraDataTransferDataSourceSink withTableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (keyspaceName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property keyspaceName in model CosmosCassandraDataTransferDataSourceSink")); + } + if (tableName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property tableName in model CosmosCassandraDataTransferDataSourceSink")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CosmosCassandraDataTransferDataSourceSink.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyspaceName", this.keyspaceName); + jsonWriter.writeStringField("tableName", this.tableName); + jsonWriter.writeStringField("component", this.component == null ? null : this.component.toString()); + jsonWriter.writeStringField("remoteAccountName", this.remoteAccountName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CosmosCassandraDataTransferDataSourceSink from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CosmosCassandraDataTransferDataSourceSink if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CosmosCassandraDataTransferDataSourceSink. + */ + public static CosmosCassandraDataTransferDataSourceSink fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CosmosCassandraDataTransferDataSourceSink deserializedCosmosCassandraDataTransferDataSourceSink + = new CosmosCassandraDataTransferDataSourceSink(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyspaceName".equals(fieldName)) { + deserializedCosmosCassandraDataTransferDataSourceSink.keyspaceName = reader.getString(); + } else if ("tableName".equals(fieldName)) { + deserializedCosmosCassandraDataTransferDataSourceSink.tableName = reader.getString(); + } else if ("component".equals(fieldName)) { + deserializedCosmosCassandraDataTransferDataSourceSink.component + = DataTransferComponent.fromString(reader.getString()); + } else if ("remoteAccountName".equals(fieldName)) { + deserializedCosmosCassandraDataTransferDataSourceSink.remoteAccountName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCosmosCassandraDataTransferDataSourceSink; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBCassandraTable.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBCassandraTable.java new file mode 100644 index 000000000000..8cb7c3d4169a --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBCassandraTable.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A CosmosDB Cassandra table. + */ +@Fluent +public final class CosmosDBCassandraTable implements JsonSerializable { + /* + * Azure Cosmos DB for Apache Cassandra keyspace. + */ + private String keyspaceName; + + /* + * Azure Cosmos DB for Apache Cassandra table. + */ + private String tableName; + + /** + * Creates an instance of CosmosDBCassandraTable class. + */ + public CosmosDBCassandraTable() { + } + + /** + * Get the keyspaceName property: Azure Cosmos DB for Apache Cassandra keyspace. + * + * @return the keyspaceName value. + */ + public String keyspaceName() { + return this.keyspaceName; + } + + /** + * Set the keyspaceName property: Azure Cosmos DB for Apache Cassandra keyspace. + * + * @param keyspaceName the keyspaceName value to set. + * @return the CosmosDBCassandraTable object itself. + */ + public CosmosDBCassandraTable withKeyspaceName(String keyspaceName) { + this.keyspaceName = keyspaceName; + return this; + } + + /** + * Get the tableName property: Azure Cosmos DB for Apache Cassandra table. + * + * @return the tableName value. + */ + public String tableName() { + return this.tableName; + } + + /** + * Set the tableName property: Azure Cosmos DB for Apache Cassandra table. + * + * @param tableName the tableName value to set. + * @return the CosmosDBCassandraTable object itself. + */ + public CosmosDBCassandraTable withTableName(String tableName) { + this.tableName = tableName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (keyspaceName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property keyspaceName in model CosmosDBCassandraTable")); + } + if (tableName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property tableName in model CosmosDBCassandraTable")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CosmosDBCassandraTable.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("keyspaceName", this.keyspaceName); + jsonWriter.writeStringField("tableName", this.tableName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CosmosDBCassandraTable from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CosmosDBCassandraTable if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CosmosDBCassandraTable. + */ + public static CosmosDBCassandraTable fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CosmosDBCassandraTable deserializedCosmosDBCassandraTable = new CosmosDBCassandraTable(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("keyspaceName".equals(fieldName)) { + deserializedCosmosDBCassandraTable.keyspaceName = reader.getString(); + } else if ("tableName".equals(fieldName)) { + deserializedCosmosDBCassandraTable.tableName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCosmosDBCassandraTable; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBMongoCollection.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBMongoCollection.java new file mode 100644 index 000000000000..c8793bcecfcc --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBMongoCollection.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A CosmosDB Mongo collection. + */ +@Fluent +public final class CosmosDBMongoCollection implements JsonSerializable { + /* + * Azure Cosmos DB for MongoDB (RU) database. + */ + private String databaseName; + + /* + * Azure Cosmos DB for MongoDB (RU) collection. + */ + private String collectionName; + + /** + * Creates an instance of CosmosDBMongoCollection class. + */ + public CosmosDBMongoCollection() { + } + + /** + * Get the databaseName property: Azure Cosmos DB for MongoDB (RU) database. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: Azure Cosmos DB for MongoDB (RU) database. + * + * @param databaseName the databaseName value to set. + * @return the CosmosDBMongoCollection object itself. + */ + public CosmosDBMongoCollection withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the collectionName property: Azure Cosmos DB for MongoDB (RU) collection. + * + * @return the collectionName value. + */ + public String collectionName() { + return this.collectionName; + } + + /** + * Set the collectionName property: Azure Cosmos DB for MongoDB (RU) collection. + * + * @param collectionName the collectionName value to set. + * @return the CosmosDBMongoCollection object itself. + */ + public CosmosDBMongoCollection withCollectionName(String collectionName) { + this.collectionName = collectionName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (databaseName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property databaseName in model CosmosDBMongoCollection")); + } + if (collectionName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property collectionName in model CosmosDBMongoCollection")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CosmosDBMongoCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("databaseName", this.databaseName); + jsonWriter.writeStringField("collectionName", this.collectionName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CosmosDBMongoCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CosmosDBMongoCollection if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CosmosDBMongoCollection. + */ + public static CosmosDBMongoCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CosmosDBMongoCollection deserializedCosmosDBMongoCollection = new CosmosDBMongoCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("databaseName".equals(fieldName)) { + deserializedCosmosDBMongoCollection.databaseName = reader.getString(); + } else if ("collectionName".equals(fieldName)) { + deserializedCosmosDBMongoCollection.collectionName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCosmosDBMongoCollection; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBMongoVCoreCollection.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBMongoVCoreCollection.java new file mode 100644 index 000000000000..778a3cb5c50a --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBMongoVCoreCollection.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A CosmosDB Mongo vCore collection. + */ +@Fluent +public final class CosmosDBMongoVCoreCollection implements JsonSerializable { + /* + * Azure Cosmos DB for MongoDB (vCore) database. + */ + private String databaseName; + + /* + * Azure Cosmos DB for MongoDB (vCore) collection. + */ + private String collectionName; + + /** + * Creates an instance of CosmosDBMongoVCoreCollection class. + */ + public CosmosDBMongoVCoreCollection() { + } + + /** + * Get the databaseName property: Azure Cosmos DB for MongoDB (vCore) database. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: Azure Cosmos DB for MongoDB (vCore) database. + * + * @param databaseName the databaseName value to set. + * @return the CosmosDBMongoVCoreCollection object itself. + */ + public CosmosDBMongoVCoreCollection withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the collectionName property: Azure Cosmos DB for MongoDB (vCore) collection. + * + * @return the collectionName value. + */ + public String collectionName() { + return this.collectionName; + } + + /** + * Set the collectionName property: Azure Cosmos DB for MongoDB (vCore) collection. + * + * @param collectionName the collectionName value to set. + * @return the CosmosDBMongoVCoreCollection object itself. + */ + public CosmosDBMongoVCoreCollection withCollectionName(String collectionName) { + this.collectionName = collectionName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (databaseName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property databaseName in model CosmosDBMongoVCoreCollection")); + } + if (collectionName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property collectionName in model CosmosDBMongoVCoreCollection")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CosmosDBMongoVCoreCollection.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("databaseName", this.databaseName); + jsonWriter.writeStringField("collectionName", this.collectionName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CosmosDBMongoVCoreCollection from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CosmosDBMongoVCoreCollection if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CosmosDBMongoVCoreCollection. + */ + public static CosmosDBMongoVCoreCollection fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CosmosDBMongoVCoreCollection deserializedCosmosDBMongoVCoreCollection = new CosmosDBMongoVCoreCollection(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("databaseName".equals(fieldName)) { + deserializedCosmosDBMongoVCoreCollection.databaseName = reader.getString(); + } else if ("collectionName".equals(fieldName)) { + deserializedCosmosDBMongoVCoreCollection.collectionName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCosmosDBMongoVCoreCollection; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBNoSqlContainer.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBNoSqlContainer.java new file mode 100644 index 000000000000..8af2545e1019 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBNoSqlContainer.java @@ -0,0 +1,135 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A CosmosDB NoSQL container. + */ +@Fluent +public final class CosmosDBNoSqlContainer implements JsonSerializable { + /* + * Azure Cosmos DB for NoSQL database. + */ + private String databaseName; + + /* + * Azure Cosmos DB for NoSQL container. + */ + private String containerName; + + /** + * Creates an instance of CosmosDBNoSqlContainer class. + */ + public CosmosDBNoSqlContainer() { + } + + /** + * Get the databaseName property: Azure Cosmos DB for NoSQL database. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: Azure Cosmos DB for NoSQL database. + * + * @param databaseName the databaseName value to set. + * @return the CosmosDBNoSqlContainer object itself. + */ + public CosmosDBNoSqlContainer withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the containerName property: Azure Cosmos DB for NoSQL container. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: Azure Cosmos DB for NoSQL container. + * + * @param containerName the containerName value to set. + * @return the CosmosDBNoSqlContainer object itself. + */ + public CosmosDBNoSqlContainer withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (databaseName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property databaseName in model CosmosDBNoSqlContainer")); + } + if (containerName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property containerName in model CosmosDBNoSqlContainer")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CosmosDBNoSqlContainer.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("databaseName", this.databaseName); + jsonWriter.writeStringField("containerName", this.containerName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CosmosDBNoSqlContainer from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CosmosDBNoSqlContainer if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CosmosDBNoSqlContainer. + */ + public static CosmosDBNoSqlContainer fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CosmosDBNoSqlContainer deserializedCosmosDBNoSqlContainer = new CosmosDBNoSqlContainer(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("databaseName".equals(fieldName)) { + deserializedCosmosDBNoSqlContainer.databaseName = reader.getString(); + } else if ("containerName".equals(fieldName)) { + deserializedCosmosDBNoSqlContainer.containerName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCosmosDBNoSqlContainer; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBSourceSinkDetails.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBSourceSinkDetails.java new file mode 100644 index 000000000000..a907c00d01f8 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBSourceSinkDetails.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A CosmosDB data source/sink details. + */ +@Fluent +public final class CosmosDBSourceSinkDetails implements JsonSerializable { + /* + * Name of remote account in case of cross-account data transfer. + */ + private String remoteAccountName; + + /** + * Creates an instance of CosmosDBSourceSinkDetails class. + */ + public CosmosDBSourceSinkDetails() { + } + + /** + * Get the remoteAccountName property: Name of remote account in case of cross-account data transfer. + * + * @return the remoteAccountName value. + */ + public String remoteAccountName() { + return this.remoteAccountName; + } + + /** + * Set the remoteAccountName property: Name of remote account in case of cross-account data transfer. + * + * @param remoteAccountName the remoteAccountName value to set. + * @return the CosmosDBSourceSinkDetails object itself. + */ + public CosmosDBSourceSinkDetails withRemoteAccountName(String remoteAccountName) { + this.remoteAccountName = remoteAccountName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("remoteAccountName", this.remoteAccountName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CosmosDBSourceSinkDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CosmosDBSourceSinkDetails if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the CosmosDBSourceSinkDetails. + */ + public static CosmosDBSourceSinkDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CosmosDBSourceSinkDetails deserializedCosmosDBSourceSinkDetails = new CosmosDBSourceSinkDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("remoteAccountName".equals(fieldName)) { + deserializedCosmosDBSourceSinkDetails.remoteAccountName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCosmosDBSourceSinkDetails; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosMongoDataTransferDataSourceSink.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosMongoDataTransferDataSourceSink.java new file mode 100644 index 000000000000..7fd2acc66190 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosMongoDataTransferDataSourceSink.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A CosmosDB Mongo API data source/sink. + */ +@Fluent +public final class CosmosMongoDataTransferDataSourceSink extends DataTransferDataSourceSink { + /* + * The component property. + */ + private DataTransferComponent component = DataTransferComponent.COSMOS_DBMONGO; + + /* + * The remoteAccountName property. + */ + private String remoteAccountName; + + /* + * The databaseName property. + */ + private String databaseName; + + /* + * The collectionName property. + */ + private String collectionName; + + /** + * Creates an instance of CosmosMongoDataTransferDataSourceSink class. + */ + public CosmosMongoDataTransferDataSourceSink() { + } + + /** + * Get the component property: The component property. + * + * @return the component value. + */ + @Override + public DataTransferComponent component() { + return this.component; + } + + /** + * Get the remoteAccountName property: The remoteAccountName property. + * + * @return the remoteAccountName value. + */ + public String remoteAccountName() { + return this.remoteAccountName; + } + + /** + * Set the remoteAccountName property: The remoteAccountName property. + * + * @param remoteAccountName the remoteAccountName value to set. + * @return the CosmosMongoDataTransferDataSourceSink object itself. + */ + public CosmosMongoDataTransferDataSourceSink withRemoteAccountName(String remoteAccountName) { + this.remoteAccountName = remoteAccountName; + return this; + } + + /** + * Get the databaseName property: The databaseName property. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: The databaseName property. + * + * @param databaseName the databaseName value to set. + * @return the CosmosMongoDataTransferDataSourceSink object itself. + */ + public CosmosMongoDataTransferDataSourceSink withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the collectionName property: The collectionName property. + * + * @return the collectionName value. + */ + public String collectionName() { + return this.collectionName; + } + + /** + * Set the collectionName property: The collectionName property. + * + * @param collectionName the collectionName value to set. + * @return the CosmosMongoDataTransferDataSourceSink object itself. + */ + public CosmosMongoDataTransferDataSourceSink withCollectionName(String collectionName) { + this.collectionName = collectionName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (databaseName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property databaseName in model CosmosMongoDataTransferDataSourceSink")); + } + if (collectionName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property collectionName in model CosmosMongoDataTransferDataSourceSink")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CosmosMongoDataTransferDataSourceSink.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("databaseName", this.databaseName); + jsonWriter.writeStringField("collectionName", this.collectionName); + jsonWriter.writeStringField("component", this.component == null ? null : this.component.toString()); + jsonWriter.writeStringField("remoteAccountName", this.remoteAccountName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CosmosMongoDataTransferDataSourceSink from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CosmosMongoDataTransferDataSourceSink if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CosmosMongoDataTransferDataSourceSink. + */ + public static CosmosMongoDataTransferDataSourceSink fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CosmosMongoDataTransferDataSourceSink deserializedCosmosMongoDataTransferDataSourceSink + = new CosmosMongoDataTransferDataSourceSink(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("databaseName".equals(fieldName)) { + deserializedCosmosMongoDataTransferDataSourceSink.databaseName = reader.getString(); + } else if ("collectionName".equals(fieldName)) { + deserializedCosmosMongoDataTransferDataSourceSink.collectionName = reader.getString(); + } else if ("component".equals(fieldName)) { + deserializedCosmosMongoDataTransferDataSourceSink.component + = DataTransferComponent.fromString(reader.getString()); + } else if ("remoteAccountName".equals(fieldName)) { + deserializedCosmosMongoDataTransferDataSourceSink.remoteAccountName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCosmosMongoDataTransferDataSourceSink; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosMongoVCoreDataTransferDataSourceSink.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosMongoVCoreDataTransferDataSourceSink.java new file mode 100644 index 000000000000..fc403053b342 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosMongoVCoreDataTransferDataSourceSink.java @@ -0,0 +1,241 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A CosmosDB Mongo vCore API data source/sink. + */ +@Fluent +public final class CosmosMongoVCoreDataTransferDataSourceSink extends DataTransferDataSourceSink { + /* + * The component property. + */ + private DataTransferComponent component = DataTransferComponent.COSMOS_DBMONGO_VCORE; + + /* + * The remoteAccountName property. + */ + private String remoteAccountName; + + /* + * The databaseName property. + */ + private String databaseName; + + /* + * The collectionName property. + */ + private String collectionName; + + /* + * The hostName property. + */ + private String hostname; + + /* + * The connectionStringKeyVaultUri property. + */ + private String connectionStringKeyVaultUri; + + /** + * Creates an instance of CosmosMongoVCoreDataTransferDataSourceSink class. + */ + public CosmosMongoVCoreDataTransferDataSourceSink() { + } + + /** + * Get the component property: The component property. + * + * @return the component value. + */ + @Override + public DataTransferComponent component() { + return this.component; + } + + /** + * Get the remoteAccountName property: The remoteAccountName property. + * + * @return the remoteAccountName value. + */ + public String remoteAccountName() { + return this.remoteAccountName; + } + + /** + * Set the remoteAccountName property: The remoteAccountName property. + * + * @param remoteAccountName the remoteAccountName value to set. + * @return the CosmosMongoVCoreDataTransferDataSourceSink object itself. + */ + public CosmosMongoVCoreDataTransferDataSourceSink withRemoteAccountName(String remoteAccountName) { + this.remoteAccountName = remoteAccountName; + return this; + } + + /** + * Get the databaseName property: The databaseName property. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: The databaseName property. + * + * @param databaseName the databaseName value to set. + * @return the CosmosMongoVCoreDataTransferDataSourceSink object itself. + */ + public CosmosMongoVCoreDataTransferDataSourceSink withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the collectionName property: The collectionName property. + * + * @return the collectionName value. + */ + public String collectionName() { + return this.collectionName; + } + + /** + * Set the collectionName property: The collectionName property. + * + * @param collectionName the collectionName value to set. + * @return the CosmosMongoVCoreDataTransferDataSourceSink object itself. + */ + public CosmosMongoVCoreDataTransferDataSourceSink withCollectionName(String collectionName) { + this.collectionName = collectionName; + return this; + } + + /** + * Get the hostname property: The hostName property. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The hostName property. + * + * @param hostname the hostname value to set. + * @return the CosmosMongoVCoreDataTransferDataSourceSink object itself. + */ + public CosmosMongoVCoreDataTransferDataSourceSink withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the connectionStringKeyVaultUri property: The connectionStringKeyVaultUri property. + * + * @return the connectionStringKeyVaultUri value. + */ + public String connectionStringKeyVaultUri() { + return this.connectionStringKeyVaultUri; + } + + /** + * Set the connectionStringKeyVaultUri property: The connectionStringKeyVaultUri property. + * + * @param connectionStringKeyVaultUri the connectionStringKeyVaultUri value to set. + * @return the CosmosMongoVCoreDataTransferDataSourceSink object itself. + */ + public CosmosMongoVCoreDataTransferDataSourceSink + withConnectionStringKeyVaultUri(String connectionStringKeyVaultUri) { + this.connectionStringKeyVaultUri = connectionStringKeyVaultUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (databaseName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property databaseName in model CosmosMongoVCoreDataTransferDataSourceSink")); + } + if (collectionName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property collectionName in model CosmosMongoVCoreDataTransferDataSourceSink")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CosmosMongoVCoreDataTransferDataSourceSink.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("databaseName", this.databaseName); + jsonWriter.writeStringField("collectionName", this.collectionName); + jsonWriter.writeStringField("component", this.component == null ? null : this.component.toString()); + jsonWriter.writeStringField("remoteAccountName", this.remoteAccountName); + jsonWriter.writeStringField("hostName", this.hostname); + jsonWriter.writeStringField("connectionStringKeyVaultUri", this.connectionStringKeyVaultUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CosmosMongoVCoreDataTransferDataSourceSink from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CosmosMongoVCoreDataTransferDataSourceSink if the JsonReader was pointing to an instance + * of it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CosmosMongoVCoreDataTransferDataSourceSink. + */ + public static CosmosMongoVCoreDataTransferDataSourceSink fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CosmosMongoVCoreDataTransferDataSourceSink deserializedCosmosMongoVCoreDataTransferDataSourceSink + = new CosmosMongoVCoreDataTransferDataSourceSink(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("databaseName".equals(fieldName)) { + deserializedCosmosMongoVCoreDataTransferDataSourceSink.databaseName = reader.getString(); + } else if ("collectionName".equals(fieldName)) { + deserializedCosmosMongoVCoreDataTransferDataSourceSink.collectionName = reader.getString(); + } else if ("component".equals(fieldName)) { + deserializedCosmosMongoVCoreDataTransferDataSourceSink.component + = DataTransferComponent.fromString(reader.getString()); + } else if ("remoteAccountName".equals(fieldName)) { + deserializedCosmosMongoVCoreDataTransferDataSourceSink.remoteAccountName = reader.getString(); + } else if ("hostName".equals(fieldName)) { + deserializedCosmosMongoVCoreDataTransferDataSourceSink.hostname = reader.getString(); + } else if ("connectionStringKeyVaultUri".equals(fieldName)) { + deserializedCosmosMongoVCoreDataTransferDataSourceSink.connectionStringKeyVaultUri + = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCosmosMongoVCoreDataTransferDataSourceSink; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosSqlDataTransferDataSourceSink.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosSqlDataTransferDataSourceSink.java new file mode 100644 index 000000000000..075be07ceca6 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CosmosSqlDataTransferDataSourceSink.java @@ -0,0 +1,183 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A CosmosDB No Sql API data source/sink. + */ +@Fluent +public final class CosmosSqlDataTransferDataSourceSink extends DataTransferDataSourceSink { + /* + * The component property. + */ + private DataTransferComponent component = DataTransferComponent.COSMOS_DBSQL; + + /* + * The remoteAccountName property. + */ + private String remoteAccountName; + + /* + * The databaseName property. + */ + private String databaseName; + + /* + * The containerName property. + */ + private String containerName; + + /** + * Creates an instance of CosmosSqlDataTransferDataSourceSink class. + */ + public CosmosSqlDataTransferDataSourceSink() { + } + + /** + * Get the component property: The component property. + * + * @return the component value. + */ + @Override + public DataTransferComponent component() { + return this.component; + } + + /** + * Get the remoteAccountName property: The remoteAccountName property. + * + * @return the remoteAccountName value. + */ + public String remoteAccountName() { + return this.remoteAccountName; + } + + /** + * Set the remoteAccountName property: The remoteAccountName property. + * + * @param remoteAccountName the remoteAccountName value to set. + * @return the CosmosSqlDataTransferDataSourceSink object itself. + */ + public CosmosSqlDataTransferDataSourceSink withRemoteAccountName(String remoteAccountName) { + this.remoteAccountName = remoteAccountName; + return this; + } + + /** + * Get the databaseName property: The databaseName property. + * + * @return the databaseName value. + */ + public String databaseName() { + return this.databaseName; + } + + /** + * Set the databaseName property: The databaseName property. + * + * @param databaseName the databaseName value to set. + * @return the CosmosSqlDataTransferDataSourceSink object itself. + */ + public CosmosSqlDataTransferDataSourceSink withDatabaseName(String databaseName) { + this.databaseName = databaseName; + return this; + } + + /** + * Get the containerName property: The containerName property. + * + * @return the containerName value. + */ + public String containerName() { + return this.containerName; + } + + /** + * Set the containerName property: The containerName property. + * + * @param containerName the containerName value to set. + * @return the CosmosSqlDataTransferDataSourceSink object itself. + */ + public CosmosSqlDataTransferDataSourceSink withContainerName(String containerName) { + this.containerName = containerName; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (databaseName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property databaseName in model CosmosSqlDataTransferDataSourceSink")); + } + if (containerName() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property containerName in model CosmosSqlDataTransferDataSourceSink")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CosmosSqlDataTransferDataSourceSink.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("databaseName", this.databaseName); + jsonWriter.writeStringField("containerName", this.containerName); + jsonWriter.writeStringField("component", this.component == null ? null : this.component.toString()); + jsonWriter.writeStringField("remoteAccountName", this.remoteAccountName); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CosmosSqlDataTransferDataSourceSink from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CosmosSqlDataTransferDataSourceSink if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CosmosSqlDataTransferDataSourceSink. + */ + public static CosmosSqlDataTransferDataSourceSink fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CosmosSqlDataTransferDataSourceSink deserializedCosmosSqlDataTransferDataSourceSink + = new CosmosSqlDataTransferDataSourceSink(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("databaseName".equals(fieldName)) { + deserializedCosmosSqlDataTransferDataSourceSink.databaseName = reader.getString(); + } else if ("containerName".equals(fieldName)) { + deserializedCosmosSqlDataTransferDataSourceSink.containerName = reader.getString(); + } else if ("component".equals(fieldName)) { + deserializedCosmosSqlDataTransferDataSourceSink.component + = DataTransferComponent.fromString(reader.getString()); + } else if ("remoteAccountName".equals(fieldName)) { + deserializedCosmosSqlDataTransferDataSourceSink.remoteAccountName = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedCosmosSqlDataTransferDataSourceSink; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CreateJobRequest.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CreateJobRequest.java new file mode 100644 index 000000000000..dc52691984b5 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CreateJobRequest.java @@ -0,0 +1,155 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.fluent.models.DataTransferJobProperties; +import java.io.IOException; + +/** + * Parameters to create Data Transfer Job. + */ +@Fluent +public final class CreateJobRequest extends ArmProxyResource { + /* + * Data Transfer Create Job Properties + */ + private DataTransferJobProperties properties; + + /* + * The type of Azure resource. + */ + private String type; + + /* + * The name of the database account. + */ + private String name; + + /* + * The unique resource identifier of the database account. + */ + private String id; + + /** + * Creates an instance of CreateJobRequest class. + */ + public CreateJobRequest() { + } + + /** + * Get the properties property: Data Transfer Create Job Properties. + * + * @return the properties value. + */ + public DataTransferJobProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Data Transfer Create Job Properties. + * + * @param properties the properties value to set. + * @return the CreateJobRequest object itself. + */ + public CreateJobRequest withProperties(DataTransferJobProperties properties) { + this.properties = properties; + return this; + } + + /** + * Get the type property: The type of Azure resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the database account. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: The unique resource identifier of the database account. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (properties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property properties in model CreateJobRequest")); + } else { + properties().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(CreateJobRequest.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of CreateJobRequest from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of CreateJobRequest if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the CreateJobRequest. + */ + public static CreateJobRequest fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + CreateJobRequest deserializedCreateJobRequest = new CreateJobRequest(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedCreateJobRequest.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedCreateJobRequest.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedCreateJobRequest.type = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedCreateJobRequest.properties = DataTransferJobProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedCreateJobRequest; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CreateMode.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CreateMode.java index 39011ce113da..552ca9ad1755 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CreateMode.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CreateMode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CreateUpdateOptions.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CreateUpdateOptions.java index 75748d00a191..9c40559e2cdb 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CreateUpdateOptions.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/CreateUpdateOptions.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataCenterResourceProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataCenterResourceProperties.java index f28504da6473..13901cdb635c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataCenterResourceProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataCenterResourceProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataMaskingPolicy.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataMaskingPolicy.java new file mode 100644 index 000000000000..250d5e890065 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataMaskingPolicy.java @@ -0,0 +1,160 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Data masking policy for the container. + */ +@Fluent +public final class DataMaskingPolicy implements JsonSerializable { + /* + * List of JSON paths to include in the masking policy. + */ + private List includedPaths; + + /* + * List of JSON paths to exclude from masking. + */ + private List excludedPaths; + + /* + * Flag indicating whether the data masking policy is enabled. + */ + private Boolean isPolicyEnabled; + + /** + * Creates an instance of DataMaskingPolicy class. + */ + public DataMaskingPolicy() { + } + + /** + * Get the includedPaths property: List of JSON paths to include in the masking policy. + * + * @return the includedPaths value. + */ + public List includedPaths() { + return this.includedPaths; + } + + /** + * Set the includedPaths property: List of JSON paths to include in the masking policy. + * + * @param includedPaths the includedPaths value to set. + * @return the DataMaskingPolicy object itself. + */ + public DataMaskingPolicy withIncludedPaths(List includedPaths) { + this.includedPaths = includedPaths; + return this; + } + + /** + * Get the excludedPaths property: List of JSON paths to exclude from masking. + * + * @return the excludedPaths value. + */ + public List excludedPaths() { + return this.excludedPaths; + } + + /** + * Set the excludedPaths property: List of JSON paths to exclude from masking. + * + * @param excludedPaths the excludedPaths value to set. + * @return the DataMaskingPolicy object itself. + */ + public DataMaskingPolicy withExcludedPaths(List excludedPaths) { + this.excludedPaths = excludedPaths; + return this; + } + + /** + * Get the isPolicyEnabled property: Flag indicating whether the data masking policy is enabled. + * + * @return the isPolicyEnabled value. + */ + public Boolean isPolicyEnabled() { + return this.isPolicyEnabled; + } + + /** + * Set the isPolicyEnabled property: Flag indicating whether the data masking policy is enabled. + * + * @param isPolicyEnabled the isPolicyEnabled value to set. + * @return the DataMaskingPolicy object itself. + */ + public DataMaskingPolicy withIsPolicyEnabled(Boolean isPolicyEnabled) { + this.isPolicyEnabled = isPolicyEnabled; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (includedPaths() != null) { + includedPaths().forEach(e -> e.validate()); + } + if (excludedPaths() != null) { + excludedPaths().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("includedPaths", this.includedPaths, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("excludedPaths", this.excludedPaths, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeBooleanField("isPolicyEnabled", this.isPolicyEnabled); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataMaskingPolicy from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataMaskingPolicy if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the DataMaskingPolicy. + */ + public static DataMaskingPolicy fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataMaskingPolicy deserializedDataMaskingPolicy = new DataMaskingPolicy(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("includedPaths".equals(fieldName)) { + List includedPaths + = reader.readArray(reader1 -> DataMaskingPolicyIncludedPath.fromJson(reader1)); + deserializedDataMaskingPolicy.includedPaths = includedPaths; + } else if ("excludedPaths".equals(fieldName)) { + List excludedPaths + = reader.readArray(reader1 -> DataMaskingPolicyExcludedPath.fromJson(reader1)); + deserializedDataMaskingPolicy.excludedPaths = excludedPaths; + } else if ("isPolicyEnabled".equals(fieldName)) { + deserializedDataMaskingPolicy.isPolicyEnabled = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedDataMaskingPolicy; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataMaskingPolicyExcludedPath.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataMaskingPolicyExcludedPath.java new file mode 100644 index 000000000000..8e6960ff7deb --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataMaskingPolicyExcludedPath.java @@ -0,0 +1,103 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * JSON path to exclude from masking. + */ +@Fluent +public final class DataMaskingPolicyExcludedPath implements JsonSerializable { + /* + * The JSON path to exclude from masking (e.g. "/id"). + */ + private String path; + + /** + * Creates an instance of DataMaskingPolicyExcludedPath class. + */ + public DataMaskingPolicyExcludedPath() { + } + + /** + * Get the path property: The JSON path to exclude from masking (e.g. "/id"). + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: The JSON path to exclude from masking (e.g. "/id"). + * + * @param path the path value to set. + * @return the DataMaskingPolicyExcludedPath object itself. + */ + public DataMaskingPolicyExcludedPath withPath(String path) { + this.path = path; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (path() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property path in model DataMaskingPolicyExcludedPath")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataMaskingPolicyExcludedPath.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("path", this.path); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataMaskingPolicyExcludedPath from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataMaskingPolicyExcludedPath if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataMaskingPolicyExcludedPath. + */ + public static DataMaskingPolicyExcludedPath fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataMaskingPolicyExcludedPath deserializedDataMaskingPolicyExcludedPath + = new DataMaskingPolicyExcludedPath(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("path".equals(fieldName)) { + deserializedDataMaskingPolicyExcludedPath.path = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedDataMaskingPolicyExcludedPath; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataMaskingPolicyIncludedPath.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataMaskingPolicyIncludedPath.java new file mode 100644 index 000000000000..fda1edf8407c --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataMaskingPolicyIncludedPath.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * JSON path to include in the masking policy. + */ +@Fluent +public final class DataMaskingPolicyIncludedPath implements JsonSerializable { + /* + * The JSON path to apply masking (e.g. "/contact/phones"). + */ + private String path; + + /* + * Masking strategy to apply (e.g. "MaskSubstring"). + */ + private String strategy; + + /* + * Start position for substring masking (when applicable). + */ + private Integer startPosition; + + /* + * Length of substring to mask (when applicable). + */ + private Integer length; + + /** + * Creates an instance of DataMaskingPolicyIncludedPath class. + */ + public DataMaskingPolicyIncludedPath() { + } + + /** + * Get the path property: The JSON path to apply masking (e.g. "/contact/phones"). + * + * @return the path value. + */ + public String path() { + return this.path; + } + + /** + * Set the path property: The JSON path to apply masking (e.g. "/contact/phones"). + * + * @param path the path value to set. + * @return the DataMaskingPolicyIncludedPath object itself. + */ + public DataMaskingPolicyIncludedPath withPath(String path) { + this.path = path; + return this; + } + + /** + * Get the strategy property: Masking strategy to apply (e.g. "MaskSubstring"). + * + * @return the strategy value. + */ + public String strategy() { + return this.strategy; + } + + /** + * Set the strategy property: Masking strategy to apply (e.g. "MaskSubstring"). + * + * @param strategy the strategy value to set. + * @return the DataMaskingPolicyIncludedPath object itself. + */ + public DataMaskingPolicyIncludedPath withStrategy(String strategy) { + this.strategy = strategy; + return this; + } + + /** + * Get the startPosition property: Start position for substring masking (when applicable). + * + * @return the startPosition value. + */ + public Integer startPosition() { + return this.startPosition; + } + + /** + * Set the startPosition property: Start position for substring masking (when applicable). + * + * @param startPosition the startPosition value to set. + * @return the DataMaskingPolicyIncludedPath object itself. + */ + public DataMaskingPolicyIncludedPath withStartPosition(Integer startPosition) { + this.startPosition = startPosition; + return this; + } + + /** + * Get the length property: Length of substring to mask (when applicable). + * + * @return the length value. + */ + public Integer length() { + return this.length; + } + + /** + * Set the length property: Length of substring to mask (when applicable). + * + * @param length the length value to set. + * @return the DataMaskingPolicyIncludedPath object itself. + */ + public DataMaskingPolicyIncludedPath withLength(Integer length) { + this.length = length; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (path() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property path in model DataMaskingPolicyIncludedPath")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(DataMaskingPolicyIncludedPath.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("path", this.path); + jsonWriter.writeStringField("strategy", this.strategy); + jsonWriter.writeNumberField("startPosition", this.startPosition); + jsonWriter.writeNumberField("length", this.length); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataMaskingPolicyIncludedPath from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataMaskingPolicyIncludedPath if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the DataMaskingPolicyIncludedPath. + */ + public static DataMaskingPolicyIncludedPath fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataMaskingPolicyIncludedPath deserializedDataMaskingPolicyIncludedPath + = new DataMaskingPolicyIncludedPath(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("path".equals(fieldName)) { + deserializedDataMaskingPolicyIncludedPath.path = reader.getString(); + } else if ("strategy".equals(fieldName)) { + deserializedDataMaskingPolicyIncludedPath.strategy = reader.getString(); + } else if ("startPosition".equals(fieldName)) { + deserializedDataMaskingPolicyIncludedPath.startPosition = reader.getNullable(JsonReader::getInt); + } else if ("length".equals(fieldName)) { + deserializedDataMaskingPolicyIncludedPath.length = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedDataMaskingPolicyIncludedPath; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferComponent.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferComponent.java new file mode 100644 index 000000000000..c93e2240f5f5 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferComponent.java @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Defines values for DataTransferComponent. + */ +public final class DataTransferComponent extends ExpandableStringEnum { + /** + * Static value CosmosDBCassandra for DataTransferComponent. + */ + public static final DataTransferComponent COSMOS_DBCASSANDRA = fromString("CosmosDBCassandra"); + + /** + * Static value CosmosDBMongo for DataTransferComponent. + */ + public static final DataTransferComponent COSMOS_DBMONGO = fromString("CosmosDBMongo"); + + /** + * Static value CosmosDBMongoVCore for DataTransferComponent. + */ + public static final DataTransferComponent COSMOS_DBMONGO_VCORE = fromString("CosmosDBMongoVCore"); + + /** + * Static value CosmosDBSql for DataTransferComponent. + */ + public static final DataTransferComponent COSMOS_DBSQL = fromString("CosmosDBSql"); + + /** + * Static value AzureBlobStorage for DataTransferComponent. + */ + public static final DataTransferComponent AZURE_BLOB_STORAGE = fromString("AzureBlobStorage"); + + /** + * Creates a new instance of DataTransferComponent value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DataTransferComponent() { + } + + /** + * Creates or finds a DataTransferComponent from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataTransferComponent. + */ + public static DataTransferComponent fromString(String name) { + return fromString(name, DataTransferComponent.class); + } + + /** + * Gets known DataTransferComponent values. + * + * @return known DataTransferComponent values. + */ + public static Collection values() { + return values(DataTransferComponent.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferDataSourceSink.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferDataSourceSink.java new file mode 100644 index 000000000000..7fc0b8424f14 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferDataSourceSink.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Base class for all DataTransfer source/sink. + */ +@Immutable +public class DataTransferDataSourceSink implements JsonSerializable { + /* + * The component property. + */ + private DataTransferComponent component = DataTransferComponent.fromString("DataTransferDataSourceSink"); + + /** + * Creates an instance of DataTransferDataSourceSink class. + */ + public DataTransferDataSourceSink() { + } + + /** + * Get the component property: The component property. + * + * @return the component value. + */ + public DataTransferComponent component() { + return this.component; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("component", this.component == null ? null : this.component.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DataTransferDataSourceSink from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DataTransferDataSourceSink if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the DataTransferDataSourceSink. + */ + public static DataTransferDataSourceSink fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + String discriminatorValue = null; + try (JsonReader readerToUse = reader.bufferObject()) { + readerToUse.nextToken(); // Prepare for reading + while (readerToUse.nextToken() != JsonToken.END_OBJECT) { + String fieldName = readerToUse.getFieldName(); + readerToUse.nextToken(); + if ("component".equals(fieldName)) { + discriminatorValue = readerToUse.getString(); + break; + } else { + readerToUse.skipChildren(); + } + } + // Use the discriminator value to determine which subtype should be deserialized. + if ("CosmosDBCassandra".equals(discriminatorValue)) { + return CosmosCassandraDataTransferDataSourceSink.fromJson(readerToUse.reset()); + } else if ("CosmosDBMongo".equals(discriminatorValue)) { + return CosmosMongoDataTransferDataSourceSink.fromJson(readerToUse.reset()); + } else if ("CosmosDBMongoVCore".equals(discriminatorValue)) { + return CosmosMongoVCoreDataTransferDataSourceSink.fromJson(readerToUse.reset()); + } else if ("CosmosDBSql".equals(discriminatorValue)) { + return CosmosSqlDataTransferDataSourceSink.fromJson(readerToUse.reset()); + } else if ("AzureBlobStorage".equals(discriminatorValue)) { + return AzureBlobDataTransferDataSourceSink.fromJson(readerToUse.reset()); + } else { + return fromJsonKnownDiscriminator(readerToUse.reset()); + } + } + }); + } + + static DataTransferDataSourceSink fromJsonKnownDiscriminator(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DataTransferDataSourceSink deserializedDataTransferDataSourceSink = new DataTransferDataSourceSink(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("component".equals(fieldName)) { + deserializedDataTransferDataSourceSink.component + = DataTransferComponent.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDataTransferDataSourceSink; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferJobMode.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferJobMode.java new file mode 100644 index 000000000000..b05fd5830741 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferJobMode.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Mode of job execution. + */ +public final class DataTransferJobMode extends ExpandableStringEnum { + /** + * Static value Offline for DataTransferJobMode. + */ + public static final DataTransferJobMode OFFLINE = fromString("Offline"); + + /** + * Static value Online for DataTransferJobMode. + */ + public static final DataTransferJobMode ONLINE = fromString("Online"); + + /** + * Creates a new instance of DataTransferJobMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public DataTransferJobMode() { + } + + /** + * Creates or finds a DataTransferJobMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding DataTransferJobMode. + */ + public static DataTransferJobMode fromString(String name) { + return fromString(name, DataTransferJobMode.class); + } + + /** + * Gets known DataTransferJobMode values. + * + * @return known DataTransferJobMode values. + */ + public static Collection values() { + return values(DataTransferJobMode.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferRegionalServiceResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferRegionalServiceResource.java index 7665cc03aee6..f6fef64367e5 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferRegionalServiceResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferRegionalServiceResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -33,7 +33,7 @@ public final class DataTransferRegionalServiceResource extends RegionalServiceRe /** * Creates an instance of DataTransferRegionalServiceResource class. */ - public DataTransferRegionalServiceResource() { + private DataTransferRegionalServiceResource() { } /** diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferServiceResourceCreateUpdateParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferServiceResourceCreateUpdateParameters.java index eab28e9c975e..cf3a13e45967 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferServiceResourceCreateUpdateParameters.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferServiceResourceCreateUpdateParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferServiceResourceProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferServiceResourceProperties.java index d2bc67745b81..1addd1d8780b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferServiceResourceProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferServiceResourceProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -17,7 +17,7 @@ /** * Properties for DataTransferServiceResource. */ -@Fluent +@Immutable public final class DataTransferServiceResourceProperties extends ServiceResourceProperties { /* * ServiceType for the service. @@ -32,7 +32,7 @@ public final class DataTransferServiceResourceProperties extends ServiceResource /** * Creates an instance of DataTransferServiceResourceProperties class. */ - public DataTransferServiceResourceProperties() { + private DataTransferServiceResourceProperties() { } /** @@ -54,24 +54,6 @@ public List locations() { return this.locations; } - /** - * {@inheritDoc} - */ - @Override - public DataTransferServiceResourceProperties withInstanceSize(ServiceSize instanceSize) { - super.withInstanceSize(instanceSize); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public DataTransferServiceResourceProperties withInstanceCount(Integer instanceCount) { - super.withInstanceCount(instanceCount); - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataType.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataType.java index 40ff60e7fef7..b5e9107373a8 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataType.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DataType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountConnectionString.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountConnectionString.java index f3dabc910eaf..3d9d76336572 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountConnectionString.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountConnectionString.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -39,7 +39,7 @@ public final class DatabaseAccountConnectionString implements JsonSerializable locati } /** - * Get the databaseAccountOfferType property: The offer type for the database. + * Get the databaseAccountOfferType property: The offer type for the Cosmos DB database account. * * @return the databaseAccountOfferType value. */ @@ -711,6 +711,32 @@ public List networkAclBypassResourceIds() { return this; } + /** + * Get the diagnosticLogSettings property: The Object representing the different Diagnostic log settings for the + * Cosmos DB Account. + * + * @return the diagnosticLogSettings value. + */ + public DiagnosticLogSettings diagnosticLogSettings() { + return this.innerProperties() == null ? null : this.innerProperties().diagnosticLogSettings(); + } + + /** + * Set the diagnosticLogSettings property: The Object representing the different Diagnostic log settings for the + * Cosmos DB Account. + * + * @param diagnosticLogSettings the diagnosticLogSettings value to set. + * @return the DatabaseAccountCreateUpdateParameters object itself. + */ + public DatabaseAccountCreateUpdateParameters + withDiagnosticLogSettings(DiagnosticLogSettings diagnosticLogSettings) { + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseAccountCreateUpdateProperties(); + } + this.innerProperties().withDiagnosticLogSettings(diagnosticLogSettings); + return this; + } + /** * Get the disableLocalAuth property: Opt-out of local authentication and ensure only MSI and AAD can be used * exclusively for authentication. @@ -784,6 +810,54 @@ public DatabaseAccountCreateUpdateParameters withCapacity(Capacity capacity) { return this; } + /** + * Get the capacityMode property: Indicates the capacityMode of the Cosmos DB account. + * + * @return the capacityMode value. + */ + public CapacityMode capacityMode() { + return this.innerProperties() == null ? null : this.innerProperties().capacityMode(); + } + + /** + * Set the capacityMode property: Indicates the capacityMode of the Cosmos DB account. + * + * @param capacityMode the capacityMode value to set. + * @return the DatabaseAccountCreateUpdateParameters object itself. + */ + public DatabaseAccountCreateUpdateParameters withCapacityMode(CapacityMode capacityMode) { + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseAccountCreateUpdateProperties(); + } + this.innerProperties().withCapacityMode(capacityMode); + return this; + } + + /** + * Get the enableMaterializedViews property: Flag to indicate whether to enable MaterializedViews on the Cosmos DB + * account. + * + * @return the enableMaterializedViews value. + */ + public Boolean enableMaterializedViews() { + return this.innerProperties() == null ? null : this.innerProperties().enableMaterializedViews(); + } + + /** + * Set the enableMaterializedViews property: Flag to indicate whether to enable MaterializedViews on the Cosmos DB + * account. + * + * @param enableMaterializedViews the enableMaterializedViews value to set. + * @return the DatabaseAccountCreateUpdateParameters object itself. + */ + public DatabaseAccountCreateUpdateParameters withEnableMaterializedViews(Boolean enableMaterializedViews) { + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseAccountCreateUpdateProperties(); + } + this.innerProperties().withEnableMaterializedViews(enableMaterializedViews); + return this; + } + /** * Get the keysMetadata property: This property is ignored during the update/create operation, as the metadata is * read-only. The object represents the metadata for the Account Keys of the Cosmos DB account. @@ -820,52 +894,52 @@ public DatabaseAccountCreateUpdateParameters withEnablePartitionMerge(Boolean en } /** - * Get the minimalTlsVersion property: Indicates the minimum allowed Tls version. The default value is Tls 1.2. - * Cassandra and Mongo APIs only work with Tls 1.2. + * Get the enableBurstCapacity property: Flag to indicate enabling/disabling of Burst Capacity Preview feature on + * the account. * - * @return the minimalTlsVersion value. + * @return the enableBurstCapacity value. */ - public MinimalTlsVersion minimalTlsVersion() { - return this.innerProperties() == null ? null : this.innerProperties().minimalTlsVersion(); + public Boolean enableBurstCapacity() { + return this.innerProperties() == null ? null : this.innerProperties().enableBurstCapacity(); } /** - * Set the minimalTlsVersion property: Indicates the minimum allowed Tls version. The default value is Tls 1.2. - * Cassandra and Mongo APIs only work with Tls 1.2. + * Set the enableBurstCapacity property: Flag to indicate enabling/disabling of Burst Capacity Preview feature on + * the account. * - * @param minimalTlsVersion the minimalTlsVersion value to set. + * @param enableBurstCapacity the enableBurstCapacity value to set. * @return the DatabaseAccountCreateUpdateParameters object itself. */ - public DatabaseAccountCreateUpdateParameters withMinimalTlsVersion(MinimalTlsVersion minimalTlsVersion) { + public DatabaseAccountCreateUpdateParameters withEnableBurstCapacity(Boolean enableBurstCapacity) { if (this.innerProperties() == null) { this.innerProperties = new DatabaseAccountCreateUpdateProperties(); } - this.innerProperties().withMinimalTlsVersion(minimalTlsVersion); + this.innerProperties().withEnableBurstCapacity(enableBurstCapacity); return this; } /** - * Get the enableBurstCapacity property: Flag to indicate enabling/disabling of Burst Capacity feature on the - * account. + * Get the minimalTlsVersion property: Indicates the minimum allowed Tls version. The default is Tls 1.0, except for + * Cassandra and Mongo API's, which only work with Tls 1.2. * - * @return the enableBurstCapacity value. + * @return the minimalTlsVersion value. */ - public Boolean enableBurstCapacity() { - return this.innerProperties() == null ? null : this.innerProperties().enableBurstCapacity(); + public MinimalTlsVersion minimalTlsVersion() { + return this.innerProperties() == null ? null : this.innerProperties().minimalTlsVersion(); } /** - * Set the enableBurstCapacity property: Flag to indicate enabling/disabling of Burst Capacity feature on the - * account. + * Set the minimalTlsVersion property: Indicates the minimum allowed Tls version. The default is Tls 1.0, except for + * Cassandra and Mongo API's, which only work with Tls 1.2. * - * @param enableBurstCapacity the enableBurstCapacity value to set. + * @param minimalTlsVersion the minimalTlsVersion value to set. * @return the DatabaseAccountCreateUpdateParameters object itself. */ - public DatabaseAccountCreateUpdateParameters withEnableBurstCapacity(Boolean enableBurstCapacity) { + public DatabaseAccountCreateUpdateParameters withMinimalTlsVersion(MinimalTlsVersion minimalTlsVersion) { if (this.innerProperties() == null) { this.innerProperties = new DatabaseAccountCreateUpdateProperties(); } - this.innerProperties().withEnableBurstCapacity(enableBurstCapacity); + this.innerProperties().withMinimalTlsVersion(minimalTlsVersion); return this; } @@ -894,32 +968,6 @@ public DatabaseAccountCreateUpdateParameters withCustomerManagedKeyStatus(String return this; } - /** - * Get the enablePerRegionPerPartitionAutoscale property: Flag to indicate enabling/disabling of - * PerRegionPerPartitionAutoscale feature on the account. - * - * @return the enablePerRegionPerPartitionAutoscale value. - */ - public Boolean enablePerRegionPerPartitionAutoscale() { - return this.innerProperties() == null ? null : this.innerProperties().enablePerRegionPerPartitionAutoscale(); - } - - /** - * Set the enablePerRegionPerPartitionAutoscale property: Flag to indicate enabling/disabling of - * PerRegionPerPartitionAutoscale feature on the account. - * - * @param enablePerRegionPerPartitionAutoscale the enablePerRegionPerPartitionAutoscale value to set. - * @return the DatabaseAccountCreateUpdateParameters object itself. - */ - public DatabaseAccountCreateUpdateParameters - withEnablePerRegionPerPartitionAutoscale(Boolean enablePerRegionPerPartitionAutoscale) { - if (this.innerProperties() == null) { - this.innerProperties = new DatabaseAccountCreateUpdateProperties(); - } - this.innerProperties().withEnablePerRegionPerPartitionAutoscale(enablePerRegionPerPartitionAutoscale); - return this; - } - /** * Get the enablePriorityBasedExecution property: Flag to indicate enabling/disabling of Priority Based Execution * Preview feature on the account. @@ -971,6 +1019,58 @@ public DatabaseAccountCreateUpdateParameters withDefaultPriorityLevel(DefaultPri return this; } + /** + * Get the enablePerRegionPerPartitionAutoscale property: Flag to indicate enabling/disabling of Per-Region + * Per-partition autoscale Preview feature on the account. + * + * @return the enablePerRegionPerPartitionAutoscale value. + */ + public Boolean enablePerRegionPerPartitionAutoscale() { + return this.innerProperties() == null ? null : this.innerProperties().enablePerRegionPerPartitionAutoscale(); + } + + /** + * Set the enablePerRegionPerPartitionAutoscale property: Flag to indicate enabling/disabling of Per-Region + * Per-partition autoscale Preview feature on the account. + * + * @param enablePerRegionPerPartitionAutoscale the enablePerRegionPerPartitionAutoscale value to set. + * @return the DatabaseAccountCreateUpdateParameters object itself. + */ + public DatabaseAccountCreateUpdateParameters + withEnablePerRegionPerPartitionAutoscale(Boolean enablePerRegionPerPartitionAutoscale) { + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseAccountCreateUpdateProperties(); + } + this.innerProperties().withEnablePerRegionPerPartitionAutoscale(enablePerRegionPerPartitionAutoscale); + return this; + } + + /** + * Get the enableAllVersionsAndDeletesChangeFeed property: Flag to indicate if All Versions and Deletes Change feed + * feature is enabled on the account. + * + * @return the enableAllVersionsAndDeletesChangeFeed value. + */ + public Boolean enableAllVersionsAndDeletesChangeFeed() { + return this.innerProperties() == null ? null : this.innerProperties().enableAllVersionsAndDeletesChangeFeed(); + } + + /** + * Set the enableAllVersionsAndDeletesChangeFeed property: Flag to indicate if All Versions and Deletes Change feed + * feature is enabled on the account. + * + * @param enableAllVersionsAndDeletesChangeFeed the enableAllVersionsAndDeletesChangeFeed value to set. + * @return the DatabaseAccountCreateUpdateParameters object itself. + */ + public DatabaseAccountCreateUpdateParameters + withEnableAllVersionsAndDeletesChangeFeed(Boolean enableAllVersionsAndDeletesChangeFeed) { + if (this.innerProperties() == null) { + this.innerProperties = new DatabaseAccountCreateUpdateProperties(); + } + this.innerProperties().withEnableAllVersionsAndDeletesChangeFeed(enableAllVersionsAndDeletesChangeFeed); + return this; + } + /** * Validates the instance. * @@ -988,6 +1088,9 @@ public void validate() { } else { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(DatabaseAccountCreateUpdateParameters.class); diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountKeysMetadata.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountKeysMetadata.java index 88725fa2b100..3331778d1ac1 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountKeysMetadata.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountKeysMetadata.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -39,7 +39,7 @@ public final class DatabaseAccountKeysMetadata implements JsonSerializable { + /* + * Describe the level of detail with which queries are to be logged. + */ + private EnableFullTextQuery enableFullTextQuery; + + /** + * Creates an instance of DiagnosticLogSettings class. + */ + public DiagnosticLogSettings() { + } + + /** + * Get the enableFullTextQuery property: Describe the level of detail with which queries are to be logged. + * + * @return the enableFullTextQuery value. + */ + public EnableFullTextQuery enableFullTextQuery() { + return this.enableFullTextQuery; + } + + /** + * Set the enableFullTextQuery property: Describe the level of detail with which queries are to be logged. + * + * @param enableFullTextQuery the enableFullTextQuery value to set. + * @return the DiagnosticLogSettings object itself. + */ + public DiagnosticLogSettings withEnableFullTextQuery(EnableFullTextQuery enableFullTextQuery) { + this.enableFullTextQuery = enableFullTextQuery; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("enableFullTextQuery", + this.enableFullTextQuery == null ? null : this.enableFullTextQuery.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of DiagnosticLogSettings from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of DiagnosticLogSettings if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the DiagnosticLogSettings. + */ + public static DiagnosticLogSettings fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + DiagnosticLogSettings deserializedDiagnosticLogSettings = new DiagnosticLogSettings(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("enableFullTextQuery".equals(fieldName)) { + deserializedDiagnosticLogSettings.enableFullTextQuery + = EnableFullTextQuery.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedDiagnosticLogSettings; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DistanceFunction.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DistanceFunction.java index 4f4d1dd24a66..79fb8eb55aea 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DistanceFunction.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/DistanceFunction.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/EnableFullTextQuery.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/EnableFullTextQuery.java new file mode 100644 index 000000000000..bb214f6b3f46 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/EnableFullTextQuery.java @@ -0,0 +1,61 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +/** + * Describe the level of detail with which queries are to be logged. + */ +public enum EnableFullTextQuery { + /** + * Enum value None. + */ + NONE("None"), + + /** + * Enum value True. + */ + TRUE("True"), + + /** + * Enum value False. + */ + FALSE("False"); + + /** + * The actual serialized value for a EnableFullTextQuery instance. + */ + private final String value; + + EnableFullTextQuery(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a EnableFullTextQuery instance. + * + * @param value the serialized value to parse. + * @return the parsed EnableFullTextQuery object, or null if unable to parse. + */ + public static EnableFullTextQuery fromString(String value) { + if (value == null) { + return null; + } + EnableFullTextQuery[] items = EnableFullTextQuery.values(); + for (EnableFullTextQuery item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ExcludedPath.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ExcludedPath.java index 9c0f5d5fad80..b973a3542564 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ExcludedPath.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ExcludedPath.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ExtendedResourceProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ExtendedResourceProperties.java deleted file mode 100644 index 12a3916d607f..000000000000 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ExtendedResourceProperties.java +++ /dev/null @@ -1,149 +0,0 @@ -// 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.models; - -import com.azure.core.annotation.Immutable; -import com.azure.json.JsonReader; -import com.azure.json.JsonSerializable; -import com.azure.json.JsonToken; -import com.azure.json.JsonWriter; -import java.io.IOException; - -/** - * The system generated resource properties associated with SQL databases, SQL containers, Gremlin databases and Gremlin - * graphs. - */ -@Immutable -public class ExtendedResourceProperties implements JsonSerializable { - /* - * A system generated property. A unique identifier. - */ - private String rid; - - /* - * A system generated property that denotes the last updated timestamp of the resource. - */ - private Float ts; - - /* - * A system generated property representing the resource etag required for optimistic concurrency control. - */ - private String etag; - - /** - * Creates an instance of ExtendedResourceProperties class. - */ - public ExtendedResourceProperties() { - } - - /** - * Get the rid property: A system generated property. A unique identifier. - * - * @return the rid value. - */ - public String rid() { - return this.rid; - } - - /** - * Set the rid property: A system generated property. A unique identifier. - * - * @param rid the rid value to set. - * @return the ExtendedResourceProperties object itself. - */ - ExtendedResourceProperties withRid(String rid) { - this.rid = rid; - return this; - } - - /** - * Get the ts property: A system generated property that denotes the last updated timestamp of the resource. - * - * @return the ts value. - */ - public Float ts() { - return this.ts; - } - - /** - * Set the ts property: A system generated property that denotes the last updated timestamp of the resource. - * - * @param ts the ts value to set. - * @return the ExtendedResourceProperties object itself. - */ - ExtendedResourceProperties withTs(Float ts) { - this.ts = ts; - return this; - } - - /** - * Get the etag property: A system generated property representing the resource etag required for optimistic - * concurrency control. - * - * @return the etag value. - */ - public String etag() { - return this.etag; - } - - /** - * Set the etag property: A system generated property representing the resource etag required for optimistic - * concurrency control. - * - * @param etag the etag value to set. - * @return the ExtendedResourceProperties object itself. - */ - ExtendedResourceProperties withEtag(String etag) { - this.etag = etag; - return this; - } - - /** - * Validates the instance. - * - * @throws IllegalArgumentException thrown if the instance is not valid. - */ - public void validate() { - } - - /** - * {@inheritDoc} - */ - @Override - public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { - jsonWriter.writeStartObject(); - return jsonWriter.writeEndObject(); - } - - /** - * Reads an instance of ExtendedResourceProperties from the JsonReader. - * - * @param jsonReader The JsonReader being read. - * @return An instance of ExtendedResourceProperties if the JsonReader was pointing to an instance of it, or null if - * it was pointing to JSON null. - * @throws IOException If an error occurs while reading the ExtendedResourceProperties. - */ - public static ExtendedResourceProperties fromJson(JsonReader jsonReader) throws IOException { - return jsonReader.readObject(reader -> { - ExtendedResourceProperties deserializedExtendedResourceProperties = new ExtendedResourceProperties(); - while (reader.nextToken() != JsonToken.END_OBJECT) { - String fieldName = reader.getFieldName(); - reader.nextToken(); - - if ("_rid".equals(fieldName)) { - deserializedExtendedResourceProperties.rid = reader.getString(); - } else if ("_ts".equals(fieldName)) { - deserializedExtendedResourceProperties.ts = reader.getNullable(JsonReader::getFloat); - } else if ("_etag".equals(fieldName)) { - deserializedExtendedResourceProperties.etag = reader.getString(); - } else { - reader.skipChildren(); - } - } - - return deserializedExtendedResourceProperties; - }); - } -} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FailoverPolicies.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FailoverPolicies.java index 757f2fc468ce..d8115099b3ec 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FailoverPolicies.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FailoverPolicies.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FailoverPolicy.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FailoverPolicy.java index 4a4677ffa146..ef81dc31c471 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FailoverPolicy.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FailoverPolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetAnalyticsPropertiesStorageLocationType.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetAnalyticsPropertiesStorageLocationType.java new file mode 100644 index 000000000000..8d80cd49a5b2 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetAnalyticsPropertiesStorageLocationType.java @@ -0,0 +1,52 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The type of the fleet analytics resource. + */ +public final class FleetAnalyticsPropertiesStorageLocationType + extends ExpandableStringEnum { + /** + * Static value StorageAccount for FleetAnalyticsPropertiesStorageLocationType. + */ + public static final FleetAnalyticsPropertiesStorageLocationType STORAGE_ACCOUNT = fromString("StorageAccount"); + + /** + * Static value FabricLakehouse for FleetAnalyticsPropertiesStorageLocationType. + */ + public static final FleetAnalyticsPropertiesStorageLocationType FABRIC_LAKEHOUSE = fromString("FabricLakehouse"); + + /** + * Creates a new instance of FleetAnalyticsPropertiesStorageLocationType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public FleetAnalyticsPropertiesStorageLocationType() { + } + + /** + * Creates or finds a FleetAnalyticsPropertiesStorageLocationType from its string representation. + * + * @param name a name to look for. + * @return the corresponding FleetAnalyticsPropertiesStorageLocationType. + */ + public static FleetAnalyticsPropertiesStorageLocationType fromString(String name) { + return fromString(name, FleetAnalyticsPropertiesStorageLocationType.class); + } + + /** + * Gets known FleetAnalyticsPropertiesStorageLocationType values. + * + * @return known FleetAnalyticsPropertiesStorageLocationType values. + */ + public static Collection values() { + return values(FleetAnalyticsPropertiesStorageLocationType.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetResourceUpdate.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetResourceUpdate.java index 9b15d844e486..f03a974960c6 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetResourceUpdate.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetResourceUpdate.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * Represents a fleet resource for updates. */ -@Fluent +@Immutable public final class FleetResourceUpdate implements JsonSerializable { /* * Properties to update Azure Cosmos DB fleet resource. @@ -46,20 +46,6 @@ public Status provisioningState() { return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } - /** - * Set the provisioningState property: A provisioning state of the Fleet. - * - * @param provisioningState the provisioningState value to set. - * @return the FleetResourceUpdate object itself. - */ - public FleetResourceUpdate withProvisioningState(Status provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new FleetResourceProperties(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetspaceAccountPropertiesGlobalDatabaseAccountProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetspaceAccountPropertiesGlobalDatabaseAccountProperties.java index 187dee9fe764..5d4b1b8aa8da 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetspaceAccountPropertiesGlobalDatabaseAccountProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetspaceAccountPropertiesGlobalDatabaseAccountProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetspacePropertiesFleetspaceApiKind.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetspacePropertiesFleetspaceApiKind.java index e9478bfe906c..4f1a0ddc215d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetspacePropertiesFleetspaceApiKind.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetspacePropertiesFleetspaceApiKind.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetspacePropertiesServiceTier.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetspacePropertiesServiceTier.java index 7fc8b452f97f..92ad7c2197ea 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetspacePropertiesServiceTier.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetspacePropertiesServiceTier.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetspacePropertiesThroughputPoolConfiguration.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetspacePropertiesThroughputPoolConfiguration.java index 53f8ce8d273b..8f6b67896f6e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetspacePropertiesThroughputPoolConfiguration.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetspacePropertiesThroughputPoolConfiguration.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -27,6 +27,19 @@ public final class FleetspacePropertiesThroughputPoolConfiguration */ private Integer maxThroughput; + /* + * Total dedicated throughput (RU/s) for fleetspace. Represents the sum of all manual provisioned throughput and all + * autoscale max RU/s across all shared throughput databases and dedicated throughput containers across all accounts + * in the fleetspace for 1 region. + */ + private Long dedicatedRUs; + + /* + * Maximum consumable throughput (RU/s) for fleetspace. Represents the maximum throughput that resources in the + * fleetspace can consume from the fleetspace's pool in 1 region. + */ + private Long maxConsumableRUs; + /** * Creates an instance of FleetspacePropertiesThroughputPoolConfiguration class. */ @@ -73,6 +86,52 @@ public FleetspacePropertiesThroughputPoolConfiguration withMaxThroughput(Integer return this; } + /** + * Get the dedicatedRUs property: Total dedicated throughput (RU/s) for fleetspace. Represents the sum of all manual + * provisioned throughput and all autoscale max RU/s across all shared throughput databases and dedicated throughput + * containers across all accounts in the fleetspace for 1 region. + * + * @return the dedicatedRUs value. + */ + public Long dedicatedRUs() { + return this.dedicatedRUs; + } + + /** + * Set the dedicatedRUs property: Total dedicated throughput (RU/s) for fleetspace. Represents the sum of all manual + * provisioned throughput and all autoscale max RU/s across all shared throughput databases and dedicated throughput + * containers across all accounts in the fleetspace for 1 region. + * + * @param dedicatedRUs the dedicatedRUs value to set. + * @return the FleetspacePropertiesThroughputPoolConfiguration object itself. + */ + public FleetspacePropertiesThroughputPoolConfiguration withDedicatedRUs(Long dedicatedRUs) { + this.dedicatedRUs = dedicatedRUs; + return this; + } + + /** + * Get the maxConsumableRUs property: Maximum consumable throughput (RU/s) for fleetspace. Represents the maximum + * throughput that resources in the fleetspace can consume from the fleetspace's pool in 1 region. + * + * @return the maxConsumableRUs value. + */ + public Long maxConsumableRUs() { + return this.maxConsumableRUs; + } + + /** + * Set the maxConsumableRUs property: Maximum consumable throughput (RU/s) for fleetspace. Represents the maximum + * throughput that resources in the fleetspace can consume from the fleetspace's pool in 1 region. + * + * @param maxConsumableRUs the maxConsumableRUs value to set. + * @return the FleetspacePropertiesThroughputPoolConfiguration object itself. + */ + public FleetspacePropertiesThroughputPoolConfiguration withMaxConsumableRUs(Long maxConsumableRUs) { + this.maxConsumableRUs = maxConsumableRUs; + return this; + } + /** * Validates the instance. * @@ -89,6 +148,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeNumberField("minThroughput", this.minThroughput); jsonWriter.writeNumberField("maxThroughput", this.maxThroughput); + jsonWriter.writeNumberField("dedicatedRUs", this.dedicatedRUs); + jsonWriter.writeNumberField("maxConsumableRUs", this.maxConsumableRUs); return jsonWriter.writeEndObject(); } @@ -114,6 +175,12 @@ public static FleetspacePropertiesThroughputPoolConfiguration fromJson(JsonReade } else if ("maxThroughput".equals(fieldName)) { deserializedFleetspacePropertiesThroughputPoolConfiguration.maxThroughput = reader.getNullable(JsonReader::getInt); + } else if ("dedicatedRUs".equals(fieldName)) { + deserializedFleetspacePropertiesThroughputPoolConfiguration.dedicatedRUs + = reader.getNullable(JsonReader::getLong); + } else if ("maxConsumableRUs".equals(fieldName)) { + deserializedFleetspacePropertiesThroughputPoolConfiguration.maxConsumableRUs + = reader.getNullable(JsonReader::getLong); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetspaceUpdate.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetspaceUpdate.java index 33328d4908b8..ace0b74a81ec 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetspaceUpdate.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FleetspaceUpdate.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -47,20 +47,6 @@ public Status provisioningState() { return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); } - /** - * Set the provisioningState property: A provisioning state of the Fleetspace. - * - * @param provisioningState the provisioningState value to set. - * @return the FleetspaceUpdate object itself. - */ - public FleetspaceUpdate withProvisioningState(Status provisioningState) { - if (this.innerProperties() == null) { - this.innerProperties = new FleetspaceProperties(); - } - this.innerProperties().withProvisioningState(provisioningState); - return this; - } - /** * Get the fleetspaceApiKind property: The kind of API this fleetspace belongs to. Acceptable values: 'NoSQL'. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FullTextIndexPath.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FullTextIndexPath.java index a8e4079a72ff..6c7af2553eda 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FullTextIndexPath.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FullTextIndexPath.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FullTextPath.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FullTextPath.java index b2fe8d082afc..cb7e665b4e2c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FullTextPath.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FullTextPath.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FullTextPolicy.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FullTextPolicy.java index e1ed396084eb..b9fc0ff288af 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FullTextPolicy.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/FullTextPolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetCacheProvisioningState.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetCacheProvisioningState.java new file mode 100644 index 000000000000..f4173605363d --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetCacheProvisioningState.java @@ -0,0 +1,71 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * The status of the resource at the time the operation was called. + */ +public final class GarnetCacheProvisioningState extends ExpandableStringEnum { + /** + * Creating. + */ + public static final GarnetCacheProvisioningState CREATING = fromString("Creating"); + + /** + * Updating. + */ + public static final GarnetCacheProvisioningState UPDATING = fromString("Updating"); + + /** + * Deleting. + */ + public static final GarnetCacheProvisioningState DELETING = fromString("Deleting"); + + /** + * Succeeded. + */ + public static final GarnetCacheProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Failed. + */ + public static final GarnetCacheProvisioningState FAILED = fromString("Failed"); + + /** + * Canceled. + */ + public static final GarnetCacheProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of GarnetCacheProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public GarnetCacheProvisioningState() { + } + + /** + * Creates or finds a GarnetCacheProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding GarnetCacheProvisioningState. + */ + public static GarnetCacheProvisioningState fromString(String name) { + return fromString(name, GarnetCacheProvisioningState.class); + } + + /** + * Gets known GarnetCacheProvisioningState values. + * + * @return known GarnetCacheProvisioningState values. + */ + public static Collection values() { + return values(GarnetCacheProvisioningState.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterEndpoint.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterEndpoint.java new file mode 100644 index 000000000000..57deb3b7908b --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterEndpoint.java @@ -0,0 +1,99 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Endpoint for clients to connect to the cluster. + */ +@Immutable +public final class GarnetClusterEndpoint implements JsonSerializable { + /* + * Ipv4 address of the endpoint. + */ + private String ipAddress; + + /* + * Port number. + */ + private Integer port; + + /** + * Creates an instance of GarnetClusterEndpoint class. + */ + private GarnetClusterEndpoint() { + } + + /** + * Get the ipAddress property: Ipv4 address of the endpoint. + * + * @return the ipAddress value. + */ + public String ipAddress() { + return this.ipAddress; + } + + /** + * Get the port property: Port number. + * + * @return the port value. + */ + public Integer port() { + return this.port; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("ipAddress", this.ipAddress); + jsonWriter.writeNumberField("port", this.port); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GarnetClusterEndpoint from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GarnetClusterEndpoint if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the GarnetClusterEndpoint. + */ + public static GarnetClusterEndpoint fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GarnetClusterEndpoint deserializedGarnetClusterEndpoint = new GarnetClusterEndpoint(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("ipAddress".equals(fieldName)) { + deserializedGarnetClusterEndpoint.ipAddress = reader.getString(); + } else if ("port".equals(fieldName)) { + deserializedGarnetClusterEndpoint.port = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedGarnetClusterEndpoint; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterProperties.java new file mode 100644 index 000000000000..fc38b7dbd71f --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterProperties.java @@ -0,0 +1,379 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.management.exception.ManagementError; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Properties of a Garnet cache cluster. + */ +@Fluent +public final class GarnetClusterProperties implements JsonSerializable { + /* + * The provisioning state of the resource. + */ + private GarnetCacheProvisioningState provisioningState; + + /* + * Resource id of a subnet that this cluster's management service should have its network interface attached to. The + * subnet must be routable to all subnets that will be delegated to data centers. The resource id must be of the + * form '/subscriptions//resourceGroups//providers/Microsoft.Network/virtualNetworks//subnets/' + */ + private String subnetId; + + /* + * Endpoints for clients to connect to the cluster. + */ + private List endPoints; + + /* + * Number of copies of data maintained by the cluster. + */ + private Integer replicationFactor; + + /* + * Number of nodes. + */ + private Integer nodeCount; + + /* + * Virtual Machine SKU used for clusters. Default value is Standard_DS14_v2. + */ + private String nodeSku; + + /* + * If the data center has Availability Zone support, apply it to the Virtual Machine ScaleSet that host the garnet + * cluster virtual machines. + */ + private Boolean availabilityZone; + + /* + * Allocation state of the cluster and data center resources. Active implies the virtual machines of the cluster are + * allocated, deallocated implies virtual machines and resources are deallocated. + */ + private AllocationState allocationState; + + /* + * Type of the cluster. If set to Production, some operations might not be permitted on cluster. + */ + private ClusterType clusterType; + + /* + * Error related to resource provisioning. + */ + private ManagementError provisionError; + + /* + * Extensions to be added or updated on cluster. + */ + private List extensions; + + /** + * Creates an instance of GarnetClusterProperties class. + */ + public GarnetClusterProperties() { + } + + /** + * Get the provisioningState property: The provisioning state of the resource. + * + * @return the provisioningState value. + */ + public GarnetCacheProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the subnetId property: Resource id of a subnet that this cluster's management service should have its network + * interface attached to. The subnet must be routable to all subnets that will be delegated to data centers. The + * resource id must be of the form '/subscriptions/<subscription id>/resourceGroups/<resource + * group>/providers/Microsoft.Network/virtualNetworks/<virtual network>/subnets/<subnet>'. + * + * @return the subnetId value. + */ + public String subnetId() { + return this.subnetId; + } + + /** + * Set the subnetId property: Resource id of a subnet that this cluster's management service should have its network + * interface attached to. The subnet must be routable to all subnets that will be delegated to data centers. The + * resource id must be of the form '/subscriptions/<subscription id>/resourceGroups/<resource + * group>/providers/Microsoft.Network/virtualNetworks/<virtual network>/subnets/<subnet>'. + * + * @param subnetId the subnetId value to set. + * @return the GarnetClusterProperties object itself. + */ + public GarnetClusterProperties withSubnetId(String subnetId) { + this.subnetId = subnetId; + return this; + } + + /** + * Get the endPoints property: Endpoints for clients to connect to the cluster. + * + * @return the endPoints value. + */ + public List endPoints() { + return this.endPoints; + } + + /** + * Get the replicationFactor property: Number of copies of data maintained by the cluster. + * + * @return the replicationFactor value. + */ + public Integer replicationFactor() { + return this.replicationFactor; + } + + /** + * Set the replicationFactor property: Number of copies of data maintained by the cluster. + * + * @param replicationFactor the replicationFactor value to set. + * @return the GarnetClusterProperties object itself. + */ + public GarnetClusterProperties withReplicationFactor(Integer replicationFactor) { + this.replicationFactor = replicationFactor; + return this; + } + + /** + * Get the nodeCount property: Number of nodes. + * + * @return the nodeCount value. + */ + public Integer nodeCount() { + return this.nodeCount; + } + + /** + * Set the nodeCount property: Number of nodes. + * + * @param nodeCount the nodeCount value to set. + * @return the GarnetClusterProperties object itself. + */ + public GarnetClusterProperties withNodeCount(Integer nodeCount) { + this.nodeCount = nodeCount; + return this; + } + + /** + * Get the nodeSku property: Virtual Machine SKU used for clusters. Default value is Standard_DS14_v2. + * + * @return the nodeSku value. + */ + public String nodeSku() { + return this.nodeSku; + } + + /** + * Set the nodeSku property: Virtual Machine SKU used for clusters. Default value is Standard_DS14_v2. + * + * @param nodeSku the nodeSku value to set. + * @return the GarnetClusterProperties object itself. + */ + public GarnetClusterProperties withNodeSku(String nodeSku) { + this.nodeSku = nodeSku; + return this; + } + + /** + * Get the availabilityZone property: If the data center has Availability Zone support, apply it to the Virtual + * Machine ScaleSet that host the garnet cluster virtual machines. + * + * @return the availabilityZone value. + */ + public Boolean availabilityZone() { + return this.availabilityZone; + } + + /** + * Set the availabilityZone property: If the data center has Availability Zone support, apply it to the Virtual + * Machine ScaleSet that host the garnet cluster virtual machines. + * + * @param availabilityZone the availabilityZone value to set. + * @return the GarnetClusterProperties object itself. + */ + public GarnetClusterProperties withAvailabilityZone(Boolean availabilityZone) { + this.availabilityZone = availabilityZone; + return this; + } + + /** + * Get the allocationState property: Allocation state of the cluster and data center resources. Active implies the + * virtual machines of the cluster are allocated, deallocated implies virtual machines and resources are + * deallocated. + * + * @return the allocationState value. + */ + public AllocationState allocationState() { + return this.allocationState; + } + + /** + * Set the allocationState property: Allocation state of the cluster and data center resources. Active implies the + * virtual machines of the cluster are allocated, deallocated implies virtual machines and resources are + * deallocated. + * + * @param allocationState the allocationState value to set. + * @return the GarnetClusterProperties object itself. + */ + public GarnetClusterProperties withAllocationState(AllocationState allocationState) { + this.allocationState = allocationState; + return this; + } + + /** + * Get the clusterType property: Type of the cluster. If set to Production, some operations might not be permitted + * on cluster. + * + * @return the clusterType value. + */ + public ClusterType clusterType() { + return this.clusterType; + } + + /** + * Set the clusterType property: Type of the cluster. If set to Production, some operations might not be permitted + * on cluster. + * + * @param clusterType the clusterType value to set. + * @return the GarnetClusterProperties object itself. + */ + public GarnetClusterProperties withClusterType(ClusterType clusterType) { + this.clusterType = clusterType; + return this; + } + + /** + * Get the provisionError property: Error related to resource provisioning. + * + * @return the provisionError value. + */ + public ManagementError provisionError() { + return this.provisionError; + } + + /** + * Set the provisionError property: Error related to resource provisioning. + * + * @param provisionError the provisionError value to set. + * @return the GarnetClusterProperties object itself. + */ + public GarnetClusterProperties withProvisionError(ManagementError provisionError) { + this.provisionError = provisionError; + return this; + } + + /** + * Get the extensions property: Extensions to be added or updated on cluster. + * + * @return the extensions value. + */ + public List extensions() { + return this.extensions; + } + + /** + * Set the extensions property: Extensions to be added or updated on cluster. + * + * @param extensions the extensions value to set. + * @return the GarnetClusterProperties object itself. + */ + public GarnetClusterProperties withExtensions(List extensions) { + this.extensions = extensions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (endPoints() != null) { + endPoints().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("subnetId", this.subnetId); + jsonWriter.writeNumberField("replicationFactor", this.replicationFactor); + jsonWriter.writeNumberField("nodeCount", this.nodeCount); + jsonWriter.writeStringField("nodeSku", this.nodeSku); + jsonWriter.writeBooleanField("availabilityZone", this.availabilityZone); + jsonWriter.writeStringField("allocationState", + this.allocationState == null ? null : this.allocationState.toString()); + jsonWriter.writeStringField("clusterType", this.clusterType == null ? null : this.clusterType.toString()); + jsonWriter.writeJsonField("provisionError", this.provisionError); + jsonWriter.writeArrayField("extensions", this.extensions, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GarnetClusterProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GarnetClusterProperties if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the GarnetClusterProperties. + */ + public static GarnetClusterProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GarnetClusterProperties deserializedGarnetClusterProperties = new GarnetClusterProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedGarnetClusterProperties.provisioningState + = GarnetCacheProvisioningState.fromString(reader.getString()); + } else if ("subnetId".equals(fieldName)) { + deserializedGarnetClusterProperties.subnetId = reader.getString(); + } else if ("endPoints".equals(fieldName)) { + List endPoints + = reader.readArray(reader1 -> GarnetClusterEndpoint.fromJson(reader1)); + deserializedGarnetClusterProperties.endPoints = endPoints; + } else if ("replicationFactor".equals(fieldName)) { + deserializedGarnetClusterProperties.replicationFactor = reader.getNullable(JsonReader::getInt); + } else if ("nodeCount".equals(fieldName)) { + deserializedGarnetClusterProperties.nodeCount = reader.getNullable(JsonReader::getInt); + } else if ("nodeSku".equals(fieldName)) { + deserializedGarnetClusterProperties.nodeSku = reader.getString(); + } else if ("availabilityZone".equals(fieldName)) { + deserializedGarnetClusterProperties.availabilityZone = reader.getNullable(JsonReader::getBoolean); + } else if ("allocationState".equals(fieldName)) { + deserializedGarnetClusterProperties.allocationState + = AllocationState.fromString(reader.getString()); + } else if ("clusterType".equals(fieldName)) { + deserializedGarnetClusterProperties.clusterType = ClusterType.fromString(reader.getString()); + } else if ("provisionError".equals(fieldName)) { + deserializedGarnetClusterProperties.provisionError = ManagementError.fromJson(reader); + } else if ("extensions".equals(fieldName)) { + List extensions = reader.readArray(reader1 -> reader1.getString()); + deserializedGarnetClusterProperties.extensions = extensions; + } else { + reader.skipChildren(); + } + } + + return deserializedGarnetClusterProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterResourcePatch.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterResourcePatch.java new file mode 100644 index 000000000000..16c4730da9f8 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterResourcePatch.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Representation of a Garnet cache cluster for updates. + */ +@Fluent +public final class GarnetClusterResourcePatch implements JsonSerializable { + /* + * Properties of a Garnet cache cluster for updates. + */ + private GarnetClusterResourcePatchProperties properties; + + /** + * Creates an instance of GarnetClusterResourcePatch class. + */ + public GarnetClusterResourcePatch() { + } + + /** + * Get the properties property: Properties of a Garnet cache cluster for updates. + * + * @return the properties value. + */ + public GarnetClusterResourcePatchProperties properties() { + return this.properties; + } + + /** + * Set the properties property: Properties of a Garnet cache cluster for updates. + * + * @param properties the properties value to set. + * @return the GarnetClusterResourcePatch object itself. + */ + public GarnetClusterResourcePatch withProperties(GarnetClusterResourcePatchProperties properties) { + this.properties = properties; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.properties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GarnetClusterResourcePatch from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GarnetClusterResourcePatch if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GarnetClusterResourcePatch. + */ + public static GarnetClusterResourcePatch fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GarnetClusterResourcePatch deserializedGarnetClusterResourcePatch = new GarnetClusterResourcePatch(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedGarnetClusterResourcePatch.properties + = GarnetClusterResourcePatchProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGarnetClusterResourcePatch; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterResourcePatchProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterResourcePatchProperties.java new file mode 100644 index 000000000000..8c6decfc8145 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterResourcePatchProperties.java @@ -0,0 +1,128 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Properties of a Garnet cache cluster for updates. + */ +@Fluent +public final class GarnetClusterResourcePatchProperties + implements JsonSerializable { + /* + * Type of the cluster. If set to Production, some operations might not be permitted on cluster. + */ + private ClusterType clusterType; + + /* + * Extensions to be added or updated on cluster. + */ + private List extensions; + + /** + * Creates an instance of GarnetClusterResourcePatchProperties class. + */ + public GarnetClusterResourcePatchProperties() { + } + + /** + * Get the clusterType property: Type of the cluster. If set to Production, some operations might not be permitted + * on cluster. + * + * @return the clusterType value. + */ + public ClusterType clusterType() { + return this.clusterType; + } + + /** + * Set the clusterType property: Type of the cluster. If set to Production, some operations might not be permitted + * on cluster. + * + * @param clusterType the clusterType value to set. + * @return the GarnetClusterResourcePatchProperties object itself. + */ + public GarnetClusterResourcePatchProperties withClusterType(ClusterType clusterType) { + this.clusterType = clusterType; + return this; + } + + /** + * Get the extensions property: Extensions to be added or updated on cluster. + * + * @return the extensions value. + */ + public List extensions() { + return this.extensions; + } + + /** + * Set the extensions property: Extensions to be added or updated on cluster. + * + * @param extensions the extensions value to set. + * @return the GarnetClusterResourcePatchProperties object itself. + */ + public GarnetClusterResourcePatchProperties withExtensions(List extensions) { + this.extensions = extensions; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("clusterType", this.clusterType == null ? null : this.clusterType.toString()); + jsonWriter.writeArrayField("extensions", this.extensions, (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GarnetClusterResourcePatchProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GarnetClusterResourcePatchProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GarnetClusterResourcePatchProperties. + */ + public static GarnetClusterResourcePatchProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GarnetClusterResourcePatchProperties deserializedGarnetClusterResourcePatchProperties + = new GarnetClusterResourcePatchProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("clusterType".equals(fieldName)) { + deserializedGarnetClusterResourcePatchProperties.clusterType + = ClusterType.fromString(reader.getString()); + } else if ("extensions".equals(fieldName)) { + List extensions = reader.readArray(reader1 -> reader1.getString()); + deserializedGarnetClusterResourcePatchProperties.extensions = extensions; + } else { + reader.skipChildren(); + } + } + + return deserializedGarnetClusterResourcePatchProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphApiComputeRegionalServiceResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphApiComputeRegionalServiceResource.java index c41bf2ad515a..fc067b3d6321 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphApiComputeRegionalServiceResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphApiComputeRegionalServiceResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -38,7 +38,7 @@ public final class GraphApiComputeRegionalServiceResource extends RegionalServic /** * Creates an instance of GraphApiComputeRegionalServiceResource class. */ - public GraphApiComputeRegionalServiceResource() { + private GraphApiComputeRegionalServiceResource() { } /** diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphApiComputeServiceResourceCreateUpdateParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphApiComputeServiceResourceCreateUpdateParameters.java index 388c1bc3390e..8b044d375329 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphApiComputeServiceResourceCreateUpdateParameters.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphApiComputeServiceResourceCreateUpdateParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphApiComputeServiceResourceProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphApiComputeServiceResourceProperties.java index 6392de60f682..2becc3cb1c40 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphApiComputeServiceResourceProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphApiComputeServiceResourceProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -17,7 +17,7 @@ /** * Properties for GraphAPIComputeServiceResource. */ -@Fluent +@Immutable public final class GraphApiComputeServiceResourceProperties extends ServiceResourceProperties { /* * ServiceType for the service. @@ -37,7 +37,7 @@ public final class GraphApiComputeServiceResourceProperties extends ServiceResou /** * Creates an instance of GraphApiComputeServiceResourceProperties class. */ - public GraphApiComputeServiceResourceProperties() { + private GraphApiComputeServiceResourceProperties() { } /** @@ -59,17 +59,6 @@ public String graphApiComputeEndpoint() { return this.graphApiComputeEndpoint; } - /** - * Set the graphApiComputeEndpoint property: GraphAPICompute endpoint for the service. - * - * @param graphApiComputeEndpoint the graphApiComputeEndpoint value to set. - * @return the GraphApiComputeServiceResourceProperties object itself. - */ - public GraphApiComputeServiceResourceProperties withGraphApiComputeEndpoint(String graphApiComputeEndpoint) { - this.graphApiComputeEndpoint = graphApiComputeEndpoint; - return this; - } - /** * Get the locations property: An array that contains all of the locations for the service. * @@ -79,24 +68,6 @@ public List locations() { return this.locations; } - /** - * {@inheritDoc} - */ - @Override - public GraphApiComputeServiceResourceProperties withInstanceSize(ServiceSize instanceSize) { - super.withInstanceSize(instanceSize); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GraphApiComputeServiceResourceProperties withInstanceCount(Integer instanceCount) { - super.withInstanceCount(instanceCount); - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphResource.java new file mode 100644 index 000000000000..f3d4be58a8d0 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphResource.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Cosmos DB Graph resource object. + */ +@Fluent +public class GraphResource implements JsonSerializable { + /* + * Name of the Cosmos DB Graph + */ + private String id; + + /** + * Creates an instance of GraphResource class. + */ + public GraphResource() { + } + + /** + * Get the id property: Name of the Cosmos DB Graph. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Name of the Cosmos DB Graph. + * + * @param id the id value to set. + * @return the GraphResource object itself. + */ + public GraphResource withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property id in model GraphResource")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GraphResource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphResource if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GraphResource. + */ + public static GraphResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphResource deserializedGraphResource = new GraphResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedGraphResource.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedGraphResource; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphResourceCreateUpdateParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphResourceCreateUpdateParameters.java new file mode 100644 index 000000000000..132a45335589 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphResourceCreateUpdateParameters.java @@ -0,0 +1,237 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.fluent.models.GraphResourceCreateUpdateProperties; +import java.io.IOException; +import java.util.Map; + +/** + * Parameters to create and update Cosmos DB Graph resource. + */ +@Fluent +public final class GraphResourceCreateUpdateParameters extends ArmResourceProperties { + /* + * Properties to create and update Azure Cosmos DB Graph resource. + */ + private GraphResourceCreateUpdateProperties innerProperties = new GraphResourceCreateUpdateProperties(); + + /* + * The type of Azure resource. + */ + private String type; + + /* + * The name of the ARM resource. + */ + private String name; + + /* + * The unique resource identifier of the ARM resource. + */ + private String id; + + /** + * Creates an instance of GraphResourceCreateUpdateParameters class. + */ + public GraphResourceCreateUpdateParameters() { + } + + /** + * Get the innerProperties property: Properties to create and update Azure Cosmos DB Graph resource. + * + * @return the innerProperties value. + */ + private GraphResourceCreateUpdateProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the type property: The type of Azure resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the ARM resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: The unique resource identifier of the ARM resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public GraphResourceCreateUpdateParameters withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public GraphResourceCreateUpdateParameters withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public GraphResourceCreateUpdateParameters withIdentity(ManagedServiceIdentity identity) { + super.withIdentity(identity); + return this; + } + + /** + * Get the resource property: The standard JSON format of a Graph resource. + * + * @return the resource value. + */ + public GraphResource resource() { + return this.innerProperties() == null ? null : this.innerProperties().resource(); + } + + /** + * Set the resource property: The standard JSON format of a Graph resource. + * + * @param resource the resource value to set. + * @return the GraphResourceCreateUpdateParameters object itself. + */ + public GraphResourceCreateUpdateParameters withResource(GraphResource resource) { + if (this.innerProperties() == null) { + this.innerProperties = new GraphResourceCreateUpdateProperties(); + } + this.innerProperties().withResource(resource); + return this; + } + + /** + * Get the options property: A key-value pair of options to be applied for the request. This corresponds to the + * headers sent with the request. + * + * @return the options value. + */ + public CreateUpdateOptions options() { + return this.innerProperties() == null ? null : this.innerProperties().options(); + } + + /** + * Set the options property: A key-value pair of options to be applied for the request. This corresponds to the + * headers sent with the request. + * + * @param options the options value to set. + * @return the GraphResourceCreateUpdateParameters object itself. + */ + public GraphResourceCreateUpdateParameters withOptions(CreateUpdateOptions options) { + if (this.innerProperties() == null) { + this.innerProperties = new GraphResourceCreateUpdateProperties(); + } + this.innerProperties().withOptions(options); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model GraphResourceCreateUpdateParameters")); + } else { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GraphResourceCreateUpdateParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", identity()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphResourceCreateUpdateParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphResourceCreateUpdateParameters if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GraphResourceCreateUpdateParameters. + */ + public static GraphResourceCreateUpdateParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphResourceCreateUpdateParameters deserializedGraphResourceCreateUpdateParameters + = new GraphResourceCreateUpdateParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedGraphResourceCreateUpdateParameters.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedGraphResourceCreateUpdateParameters.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedGraphResourceCreateUpdateParameters.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedGraphResourceCreateUpdateParameters.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedGraphResourceCreateUpdateParameters.withTags(tags); + } else if ("identity".equals(fieldName)) { + deserializedGraphResourceCreateUpdateParameters + .withIdentity(ManagedServiceIdentity.fromJson(reader)); + } else if ("properties".equals(fieldName)) { + deserializedGraphResourceCreateUpdateParameters.innerProperties + = GraphResourceCreateUpdateProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGraphResourceCreateUpdateParameters; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphResourceGetPropertiesOptions.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphResourceGetPropertiesOptions.java new file mode 100644 index 000000000000..79c6e686f8cb --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphResourceGetPropertiesOptions.java @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The GraphResourceGetPropertiesOptions model. + */ +@Immutable +public final class GraphResourceGetPropertiesOptions extends OptionsResource { + /* + * Specifies the Autoscale settings. + */ + private AutoscaleSettings autoscaleSettings; + + /* + * Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when + * retrieving offer details. + */ + private Integer throughput; + + /** + * Creates an instance of GraphResourceGetPropertiesOptions class. + */ + private GraphResourceGetPropertiesOptions() { + } + + /** + * Get the autoscaleSettings property: Specifies the Autoscale settings. + * + * @return the autoscaleSettings value. + */ + @Override + public AutoscaleSettings autoscaleSettings() { + return this.autoscaleSettings; + } + + /** + * Get the throughput property: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the + * ThroughputSetting resource when retrieving offer details. + * + * @return the throughput value. + */ + @Override + public Integer throughput() { + return this.throughput; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (autoscaleSettings() != null) { + autoscaleSettings().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("throughput", throughput()); + jsonWriter.writeJsonField("autoscaleSettings", autoscaleSettings()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphResourceGetPropertiesOptions from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphResourceGetPropertiesOptions if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the GraphResourceGetPropertiesOptions. + */ + public static GraphResourceGetPropertiesOptions fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphResourceGetPropertiesOptions deserializedGraphResourceGetPropertiesOptions + = new GraphResourceGetPropertiesOptions(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("throughput".equals(fieldName)) { + deserializedGraphResourceGetPropertiesOptions.throughput = reader.getNullable(JsonReader::getInt); + } else if ("autoscaleSettings".equals(fieldName)) { + deserializedGraphResourceGetPropertiesOptions.autoscaleSettings + = AutoscaleSettings.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedGraphResourceGetPropertiesOptions; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphResourceGetPropertiesResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphResourceGetPropertiesResource.java new file mode 100644 index 000000000000..b0facce9b0d8 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GraphResourceGetPropertiesResource.java @@ -0,0 +1,78 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The GraphResourceGetPropertiesResource model. + */ +@Immutable +public final class GraphResourceGetPropertiesResource extends GraphResource { + /** + * Creates an instance of GraphResourceGetPropertiesResource class. + */ + private GraphResourceGetPropertiesResource() { + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (id() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property id in model GraphResourceGetPropertiesResource")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(GraphResourceGetPropertiesResource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", id()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of GraphResourceGetPropertiesResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of GraphResourceGetPropertiesResource if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the GraphResourceGetPropertiesResource. + */ + public static GraphResourceGetPropertiesResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + GraphResourceGetPropertiesResource deserializedGraphResourceGetPropertiesResource + = new GraphResourceGetPropertiesResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedGraphResourceGetPropertiesResource.withId(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedGraphResourceGetPropertiesResource; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseCreateUpdateParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseCreateUpdateParameters.java index 828c6c167a45..469ac96577ca 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseCreateUpdateParameters.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseCreateUpdateParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -24,17 +24,17 @@ public final class GremlinDatabaseCreateUpdateParameters extends ArmResourceProp private GremlinDatabaseCreateUpdateProperties innerProperties = new GremlinDatabaseCreateUpdateProperties(); /* - * The type of the resource. + * The type of Azure resource. */ private String type; /* - * The name of the resource. + * The name of the ARM resource. */ private String name; /* - * Fully qualified resource Id for the resource. + * The unique resource identifier of the ARM resource. */ private String id; @@ -54,7 +54,7 @@ private GremlinDatabaseCreateUpdateProperties innerProperties() { } /** - * Get the type property: The type of the resource. + * Get the type property: The type of Azure resource. * * @return the type value. */ @@ -64,7 +64,7 @@ public String type() { } /** - * Get the name property: The name of the resource. + * Get the name property: The name of the ARM resource. * * @return the name value. */ @@ -74,7 +74,7 @@ public String name() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the id property: The unique resource identifier of the ARM resource. * * @return the id value. */ @@ -101,6 +101,15 @@ public GremlinDatabaseCreateUpdateParameters withTags(Map tags) return this; } + /** + * {@inheritDoc} + */ + @Override + public GremlinDatabaseCreateUpdateParameters withIdentity(ManagedServiceIdentity identity) { + super.withIdentity(identity); + return this; + } + /** * Get the resource property: The standard JSON format of a Gremlin database. * @@ -163,6 +172,9 @@ public void validate() { } else { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(GremlinDatabaseCreateUpdateParameters.class); @@ -175,6 +187,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", identity()); jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -207,6 +220,9 @@ public static GremlinDatabaseCreateUpdateParameters fromJson(JsonReader jsonRead } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedGremlinDatabaseCreateUpdateParameters.withTags(tags); + } else if ("identity".equals(fieldName)) { + deserializedGremlinDatabaseCreateUpdateParameters + .withIdentity(ManagedServiceIdentity.fromJson(reader)); } else if ("properties".equals(fieldName)) { deserializedGremlinDatabaseCreateUpdateParameters.innerProperties = GremlinDatabaseCreateUpdateProperties.fromJson(reader); diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseGetPropertiesOptions.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseGetPropertiesOptions.java index 6a593f380e9e..21564904f54e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseGetPropertiesOptions.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseGetPropertiesOptions.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -13,30 +13,44 @@ /** * The GremlinDatabaseGetPropertiesOptions model. */ -@Fluent +@Immutable public final class GremlinDatabaseGetPropertiesOptions extends OptionsResource { + /* + * Specifies the Autoscale settings. + */ + private AutoscaleSettings autoscaleSettings; + + /* + * Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when + * retrieving offer details. + */ + private Integer throughput; + /** * Creates an instance of GremlinDatabaseGetPropertiesOptions class. */ - public GremlinDatabaseGetPropertiesOptions() { + private GremlinDatabaseGetPropertiesOptions() { } /** - * {@inheritDoc} + * Get the autoscaleSettings property: Specifies the Autoscale settings. + * + * @return the autoscaleSettings value. */ @Override - public GremlinDatabaseGetPropertiesOptions withThroughput(Integer throughput) { - super.withThroughput(throughput); - return this; + public AutoscaleSettings autoscaleSettings() { + return this.autoscaleSettings; } /** - * {@inheritDoc} + * Get the throughput property: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the + * ThroughputSetting resource when retrieving offer details. + * + * @return the throughput value. */ @Override - public GremlinDatabaseGetPropertiesOptions withAutoscaleSettings(AutoscaleSettings autoscaleSettings) { - super.withAutoscaleSettings(autoscaleSettings); - return this; + public Integer throughput() { + return this.throughput; } /** @@ -79,11 +93,10 @@ public static GremlinDatabaseGetPropertiesOptions fromJson(JsonReader jsonReader reader.nextToken(); if ("throughput".equals(fieldName)) { - deserializedGremlinDatabaseGetPropertiesOptions - .withThroughput(reader.getNullable(JsonReader::getInt)); + deserializedGremlinDatabaseGetPropertiesOptions.throughput = reader.getNullable(JsonReader::getInt); } else if ("autoscaleSettings".equals(fieldName)) { - deserializedGremlinDatabaseGetPropertiesOptions - .withAutoscaleSettings(AutoscaleSettings.fromJson(reader)); + deserializedGremlinDatabaseGetPropertiesOptions.autoscaleSettings + = AutoscaleSettings.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseGetPropertiesResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseGetPropertiesResource.java index 2f9e21e27d92..194cf3aee082 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseGetPropertiesResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseGetPropertiesResource.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * The GremlinDatabaseGetPropertiesResource model. */ -@Fluent +@Immutable public final class GremlinDatabaseGetPropertiesResource extends GremlinDatabaseResource { /* * A system generated property. A unique identifier. @@ -34,7 +34,7 @@ public final class GremlinDatabaseGetPropertiesResource extends GremlinDatabaseR /** * Creates an instance of GremlinDatabaseGetPropertiesResource class. */ - public GremlinDatabaseGetPropertiesResource() { + private GremlinDatabaseGetPropertiesResource() { } /** @@ -65,33 +65,6 @@ public String etag() { return this.etag; } - /** - * {@inheritDoc} - */ - @Override - public GremlinDatabaseGetPropertiesResource withId(String id) { - super.withId(id); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GremlinDatabaseGetPropertiesResource withRestoreParameters(ResourceRestoreParameters restoreParameters) { - super.withRestoreParameters(restoreParameters); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GremlinDatabaseGetPropertiesResource withCreateMode(CreateMode createMode) { - super.withCreateMode(createMode); - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseResource.java index a6cad9f8a10c..51be7dca1cac 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseRestoreResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseRestoreResource.java index ed28559ed18f..bb10cefb89fb 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseRestoreResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseRestoreResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphCreateUpdateParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphCreateUpdateParameters.java index bdbf152eca06..1d0f39944899 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphCreateUpdateParameters.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphCreateUpdateParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -24,17 +24,17 @@ public final class GremlinGraphCreateUpdateParameters extends ArmResourcePropert private GremlinGraphCreateUpdateProperties innerProperties = new GremlinGraphCreateUpdateProperties(); /* - * The type of the resource. + * The type of Azure resource. */ private String type; /* - * The name of the resource. + * The name of the ARM resource. */ private String name; /* - * Fully qualified resource Id for the resource. + * The unique resource identifier of the ARM resource. */ private String id; @@ -54,7 +54,7 @@ private GremlinGraphCreateUpdateProperties innerProperties() { } /** - * Get the type property: The type of the resource. + * Get the type property: The type of Azure resource. * * @return the type value. */ @@ -64,7 +64,7 @@ public String type() { } /** - * Get the name property: The name of the resource. + * Get the name property: The name of the ARM resource. * * @return the name value. */ @@ -74,7 +74,7 @@ public String name() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the id property: The unique resource identifier of the ARM resource. * * @return the id value. */ @@ -101,6 +101,15 @@ public GremlinGraphCreateUpdateParameters withTags(Map tags) { return this; } + /** + * {@inheritDoc} + */ + @Override + public GremlinGraphCreateUpdateParameters withIdentity(ManagedServiceIdentity identity) { + super.withIdentity(identity); + return this; + } + /** * Get the resource property: The standard JSON format of a Gremlin graph. * @@ -163,6 +172,9 @@ public void validate() { } else { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(GremlinGraphCreateUpdateParameters.class); @@ -175,6 +187,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", identity()); jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -207,6 +220,9 @@ public static GremlinGraphCreateUpdateParameters fromJson(JsonReader jsonReader) } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedGremlinGraphCreateUpdateParameters.withTags(tags); + } else if ("identity".equals(fieldName)) { + deserializedGremlinGraphCreateUpdateParameters + .withIdentity(ManagedServiceIdentity.fromJson(reader)); } else if ("properties".equals(fieldName)) { deserializedGremlinGraphCreateUpdateParameters.innerProperties = GremlinGraphCreateUpdateProperties.fromJson(reader); diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphGetPropertiesOptions.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphGetPropertiesOptions.java index 6e7c58ef127f..3e923019afd6 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphGetPropertiesOptions.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphGetPropertiesOptions.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -13,30 +13,44 @@ /** * The GremlinGraphGetPropertiesOptions model. */ -@Fluent +@Immutable public final class GremlinGraphGetPropertiesOptions extends OptionsResource { + /* + * Specifies the Autoscale settings. + */ + private AutoscaleSettings autoscaleSettings; + + /* + * Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when + * retrieving offer details. + */ + private Integer throughput; + /** * Creates an instance of GremlinGraphGetPropertiesOptions class. */ - public GremlinGraphGetPropertiesOptions() { + private GremlinGraphGetPropertiesOptions() { } /** - * {@inheritDoc} + * Get the autoscaleSettings property: Specifies the Autoscale settings. + * + * @return the autoscaleSettings value. */ @Override - public GremlinGraphGetPropertiesOptions withThroughput(Integer throughput) { - super.withThroughput(throughput); - return this; + public AutoscaleSettings autoscaleSettings() { + return this.autoscaleSettings; } /** - * {@inheritDoc} + * Get the throughput property: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the + * ThroughputSetting resource when retrieving offer details. + * + * @return the throughput value. */ @Override - public GremlinGraphGetPropertiesOptions withAutoscaleSettings(AutoscaleSettings autoscaleSettings) { - super.withAutoscaleSettings(autoscaleSettings); - return this; + public Integer throughput() { + return this.throughput; } /** @@ -79,10 +93,9 @@ public static GremlinGraphGetPropertiesOptions fromJson(JsonReader jsonReader) t reader.nextToken(); if ("throughput".equals(fieldName)) { - deserializedGremlinGraphGetPropertiesOptions.withThroughput(reader.getNullable(JsonReader::getInt)); + deserializedGremlinGraphGetPropertiesOptions.throughput = reader.getNullable(JsonReader::getInt); } else if ("autoscaleSettings".equals(fieldName)) { - deserializedGremlinGraphGetPropertiesOptions - .withAutoscaleSettings(AutoscaleSettings.fromJson(reader)); + deserializedGremlinGraphGetPropertiesOptions.autoscaleSettings = AutoscaleSettings.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphGetPropertiesResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphGetPropertiesResource.java index 5fa6735fe4b8..d05727f4f2ec 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphGetPropertiesResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphGetPropertiesResource.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * The GremlinGraphGetPropertiesResource model. */ -@Fluent +@Immutable public final class GremlinGraphGetPropertiesResource extends GremlinGraphResource { /* * A system generated property. A unique identifier. @@ -34,7 +34,7 @@ public final class GremlinGraphGetPropertiesResource extends GremlinGraphResourc /** * Creates an instance of GremlinGraphGetPropertiesResource class. */ - public GremlinGraphGetPropertiesResource() { + private GremlinGraphGetPropertiesResource() { } /** @@ -65,88 +65,6 @@ public String etag() { return this.etag; } - /** - * {@inheritDoc} - */ - @Override - public GremlinGraphGetPropertiesResource withId(String id) { - super.withId(id); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GremlinGraphGetPropertiesResource withIndexingPolicy(IndexingPolicy indexingPolicy) { - super.withIndexingPolicy(indexingPolicy); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GremlinGraphGetPropertiesResource withPartitionKey(ContainerPartitionKey partitionKey) { - super.withPartitionKey(partitionKey); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GremlinGraphGetPropertiesResource withDefaultTtl(Integer defaultTtl) { - super.withDefaultTtl(defaultTtl); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GremlinGraphGetPropertiesResource withUniqueKeyPolicy(UniqueKeyPolicy uniqueKeyPolicy) { - super.withUniqueKeyPolicy(uniqueKeyPolicy); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GremlinGraphGetPropertiesResource - withConflictResolutionPolicy(ConflictResolutionPolicy conflictResolutionPolicy) { - super.withConflictResolutionPolicy(conflictResolutionPolicy); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GremlinGraphGetPropertiesResource withAnalyticalStorageTtl(Long analyticalStorageTtl) { - super.withAnalyticalStorageTtl(analyticalStorageTtl); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GremlinGraphGetPropertiesResource withRestoreParameters(ResourceRestoreParameters restoreParameters) { - super.withRestoreParameters(restoreParameters); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public GremlinGraphGetPropertiesResource withCreateMode(CreateMode createMode) { - super.withCreateMode(createMode); - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphResource.java index 6325f8e53676..93f8d5517c64 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/IncludedPath.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/IncludedPath.java index 7e2c385fb32b..329d1c49a6ce 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/IncludedPath.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/IncludedPath.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/IndexKind.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/IndexKind.java index f6306286955e..f0b4530b92f2 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/IndexKind.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/IndexKind.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Indexes.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Indexes.java index bf5ddb162c22..8efa2f3bc107 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Indexes.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Indexes.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/IndexingMode.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/IndexingMode.java index 71a7e69623d7..e9e4541c730c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/IndexingMode.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/IndexingMode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/IndexingPolicy.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/IndexingPolicy.java index 4eb7308acd44..57cf090eda06 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/IndexingPolicy.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/IndexingPolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/IpAddressOrRange.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/IpAddressOrRange.java index b6e7639d7c8d..79d42c9c1048 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/IpAddressOrRange.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/IpAddressOrRange.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/IssueType.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/IssueType.java new file mode 100644 index 000000000000..a54c57901ff0 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/IssueType.java @@ -0,0 +1,64 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Type of issue. + */ +public final class IssueType extends ExpandableStringEnum { + /** + * Unknown issue type. + */ + public static final IssueType UNKNOWN = fromString("Unknown"); + + /** + * An error occurred while applying the network security perimeter (NSP) configuration. + */ + public static final IssueType CONFIGURATION_PROPAGATION_FAILURE = fromString("ConfigurationPropagationFailure"); + + /** + * A network connectivity issue is happening on the resource which could be addressed either by adding new resources + * to the network security perimeter (NSP) or by modifying access rules. + */ + public static final IssueType MISSING_PERIMETER_CONFIGURATION = fromString("MissingPerimeterConfiguration"); + + /** + * An managed identity hasn't been associated with the resource. The resource will still be able to validate inbound + * traffic from the network security perimeter (NSP) or matching inbound access rules, but it won't be able to + * perform outbound access as a member of the NSP. + */ + public static final IssueType MISSING_IDENTITY_CONFIGURATION = fromString("MissingIdentityConfiguration"); + + /** + * Creates a new instance of IssueType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public IssueType() { + } + + /** + * Creates or finds a IssueType from its string representation. + * + * @param name a name to look for. + * @return the corresponding IssueType. + */ + public static IssueType fromString(String name) { + return fromString(name, IssueType.class); + } + + /** + * Gets known IssueType values. + * + * @return known IssueType values. + */ + public static Collection values() { + return values(IssueType.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/KeyKind.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/KeyKind.java index cae6f89363f1..edfbdae56f08 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/KeyKind.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/KeyKind.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/KeyWrapMetadata.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/KeyWrapMetadata.java index 756c67d392fc..a87030550cb9 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/KeyWrapMetadata.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/KeyWrapMetadata.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Kind.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Kind.java index 444f41dcc8f1..4fceac35bb11 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Kind.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Kind.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Location.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Location.java index 4f1773f50927..fafb5592b32a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Location.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Location.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -34,12 +34,7 @@ public final class Location implements JsonSerializable { private String documentEndpoint; /* - * The status of the Cosmos DB account at the time the operation was called. The status can be one of following. - * 'Creating' – the Cosmos DB account is being created. When an account is in Creating state, only properties that - * are specified as input for the Create Cosmos DB account operation are returned. 'Succeeded' – the Cosmos DB - * account is active for use. 'Updating' – the Cosmos DB account is being updated. 'Deleting' – the Cosmos DB - * account is being deleted. 'Failed' – the Cosmos DB account failed creation. 'DeletionFailed' – the Cosmos DB - * account deletion failed. + * The provisioning state of the resource. */ private String provisioningState; @@ -102,12 +97,7 @@ public String documentEndpoint() { } /** - * Get the provisioningState property: The status of the Cosmos DB account at the time the operation was called. The - * status can be one of following. 'Creating' – the Cosmos DB account is being created. When an account is in - * Creating state, only properties that are specified as input for the Create Cosmos DB account operation are - * returned. 'Succeeded' – the Cosmos DB account is active for use. 'Updating' – the Cosmos DB account is being - * updated. 'Deleting' – the Cosmos DB account is being deleted. 'Failed' – the Cosmos DB account failed creation. - * 'DeletionFailed' – the Cosmos DB account deletion failed. + * Get the provisioningState property: The provisioning state of the resource. * * @return the provisioningState value. */ diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/LocationProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/LocationProperties.java index 019c0a1b489c..8c8c0364abe3 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/LocationProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/LocationProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -50,7 +50,7 @@ public final class LocationProperties implements JsonSerializable { /* * The healthy property. @@ -35,7 +35,7 @@ public final class ManagedCassandraReaperStatus implements JsonSerializable repairRunIds() { return this.repairRunIds; } - /** - * Set the repairRunIds property: Dictionary of <string>. - * - * @param repairRunIds the repairRunIds value to set. - * @return the ManagedCassandraReaperStatus object itself. - */ - public ManagedCassandraReaperStatus withRepairRunIds(Map repairRunIds) { - this.repairRunIds = repairRunIds; - return this; - } - /** * Get the repairSchedules property: Dictionary of <string>. * @@ -87,17 +65,6 @@ public Map repairSchedules() { return this.repairSchedules; } - /** - * Set the repairSchedules property: Dictionary of <string>. - * - * @param repairSchedules the repairSchedules value to set. - * @return the ManagedCassandraReaperStatus object itself. - */ - public ManagedCassandraReaperStatus withRepairSchedules(Map repairSchedules) { - this.repairSchedules = repairSchedules; - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ManagedCassandraResourceIdentityType.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ManagedCassandraResourceIdentityType.java index c5e8b0708c70..428f7fb0d3c8 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ManagedCassandraResourceIdentityType.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ManagedCassandraResourceIdentityType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ManagedServiceIdentity.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ManagedServiceIdentity.java index e4b538de6112..af2b71b4b158 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ManagedServiceIdentity.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ManagedServiceIdentity.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ManagedServiceIdentityUserAssignedIdentities.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ManagedServiceIdentityUserAssignedIdentities.java index 382826e0b9f1..abbfb19314a0 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ManagedServiceIdentityUserAssignedIdentities.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ManagedServiceIdentityUserAssignedIdentities.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewDefinition.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewDefinition.java new file mode 100644 index 000000000000..6042d80abfe3 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewDefinition.java @@ -0,0 +1,188 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Materialized View definition for the container. + */ +@Fluent +public final class MaterializedViewDefinition implements JsonSerializable { + /* + * An unique identifier for the source collection. This is a system generated property. + */ + private String sourceCollectionRid; + + /* + * The name of the source container on which the Materialized View will be created. + */ + private String sourceCollectionId; + + /* + * The definition should be an SQL query which would be used to fetch data from the source container to populate + * into the Materialized View container. + */ + private String definition; + + /* + * Throughput bucket assigned for the materialized view operations on target container. + */ + private Integer throughputBucketForBuild; + + /** + * Creates an instance of MaterializedViewDefinition class. + */ + public MaterializedViewDefinition() { + } + + /** + * Get the sourceCollectionRid property: An unique identifier for the source collection. This is a system generated + * property. + * + * @return the sourceCollectionRid value. + */ + public String sourceCollectionRid() { + return this.sourceCollectionRid; + } + + /** + * Get the sourceCollectionId property: The name of the source container on which the Materialized View will be + * created. + * + * @return the sourceCollectionId value. + */ + public String sourceCollectionId() { + return this.sourceCollectionId; + } + + /** + * Set the sourceCollectionId property: The name of the source container on which the Materialized View will be + * created. + * + * @param sourceCollectionId the sourceCollectionId value to set. + * @return the MaterializedViewDefinition object itself. + */ + public MaterializedViewDefinition withSourceCollectionId(String sourceCollectionId) { + this.sourceCollectionId = sourceCollectionId; + return this; + } + + /** + * Get the definition property: The definition should be an SQL query which would be used to fetch data from the + * source container to populate into the Materialized View container. + * + * @return the definition value. + */ + public String definition() { + return this.definition; + } + + /** + * Set the definition property: The definition should be an SQL query which would be used to fetch data from the + * source container to populate into the Materialized View container. + * + * @param definition the definition value to set. + * @return the MaterializedViewDefinition object itself. + */ + public MaterializedViewDefinition withDefinition(String definition) { + this.definition = definition; + return this; + } + + /** + * Get the throughputBucketForBuild property: Throughput bucket assigned for the materialized view operations on + * target container. + * + * @return the throughputBucketForBuild value. + */ + public Integer throughputBucketForBuild() { + return this.throughputBucketForBuild; + } + + /** + * Set the throughputBucketForBuild property: Throughput bucket assigned for the materialized view operations on + * target container. + * + * @param throughputBucketForBuild the throughputBucketForBuild value to set. + * @return the MaterializedViewDefinition object itself. + */ + public MaterializedViewDefinition withThroughputBucketForBuild(Integer throughputBucketForBuild) { + this.throughputBucketForBuild = throughputBucketForBuild; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (sourceCollectionId() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sourceCollectionId in model MaterializedViewDefinition")); + } + if (definition() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property definition in model MaterializedViewDefinition")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MaterializedViewDefinition.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("sourceCollectionId", this.sourceCollectionId); + jsonWriter.writeStringField("definition", this.definition); + jsonWriter.writeNumberField("throughputBucketForBuild", this.throughputBucketForBuild); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MaterializedViewDefinition from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MaterializedViewDefinition if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MaterializedViewDefinition. + */ + public static MaterializedViewDefinition fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MaterializedViewDefinition deserializedMaterializedViewDefinition = new MaterializedViewDefinition(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("sourceCollectionId".equals(fieldName)) { + deserializedMaterializedViewDefinition.sourceCollectionId = reader.getString(); + } else if ("definition".equals(fieldName)) { + deserializedMaterializedViewDefinition.definition = reader.getString(); + } else if ("sourceCollectionRid".equals(fieldName)) { + deserializedMaterializedViewDefinition.sourceCollectionRid = reader.getString(); + } else if ("throughputBucketForBuild".equals(fieldName)) { + deserializedMaterializedViewDefinition.throughputBucketForBuild + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedMaterializedViewDefinition; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewDetails.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewDetails.java new file mode 100644 index 000000000000..f5d1df314e1f --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewDetails.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * MaterializedViewDetails, contains Id & _rid fields of materialized view. + */ +@Fluent +public final class MaterializedViewDetails implements JsonSerializable { + /* + * Id field of Materialized container. + */ + private String id; + + /* + * _rid field of Materialized container. + */ + private String rid; + + /** + * Creates an instance of MaterializedViewDetails class. + */ + public MaterializedViewDetails() { + } + + /** + * Get the id property: Id field of Materialized container. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Id field of Materialized container. + * + * @param id the id value to set. + * @return the MaterializedViewDetails object itself. + */ + public MaterializedViewDetails withId(String id) { + this.id = id; + return this; + } + + /** + * Get the rid property: _rid field of Materialized container. + * + * @return the rid value. + */ + public String rid() { + return this.rid; + } + + /** + * Set the rid property: _rid field of Materialized container. + * + * @param rid the rid value to set. + * @return the MaterializedViewDetails object itself. + */ + public MaterializedViewDetails withRid(String rid) { + this.rid = rid; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("_rid", this.rid); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MaterializedViewDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MaterializedViewDetails if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the MaterializedViewDetails. + */ + public static MaterializedViewDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MaterializedViewDetails deserializedMaterializedViewDetails = new MaterializedViewDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedMaterializedViewDetails.id = reader.getString(); + } else if ("_rid".equals(fieldName)) { + deserializedMaterializedViewDetails.rid = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMaterializedViewDetails; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewsBuilderRegionalServiceResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewsBuilderRegionalServiceResource.java index 5f16844d5742..dce6499cd268 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewsBuilderRegionalServiceResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewsBuilderRegionalServiceResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -33,7 +33,7 @@ public final class MaterializedViewsBuilderRegionalServiceResource extends Regio /** * Creates an instance of MaterializedViewsBuilderRegionalServiceResource class. */ - public MaterializedViewsBuilderRegionalServiceResource() { + private MaterializedViewsBuilderRegionalServiceResource() { } /** diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewsBuilderServiceResourceCreateUpdateParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewsBuilderServiceResourceCreateUpdateParameters.java index 76a6cf8e4cb8..93c6759185d0 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewsBuilderServiceResourceCreateUpdateParameters.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewsBuilderServiceResourceCreateUpdateParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewsBuilderServiceResourceProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewsBuilderServiceResourceProperties.java index c89895e262f4..ae6547a59297 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewsBuilderServiceResourceProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewsBuilderServiceResourceProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -17,7 +17,7 @@ /** * Properties for MaterializedViewsBuilderServiceResource. */ -@Fluent +@Immutable public final class MaterializedViewsBuilderServiceResourceProperties extends ServiceResourceProperties { /* * ServiceType for the service. @@ -32,7 +32,7 @@ public final class MaterializedViewsBuilderServiceResourceProperties extends Ser /** * Creates an instance of MaterializedViewsBuilderServiceResourceProperties class. */ - public MaterializedViewsBuilderServiceResourceProperties() { + private MaterializedViewsBuilderServiceResourceProperties() { } /** @@ -54,24 +54,6 @@ public List locations() { return this.locations; } - /** - * {@inheritDoc} - */ - @Override - public MaterializedViewsBuilderServiceResourceProperties withInstanceSize(ServiceSize instanceSize) { - super.withInstanceSize(instanceSize); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MaterializedViewsBuilderServiceResourceProperties withInstanceCount(Integer instanceCount) { - super.withInstanceCount(instanceCount); - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewsProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewsProperties.java new file mode 100644 index 000000000000..7a76fb9f7996 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewsProperties.java @@ -0,0 +1,96 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Materialized Views Properties for the source container. + */ +@Fluent +public final class MaterializedViewsProperties implements JsonSerializable { + /* + * Throughput bucket assigned for the materialized view operations on source container. + */ + private Integer throughputBucketForBuild; + + /** + * Creates an instance of MaterializedViewsProperties class. + */ + public MaterializedViewsProperties() { + } + + /** + * Get the throughputBucketForBuild property: Throughput bucket assigned for the materialized view operations on + * source container. + * + * @return the throughputBucketForBuild value. + */ + public Integer throughputBucketForBuild() { + return this.throughputBucketForBuild; + } + + /** + * Set the throughputBucketForBuild property: Throughput bucket assigned for the materialized view operations on + * source container. + * + * @param throughputBucketForBuild the throughputBucketForBuild value to set. + * @return the MaterializedViewsProperties object itself. + */ + public MaterializedViewsProperties withThroughputBucketForBuild(Integer throughputBucketForBuild) { + this.throughputBucketForBuild = throughputBucketForBuild; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeNumberField("throughputBucketForBuild", this.throughputBucketForBuild); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MaterializedViewsProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MaterializedViewsProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MaterializedViewsProperties. + */ + public static MaterializedViewsProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MaterializedViewsProperties deserializedMaterializedViewsProperties = new MaterializedViewsProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("throughputBucketForBuild".equals(fieldName)) { + deserializedMaterializedViewsProperties.throughputBucketForBuild + = reader.getNullable(JsonReader::getInt); + } else { + reader.skipChildren(); + } + } + + return deserializedMaterializedViewsProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MergeParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MergeParameters.java new file mode 100644 index 000000000000..598ee637bd57 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MergeParameters.java @@ -0,0 +1,93 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The properties of an Azure Cosmos DB merge operations. + */ +@Fluent +public final class MergeParameters implements JsonSerializable { + /* + * Specifies whether the operation is a real merge operation or a simulation. + */ + private Boolean isDryRun; + + /** + * Creates an instance of MergeParameters class. + */ + public MergeParameters() { + } + + /** + * Get the isDryRun property: Specifies whether the operation is a real merge operation or a simulation. + * + * @return the isDryRun value. + */ + public Boolean isDryRun() { + return this.isDryRun; + } + + /** + * Set the isDryRun property: Specifies whether the operation is a real merge operation or a simulation. + * + * @param isDryRun the isDryRun value to set. + * @return the MergeParameters object itself. + */ + public MergeParameters withIsDryRun(Boolean isDryRun) { + this.isDryRun = isDryRun; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeBooleanField("isDryRun", this.isDryRun); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MergeParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MergeParameters if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the MergeParameters. + */ + public static MergeParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MergeParameters deserializedMergeParameters = new MergeParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("isDryRun".equals(fieldName)) { + deserializedMergeParameters.isDryRun = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedMergeParameters; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MetricAvailability.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MetricAvailability.java index 48376f1d6a95..793a13d52756 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MetricAvailability.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MetricAvailability.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -29,7 +29,7 @@ public final class MetricAvailability implements JsonSerializable { /** * Creates an instance of MetricName class. */ - public MetricName() { + private MetricName() { } /** diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MetricValue.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MetricValue.java index eba76fc4905a..3757e27b7670 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MetricValue.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MetricValue.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -51,7 +51,7 @@ public class MetricValue implements JsonSerializable { /** * Creates an instance of MetricValue class. */ - public MetricValue() { + protected MetricValue() { } /** diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MinimalTlsVersion.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MinimalTlsVersion.java index 0e34dbbea13f..52b0b6619ce6 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MinimalTlsVersion.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MinimalTlsVersion.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -8,8 +8,8 @@ import java.util.Collection; /** - * Indicates the minimum allowed Tls version. The default value is Tls 1.2. Cassandra and Mongo APIs only work with Tls - * 1.2. + * Indicates the minimum allowed Tls version. The default is Tls 1.0, except for Cassandra and Mongo API's, which only + * work with Tls 1.2. */ public final class MinimalTlsVersion extends ExpandableStringEnum { /** diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionCreateUpdateParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionCreateUpdateParameters.java index d885ebd9debc..b48fa400286a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionCreateUpdateParameters.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionCreateUpdateParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -24,17 +24,17 @@ public final class MongoDBCollectionCreateUpdateParameters extends ArmResourcePr private MongoDBCollectionCreateUpdateProperties innerProperties = new MongoDBCollectionCreateUpdateProperties(); /* - * The type of the resource. + * The type of Azure resource. */ private String type; /* - * The name of the resource. + * The name of the ARM resource. */ private String name; /* - * Fully qualified resource Id for the resource. + * The unique resource identifier of the ARM resource. */ private String id; @@ -54,7 +54,7 @@ private MongoDBCollectionCreateUpdateProperties innerProperties() { } /** - * Get the type property: The type of the resource. + * Get the type property: The type of Azure resource. * * @return the type value. */ @@ -64,7 +64,7 @@ public String type() { } /** - * Get the name property: The name of the resource. + * Get the name property: The name of the ARM resource. * * @return the name value. */ @@ -74,7 +74,7 @@ public String name() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the id property: The unique resource identifier of the ARM resource. * * @return the id value. */ @@ -101,6 +101,15 @@ public MongoDBCollectionCreateUpdateParameters withTags(Map tags return this; } + /** + * {@inheritDoc} + */ + @Override + public MongoDBCollectionCreateUpdateParameters withIdentity(ManagedServiceIdentity identity) { + super.withIdentity(identity); + return this; + } + /** * Get the resource property: The standard JSON format of a MongoDB collection. * @@ -163,6 +172,9 @@ public void validate() { } else { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(MongoDBCollectionCreateUpdateParameters.class); @@ -175,6 +187,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", identity()); jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -207,6 +220,9 @@ public static MongoDBCollectionCreateUpdateParameters fromJson(JsonReader jsonRe } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedMongoDBCollectionCreateUpdateParameters.withTags(tags); + } else if ("identity".equals(fieldName)) { + deserializedMongoDBCollectionCreateUpdateParameters + .withIdentity(ManagedServiceIdentity.fromJson(reader)); } else if ("properties".equals(fieldName)) { deserializedMongoDBCollectionCreateUpdateParameters.innerProperties = MongoDBCollectionCreateUpdateProperties.fromJson(reader); diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionGetPropertiesOptions.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionGetPropertiesOptions.java index f268612ee2a1..a73c2fea22e0 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionGetPropertiesOptions.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionGetPropertiesOptions.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -13,30 +13,44 @@ /** * The MongoDBCollectionGetPropertiesOptions model. */ -@Fluent +@Immutable public final class MongoDBCollectionGetPropertiesOptions extends OptionsResource { + /* + * Specifies the Autoscale settings. + */ + private AutoscaleSettings autoscaleSettings; + + /* + * Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when + * retrieving offer details. + */ + private Integer throughput; + /** * Creates an instance of MongoDBCollectionGetPropertiesOptions class. */ - public MongoDBCollectionGetPropertiesOptions() { + private MongoDBCollectionGetPropertiesOptions() { } /** - * {@inheritDoc} + * Get the autoscaleSettings property: Specifies the Autoscale settings. + * + * @return the autoscaleSettings value. */ @Override - public MongoDBCollectionGetPropertiesOptions withThroughput(Integer throughput) { - super.withThroughput(throughput); - return this; + public AutoscaleSettings autoscaleSettings() { + return this.autoscaleSettings; } /** - * {@inheritDoc} + * Get the throughput property: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the + * ThroughputSetting resource when retrieving offer details. + * + * @return the throughput value. */ @Override - public MongoDBCollectionGetPropertiesOptions withAutoscaleSettings(AutoscaleSettings autoscaleSettings) { - super.withAutoscaleSettings(autoscaleSettings); - return this; + public Integer throughput() { + return this.throughput; } /** @@ -79,11 +93,11 @@ public static MongoDBCollectionGetPropertiesOptions fromJson(JsonReader jsonRead reader.nextToken(); if ("throughput".equals(fieldName)) { - deserializedMongoDBCollectionGetPropertiesOptions - .withThroughput(reader.getNullable(JsonReader::getInt)); + deserializedMongoDBCollectionGetPropertiesOptions.throughput + = reader.getNullable(JsonReader::getInt); } else if ("autoscaleSettings".equals(fieldName)) { - deserializedMongoDBCollectionGetPropertiesOptions - .withAutoscaleSettings(AutoscaleSettings.fromJson(reader)); + deserializedMongoDBCollectionGetPropertiesOptions.autoscaleSettings + = AutoscaleSettings.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionGetPropertiesResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionGetPropertiesResource.java index 268b2b995c66..e066eee7fa77 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionGetPropertiesResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionGetPropertiesResource.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -16,7 +16,7 @@ /** * The MongoDBCollectionGetPropertiesResource model. */ -@Fluent +@Immutable public final class MongoDBCollectionGetPropertiesResource extends MongoDBCollectionResource { /* * A system generated property. A unique identifier. @@ -36,7 +36,7 @@ public final class MongoDBCollectionGetPropertiesResource extends MongoDBCollect /** * Creates an instance of MongoDBCollectionGetPropertiesResource class. */ - public MongoDBCollectionGetPropertiesResource() { + private MongoDBCollectionGetPropertiesResource() { } /** @@ -67,60 +67,6 @@ public String etag() { return this.etag; } - /** - * {@inheritDoc} - */ - @Override - public MongoDBCollectionGetPropertiesResource withId(String id) { - super.withId(id); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MongoDBCollectionGetPropertiesResource withShardKey(Map shardKey) { - super.withShardKey(shardKey); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MongoDBCollectionGetPropertiesResource withIndexes(List indexes) { - super.withIndexes(indexes); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MongoDBCollectionGetPropertiesResource withAnalyticalStorageTtl(Integer analyticalStorageTtl) { - super.withAnalyticalStorageTtl(analyticalStorageTtl); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MongoDBCollectionGetPropertiesResource withRestoreParameters(ResourceRestoreParameters restoreParameters) { - super.withRestoreParameters(restoreParameters); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MongoDBCollectionGetPropertiesResource withCreateMode(CreateMode createMode) { - super.withCreateMode(createMode); - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionResource.java index e3807daf6ac9..2d138f9a9ec1 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseCreateUpdateParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseCreateUpdateParameters.java index 678c79692c87..609666947914 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseCreateUpdateParameters.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseCreateUpdateParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -24,17 +24,17 @@ public final class MongoDBDatabaseCreateUpdateParameters extends ArmResourceProp private MongoDBDatabaseCreateUpdateProperties innerProperties = new MongoDBDatabaseCreateUpdateProperties(); /* - * The type of the resource. + * The type of Azure resource. */ private String type; /* - * The name of the resource. + * The name of the ARM resource. */ private String name; /* - * Fully qualified resource Id for the resource. + * The unique resource identifier of the ARM resource. */ private String id; @@ -54,7 +54,7 @@ private MongoDBDatabaseCreateUpdateProperties innerProperties() { } /** - * Get the type property: The type of the resource. + * Get the type property: The type of Azure resource. * * @return the type value. */ @@ -64,7 +64,7 @@ public String type() { } /** - * Get the name property: The name of the resource. + * Get the name property: The name of the ARM resource. * * @return the name value. */ @@ -74,7 +74,7 @@ public String name() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the id property: The unique resource identifier of the ARM resource. * * @return the id value. */ @@ -101,6 +101,15 @@ public MongoDBDatabaseCreateUpdateParameters withTags(Map tags) return this; } + /** + * {@inheritDoc} + */ + @Override + public MongoDBDatabaseCreateUpdateParameters withIdentity(ManagedServiceIdentity identity) { + super.withIdentity(identity); + return this; + } + /** * Get the resource property: The standard JSON format of a MongoDB database. * @@ -163,6 +172,9 @@ public void validate() { } else { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(MongoDBDatabaseCreateUpdateParameters.class); @@ -175,6 +187,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", identity()); jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -207,6 +220,9 @@ public static MongoDBDatabaseCreateUpdateParameters fromJson(JsonReader jsonRead } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedMongoDBDatabaseCreateUpdateParameters.withTags(tags); + } else if ("identity".equals(fieldName)) { + deserializedMongoDBDatabaseCreateUpdateParameters + .withIdentity(ManagedServiceIdentity.fromJson(reader)); } else if ("properties".equals(fieldName)) { deserializedMongoDBDatabaseCreateUpdateParameters.innerProperties = MongoDBDatabaseCreateUpdateProperties.fromJson(reader); diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseGetPropertiesOptions.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseGetPropertiesOptions.java index 8b56cb022878..ffe796bd716f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseGetPropertiesOptions.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseGetPropertiesOptions.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -13,30 +13,44 @@ /** * The MongoDBDatabaseGetPropertiesOptions model. */ -@Fluent +@Immutable public final class MongoDBDatabaseGetPropertiesOptions extends OptionsResource { + /* + * Specifies the Autoscale settings. + */ + private AutoscaleSettings autoscaleSettings; + + /* + * Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when + * retrieving offer details. + */ + private Integer throughput; + /** * Creates an instance of MongoDBDatabaseGetPropertiesOptions class. */ - public MongoDBDatabaseGetPropertiesOptions() { + private MongoDBDatabaseGetPropertiesOptions() { } /** - * {@inheritDoc} + * Get the autoscaleSettings property: Specifies the Autoscale settings. + * + * @return the autoscaleSettings value. */ @Override - public MongoDBDatabaseGetPropertiesOptions withThroughput(Integer throughput) { - super.withThroughput(throughput); - return this; + public AutoscaleSettings autoscaleSettings() { + return this.autoscaleSettings; } /** - * {@inheritDoc} + * Get the throughput property: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the + * ThroughputSetting resource when retrieving offer details. + * + * @return the throughput value. */ @Override - public MongoDBDatabaseGetPropertiesOptions withAutoscaleSettings(AutoscaleSettings autoscaleSettings) { - super.withAutoscaleSettings(autoscaleSettings); - return this; + public Integer throughput() { + return this.throughput; } /** @@ -79,11 +93,10 @@ public static MongoDBDatabaseGetPropertiesOptions fromJson(JsonReader jsonReader reader.nextToken(); if ("throughput".equals(fieldName)) { - deserializedMongoDBDatabaseGetPropertiesOptions - .withThroughput(reader.getNullable(JsonReader::getInt)); + deserializedMongoDBDatabaseGetPropertiesOptions.throughput = reader.getNullable(JsonReader::getInt); } else if ("autoscaleSettings".equals(fieldName)) { - deserializedMongoDBDatabaseGetPropertiesOptions - .withAutoscaleSettings(AutoscaleSettings.fromJson(reader)); + deserializedMongoDBDatabaseGetPropertiesOptions.autoscaleSettings + = AutoscaleSettings.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseGetPropertiesResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseGetPropertiesResource.java index f95dbd034662..d25277f1f794 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseGetPropertiesResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseGetPropertiesResource.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * The MongoDBDatabaseGetPropertiesResource model. */ -@Fluent +@Immutable public final class MongoDBDatabaseGetPropertiesResource extends MongoDBDatabaseResource { /* * A system generated property. A unique identifier. @@ -34,7 +34,7 @@ public final class MongoDBDatabaseGetPropertiesResource extends MongoDBDatabaseR /** * Creates an instance of MongoDBDatabaseGetPropertiesResource class. */ - public MongoDBDatabaseGetPropertiesResource() { + private MongoDBDatabaseGetPropertiesResource() { } /** @@ -65,33 +65,6 @@ public String etag() { return this.etag; } - /** - * {@inheritDoc} - */ - @Override - public MongoDBDatabaseGetPropertiesResource withId(String id) { - super.withId(id); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MongoDBDatabaseGetPropertiesResource withRestoreParameters(ResourceRestoreParameters restoreParameters) { - super.withRestoreParameters(restoreParameters); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public MongoDBDatabaseGetPropertiesResource withCreateMode(CreateMode createMode) { - super.withCreateMode(createMode); - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseResource.java index 8dc0129b5ba3..308486b230a6 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -28,7 +28,7 @@ public class MongoDBDatabaseResource implements JsonSerializable tasks; + + /** + * Creates an instance of MongoRUToMongoRUCopyJobProperties class. + */ + public MongoRUToMongoRUCopyJobProperties() { + } + + /** + * Get the jobType property: Copy Job Type. + * + * @return the jobType value. + */ + @Override + public CopyJobType jobType() { + return this.jobType; + } + + /** + * Get the sourceDetails property: Source Mongo DataStore details. + * + * @return the sourceDetails value. + */ + public CosmosDBSourceSinkDetails sourceDetails() { + return this.sourceDetails; + } + + /** + * Set the sourceDetails property: Source Mongo DataStore details. + * + * @param sourceDetails the sourceDetails value to set. + * @return the MongoRUToMongoRUCopyJobProperties object itself. + */ + public MongoRUToMongoRUCopyJobProperties withSourceDetails(CosmosDBSourceSinkDetails sourceDetails) { + this.sourceDetails = sourceDetails; + return this; + } + + /** + * Get the destinationDetails property: Destination Mongo DataStore details. + * + * @return the destinationDetails value. + */ + public CosmosDBSourceSinkDetails destinationDetails() { + return this.destinationDetails; + } + + /** + * Set the destinationDetails property: Destination Mongo DataStore details. + * + * @param destinationDetails the destinationDetails value to set. + * @return the MongoRUToMongoRUCopyJobProperties object itself. + */ + public MongoRUToMongoRUCopyJobProperties withDestinationDetails(CosmosDBSourceSinkDetails destinationDetails) { + this.destinationDetails = destinationDetails; + return this; + } + + /** + * Get the tasks property: Copy Job tasks. + * + * @return the tasks value. + */ + public List tasks() { + return this.tasks; + } + + /** + * Set the tasks property: Copy Job tasks. + * + * @param tasks the tasks value to set. + * @return the MongoRUToMongoRUCopyJobProperties object itself. + */ + public MongoRUToMongoRUCopyJobProperties withTasks(List tasks) { + this.tasks = tasks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (sourceDetails() != null) { + sourceDetails().validate(); + } + if (destinationDetails() != null) { + destinationDetails().validate(); + } + if (tasks() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property tasks in model MongoRUToMongoRUCopyJobProperties")); + } else { + tasks().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoRUToMongoRUCopyJobProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("tasks", this.tasks, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("jobType", this.jobType == null ? null : this.jobType.toString()); + jsonWriter.writeJsonField("sourceDetails", this.sourceDetails); + jsonWriter.writeJsonField("destinationDetails", this.destinationDetails); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoRUToMongoRUCopyJobProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoRUToMongoRUCopyJobProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MongoRUToMongoRUCopyJobProperties. + */ + public static MongoRUToMongoRUCopyJobProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoRUToMongoRUCopyJobProperties deserializedMongoRUToMongoRUCopyJobProperties + = new MongoRUToMongoRUCopyJobProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tasks".equals(fieldName)) { + List tasks + = reader.readArray(reader1 -> MongoRUToMongoRUCopyJobTask.fromJson(reader1)); + deserializedMongoRUToMongoRUCopyJobProperties.tasks = tasks; + } else if ("jobType".equals(fieldName)) { + deserializedMongoRUToMongoRUCopyJobProperties.jobType = CopyJobType.fromString(reader.getString()); + } else if ("sourceDetails".equals(fieldName)) { + deserializedMongoRUToMongoRUCopyJobProperties.sourceDetails + = CosmosDBSourceSinkDetails.fromJson(reader); + } else if ("destinationDetails".equals(fieldName)) { + deserializedMongoRUToMongoRUCopyJobProperties.destinationDetails + = CosmosDBSourceSinkDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoRUToMongoRUCopyJobProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoRUCopyJobTask.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoRUCopyJobTask.java new file mode 100644 index 000000000000..dc49d39cfde4 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoRUCopyJobTask.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The MongoRUToMongoRUCopyJobTask model. + */ +@Fluent +public final class MongoRUToMongoRUCopyJobTask extends BaseCopyJobTask { + /* + * Source Mongo (RU) collection + */ + private CosmosDBMongoCollection source; + + /* + * Destination Mongo (RU) collection + */ + private CosmosDBMongoCollection destination; + + /* + * Task level Processed Count. + */ + private Long processedCount; + + /* + * Task level Total Count. + */ + private Long totalCount; + + /** + * Creates an instance of MongoRUToMongoRUCopyJobTask class. + */ + public MongoRUToMongoRUCopyJobTask() { + } + + /** + * Get the source property: Source Mongo (RU) collection. + * + * @return the source value. + */ + public CosmosDBMongoCollection source() { + return this.source; + } + + /** + * Set the source property: Source Mongo (RU) collection. + * + * @param source the source value to set. + * @return the MongoRUToMongoRUCopyJobTask object itself. + */ + public MongoRUToMongoRUCopyJobTask withSource(CosmosDBMongoCollection source) { + this.source = source; + return this; + } + + /** + * Get the destination property: Destination Mongo (RU) collection. + * + * @return the destination value. + */ + public CosmosDBMongoCollection destination() { + return this.destination; + } + + /** + * Set the destination property: Destination Mongo (RU) collection. + * + * @param destination the destination value to set. + * @return the MongoRUToMongoRUCopyJobTask object itself. + */ + public MongoRUToMongoRUCopyJobTask withDestination(CosmosDBMongoCollection destination) { + this.destination = destination; + return this; + } + + /** + * Get the processedCount property: Task level Processed Count. + * + * @return the processedCount value. + */ + @Override + public Long processedCount() { + return this.processedCount; + } + + /** + * Get the totalCount property: Task level Total Count. + * + * @return the totalCount value. + */ + @Override + public Long totalCount() { + return this.totalCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (source() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property source in model MongoRUToMongoRUCopyJobTask")); + } else { + source().validate(); + } + if (destination() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property destination in model MongoRUToMongoRUCopyJobTask")); + } else { + destination().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoRUToMongoRUCopyJobTask.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("source", this.source); + jsonWriter.writeJsonField("destination", this.destination); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoRUToMongoRUCopyJobTask from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoRUToMongoRUCopyJobTask if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MongoRUToMongoRUCopyJobTask. + */ + public static MongoRUToMongoRUCopyJobTask fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoRUToMongoRUCopyJobTask deserializedMongoRUToMongoRUCopyJobTask = new MongoRUToMongoRUCopyJobTask(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("totalCount".equals(fieldName)) { + deserializedMongoRUToMongoRUCopyJobTask.totalCount = reader.getNullable(JsonReader::getLong); + } else if ("processedCount".equals(fieldName)) { + deserializedMongoRUToMongoRUCopyJobTask.processedCount = reader.getNullable(JsonReader::getLong); + } else if ("source".equals(fieldName)) { + deserializedMongoRUToMongoRUCopyJobTask.source = CosmosDBMongoCollection.fromJson(reader); + } else if ("destination".equals(fieldName)) { + deserializedMongoRUToMongoRUCopyJobTask.destination = CosmosDBMongoCollection.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoRUToMongoRUCopyJobTask; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoVCoreCopyJobProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoVCoreCopyJobProperties.java new file mode 100644 index 000000000000..bdfd34369921 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoVCoreCopyJobProperties.java @@ -0,0 +1,195 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Source Mongo to Destination Mongo vCore copy job properties. + */ +@Fluent +public final class MongoRUToMongoVCoreCopyJobProperties extends BaseCopyJobProperties { + /* + * Copy Job Type + */ + private CopyJobType jobType = CopyJobType.MONGO_RUTO_MONGO_VCORE; + + /* + * Source Mongo (RU) DataStore details + */ + private CosmosDBSourceSinkDetails sourceDetails; + + /* + * Destination Mongo (vCore) DataStore details + */ + private MongoVCoreSourceSinkDetails destinationDetails; + + /* + * Copy Job tasks. + */ + private List tasks; + + /** + * Creates an instance of MongoRUToMongoVCoreCopyJobProperties class. + */ + public MongoRUToMongoVCoreCopyJobProperties() { + } + + /** + * Get the jobType property: Copy Job Type. + * + * @return the jobType value. + */ + @Override + public CopyJobType jobType() { + return this.jobType; + } + + /** + * Get the sourceDetails property: Source Mongo (RU) DataStore details. + * + * @return the sourceDetails value. + */ + public CosmosDBSourceSinkDetails sourceDetails() { + return this.sourceDetails; + } + + /** + * Set the sourceDetails property: Source Mongo (RU) DataStore details. + * + * @param sourceDetails the sourceDetails value to set. + * @return the MongoRUToMongoVCoreCopyJobProperties object itself. + */ + public MongoRUToMongoVCoreCopyJobProperties withSourceDetails(CosmosDBSourceSinkDetails sourceDetails) { + this.sourceDetails = sourceDetails; + return this; + } + + /** + * Get the destinationDetails property: Destination Mongo (vCore) DataStore details. + * + * @return the destinationDetails value. + */ + public MongoVCoreSourceSinkDetails destinationDetails() { + return this.destinationDetails; + } + + /** + * Set the destinationDetails property: Destination Mongo (vCore) DataStore details. + * + * @param destinationDetails the destinationDetails value to set. + * @return the MongoRUToMongoVCoreCopyJobProperties object itself. + */ + public MongoRUToMongoVCoreCopyJobProperties withDestinationDetails(MongoVCoreSourceSinkDetails destinationDetails) { + this.destinationDetails = destinationDetails; + return this; + } + + /** + * Get the tasks property: Copy Job tasks. + * + * @return the tasks value. + */ + public List tasks() { + return this.tasks; + } + + /** + * Set the tasks property: Copy Job tasks. + * + * @param tasks the tasks value to set. + * @return the MongoRUToMongoVCoreCopyJobProperties object itself. + */ + public MongoRUToMongoVCoreCopyJobProperties withTasks(List tasks) { + this.tasks = tasks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (sourceDetails() != null) { + sourceDetails().validate(); + } + if (destinationDetails() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property destinationDetails in model MongoRUToMongoVCoreCopyJobProperties")); + } else { + destinationDetails().validate(); + } + if (tasks() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property tasks in model MongoRUToMongoVCoreCopyJobProperties")); + } else { + tasks().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoRUToMongoVCoreCopyJobProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("destinationDetails", this.destinationDetails); + jsonWriter.writeArrayField("tasks", this.tasks, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("jobType", this.jobType == null ? null : this.jobType.toString()); + jsonWriter.writeJsonField("sourceDetails", this.sourceDetails); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoRUToMongoVCoreCopyJobProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoRUToMongoVCoreCopyJobProperties if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MongoRUToMongoVCoreCopyJobProperties. + */ + public static MongoRUToMongoVCoreCopyJobProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoRUToMongoVCoreCopyJobProperties deserializedMongoRUToMongoVCoreCopyJobProperties + = new MongoRUToMongoVCoreCopyJobProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("destinationDetails".equals(fieldName)) { + deserializedMongoRUToMongoVCoreCopyJobProperties.destinationDetails + = MongoVCoreSourceSinkDetails.fromJson(reader); + } else if ("tasks".equals(fieldName)) { + List tasks + = reader.readArray(reader1 -> MongoRUToMongoVCoreCopyJobTask.fromJson(reader1)); + deserializedMongoRUToMongoVCoreCopyJobProperties.tasks = tasks; + } else if ("jobType".equals(fieldName)) { + deserializedMongoRUToMongoVCoreCopyJobProperties.jobType + = CopyJobType.fromString(reader.getString()); + } else if ("sourceDetails".equals(fieldName)) { + deserializedMongoRUToMongoVCoreCopyJobProperties.sourceDetails + = CosmosDBSourceSinkDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoRUToMongoVCoreCopyJobProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoVCoreCopyJobTask.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoVCoreCopyJobTask.java new file mode 100644 index 000000000000..3adb4e02cfad --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoVCoreCopyJobTask.java @@ -0,0 +1,175 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The MongoRUToMongoVCoreCopyJobTask model. + */ +@Fluent +public final class MongoRUToMongoVCoreCopyJobTask extends BaseCopyJobTask { + /* + * Source Mongo (RU) collection + */ + private CosmosDBMongoCollection source; + + /* + * Destination Mongo (vCore) collection + */ + private CosmosDBMongoVCoreCollection destination; + + /* + * Task level Processed Count. + */ + private Long processedCount; + + /* + * Task level Total Count. + */ + private Long totalCount; + + /** + * Creates an instance of MongoRUToMongoVCoreCopyJobTask class. + */ + public MongoRUToMongoVCoreCopyJobTask() { + } + + /** + * Get the source property: Source Mongo (RU) collection. + * + * @return the source value. + */ + public CosmosDBMongoCollection source() { + return this.source; + } + + /** + * Set the source property: Source Mongo (RU) collection. + * + * @param source the source value to set. + * @return the MongoRUToMongoVCoreCopyJobTask object itself. + */ + public MongoRUToMongoVCoreCopyJobTask withSource(CosmosDBMongoCollection source) { + this.source = source; + return this; + } + + /** + * Get the destination property: Destination Mongo (vCore) collection. + * + * @return the destination value. + */ + public CosmosDBMongoVCoreCollection destination() { + return this.destination; + } + + /** + * Set the destination property: Destination Mongo (vCore) collection. + * + * @param destination the destination value to set. + * @return the MongoRUToMongoVCoreCopyJobTask object itself. + */ + public MongoRUToMongoVCoreCopyJobTask withDestination(CosmosDBMongoVCoreCollection destination) { + this.destination = destination; + return this; + } + + /** + * Get the processedCount property: Task level Processed Count. + * + * @return the processedCount value. + */ + @Override + public Long processedCount() { + return this.processedCount; + } + + /** + * Get the totalCount property: Task level Total Count. + * + * @return the totalCount value. + */ + @Override + public Long totalCount() { + return this.totalCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (source() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property source in model MongoRUToMongoVCoreCopyJobTask")); + } else { + source().validate(); + } + if (destination() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property destination in model MongoRUToMongoVCoreCopyJobTask")); + } else { + destination().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(MongoRUToMongoVCoreCopyJobTask.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("source", this.source); + jsonWriter.writeJsonField("destination", this.destination); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoRUToMongoVCoreCopyJobTask from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoRUToMongoVCoreCopyJobTask if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the MongoRUToMongoVCoreCopyJobTask. + */ + public static MongoRUToMongoVCoreCopyJobTask fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoRUToMongoVCoreCopyJobTask deserializedMongoRUToMongoVCoreCopyJobTask + = new MongoRUToMongoVCoreCopyJobTask(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("totalCount".equals(fieldName)) { + deserializedMongoRUToMongoVCoreCopyJobTask.totalCount = reader.getNullable(JsonReader::getLong); + } else if ("processedCount".equals(fieldName)) { + deserializedMongoRUToMongoVCoreCopyJobTask.processedCount = reader.getNullable(JsonReader::getLong); + } else if ("source".equals(fieldName)) { + deserializedMongoRUToMongoVCoreCopyJobTask.source = CosmosDBMongoCollection.fromJson(reader); + } else if ("destination".equals(fieldName)) { + deserializedMongoRUToMongoVCoreCopyJobTask.destination + = CosmosDBMongoVCoreCollection.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoRUToMongoVCoreCopyJobTask; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRoleDefinitionCreateUpdateParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRoleDefinitionCreateUpdateParameters.java index 978a3e5dca6b..ec27b7d680ea 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRoleDefinitionCreateUpdateParameters.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRoleDefinitionCreateUpdateParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRoleDefinitionType.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRoleDefinitionType.java index 9548bb61ae51..b2113d03104b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRoleDefinitionType.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoRoleDefinitionType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoUserDefinitionCreateUpdateParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoUserDefinitionCreateUpdateParameters.java index 835e6256f061..8136f6d51aba 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoUserDefinitionCreateUpdateParameters.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoUserDefinitionCreateUpdateParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoVCoreSourceSinkDetails.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoVCoreSourceSinkDetails.java new file mode 100644 index 000000000000..5dd75fce6b8e --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/MongoVCoreSourceSinkDetails.java @@ -0,0 +1,121 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * A CosmosDB Mongo vCore data source/sink details. + */ +@Fluent +public final class MongoVCoreSourceSinkDetails implements JsonSerializable { + /* + * The hostName property. + */ + private String hostname; + + /* + * URI of Azure KeyVault secret containing connection string. + */ + private String connectionStringKeyVaultUri; + + /** + * Creates an instance of MongoVCoreSourceSinkDetails class. + */ + public MongoVCoreSourceSinkDetails() { + } + + /** + * Get the hostname property: The hostName property. + * + * @return the hostname value. + */ + public String hostname() { + return this.hostname; + } + + /** + * Set the hostname property: The hostName property. + * + * @param hostname the hostname value to set. + * @return the MongoVCoreSourceSinkDetails object itself. + */ + public MongoVCoreSourceSinkDetails withHostname(String hostname) { + this.hostname = hostname; + return this; + } + + /** + * Get the connectionStringKeyVaultUri property: URI of Azure KeyVault secret containing connection string. + * + * @return the connectionStringKeyVaultUri value. + */ + public String connectionStringKeyVaultUri() { + return this.connectionStringKeyVaultUri; + } + + /** + * Set the connectionStringKeyVaultUri property: URI of Azure KeyVault secret containing connection string. + * + * @param connectionStringKeyVaultUri the connectionStringKeyVaultUri value to set. + * @return the MongoVCoreSourceSinkDetails object itself. + */ + public MongoVCoreSourceSinkDetails withConnectionStringKeyVaultUri(String connectionStringKeyVaultUri) { + this.connectionStringKeyVaultUri = connectionStringKeyVaultUri; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("hostName", this.hostname); + jsonWriter.writeStringField("connectionStringKeyVaultUri", this.connectionStringKeyVaultUri); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of MongoVCoreSourceSinkDetails from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of MongoVCoreSourceSinkDetails if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the MongoVCoreSourceSinkDetails. + */ + public static MongoVCoreSourceSinkDetails fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + MongoVCoreSourceSinkDetails deserializedMongoVCoreSourceSinkDetails = new MongoVCoreSourceSinkDetails(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("hostName".equals(fieldName)) { + deserializedMongoVCoreSourceSinkDetails.hostname = reader.getString(); + } else if ("connectionStringKeyVaultUri".equals(fieldName)) { + deserializedMongoVCoreSourceSinkDetails.connectionStringKeyVaultUri = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedMongoVCoreSourceSinkDetails; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkAclBypass.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkAclBypass.java index a2b129de9860..00d85ceb288a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkAclBypass.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkAclBypass.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityPerimeter.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityPerimeter.java new file mode 100644 index 000000000000..0ad05fe980a0 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityPerimeter.java @@ -0,0 +1,116 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Information about a network security perimeter (NSP). + */ +@Immutable +public final class NetworkSecurityPerimeter implements JsonSerializable { + /* + * Fully qualified Azure resource ID of the NSP resource + */ + private String id; + + /* + * Universal unique ID (UUID) of the network security perimeter + */ + private String perimeterGuid; + + /* + * Location of the network security perimeter + */ + private String location; + + /** + * Creates an instance of NetworkSecurityPerimeter class. + */ + private NetworkSecurityPerimeter() { + } + + /** + * Get the id property: Fully qualified Azure resource ID of the NSP resource. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the perimeterGuid property: Universal unique ID (UUID) of the network security perimeter. + * + * @return the perimeterGuid value. + */ + public String perimeterGuid() { + return this.perimeterGuid; + } + + /** + * Get the location property: Location of the network security perimeter. + * + * @return the location value. + */ + public String location() { + return this.location; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeStringField("perimeterGuid", this.perimeterGuid); + jsonWriter.writeStringField("location", this.location); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityPerimeter from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityPerimeter if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkSecurityPerimeter. + */ + public static NetworkSecurityPerimeter fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityPerimeter deserializedNetworkSecurityPerimeter = new NetworkSecurityPerimeter(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedNetworkSecurityPerimeter.id = reader.getString(); + } else if ("perimeterGuid".equals(fieldName)) { + deserializedNetworkSecurityPerimeter.perimeterGuid = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedNetworkSecurityPerimeter.location = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityPerimeter; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityPerimeterConfigurationProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityPerimeterConfigurationProperties.java new file mode 100644 index 000000000000..6939edc348c5 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityPerimeterConfigurationProperties.java @@ -0,0 +1,169 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Network security configuration properties. + */ +@Immutable +public final class NetworkSecurityPerimeterConfigurationProperties + implements JsonSerializable { + /* + * The provisioningState property. + */ + private NetworkSecurityPerimeterConfigurationProvisioningState provisioningState; + + /* + * List of provisioning issues, if any + */ + private List provisioningIssues; + + /* + * The networkSecurityPerimeter property. + */ + private NetworkSecurityPerimeter networkSecurityPerimeter; + + /* + * The resourceAssociation property. + */ + private ResourceAssociation resourceAssociation; + + /* + * The profile property. + */ + private NetworkSecurityProfile profile; + + /** + * Creates an instance of NetworkSecurityPerimeterConfigurationProperties class. + */ + private NetworkSecurityPerimeterConfigurationProperties() { + } + + /** + * Get the provisioningState property: The provisioningState property. + * + * @return the provisioningState value. + */ + public NetworkSecurityPerimeterConfigurationProvisioningState provisioningState() { + return this.provisioningState; + } + + /** + * Get the provisioningIssues property: List of provisioning issues, if any. + * + * @return the provisioningIssues value. + */ + public List provisioningIssues() { + return this.provisioningIssues; + } + + /** + * Get the networkSecurityPerimeter property: The networkSecurityPerimeter property. + * + * @return the networkSecurityPerimeter value. + */ + public NetworkSecurityPerimeter networkSecurityPerimeter() { + return this.networkSecurityPerimeter; + } + + /** + * Get the resourceAssociation property: The resourceAssociation property. + * + * @return the resourceAssociation value. + */ + public ResourceAssociation resourceAssociation() { + return this.resourceAssociation; + } + + /** + * Get the profile property: The profile property. + * + * @return the profile value. + */ + public NetworkSecurityProfile profile() { + return this.profile; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (provisioningIssues() != null) { + provisioningIssues().forEach(e -> e.validate()); + } + if (networkSecurityPerimeter() != null) { + networkSecurityPerimeter().validate(); + } + if (resourceAssociation() != null) { + resourceAssociation().validate(); + } + if (profile() != null) { + profile().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("networkSecurityPerimeter", this.networkSecurityPerimeter); + jsonWriter.writeJsonField("resourceAssociation", this.resourceAssociation); + jsonWriter.writeJsonField("profile", this.profile); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityPerimeterConfigurationProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityPerimeterConfigurationProperties if the JsonReader was pointing to an + * instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkSecurityPerimeterConfigurationProperties. + */ + public static NetworkSecurityPerimeterConfigurationProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityPerimeterConfigurationProperties deserializedNetworkSecurityPerimeterConfigurationProperties + = new NetworkSecurityPerimeterConfigurationProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("provisioningState".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationProperties.provisioningState + = NetworkSecurityPerimeterConfigurationProvisioningState.fromString(reader.getString()); + } else if ("provisioningIssues".equals(fieldName)) { + List provisioningIssues + = reader.readArray(reader1 -> ProvisioningIssue.fromJson(reader1)); + deserializedNetworkSecurityPerimeterConfigurationProperties.provisioningIssues = provisioningIssues; + } else if ("networkSecurityPerimeter".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationProperties.networkSecurityPerimeter + = NetworkSecurityPerimeter.fromJson(reader); + } else if ("resourceAssociation".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationProperties.resourceAssociation + = ResourceAssociation.fromJson(reader); + } else if ("profile".equals(fieldName)) { + deserializedNetworkSecurityPerimeterConfigurationProperties.profile + = NetworkSecurityProfile.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityPerimeterConfigurationProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityPerimeterConfigurationProvisioningState.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityPerimeterConfigurationProvisioningState.java new file mode 100644 index 000000000000..bd086124b83f --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityPerimeterConfigurationProvisioningState.java @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Provisioning state of a network security perimeter configuration that is being created or updated. + */ +public final class NetworkSecurityPerimeterConfigurationProvisioningState + extends ExpandableStringEnum { + /** + * Static value Succeeded for NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState SUCCEEDED = fromString("Succeeded"); + + /** + * Static value Creating for NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState CREATING = fromString("Creating"); + + /** + * Static value Updating for NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState UPDATING = fromString("Updating"); + + /** + * Static value Deleting for NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState DELETING = fromString("Deleting"); + + /** + * Static value Accepted for NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState ACCEPTED = fromString("Accepted"); + + /** + * Static value Failed for NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState FAILED = fromString("Failed"); + + /** + * Static value Canceled for NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static final NetworkSecurityPerimeterConfigurationProvisioningState CANCELED = fromString("Canceled"); + + /** + * Creates a new instance of NetworkSecurityPerimeterConfigurationProvisioningState value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public NetworkSecurityPerimeterConfigurationProvisioningState() { + } + + /** + * Creates or finds a NetworkSecurityPerimeterConfigurationProvisioningState from its string representation. + * + * @param name a name to look for. + * @return the corresponding NetworkSecurityPerimeterConfigurationProvisioningState. + */ + public static NetworkSecurityPerimeterConfigurationProvisioningState fromString(String name) { + return fromString(name, NetworkSecurityPerimeterConfigurationProvisioningState.class); + } + + /** + * Gets known NetworkSecurityPerimeterConfigurationProvisioningState values. + * + * @return known NetworkSecurityPerimeterConfigurationProvisioningState values. + */ + public static Collection values() { + return values(NetworkSecurityPerimeterConfigurationProvisioningState.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityProfile.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityProfile.java new file mode 100644 index 000000000000..16f932adcfd7 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityProfile.java @@ -0,0 +1,158 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Network security perimeter configuration profile. + */ +@Immutable +public final class NetworkSecurityProfile implements JsonSerializable { + /* + * Name of the profile + */ + private String name; + + /* + * Current access rules version + */ + private Integer accessRulesVersion; + + /* + * List of Access Rules + */ + private List accessRules; + + /* + * Current diagnostic settings version + */ + private Integer diagnosticSettingsVersion; + + /* + * List of log categories that are enabled + */ + private List enabledLogCategories; + + /** + * Creates an instance of NetworkSecurityProfile class. + */ + private NetworkSecurityProfile() { + } + + /** + * Get the name property: Name of the profile. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the accessRulesVersion property: Current access rules version. + * + * @return the accessRulesVersion value. + */ + public Integer accessRulesVersion() { + return this.accessRulesVersion; + } + + /** + * Get the accessRules property: List of Access Rules. + * + * @return the accessRules value. + */ + public List accessRules() { + return this.accessRules; + } + + /** + * Get the diagnosticSettingsVersion property: Current diagnostic settings version. + * + * @return the diagnosticSettingsVersion value. + */ + public Integer diagnosticSettingsVersion() { + return this.diagnosticSettingsVersion; + } + + /** + * Get the enabledLogCategories property: List of log categories that are enabled. + * + * @return the enabledLogCategories value. + */ + public List enabledLogCategories() { + return this.enabledLogCategories; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (accessRules() != null) { + accessRules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeNumberField("accessRulesVersion", this.accessRulesVersion); + jsonWriter.writeArrayField("accessRules", this.accessRules, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeNumberField("diagnosticSettingsVersion", this.diagnosticSettingsVersion); + jsonWriter.writeArrayField("enabledLogCategories", this.enabledLogCategories, + (writer, element) -> writer.writeString(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NetworkSecurityProfile from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NetworkSecurityProfile if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the NetworkSecurityProfile. + */ + public static NetworkSecurityProfile fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NetworkSecurityProfile deserializedNetworkSecurityProfile = new NetworkSecurityProfile(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedNetworkSecurityProfile.name = reader.getString(); + } else if ("accessRulesVersion".equals(fieldName)) { + deserializedNetworkSecurityProfile.accessRulesVersion = reader.getNullable(JsonReader::getInt); + } else if ("accessRules".equals(fieldName)) { + List accessRules = reader.readArray(reader1 -> AccessRule.fromJson(reader1)); + deserializedNetworkSecurityProfile.accessRules = accessRules; + } else if ("diagnosticSettingsVersion".equals(fieldName)) { + deserializedNetworkSecurityProfile.diagnosticSettingsVersion + = reader.getNullable(JsonReader::getInt); + } else if ("enabledLogCategories".equals(fieldName)) { + List enabledLogCategories = reader.readArray(reader1 -> reader1.getString()); + deserializedNetworkSecurityProfile.enabledLogCategories = enabledLogCategories; + } else { + reader.skipChildren(); + } + } + + return deserializedNetworkSecurityProfile; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NoSqlRUToNoSqlRUCopyJobProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NoSqlRUToNoSqlRUCopyJobProperties.java new file mode 100644 index 000000000000..46dad67b3b21 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NoSqlRUToNoSqlRUCopyJobProperties.java @@ -0,0 +1,190 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Source SQL to Destination SQL copy job properties. + */ +@Fluent +public final class NoSqlRUToNoSqlRUCopyJobProperties extends BaseCopyJobProperties { + /* + * Copy Job Type + */ + private CopyJobType jobType = CopyJobType.NO_SQL_RUTO_NO_SQL_RU; + + /* + * Source SQL DataStore details + */ + private CosmosDBSourceSinkDetails sourceDetails; + + /* + * Destination SQL DataStore details + */ + private CosmosDBSourceSinkDetails destinationDetails; + + /* + * Copy Job tasks. + */ + private List tasks; + + /** + * Creates an instance of NoSqlRUToNoSqlRUCopyJobProperties class. + */ + public NoSqlRUToNoSqlRUCopyJobProperties() { + } + + /** + * Get the jobType property: Copy Job Type. + * + * @return the jobType value. + */ + @Override + public CopyJobType jobType() { + return this.jobType; + } + + /** + * Get the sourceDetails property: Source SQL DataStore details. + * + * @return the sourceDetails value. + */ + public CosmosDBSourceSinkDetails sourceDetails() { + return this.sourceDetails; + } + + /** + * Set the sourceDetails property: Source SQL DataStore details. + * + * @param sourceDetails the sourceDetails value to set. + * @return the NoSqlRUToNoSqlRUCopyJobProperties object itself. + */ + public NoSqlRUToNoSqlRUCopyJobProperties withSourceDetails(CosmosDBSourceSinkDetails sourceDetails) { + this.sourceDetails = sourceDetails; + return this; + } + + /** + * Get the destinationDetails property: Destination SQL DataStore details. + * + * @return the destinationDetails value. + */ + public CosmosDBSourceSinkDetails destinationDetails() { + return this.destinationDetails; + } + + /** + * Set the destinationDetails property: Destination SQL DataStore details. + * + * @param destinationDetails the destinationDetails value to set. + * @return the NoSqlRUToNoSqlRUCopyJobProperties object itself. + */ + public NoSqlRUToNoSqlRUCopyJobProperties withDestinationDetails(CosmosDBSourceSinkDetails destinationDetails) { + this.destinationDetails = destinationDetails; + return this; + } + + /** + * Get the tasks property: Copy Job tasks. + * + * @return the tasks value. + */ + public List tasks() { + return this.tasks; + } + + /** + * Set the tasks property: Copy Job tasks. + * + * @param tasks the tasks value to set. + * @return the NoSqlRUToNoSqlRUCopyJobProperties object itself. + */ + public NoSqlRUToNoSqlRUCopyJobProperties withTasks(List tasks) { + this.tasks = tasks; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (sourceDetails() != null) { + sourceDetails().validate(); + } + if (destinationDetails() != null) { + destinationDetails().validate(); + } + if (tasks() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property tasks in model NoSqlRUToNoSqlRUCopyJobProperties")); + } else { + tasks().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NoSqlRUToNoSqlRUCopyJobProperties.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("tasks", this.tasks, (writer, element) -> writer.writeJson(element)); + jsonWriter.writeStringField("jobType", this.jobType == null ? null : this.jobType.toString()); + jsonWriter.writeJsonField("sourceDetails", this.sourceDetails); + jsonWriter.writeJsonField("destinationDetails", this.destinationDetails); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NoSqlRUToNoSqlRUCopyJobProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NoSqlRUToNoSqlRUCopyJobProperties if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NoSqlRUToNoSqlRUCopyJobProperties. + */ + public static NoSqlRUToNoSqlRUCopyJobProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NoSqlRUToNoSqlRUCopyJobProperties deserializedNoSqlRUToNoSqlRUCopyJobProperties + = new NoSqlRUToNoSqlRUCopyJobProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("tasks".equals(fieldName)) { + List tasks + = reader.readArray(reader1 -> NoSqlRUToNoSqlRUCopyJobTask.fromJson(reader1)); + deserializedNoSqlRUToNoSqlRUCopyJobProperties.tasks = tasks; + } else if ("jobType".equals(fieldName)) { + deserializedNoSqlRUToNoSqlRUCopyJobProperties.jobType = CopyJobType.fromString(reader.getString()); + } else if ("sourceDetails".equals(fieldName)) { + deserializedNoSqlRUToNoSqlRUCopyJobProperties.sourceDetails + = CosmosDBSourceSinkDetails.fromJson(reader); + } else if ("destinationDetails".equals(fieldName)) { + deserializedNoSqlRUToNoSqlRUCopyJobProperties.destinationDetails + = CosmosDBSourceSinkDetails.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNoSqlRUToNoSqlRUCopyJobProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NoSqlRUToNoSqlRUCopyJobTask.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NoSqlRUToNoSqlRUCopyJobTask.java new file mode 100644 index 000000000000..bcfd2179e926 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NoSqlRUToNoSqlRUCopyJobTask.java @@ -0,0 +1,173 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The NoSqlRUToNoSqlRUCopyJobTask model. + */ +@Fluent +public final class NoSqlRUToNoSqlRUCopyJobTask extends BaseCopyJobTask { + /* + * Source SQL container + */ + private CosmosDBNoSqlContainer source; + + /* + * Destination SQL container + */ + private CosmosDBNoSqlContainer destination; + + /* + * Task level Processed Count. + */ + private Long processedCount; + + /* + * Task level Total Count. + */ + private Long totalCount; + + /** + * Creates an instance of NoSqlRUToNoSqlRUCopyJobTask class. + */ + public NoSqlRUToNoSqlRUCopyJobTask() { + } + + /** + * Get the source property: Source SQL container. + * + * @return the source value. + */ + public CosmosDBNoSqlContainer source() { + return this.source; + } + + /** + * Set the source property: Source SQL container. + * + * @param source the source value to set. + * @return the NoSqlRUToNoSqlRUCopyJobTask object itself. + */ + public NoSqlRUToNoSqlRUCopyJobTask withSource(CosmosDBNoSqlContainer source) { + this.source = source; + return this; + } + + /** + * Get the destination property: Destination SQL container. + * + * @return the destination value. + */ + public CosmosDBNoSqlContainer destination() { + return this.destination; + } + + /** + * Set the destination property: Destination SQL container. + * + * @param destination the destination value to set. + * @return the NoSqlRUToNoSqlRUCopyJobTask object itself. + */ + public NoSqlRUToNoSqlRUCopyJobTask withDestination(CosmosDBNoSqlContainer destination) { + this.destination = destination; + return this; + } + + /** + * Get the processedCount property: Task level Processed Count. + * + * @return the processedCount value. + */ + @Override + public Long processedCount() { + return this.processedCount; + } + + /** + * Get the totalCount property: Task level Total Count. + * + * @return the totalCount value. + */ + @Override + public Long totalCount() { + return this.totalCount; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (source() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property source in model NoSqlRUToNoSqlRUCopyJobTask")); + } else { + source().validate(); + } + if (destination() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property destination in model NoSqlRUToNoSqlRUCopyJobTask")); + } else { + destination().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(NoSqlRUToNoSqlRUCopyJobTask.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("source", this.source); + jsonWriter.writeJsonField("destination", this.destination); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of NoSqlRUToNoSqlRUCopyJobTask from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of NoSqlRUToNoSqlRUCopyJobTask if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the NoSqlRUToNoSqlRUCopyJobTask. + */ + public static NoSqlRUToNoSqlRUCopyJobTask fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + NoSqlRUToNoSqlRUCopyJobTask deserializedNoSqlRUToNoSqlRUCopyJobTask = new NoSqlRUToNoSqlRUCopyJobTask(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("totalCount".equals(fieldName)) { + deserializedNoSqlRUToNoSqlRUCopyJobTask.totalCount = reader.getNullable(JsonReader::getLong); + } else if ("processedCount".equals(fieldName)) { + deserializedNoSqlRUToNoSqlRUCopyJobTask.processedCount = reader.getNullable(JsonReader::getLong); + } else if ("source".equals(fieldName)) { + deserializedNoSqlRUToNoSqlRUCopyJobTask.source = CosmosDBNoSqlContainer.fromJson(reader); + } else if ("destination".equals(fieldName)) { + deserializedNoSqlRUToNoSqlRUCopyJobTask.destination = CosmosDBNoSqlContainer.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedNoSqlRUToNoSqlRUCopyJobTask; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NodeState.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NodeState.java index 9d721fe1dda7..3848dbfd8b91 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NodeState.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NodeState.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NotebookWorkspaceCreateUpdateParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NotebookWorkspaceCreateUpdateParameters.java index 8273b8c68dd1..35b46f698438 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NotebookWorkspaceCreateUpdateParameters.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NotebookWorkspaceCreateUpdateParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -16,17 +16,17 @@ @Immutable public final class NotebookWorkspaceCreateUpdateParameters extends ArmProxyResource { /* - * The type of the resource. + * The type of Azure resource. */ private String type; /* - * The name of the resource. + * The name of the database account. */ private String name; /* - * Fully qualified resource Id for the resource. + * The unique resource identifier of the database account. */ private String id; @@ -37,7 +37,7 @@ public NotebookWorkspaceCreateUpdateParameters() { } /** - * Get the type property: The type of the resource. + * Get the type property: The type of Azure resource. * * @return the type value. */ @@ -47,7 +47,7 @@ public String type() { } /** - * Get the name property: The name of the resource. + * Get the name property: The name of the database account. * * @return the name value. */ @@ -57,7 +57,7 @@ public String name() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the id property: The unique resource identifier of the database account. * * @return the id value. */ @@ -90,7 +90,6 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { * @param jsonReader The JsonReader being read. * @return An instance of NotebookWorkspaceCreateUpdateParameters if the JsonReader was pointing to an instance of * it, or null if it was pointing to JSON null. - * @throws IllegalStateException If the deserialized JSON object was missing any required properties. * @throws IOException If an error occurs while reading the NotebookWorkspaceCreateUpdateParameters. */ public static NotebookWorkspaceCreateUpdateParameters fromJson(JsonReader jsonReader) throws IOException { diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NotebookWorkspaceName.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NotebookWorkspaceName.java index b063e4dc42d3..1d2ebc2d876c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NotebookWorkspaceName.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/NotebookWorkspaceName.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/OperationDisplay.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/OperationDisplay.java index 0015b4111a83..34f6dea2e51d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/OperationDisplay.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/OperationDisplay.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * The object that represents the operation. */ -@Fluent +@Immutable public final class OperationDisplay implements JsonSerializable { /* * Service provider: Microsoft.ResourceProvider @@ -39,7 +39,7 @@ public final class OperationDisplay implements JsonSerializable { /* * Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when @@ -30,7 +30,7 @@ public class OptionsResource implements JsonSerializable { /** * Creates an instance of OptionsResource class. */ - public OptionsResource() { + protected OptionsResource() { } /** @@ -50,7 +50,7 @@ public Integer throughput() { * @param throughput the throughput value to set. * @return the OptionsResource object itself. */ - public OptionsResource withThroughput(Integer throughput) { + OptionsResource withThroughput(Integer throughput) { this.throughput = throughput; return this; } @@ -70,7 +70,7 @@ public AutoscaleSettings autoscaleSettings() { * @param autoscaleSettings the autoscaleSettings value to set. * @return the OptionsResource object itself. */ - public OptionsResource withAutoscaleSettings(AutoscaleSettings autoscaleSettings) { + OptionsResource withAutoscaleSettings(AutoscaleSettings autoscaleSettings) { this.autoscaleSettings = autoscaleSettings; return this; } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PartitionKind.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PartitionKind.java index 0c5360e82d60..e8183c478897 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PartitionKind.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PartitionKind.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PercentileMetricValue.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PercentileMetricValue.java index 76696ebea44f..7ef2f1076238 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PercentileMetricValue.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PercentileMetricValue.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -85,7 +85,7 @@ public final class PercentileMetricValue extends MetricValue { /** * Creates an instance of PercentileMetricValue class. */ - public PercentileMetricValue() { + private PercentileMetricValue() { } /** diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PeriodicModeBackupPolicy.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PeriodicModeBackupPolicy.java index 31f18c0f7bb6..6438375ceb3e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PeriodicModeBackupPolicy.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PeriodicModeBackupPolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PeriodicModeProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PeriodicModeProperties.java index 5e98029ec3f8..045292ef3a08 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PeriodicModeProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PeriodicModeProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Permission.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Permission.java index f062b6d246c7..458b95828a31 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Permission.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Permission.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -17,6 +17,11 @@ */ @Fluent public final class Permission implements JsonSerializable { + /* + * The id for the permission. + */ + private String id; + /* * An array of data actions that are allowed. */ @@ -33,6 +38,26 @@ public final class Permission implements JsonSerializable { public Permission() { } + /** + * Get the id property: The id for the permission. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: The id for the permission. + * + * @param id the id value to set. + * @return the Permission object itself. + */ + public Permission withId(String id) { + this.id = id; + return this; + } + /** * Get the dataActions property: An array of data actions that are allowed. * @@ -87,6 +112,7 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); jsonWriter.writeArrayField("dataActions", this.dataActions, (writer, element) -> writer.writeString(element)); jsonWriter.writeArrayField("notDataActions", this.notDataActions, (writer, element) -> writer.writeString(element)); @@ -108,7 +134,9 @@ public static Permission fromJson(JsonReader jsonReader) throws IOException { String fieldName = reader.getFieldName(); reader.nextToken(); - if ("dataActions".equals(fieldName)) { + if ("id".equals(fieldName)) { + deserializedPermission.id = reader.getString(); + } else if ("dataActions".equals(fieldName)) { List dataActions = reader.readArray(reader1 -> reader1.getString()); deserializedPermission.dataActions = dataActions; } else if ("notDataActions".equals(fieldName)) { diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionId.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionId.java new file mode 100644 index 000000000000..b061ee41e8e2 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionId.java @@ -0,0 +1,101 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * PhysicalPartitionId object. + */ +@Fluent +public final class PhysicalPartitionId implements JsonSerializable { + /* + * Id of a physical partition + */ + private String id; + + /** + * Creates an instance of PhysicalPartitionId class. + */ + public PhysicalPartitionId() { + } + + /** + * Get the id property: Id of a physical partition. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Id of a physical partition. + * + * @param id the id value to set. + * @return the PhysicalPartitionId object itself. + */ + public PhysicalPartitionId withId(String id) { + this.id = id; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException("Missing required property id in model PhysicalPartitionId")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PhysicalPartitionId.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PhysicalPartitionId from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PhysicalPartitionId if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PhysicalPartitionId. + */ + public static PhysicalPartitionId fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PhysicalPartitionId deserializedPhysicalPartitionId = new PhysicalPartitionId(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPhysicalPartitionId.id = reader.getString(); + } else { + reader.skipChildren(); + } + } + + return deserializedPhysicalPartitionId; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionStorageInfo.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionStorageInfo.java new file mode 100644 index 000000000000..d2ff709b9662 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionStorageInfo.java @@ -0,0 +1,97 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * The storage of a physical partition. + */ +@Immutable +public final class PhysicalPartitionStorageInfo implements JsonSerializable { + /* + * The unique identifier of the partition. + */ + private String id; + + /* + * The storage in KB for the physical partition. + */ + private Double storageInKB; + + /** + * Creates an instance of PhysicalPartitionStorageInfo class. + */ + private PhysicalPartitionStorageInfo() { + } + + /** + * Get the id property: The unique identifier of the partition. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Get the storageInKB property: The storage in KB for the physical partition. + * + * @return the storageInKB value. + */ + public Double storageInKB() { + return this.storageInKB; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PhysicalPartitionStorageInfo from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PhysicalPartitionStorageInfo if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PhysicalPartitionStorageInfo. + */ + public static PhysicalPartitionStorageInfo fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PhysicalPartitionStorageInfo deserializedPhysicalPartitionStorageInfo = new PhysicalPartitionStorageInfo(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPhysicalPartitionStorageInfo.id = reader.getString(); + } else if ("storageInKB".equals(fieldName)) { + deserializedPhysicalPartitionStorageInfo.storageInKB = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + + return deserializedPhysicalPartitionStorageInfo; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionThroughputInfoProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionThroughputInfoProperties.java new file mode 100644 index 000000000000..a3f73b2283fc --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionThroughputInfoProperties.java @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * The properties of an Azure Cosmos DB PhysicalPartitionThroughputInfoProperties object. + */ +@Immutable +public class PhysicalPartitionThroughputInfoProperties + implements JsonSerializable { + /* + * Array of physical partition throughput info objects + */ + private List physicalPartitionThroughputInfo; + + /** + * Creates an instance of PhysicalPartitionThroughputInfoProperties class. + */ + protected PhysicalPartitionThroughputInfoProperties() { + } + + /** + * Get the physicalPartitionThroughputInfo property: Array of physical partition throughput info objects. + * + * @return the physicalPartitionThroughputInfo value. + */ + public List physicalPartitionThroughputInfo() { + return this.physicalPartitionThroughputInfo; + } + + /** + * Set the physicalPartitionThroughputInfo property: Array of physical partition throughput info objects. + * + * @param physicalPartitionThroughputInfo the physicalPartitionThroughputInfo value to set. + * @return the PhysicalPartitionThroughputInfoProperties object itself. + */ + PhysicalPartitionThroughputInfoProperties withPhysicalPartitionThroughputInfo( + List physicalPartitionThroughputInfo) { + this.physicalPartitionThroughputInfo = physicalPartitionThroughputInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (physicalPartitionThroughputInfo() != null) { + physicalPartitionThroughputInfo().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("physicalPartitionThroughputInfo", this.physicalPartitionThroughputInfo, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PhysicalPartitionThroughputInfoProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PhysicalPartitionThroughputInfoProperties if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PhysicalPartitionThroughputInfoProperties. + */ + public static PhysicalPartitionThroughputInfoProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PhysicalPartitionThroughputInfoProperties deserializedPhysicalPartitionThroughputInfoProperties + = new PhysicalPartitionThroughputInfoProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("physicalPartitionThroughputInfo".equals(fieldName)) { + List physicalPartitionThroughputInfo + = reader.readArray(reader1 -> PhysicalPartitionThroughputInfoResource.fromJson(reader1)); + deserializedPhysicalPartitionThroughputInfoProperties.physicalPartitionThroughputInfo + = physicalPartitionThroughputInfo; + } else { + reader.skipChildren(); + } + } + + return deserializedPhysicalPartitionThroughputInfoProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionThroughputInfoResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionThroughputInfoResource.java new file mode 100644 index 000000000000..a1496051e2e4 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionThroughputInfoResource.java @@ -0,0 +1,162 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * PhysicalPartitionThroughputInfo object. + */ +@Fluent +public final class PhysicalPartitionThroughputInfoResource + implements JsonSerializable { + /* + * Id of a physical partition + */ + private String id; + + /* + * Throughput of a physical partition + */ + private Double throughput; + + /* + * Target throughput of a physical partition + */ + private Double targetThroughput; + + /** + * Creates an instance of PhysicalPartitionThroughputInfoResource class. + */ + public PhysicalPartitionThroughputInfoResource() { + } + + /** + * Get the id property: Id of a physical partition. + * + * @return the id value. + */ + public String id() { + return this.id; + } + + /** + * Set the id property: Id of a physical partition. + * + * @param id the id value to set. + * @return the PhysicalPartitionThroughputInfoResource object itself. + */ + public PhysicalPartitionThroughputInfoResource withId(String id) { + this.id = id; + return this; + } + + /** + * Get the throughput property: Throughput of a physical partition. + * + * @return the throughput value. + */ + public Double throughput() { + return this.throughput; + } + + /** + * Set the throughput property: Throughput of a physical partition. + * + * @param throughput the throughput value to set. + * @return the PhysicalPartitionThroughputInfoResource object itself. + */ + public PhysicalPartitionThroughputInfoResource withThroughput(Double throughput) { + this.throughput = throughput; + return this; + } + + /** + * Get the targetThroughput property: Target throughput of a physical partition. + * + * @return the targetThroughput value. + */ + public Double targetThroughput() { + return this.targetThroughput; + } + + /** + * Set the targetThroughput property: Target throughput of a physical partition. + * + * @param targetThroughput the targetThroughput value to set. + * @return the PhysicalPartitionThroughputInfoResource object itself. + */ + public PhysicalPartitionThroughputInfoResource withTargetThroughput(Double targetThroughput) { + this.targetThroughput = targetThroughput; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (id() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property id in model PhysicalPartitionThroughputInfoResource")); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(PhysicalPartitionThroughputInfoResource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("id", this.id); + jsonWriter.writeNumberField("throughput", this.throughput); + jsonWriter.writeNumberField("targetThroughput", this.targetThroughput); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PhysicalPartitionThroughputInfoResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PhysicalPartitionThroughputInfoResource if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the PhysicalPartitionThroughputInfoResource. + */ + public static PhysicalPartitionThroughputInfoResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + PhysicalPartitionThroughputInfoResource deserializedPhysicalPartitionThroughputInfoResource + = new PhysicalPartitionThroughputInfoResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedPhysicalPartitionThroughputInfoResource.id = reader.getString(); + } else if ("throughput".equals(fieldName)) { + deserializedPhysicalPartitionThroughputInfoResource.throughput + = reader.getNullable(JsonReader::getDouble); + } else if ("targetThroughput".equals(fieldName)) { + deserializedPhysicalPartitionThroughputInfoResource.targetThroughput + = reader.getNullable(JsonReader::getDouble); + } else { + reader.skipChildren(); + } + } + + return deserializedPhysicalPartitionThroughputInfoResource; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionThroughputInfoResultPropertiesResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionThroughputInfoResultPropertiesResource.java new file mode 100644 index 000000000000..aff96117ea74 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionThroughputInfoResultPropertiesResource.java @@ -0,0 +1,94 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * properties of physical partition throughput info. + */ +@Immutable +public final class PhysicalPartitionThroughputInfoResultPropertiesResource + extends PhysicalPartitionThroughputInfoProperties { + /* + * Array of physical partition throughput info objects + */ + private List physicalPartitionThroughputInfo; + + /** + * Creates an instance of PhysicalPartitionThroughputInfoResultPropertiesResource class. + */ + private PhysicalPartitionThroughputInfoResultPropertiesResource() { + } + + /** + * Get the physicalPartitionThroughputInfo property: Array of physical partition throughput info objects. + * + * @return the physicalPartitionThroughputInfo value. + */ + @Override + public List physicalPartitionThroughputInfo() { + return this.physicalPartitionThroughputInfo; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (physicalPartitionThroughputInfo() != null) { + physicalPartitionThroughputInfo().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("physicalPartitionThroughputInfo", physicalPartitionThroughputInfo(), + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of PhysicalPartitionThroughputInfoResultPropertiesResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of PhysicalPartitionThroughputInfoResultPropertiesResource if the JsonReader was pointing to + * an instance of it, or null if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the PhysicalPartitionThroughputInfoResultPropertiesResource. + */ + public static PhysicalPartitionThroughputInfoResultPropertiesResource fromJson(JsonReader jsonReader) + throws IOException { + return jsonReader.readObject(reader -> { + PhysicalPartitionThroughputInfoResultPropertiesResource deserializedPhysicalPartitionThroughputInfoResultPropertiesResource + = new PhysicalPartitionThroughputInfoResultPropertiesResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("physicalPartitionThroughputInfo".equals(fieldName)) { + List physicalPartitionThroughputInfo + = reader.readArray(reader1 -> PhysicalPartitionThroughputInfoResource.fromJson(reader1)); + deserializedPhysicalPartitionThroughputInfoResultPropertiesResource.physicalPartitionThroughputInfo + = physicalPartitionThroughputInfo; + } else { + reader.skipChildren(); + } + } + + return deserializedPhysicalPartitionThroughputInfoResultPropertiesResource; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PrimaryAggregationType.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PrimaryAggregationType.java index 756a1cfb98ac..6bd5f2ac5577 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PrimaryAggregationType.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PrimaryAggregationType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PrivateEndpointProperty.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PrivateEndpointProperty.java index 26c3dd3038f3..dc160e2d3b4f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PrivateEndpointProperty.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PrivateEndpointProperty.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PrivateLinkServiceConnectionStateProperty.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PrivateLinkServiceConnectionStateProperty.java index ff2c3c4785a7..51c1396ff5a7 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PrivateLinkServiceConnectionStateProperty.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PrivateLinkServiceConnectionStateProperty.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Privilege.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Privilege.java index 9a586cf63765..270e4b01ad29 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Privilege.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Privilege.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PrivilegeResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PrivilegeResource.java index df495b6e70b0..49e8ad9b9a31 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PrivilegeResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PrivilegeResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ProvisioningIssue.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ProvisioningIssue.java new file mode 100644 index 000000000000..00a24c61e8a6 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ProvisioningIssue.java @@ -0,0 +1,100 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Describes a provisioning issue for a network security perimeter configuration. + */ +@Immutable +public final class ProvisioningIssue implements JsonSerializable { + /* + * Name of the issue + */ + private String name; + + /* + * The properties property. + */ + private ProvisioningIssueProperties properties; + + /** + * Creates an instance of ProvisioningIssue class. + */ + private ProvisioningIssue() { + } + + /** + * Get the name property: Name of the issue. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the properties property: The properties property. + * + * @return the properties value. + */ + public ProvisioningIssueProperties properties() { + return this.properties; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (properties() != null) { + properties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProvisioningIssue from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProvisioningIssue if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ProvisioningIssue. + */ + public static ProvisioningIssue fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProvisioningIssue deserializedProvisioningIssue = new ProvisioningIssue(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedProvisioningIssue.name = reader.getString(); + } else if ("properties".equals(fieldName)) { + deserializedProvisioningIssue.properties = ProvisioningIssueProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedProvisioningIssue; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ProvisioningIssueProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ProvisioningIssueProperties.java new file mode 100644 index 000000000000..ebf16a08ad7d --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ProvisioningIssueProperties.java @@ -0,0 +1,156 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Immutable; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Details of a provisioning issue for a network security perimeter (NSP) configuration. Resource providers should + * generate separate provisioning issue elements for each separate issue detected, and include a meaningful and + * distinctive description, as well as any appropriate suggestedResourceIds and suggestedAccessRules. + */ +@Immutable +public final class ProvisioningIssueProperties implements JsonSerializable { + /* + * Type of issue + */ + private IssueType issueType; + + /* + * Severity of the issue. + */ + private Severity severity; + + /* + * Description of the issue + */ + private String description; + + /* + * Fully qualified resource IDs of suggested resources that can be associated to the network security perimeter + * (NSP) to remediate the issue. + */ + private List suggestedResourceIds; + + /* + * Access rules that can be added to the network security profile (NSP) to remediate the issue. + */ + private List suggestedAccessRules; + + /** + * Creates an instance of ProvisioningIssueProperties class. + */ + private ProvisioningIssueProperties() { + } + + /** + * Get the issueType property: Type of issue. + * + * @return the issueType value. + */ + public IssueType issueType() { + return this.issueType; + } + + /** + * Get the severity property: Severity of the issue. + * + * @return the severity value. + */ + public Severity severity() { + return this.severity; + } + + /** + * Get the description property: Description of the issue. + * + * @return the description value. + */ + public String description() { + return this.description; + } + + /** + * Get the suggestedResourceIds property: Fully qualified resource IDs of suggested resources that can be associated + * to the network security perimeter (NSP) to remediate the issue. + * + * @return the suggestedResourceIds value. + */ + public List suggestedResourceIds() { + return this.suggestedResourceIds; + } + + /** + * Get the suggestedAccessRules property: Access rules that can be added to the network security profile (NSP) to + * remediate the issue. + * + * @return the suggestedAccessRules value. + */ + public List suggestedAccessRules() { + return this.suggestedAccessRules; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (suggestedAccessRules() != null) { + suggestedAccessRules().forEach(e -> e.validate()); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ProvisioningIssueProperties from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ProvisioningIssueProperties if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IOException If an error occurs while reading the ProvisioningIssueProperties. + */ + public static ProvisioningIssueProperties fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ProvisioningIssueProperties deserializedProvisioningIssueProperties = new ProvisioningIssueProperties(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("issueType".equals(fieldName)) { + deserializedProvisioningIssueProperties.issueType = IssueType.fromString(reader.getString()); + } else if ("severity".equals(fieldName)) { + deserializedProvisioningIssueProperties.severity = Severity.fromString(reader.getString()); + } else if ("description".equals(fieldName)) { + deserializedProvisioningIssueProperties.description = reader.getString(); + } else if ("suggestedResourceIds".equals(fieldName)) { + List suggestedResourceIds = reader.readArray(reader1 -> reader1.getString()); + deserializedProvisioningIssueProperties.suggestedResourceIds = suggestedResourceIds; + } else if ("suggestedAccessRules".equals(fieldName)) { + List suggestedAccessRules = reader.readArray(reader1 -> AccessRule.fromJson(reader1)); + deserializedProvisioningIssueProperties.suggestedAccessRules = suggestedAccessRules; + } else { + reader.skipChildren(); + } + } + + return deserializedProvisioningIssueProperties; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PublicNetworkAccess.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PublicNetworkAccess.java index 95af4473bf9b..fc265ddd9801 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PublicNetworkAccess.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/PublicNetworkAccess.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RedistributeThroughputParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RedistributeThroughputParameters.java new file mode 100644 index 000000000000..65853a23c6e6 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RedistributeThroughputParameters.java @@ -0,0 +1,211 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.fluent.models.RedistributeThroughputProperties; +import java.io.IOException; +import java.util.Map; + +/** + * Cosmos DB redistribute throughput parameters object. + */ +@Fluent +public final class RedistributeThroughputParameters extends ArmResourceProperties { + /* + * Properties to redistribute throughput parameters object + */ + private RedistributeThroughputProperties innerProperties = new RedistributeThroughputProperties(); + + /* + * The type of Azure resource. + */ + private String type; + + /* + * The name of the ARM resource. + */ + private String name; + + /* + * The unique resource identifier of the ARM resource. + */ + private String id; + + /** + * Creates an instance of RedistributeThroughputParameters class. + */ + public RedistributeThroughputParameters() { + } + + /** + * Get the innerProperties property: Properties to redistribute throughput parameters object. + * + * @return the innerProperties value. + */ + private RedistributeThroughputProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the type property: The type of Azure resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the ARM resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: The unique resource identifier of the ARM resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public RedistributeThroughputParameters withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RedistributeThroughputParameters withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RedistributeThroughputParameters withIdentity(ManagedServiceIdentity identity) { + super.withIdentity(identity); + return this; + } + + /** + * Get the resource property: The standard JSON format of a resource throughput. + * + * @return the resource value. + */ + public RedistributeThroughputPropertiesResource resource() { + return this.innerProperties() == null ? null : this.innerProperties().resource(); + } + + /** + * Set the resource property: The standard JSON format of a resource throughput. + * + * @param resource the resource value to set. + * @return the RedistributeThroughputParameters object itself. + */ + public RedistributeThroughputParameters withResource(RedistributeThroughputPropertiesResource resource) { + if (this.innerProperties() == null) { + this.innerProperties = new RedistributeThroughputProperties(); + } + this.innerProperties().withResource(resource); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model RedistributeThroughputParameters")); + } else { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RedistributeThroughputParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", identity()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RedistributeThroughputParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RedistributeThroughputParameters if the JsonReader was pointing to an instance of it, or + * null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RedistributeThroughputParameters. + */ + public static RedistributeThroughputParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RedistributeThroughputParameters deserializedRedistributeThroughputParameters + = new RedistributeThroughputParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRedistributeThroughputParameters.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRedistributeThroughputParameters.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRedistributeThroughputParameters.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedRedistributeThroughputParameters.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRedistributeThroughputParameters.withTags(tags); + } else if ("identity".equals(fieldName)) { + deserializedRedistributeThroughputParameters.withIdentity(ManagedServiceIdentity.fromJson(reader)); + } else if ("properties".equals(fieldName)) { + deserializedRedistributeThroughputParameters.innerProperties + = RedistributeThroughputProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRedistributeThroughputParameters; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RedistributeThroughputPropertiesResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RedistributeThroughputPropertiesResource.java new file mode 100644 index 000000000000..84471e445ae1 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RedistributeThroughputPropertiesResource.java @@ -0,0 +1,187 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Resource to redistribute throughput for Azure Cosmos DB resource. + */ +@Fluent +public final class RedistributeThroughputPropertiesResource + implements JsonSerializable { + /* + * ThroughputPolicy to apply for throughput redistribution + */ + private ThroughputPolicyType throughputPolicy; + + /* + * Array of PhysicalPartitionThroughputInfoResource objects. + */ + private List targetPhysicalPartitionThroughputInfo; + + /* + * Array of PhysicalPartitionThroughputInfoResource objects. + */ + private List sourcePhysicalPartitionThroughputInfo; + + /** + * Creates an instance of RedistributeThroughputPropertiesResource class. + */ + public RedistributeThroughputPropertiesResource() { + } + + /** + * Get the throughputPolicy property: ThroughputPolicy to apply for throughput redistribution. + * + * @return the throughputPolicy value. + */ + public ThroughputPolicyType throughputPolicy() { + return this.throughputPolicy; + } + + /** + * Set the throughputPolicy property: ThroughputPolicy to apply for throughput redistribution. + * + * @param throughputPolicy the throughputPolicy value to set. + * @return the RedistributeThroughputPropertiesResource object itself. + */ + public RedistributeThroughputPropertiesResource withThroughputPolicy(ThroughputPolicyType throughputPolicy) { + this.throughputPolicy = throughputPolicy; + return this; + } + + /** + * Get the targetPhysicalPartitionThroughputInfo property: Array of PhysicalPartitionThroughputInfoResource objects. + * + * @return the targetPhysicalPartitionThroughputInfo value. + */ + public List targetPhysicalPartitionThroughputInfo() { + return this.targetPhysicalPartitionThroughputInfo; + } + + /** + * Set the targetPhysicalPartitionThroughputInfo property: Array of PhysicalPartitionThroughputInfoResource objects. + * + * @param targetPhysicalPartitionThroughputInfo the targetPhysicalPartitionThroughputInfo value to set. + * @return the RedistributeThroughputPropertiesResource object itself. + */ + public RedistributeThroughputPropertiesResource withTargetPhysicalPartitionThroughputInfo( + List targetPhysicalPartitionThroughputInfo) { + this.targetPhysicalPartitionThroughputInfo = targetPhysicalPartitionThroughputInfo; + return this; + } + + /** + * Get the sourcePhysicalPartitionThroughputInfo property: Array of PhysicalPartitionThroughputInfoResource objects. + * + * @return the sourcePhysicalPartitionThroughputInfo value. + */ + public List sourcePhysicalPartitionThroughputInfo() { + return this.sourcePhysicalPartitionThroughputInfo; + } + + /** + * Set the sourcePhysicalPartitionThroughputInfo property: Array of PhysicalPartitionThroughputInfoResource objects. + * + * @param sourcePhysicalPartitionThroughputInfo the sourcePhysicalPartitionThroughputInfo value to set. + * @return the RedistributeThroughputPropertiesResource object itself. + */ + public RedistributeThroughputPropertiesResource withSourcePhysicalPartitionThroughputInfo( + List sourcePhysicalPartitionThroughputInfo) { + this.sourcePhysicalPartitionThroughputInfo = sourcePhysicalPartitionThroughputInfo; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (throughputPolicy() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property throughputPolicy in model RedistributeThroughputPropertiesResource")); + } + if (targetPhysicalPartitionThroughputInfo() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property targetPhysicalPartitionThroughputInfo in model RedistributeThroughputPropertiesResource")); + } else { + targetPhysicalPartitionThroughputInfo().forEach(e -> e.validate()); + } + if (sourcePhysicalPartitionThroughputInfo() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property sourcePhysicalPartitionThroughputInfo in model RedistributeThroughputPropertiesResource")); + } else { + sourcePhysicalPartitionThroughputInfo().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RedistributeThroughputPropertiesResource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("throughputPolicy", + this.throughputPolicy == null ? null : this.throughputPolicy.toString()); + jsonWriter.writeArrayField("targetPhysicalPartitionThroughputInfo", this.targetPhysicalPartitionThroughputInfo, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeArrayField("sourcePhysicalPartitionThroughputInfo", this.sourcePhysicalPartitionThroughputInfo, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RedistributeThroughputPropertiesResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RedistributeThroughputPropertiesResource if the JsonReader was pointing to an instance of + * it, or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RedistributeThroughputPropertiesResource. + */ + public static RedistributeThroughputPropertiesResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RedistributeThroughputPropertiesResource deserializedRedistributeThroughputPropertiesResource + = new RedistributeThroughputPropertiesResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("throughputPolicy".equals(fieldName)) { + deserializedRedistributeThroughputPropertiesResource.throughputPolicy + = ThroughputPolicyType.fromString(reader.getString()); + } else if ("targetPhysicalPartitionThroughputInfo".equals(fieldName)) { + List targetPhysicalPartitionThroughputInfo + = reader.readArray(reader1 -> PhysicalPartitionThroughputInfoResource.fromJson(reader1)); + deserializedRedistributeThroughputPropertiesResource.targetPhysicalPartitionThroughputInfo + = targetPhysicalPartitionThroughputInfo; + } else if ("sourcePhysicalPartitionThroughputInfo".equals(fieldName)) { + List sourcePhysicalPartitionThroughputInfo + = reader.readArray(reader1 -> PhysicalPartitionThroughputInfoResource.fromJson(reader1)); + deserializedRedistributeThroughputPropertiesResource.sourcePhysicalPartitionThroughputInfo + = sourcePhysicalPartitionThroughputInfo; + } else { + reader.skipChildren(); + } + } + + return deserializedRedistributeThroughputPropertiesResource; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RegionForOnlineOffline.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RegionForOnlineOffline.java index 1f9bbfe798a4..137d545bddfd 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RegionForOnlineOffline.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RegionForOnlineOffline.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RegionalServiceResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RegionalServiceResource.java index 557975dce8c3..0ae6a867bf0b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RegionalServiceResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RegionalServiceResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -34,7 +34,7 @@ public class RegionalServiceResource implements JsonSerializable { + /* + * Name of the resource association + */ + private String name; + + /* + * The accessMode property. + */ + private ResourceAssociationAccessMode accessMode; + + /** + * Creates an instance of ResourceAssociation class. + */ + private ResourceAssociation() { + } + + /** + * Get the name property: Name of the resource association. + * + * @return the name value. + */ + public String name() { + return this.name; + } + + /** + * Get the accessMode property: The accessMode property. + * + * @return the accessMode value. + */ + public ResourceAssociationAccessMode accessMode() { + return this.accessMode; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("name", this.name); + jsonWriter.writeStringField("accessMode", this.accessMode == null ? null : this.accessMode.toString()); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ResourceAssociation from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ResourceAssociation if the JsonReader was pointing to an instance of it, or null if it was + * pointing to JSON null. + * @throws IOException If an error occurs while reading the ResourceAssociation. + */ + public static ResourceAssociation fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ResourceAssociation deserializedResourceAssociation = new ResourceAssociation(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("name".equals(fieldName)) { + deserializedResourceAssociation.name = reader.getString(); + } else if ("accessMode".equals(fieldName)) { + deserializedResourceAssociation.accessMode + = ResourceAssociationAccessMode.fromString(reader.getString()); + } else { + reader.skipChildren(); + } + } + + return deserializedResourceAssociation; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ResourceAssociationAccessMode.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ResourceAssociationAccessMode.java new file mode 100644 index 000000000000..53206b19d4df --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ResourceAssociationAccessMode.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Access mode of the resource association. + */ +public final class ResourceAssociationAccessMode extends ExpandableStringEnum { + /** + * Enforced access mode - traffic to the resource that failed access checks is blocked. + */ + public static final ResourceAssociationAccessMode ENFORCED = fromString("Enforced"); + + /** + * Learning access mode - traffic to the resource is enabled for analysis but not blocked. + */ + public static final ResourceAssociationAccessMode LEARNING = fromString("Learning"); + + /** + * Audit access mode - traffic to the resource that fails access checks is logged but not blocked. + */ + public static final ResourceAssociationAccessMode AUDIT = fromString("Audit"); + + /** + * Creates a new instance of ResourceAssociationAccessMode value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ResourceAssociationAccessMode() { + } + + /** + * Creates or finds a ResourceAssociationAccessMode from its string representation. + * + * @param name a name to look for. + * @return the corresponding ResourceAssociationAccessMode. + */ + public static ResourceAssociationAccessMode fromString(String name) { + return fromString(name, ResourceAssociationAccessMode.class); + } + + /** + * Gets known ResourceAssociationAccessMode values. + * + * @return known ResourceAssociationAccessMode values. + */ + public static Collection values() { + return values(ResourceAssociationAccessMode.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ResourceIdentityType.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ResourceIdentityType.java index 898b4db8eca0..db2d809e3e45 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ResourceIdentityType.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ResourceIdentityType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ResourceRestoreParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ResourceRestoreParameters.java index e6b2473e2f30..591f7e681263 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ResourceRestoreParameters.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ResourceRestoreParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableGremlinDatabasePropertiesResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableGremlinDatabasePropertiesResource.java index 4dc71c96fd9a..92424cd66c0d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableGremlinDatabasePropertiesResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableGremlinDatabasePropertiesResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -55,7 +55,7 @@ public final class RestorableGremlinDatabasePropertiesResource /** * Creates an instance of RestorableGremlinDatabasePropertiesResource class. */ - public RestorableGremlinDatabasePropertiesResource() { + private RestorableGremlinDatabasePropertiesResource() { } /** diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableGremlinGraphPropertiesResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableGremlinGraphPropertiesResource.java index 3db729c40eeb..d3df261d8d1e 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableGremlinGraphPropertiesResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableGremlinGraphPropertiesResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -55,7 +55,7 @@ public final class RestorableGremlinGraphPropertiesResource /** * Creates an instance of RestorableGremlinGraphPropertiesResource class. */ - public RestorableGremlinGraphPropertiesResource() { + private RestorableGremlinGraphPropertiesResource() { } /** diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableLocationResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableLocationResource.java index 2d690c373093..040e82eb03dc 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableLocationResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableLocationResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -41,7 +41,7 @@ public final class RestorableLocationResource implements JsonSerializable { /* @@ -60,7 +60,7 @@ public final class RestorableSqlContainerPropertiesResource /** * Creates an instance of RestorableSqlContainerPropertiesResource class. */ - public RestorableSqlContainerPropertiesResource() { + private RestorableSqlContainerPropertiesResource() { } /** @@ -136,18 +136,6 @@ public RestorableSqlContainerPropertiesResourceContainer container() { return this.container; } - /** - * Set the container property: Cosmos DB SQL container resource object. - * - * @param container the container value to set. - * @return the RestorableSqlContainerPropertiesResource object itself. - */ - public RestorableSqlContainerPropertiesResource - withContainer(RestorableSqlContainerPropertiesResourceContainer container) { - this.container = container; - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlContainerPropertiesResourceContainer.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlContainerPropertiesResourceContainer.java index a03309830065..fb01a31158d0 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlContainerPropertiesResourceContainer.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlContainerPropertiesResourceContainer.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -15,13 +15,8 @@ /** * Cosmos DB SQL container resource object. */ -@Fluent +@Immutable public final class RestorableSqlContainerPropertiesResourceContainer extends SqlContainerResource { - /* - * A system generated property that specifies the addressable path of the container resource. - */ - private String self; - /* * A system generated property. A unique identifier. */ @@ -37,19 +32,15 @@ public final class RestorableSqlContainerPropertiesResourceContainer extends Sql */ private String etag; - /** - * Creates an instance of RestorableSqlContainerPropertiesResourceContainer class. + /* + * A system generated property that specifies the addressable path of the container resource. */ - public RestorableSqlContainerPropertiesResourceContainer() { - } + private String self; /** - * Get the self property: A system generated property that specifies the addressable path of the container resource. - * - * @return the self value. + * Creates an instance of RestorableSqlContainerPropertiesResourceContainer class. */ - public String self() { - return this.self; + private RestorableSqlContainerPropertiesResourceContainer() { } /** @@ -81,125 +72,12 @@ public String etag() { } /** - * {@inheritDoc} - */ - @Override - public RestorableSqlContainerPropertiesResourceContainer withId(String id) { - super.withId(id); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RestorableSqlContainerPropertiesResourceContainer withIndexingPolicy(IndexingPolicy indexingPolicy) { - super.withIndexingPolicy(indexingPolicy); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RestorableSqlContainerPropertiesResourceContainer withPartitionKey(ContainerPartitionKey partitionKey) { - super.withPartitionKey(partitionKey); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RestorableSqlContainerPropertiesResourceContainer withDefaultTtl(Integer defaultTtl) { - super.withDefaultTtl(defaultTtl); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RestorableSqlContainerPropertiesResourceContainer withUniqueKeyPolicy(UniqueKeyPolicy uniqueKeyPolicy) { - super.withUniqueKeyPolicy(uniqueKeyPolicy); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RestorableSqlContainerPropertiesResourceContainer - withConflictResolutionPolicy(ConflictResolutionPolicy conflictResolutionPolicy) { - super.withConflictResolutionPolicy(conflictResolutionPolicy); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RestorableSqlContainerPropertiesResourceContainer - withClientEncryptionPolicy(ClientEncryptionPolicy clientEncryptionPolicy) { - super.withClientEncryptionPolicy(clientEncryptionPolicy); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RestorableSqlContainerPropertiesResourceContainer withAnalyticalStorageTtl(Long analyticalStorageTtl) { - super.withAnalyticalStorageTtl(analyticalStorageTtl); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RestorableSqlContainerPropertiesResourceContainer - withRestoreParameters(ResourceRestoreParameters restoreParameters) { - super.withRestoreParameters(restoreParameters); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RestorableSqlContainerPropertiesResourceContainer withCreateMode(CreateMode createMode) { - super.withCreateMode(createMode); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RestorableSqlContainerPropertiesResourceContainer - withComputedProperties(List computedProperties) { - super.withComputedProperties(computedProperties); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RestorableSqlContainerPropertiesResourceContainer - withVectorEmbeddingPolicy(VectorEmbeddingPolicy vectorEmbeddingPolicy) { - super.withVectorEmbeddingPolicy(vectorEmbeddingPolicy); - return this; - } - - /** - * {@inheritDoc} + * Get the self property: A system generated property that specifies the addressable path of the container resource. + * + * @return the self value. */ - @Override - public RestorableSqlContainerPropertiesResourceContainer withFullTextPolicy(FullTextPolicy fullTextPolicy) { - super.withFullTextPolicy(fullTextPolicy); - return this; + public String self() { + return this.self; } /** @@ -232,6 +110,15 @@ public void validate() { if (restoreParameters() != null) { restoreParameters().validate(); } + if (materializedViewDefinition() != null) { + materializedViewDefinition().validate(); + } + if (materializedViews() != null) { + materializedViews().forEach(e -> e.validate()); + } + if (materializedViewsProperties() != null) { + materializedViewsProperties().validate(); + } if (computedProperties() != null) { computedProperties().forEach(e -> e.validate()); } @@ -241,6 +128,9 @@ public void validate() { if (fullTextPolicy() != null) { fullTextPolicy().validate(); } + if (dataMaskingPolicy() != null) { + dataMaskingPolicy().validate(); + } } private static final ClientLogger LOGGER @@ -262,10 +152,15 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeNumberField("analyticalStorageTtl", analyticalStorageTtl()); jsonWriter.writeJsonField("restoreParameters", restoreParameters()); jsonWriter.writeStringField("createMode", createMode() == null ? null : createMode().toString()); + jsonWriter.writeJsonField("materializedViewDefinition", materializedViewDefinition()); + jsonWriter.writeArrayField("materializedViews", materializedViews(), + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("materializedViewsProperties", materializedViewsProperties()); jsonWriter.writeArrayField("computedProperties", computedProperties(), (writer, element) -> writer.writeJson(element)); jsonWriter.writeJsonField("vectorEmbeddingPolicy", vectorEmbeddingPolicy()); jsonWriter.writeJsonField("fullTextPolicy", fullTextPolicy()); + jsonWriter.writeJsonField("dataMaskingPolicy", dataMaskingPolicy()); return jsonWriter.writeEndObject(); } @@ -315,6 +210,17 @@ public static RestorableSqlContainerPropertiesResourceContainer fromJson(JsonRea } else if ("createMode".equals(fieldName)) { deserializedRestorableSqlContainerPropertiesResourceContainer .withCreateMode(CreateMode.fromString(reader.getString())); + } else if ("materializedViewDefinition".equals(fieldName)) { + deserializedRestorableSqlContainerPropertiesResourceContainer + .withMaterializedViewDefinition(MaterializedViewDefinition.fromJson(reader)); + } else if ("materializedViews".equals(fieldName)) { + List materializedViews + = reader.readArray(reader1 -> MaterializedViewDetails.fromJson(reader1)); + deserializedRestorableSqlContainerPropertiesResourceContainer + .withMaterializedViews(materializedViews); + } else if ("materializedViewsProperties".equals(fieldName)) { + deserializedRestorableSqlContainerPropertiesResourceContainer + .withMaterializedViewsProperties(MaterializedViewsProperties.fromJson(reader)); } else if ("computedProperties".equals(fieldName)) { List computedProperties = reader.readArray(reader1 -> ComputedProperty.fromJson(reader1)); @@ -326,8 +232,9 @@ public static RestorableSqlContainerPropertiesResourceContainer fromJson(JsonRea } else if ("fullTextPolicy".equals(fieldName)) { deserializedRestorableSqlContainerPropertiesResourceContainer .withFullTextPolicy(FullTextPolicy.fromJson(reader)); - } else if ("_self".equals(fieldName)) { - deserializedRestorableSqlContainerPropertiesResourceContainer.self = reader.getString(); + } else if ("dataMaskingPolicy".equals(fieldName)) { + deserializedRestorableSqlContainerPropertiesResourceContainer + .withDataMaskingPolicy(DataMaskingPolicy.fromJson(reader)); } else if ("_rid".equals(fieldName)) { deserializedRestorableSqlContainerPropertiesResourceContainer.rid = reader.getString(); } else if ("_ts".equals(fieldName)) { @@ -335,6 +242,8 @@ public static RestorableSqlContainerPropertiesResourceContainer fromJson(JsonRea = reader.getNullable(JsonReader::getFloat); } else if ("_etag".equals(fieldName)) { deserializedRestorableSqlContainerPropertiesResourceContainer.etag = reader.getString(); + } else if ("_self".equals(fieldName)) { + deserializedRestorableSqlContainerPropertiesResourceContainer.self = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlDatabasePropertiesResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlDatabasePropertiesResource.java index 2f239407c24c..fa9f86ecd069 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlDatabasePropertiesResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlDatabasePropertiesResource.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * The resource of an Azure Cosmos DB SQL database event. */ -@Fluent +@Immutable public final class RestorableSqlDatabasePropertiesResource implements JsonSerializable { /* @@ -60,7 +60,7 @@ public final class RestorableSqlDatabasePropertiesResource /** * Creates an instance of RestorableSqlDatabasePropertiesResource class. */ - public RestorableSqlDatabasePropertiesResource() { + private RestorableSqlDatabasePropertiesResource() { } /** @@ -136,18 +136,6 @@ public RestorableSqlDatabasePropertiesResourceDatabase database() { return this.database; } - /** - * Set the database property: Cosmos DB SQL database resource object. - * - * @param database the database value to set. - * @return the RestorableSqlDatabasePropertiesResource object itself. - */ - public RestorableSqlDatabasePropertiesResource - withDatabase(RestorableSqlDatabasePropertiesResourceDatabase database) { - this.database = database; - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlDatabasePropertiesResourceDatabase.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlDatabasePropertiesResourceDatabase.java index 76b0f771e40d..e9a6d62fe05c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlDatabasePropertiesResourceDatabase.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlDatabasePropertiesResourceDatabase.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -14,23 +14,8 @@ /** * Cosmos DB SQL database resource object. */ -@Fluent +@Immutable public final class RestorableSqlDatabasePropertiesResourceDatabase extends SqlDatabaseResource { - /* - * A system generated property that specified the addressable path of the collections resource. - */ - private String colls; - - /* - * A system generated property that specifies the addressable path of the users resource. - */ - private String users; - - /* - * A system generated property that specifies the addressable path of the database resource. - */ - private String self; - /* * A system generated property. A unique identifier. */ @@ -46,38 +31,25 @@ public final class RestorableSqlDatabasePropertiesResourceDatabase extends SqlDa */ private String etag; - /** - * Creates an instance of RestorableSqlDatabasePropertiesResourceDatabase class. + /* + * A system generated property that specified the addressable path of the collections resource. */ - public RestorableSqlDatabasePropertiesResourceDatabase() { - } + private String colls; - /** - * Get the colls property: A system generated property that specified the addressable path of the collections - * resource. - * - * @return the colls value. + /* + * A system generated property that specifies the addressable path of the users resource. */ - public String colls() { - return this.colls; - } + private String users; - /** - * Get the users property: A system generated property that specifies the addressable path of the users resource. - * - * @return the users value. + /* + * A system generated property that specifies the addressable path of the database resource. */ - public String users() { - return this.users; - } + private String self; /** - * Get the self property: A system generated property that specifies the addressable path of the database resource. - * - * @return the self value. + * Creates an instance of RestorableSqlDatabasePropertiesResourceDatabase class. */ - public String self() { - return this.self; + private RestorableSqlDatabasePropertiesResourceDatabase() { } /** @@ -109,31 +81,31 @@ public String etag() { } /** - * {@inheritDoc} + * Get the colls property: A system generated property that specified the addressable path of the collections + * resource. + * + * @return the colls value. */ - @Override - public RestorableSqlDatabasePropertiesResourceDatabase withId(String id) { - super.withId(id); - return this; + public String colls() { + return this.colls; } /** - * {@inheritDoc} + * Get the users property: A system generated property that specifies the addressable path of the users resource. + * + * @return the users value. */ - @Override - public RestorableSqlDatabasePropertiesResourceDatabase - withRestoreParameters(ResourceRestoreParameters restoreParameters) { - super.withRestoreParameters(restoreParameters); - return this; + public String users() { + return this.users; } /** - * {@inheritDoc} + * Get the self property: A system generated property that specifies the addressable path of the database resource. + * + * @return the self value. */ - @Override - public RestorableSqlDatabasePropertiesResourceDatabase withCreateMode(CreateMode createMode) { - super.withCreateMode(createMode); - return this; + public String self() { + return this.self; } /** @@ -192,12 +164,6 @@ public static RestorableSqlDatabasePropertiesResourceDatabase fromJson(JsonReade } else if ("createMode".equals(fieldName)) { deserializedRestorableSqlDatabasePropertiesResourceDatabase .withCreateMode(CreateMode.fromString(reader.getString())); - } else if ("_colls".equals(fieldName)) { - deserializedRestorableSqlDatabasePropertiesResourceDatabase.colls = reader.getString(); - } else if ("_users".equals(fieldName)) { - deserializedRestorableSqlDatabasePropertiesResourceDatabase.users = reader.getString(); - } else if ("_self".equals(fieldName)) { - deserializedRestorableSqlDatabasePropertiesResourceDatabase.self = reader.getString(); } else if ("_rid".equals(fieldName)) { deserializedRestorableSqlDatabasePropertiesResourceDatabase.rid = reader.getString(); } else if ("_ts".equals(fieldName)) { @@ -205,6 +171,12 @@ public static RestorableSqlDatabasePropertiesResourceDatabase fromJson(JsonReade = reader.getNullable(JsonReader::getFloat); } else if ("_etag".equals(fieldName)) { deserializedRestorableSqlDatabasePropertiesResourceDatabase.etag = reader.getString(); + } else if ("_colls".equals(fieldName)) { + deserializedRestorableSqlDatabasePropertiesResourceDatabase.colls = reader.getString(); + } else if ("_users".equals(fieldName)) { + deserializedRestorableSqlDatabasePropertiesResourceDatabase.users = reader.getString(); + } else if ("_self".equals(fieldName)) { + deserializedRestorableSqlDatabasePropertiesResourceDatabase.self = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableTablePropertiesResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableTablePropertiesResource.java index bc8dc1003c16..5070aa0d08c7 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableTablePropertiesResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestorableTablePropertiesResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -54,7 +54,7 @@ public final class RestorableTablePropertiesResource implements JsonSerializable /** * Creates an instance of RestorableTablePropertiesResource class. */ - public RestorableTablePropertiesResource() { + private RestorableTablePropertiesResource() { } /** diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestoreMode.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestoreMode.java index 25364c31a35d..573f5b1666ce 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestoreMode.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestoreMode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestoreParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestoreParameters.java index 3741c927a36a..b977262475dc 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestoreParameters.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestoreParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -24,6 +24,18 @@ public final class RestoreParameters extends RestoreParametersBase { */ private RestoreMode restoreMode; + /* + * The id of the restorable database account from which the restore has to be initiated. For example: + * /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{ + * restorableDatabaseAccountName} + */ + private String restoreSource; + + /* + * Time to which the account has to be restored (ISO-8601 format). + */ + private OffsetDateTime restoreTimestampInUtc; + /* * List of specific databases available for restore. */ @@ -70,6 +82,50 @@ public RestoreParameters withRestoreMode(RestoreMode restoreMode) { return this; } + /** + * Get the restoreSource property: The id of the restorable database account from which the restore has to be + * initiated. For example: + * /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}. + * + * @return the restoreSource value. + */ + public String restoreSource() { + return this.restoreSource; + } + + /** + * Set the restoreSource property: The id of the restorable database account from which the restore has to be + * initiated. For example: + * /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{restorableDatabaseAccountName}. + * + * @param restoreSource the restoreSource value to set. + * @return the RestoreParameters object itself. + */ + public RestoreParameters withRestoreSource(String restoreSource) { + this.restoreSource = restoreSource; + return this; + } + + /** + * Get the restoreTimestampInUtc property: Time to which the account has to be restored (ISO-8601 format). + * + * @return the restoreTimestampInUtc value. + */ + public OffsetDateTime restoreTimestampInUtc() { + return this.restoreTimestampInUtc; + } + + /** + * Set the restoreTimestampInUtc property: Time to which the account has to be restored (ISO-8601 format). + * + * @param restoreTimestampInUtc the restoreTimestampInUtc value to set. + * @return the RestoreParameters object itself. + */ + public RestoreParameters withRestoreTimestampInUtc(OffsetDateTime restoreTimestampInUtc) { + this.restoreTimestampInUtc = restoreTimestampInUtc; + return this; + } + /** * Get the databasesToRestore property: List of specific databases available for restore. * @@ -151,24 +207,6 @@ public RestoreParameters withSourceBackupLocation(String sourceBackupLocation) { return this; } - /** - * {@inheritDoc} - */ - @Override - public RestoreParameters withRestoreSource(String restoreSource) { - super.withRestoreSource(restoreSource); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public RestoreParameters withRestoreTimestampInUtc(OffsetDateTime restoreTimestampInUtc) { - super.withRestoreTimestampInUtc(restoreTimestampInUtc); - return this; - } - /** * {@inheritDoc} */ @@ -199,13 +237,13 @@ public void validate() { @Override public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); - jsonWriter.writeStringField("restoreSource", restoreSource()); - jsonWriter.writeStringField("restoreTimestampInUtc", - restoreTimestampInUtc() == null - ? null - : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(restoreTimestampInUtc())); jsonWriter.writeBooleanField("restoreWithTtlDisabled", restoreWithTtlDisabled()); jsonWriter.writeStringField("restoreMode", this.restoreMode == null ? null : this.restoreMode.toString()); + jsonWriter.writeStringField("restoreSource", this.restoreSource); + jsonWriter.writeStringField("restoreTimestampInUtc", + this.restoreTimestampInUtc == null + ? null + : DateTimeFormatter.ISO_OFFSET_DATE_TIME.format(this.restoreTimestampInUtc)); jsonWriter.writeArrayField("databasesToRestore", this.databasesToRestore, (writer, element) -> writer.writeJson(element)); jsonWriter.writeArrayField("gremlinDatabasesToRestore", this.gremlinDatabasesToRestore, @@ -231,16 +269,16 @@ public static RestoreParameters fromJson(JsonReader jsonReader) throws IOExcepti String fieldName = reader.getFieldName(); reader.nextToken(); - if ("restoreSource".equals(fieldName)) { - deserializedRestoreParameters.withRestoreSource(reader.getString()); - } else if ("restoreTimestampInUtc".equals(fieldName)) { - deserializedRestoreParameters.withRestoreTimestampInUtc(reader - .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString()))); - } else if ("restoreWithTtlDisabled".equals(fieldName)) { + if ("restoreWithTtlDisabled".equals(fieldName)) { deserializedRestoreParameters .withRestoreWithTtlDisabled(reader.getNullable(JsonReader::getBoolean)); } else if ("restoreMode".equals(fieldName)) { deserializedRestoreParameters.restoreMode = RestoreMode.fromString(reader.getString()); + } else if ("restoreSource".equals(fieldName)) { + deserializedRestoreParameters.restoreSource = reader.getString(); + } else if ("restoreTimestampInUtc".equals(fieldName)) { + deserializedRestoreParameters.restoreTimestampInUtc = reader + .getNullable(nonNullReader -> CoreUtils.parseBestOffsetDateTime(nonNullReader.getString())); } else if ("databasesToRestore".equals(fieldName)) { List databasesToRestore = reader.readArray(reader1 -> DatabaseRestoreResource.fromJson(reader1)); diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestoreParametersBase.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestoreParametersBase.java index d443fcc64730..5c72263ccec9 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestoreParametersBase.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RestoreParametersBase.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RetrieveThroughputParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RetrieveThroughputParameters.java new file mode 100644 index 000000000000..f22891ff4518 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RetrieveThroughputParameters.java @@ -0,0 +1,210 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.fluent.models.RetrieveThroughputProperties; +import java.io.IOException; +import java.util.Map; + +/** + * Cosmos DB retrieve throughput parameters object. + */ +@Fluent +public final class RetrieveThroughputParameters extends ArmResourceProperties { + /* + * Properties to retrieve throughput parameters object + */ + private RetrieveThroughputProperties innerProperties = new RetrieveThroughputProperties(); + + /* + * The type of Azure resource. + */ + private String type; + + /* + * The name of the ARM resource. + */ + private String name; + + /* + * The unique resource identifier of the ARM resource. + */ + private String id; + + /** + * Creates an instance of RetrieveThroughputParameters class. + */ + public RetrieveThroughputParameters() { + } + + /** + * Get the innerProperties property: Properties to retrieve throughput parameters object. + * + * @return the innerProperties value. + */ + private RetrieveThroughputProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the type property: The type of Azure resource. + * + * @return the type value. + */ + @Override + public String type() { + return this.type; + } + + /** + * Get the name property: The name of the ARM resource. + * + * @return the name value. + */ + @Override + public String name() { + return this.name; + } + + /** + * Get the id property: The unique resource identifier of the ARM resource. + * + * @return the id value. + */ + @Override + public String id() { + return this.id; + } + + /** + * {@inheritDoc} + */ + @Override + public RetrieveThroughputParameters withLocation(String location) { + super.withLocation(location); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RetrieveThroughputParameters withTags(Map tags) { + super.withTags(tags); + return this; + } + + /** + * {@inheritDoc} + */ + @Override + public RetrieveThroughputParameters withIdentity(ManagedServiceIdentity identity) { + super.withIdentity(identity); + return this; + } + + /** + * Get the resource property: The standard JSON format of a resource throughput. + * + * @return the resource value. + */ + public RetrieveThroughputPropertiesResource resource() { + return this.innerProperties() == null ? null : this.innerProperties().resource(); + } + + /** + * Set the resource property: The standard JSON format of a resource throughput. + * + * @param resource the resource value to set. + * @return the RetrieveThroughputParameters object itself. + */ + public RetrieveThroughputParameters withResource(RetrieveThroughputPropertiesResource resource) { + if (this.innerProperties() == null) { + this.innerProperties = new RetrieveThroughputProperties(); + } + this.innerProperties().withResource(resource); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + @Override + public void validate() { + if (innerProperties() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property innerProperties in model RetrieveThroughputParameters")); + } else { + innerProperties().validate(); + } + if (identity() != null) { + identity().validate(); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RetrieveThroughputParameters.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeStringField("location", location()); + jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", identity()); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RetrieveThroughputParameters from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RetrieveThroughputParameters if the JsonReader was pointing to an instance of it, or null + * if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RetrieveThroughputParameters. + */ + public static RetrieveThroughputParameters fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RetrieveThroughputParameters deserializedRetrieveThroughputParameters = new RetrieveThroughputParameters(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedRetrieveThroughputParameters.id = reader.getString(); + } else if ("name".equals(fieldName)) { + deserializedRetrieveThroughputParameters.name = reader.getString(); + } else if ("type".equals(fieldName)) { + deserializedRetrieveThroughputParameters.type = reader.getString(); + } else if ("location".equals(fieldName)) { + deserializedRetrieveThroughputParameters.withLocation(reader.getString()); + } else if ("tags".equals(fieldName)) { + Map tags = reader.readMap(reader1 -> reader1.getString()); + deserializedRetrieveThroughputParameters.withTags(tags); + } else if ("identity".equals(fieldName)) { + deserializedRetrieveThroughputParameters.withIdentity(ManagedServiceIdentity.fromJson(reader)); + } else if ("properties".equals(fieldName)) { + deserializedRetrieveThroughputParameters.innerProperties + = RetrieveThroughputProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedRetrieveThroughputParameters; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RetrieveThroughputPropertiesResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RetrieveThroughputPropertiesResource.java new file mode 100644 index 000000000000..33cb10ab6a44 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RetrieveThroughputPropertiesResource.java @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.core.util.logging.ClientLogger; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; +import java.util.List; + +/** + * Resource to retrieve throughput information for Cosmos DB resource. + */ +@Fluent +public final class RetrieveThroughputPropertiesResource + implements JsonSerializable { + /* + * Array of PhysicalPartitionId objects. + */ + private List physicalPartitionIds; + + /** + * Creates an instance of RetrieveThroughputPropertiesResource class. + */ + public RetrieveThroughputPropertiesResource() { + } + + /** + * Get the physicalPartitionIds property: Array of PhysicalPartitionId objects. + * + * @return the physicalPartitionIds value. + */ + public List physicalPartitionIds() { + return this.physicalPartitionIds; + } + + /** + * Set the physicalPartitionIds property: Array of PhysicalPartitionId objects. + * + * @param physicalPartitionIds the physicalPartitionIds value to set. + * @return the RetrieveThroughputPropertiesResource object itself. + */ + public RetrieveThroughputPropertiesResource + withPhysicalPartitionIds(List physicalPartitionIds) { + this.physicalPartitionIds = physicalPartitionIds; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (physicalPartitionIds() == null) { + throw LOGGER.atError() + .log(new IllegalArgumentException( + "Missing required property physicalPartitionIds in model RetrieveThroughputPropertiesResource")); + } else { + physicalPartitionIds().forEach(e -> e.validate()); + } + } + + private static final ClientLogger LOGGER = new ClientLogger(RetrieveThroughputPropertiesResource.class); + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeArrayField("physicalPartitionIds", this.physicalPartitionIds, + (writer, element) -> writer.writeJson(element)); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of RetrieveThroughputPropertiesResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of RetrieveThroughputPropertiesResource if the JsonReader was pointing to an instance of it, + * or null if it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the RetrieveThroughputPropertiesResource. + */ + public static RetrieveThroughputPropertiesResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + RetrieveThroughputPropertiesResource deserializedRetrieveThroughputPropertiesResource + = new RetrieveThroughputPropertiesResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("physicalPartitionIds".equals(fieldName)) { + List physicalPartitionIds + = reader.readArray(reader1 -> PhysicalPartitionId.fromJson(reader1)); + deserializedRetrieveThroughputPropertiesResource.physicalPartitionIds = physicalPartitionIds; + } else { + reader.skipChildren(); + } + } + + return deserializedRetrieveThroughputPropertiesResource; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Role.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Role.java index 5de8023b3f6c..e8d658e945ee 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Role.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Role.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RoleDefinitionType.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RoleDefinitionType.java index ac00882e0e5b..3d2d23cbda8a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RoleDefinitionType.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/RoleDefinitionType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ScheduledEventStrategy.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ScheduledEventStrategy.java new file mode 100644 index 000000000000..f0cf1803c9ab --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ScheduledEventStrategy.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * How the nodes in the cluster react to scheduled events. + */ +public final class ScheduledEventStrategy extends ExpandableStringEnum { + /** + * Static value Ignore for ScheduledEventStrategy. + */ + public static final ScheduledEventStrategy IGNORE = fromString("Ignore"); + + /** + * Static value StopAny for ScheduledEventStrategy. + */ + public static final ScheduledEventStrategy STOP_ANY = fromString("StopAny"); + + /** + * Static value StopByRack for ScheduledEventStrategy. + */ + public static final ScheduledEventStrategy STOP_BY_RACK = fromString("StopByRack"); + + /** + * Creates a new instance of ScheduledEventStrategy value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ScheduledEventStrategy() { + } + + /** + * Creates or finds a ScheduledEventStrategy from its string representation. + * + * @param name a name to look for. + * @return the corresponding ScheduledEventStrategy. + */ + public static ScheduledEventStrategy fromString(String name) { + return fromString(name, ScheduledEventStrategy.class); + } + + /** + * Gets known ScheduledEventStrategy values. + * + * @return known ScheduledEventStrategy values. + */ + public static Collection values() { + return values(ScheduledEventStrategy.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SeedNode.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SeedNode.java index 666547430dcd..d6badc0da754 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SeedNode.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SeedNode.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServerVersion.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServerVersion.java index f9bf55e7f108..8a9c21593067 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServerVersion.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServerVersion.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServiceResourceCreateUpdateParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServiceResourceCreateUpdateParameters.java index f52defe93870..08e8ad55976b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServiceResourceCreateUpdateParameters.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServiceResourceCreateUpdateParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServiceResourceCreateUpdateProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServiceResourceCreateUpdateProperties.java index 7fdadcb3f2ec..879695b9488d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServiceResourceCreateUpdateProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServiceResourceCreateUpdateProperties.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServiceResourceProperties.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServiceResourceProperties.java index 355388f6701e..bd7cc3c13b83 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServiceResourceProperties.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServiceResourceProperties.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.CoreUtils; import com.azure.json.JsonReader; import com.azure.json.JsonSerializable; @@ -18,7 +18,7 @@ /** * Services response resource. */ -@Fluent +@Immutable public class ServiceResourceProperties implements JsonSerializable { /* * ServiceType for the service. @@ -53,7 +53,7 @@ public class ServiceResourceProperties implements JsonSerializable additionalProperties() { * @param additionalProperties the additionalProperties value to set. * @return the ServiceResourceProperties object itself. */ - public ServiceResourceProperties withAdditionalProperties(Map additionalProperties) { + ServiceResourceProperties withAdditionalProperties(Map additionalProperties) { this.additionalProperties = additionalProperties; return this; } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServiceSize.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServiceSize.java index 84889916ec06..f3c22a671bc8 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServiceSize.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServiceSize.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServiceStatus.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServiceStatus.java index 1e8099af16e5..cd216f2d1394 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServiceStatus.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServiceStatus.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServiceType.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServiceType.java index 7478b364379a..63800a8a9c6d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServiceType.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ServiceType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Severity.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Severity.java new file mode 100644 index 000000000000..ea0f07a757d4 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Severity.java @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * Severity of the issue. + */ +public final class Severity extends ExpandableStringEnum { + /** + * Static value Warning for Severity. + */ + public static final Severity WARNING = fromString("Warning"); + + /** + * Static value Error for Severity. + */ + public static final Severity ERROR = fromString("Error"); + + /** + * Creates a new instance of Severity value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public Severity() { + } + + /** + * Creates or finds a Severity from its string representation. + * + * @param name a name to look for. + * @return the corresponding Severity. + */ + public static Severity fromString(String name) { + return fromString(name, Severity.class); + } + + /** + * Gets known Severity values. + * + * @return known Severity values. + */ + public static Collection values() { + return values(Severity.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SpatialSpec.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SpatialSpec.java index 36b259f8a973..57f5c831ec49 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SpatialSpec.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SpatialSpec.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SpatialType.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SpatialType.java index 1793ceb56284..1cd9f4a011ca 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SpatialType.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SpatialType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerCreateUpdateParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerCreateUpdateParameters.java index 1c149bd547ed..8ead673e2414 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerCreateUpdateParameters.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerCreateUpdateParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -24,17 +24,17 @@ public final class SqlContainerCreateUpdateParameters extends ArmResourcePropert private SqlContainerCreateUpdateProperties innerProperties = new SqlContainerCreateUpdateProperties(); /* - * The type of the resource. + * The type of Azure resource. */ private String type; /* - * The name of the resource. + * The name of the ARM resource. */ private String name; /* - * Fully qualified resource Id for the resource. + * The unique resource identifier of the ARM resource. */ private String id; @@ -54,7 +54,7 @@ private SqlContainerCreateUpdateProperties innerProperties() { } /** - * Get the type property: The type of the resource. + * Get the type property: The type of Azure resource. * * @return the type value. */ @@ -64,7 +64,7 @@ public String type() { } /** - * Get the name property: The name of the resource. + * Get the name property: The name of the ARM resource. * * @return the name value. */ @@ -74,7 +74,7 @@ public String name() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the id property: The unique resource identifier of the ARM resource. * * @return the id value. */ @@ -101,6 +101,15 @@ public SqlContainerCreateUpdateParameters withTags(Map tags) { return this; } + /** + * {@inheritDoc} + */ + @Override + public SqlContainerCreateUpdateParameters withIdentity(ManagedServiceIdentity identity) { + super.withIdentity(identity); + return this; + } + /** * Get the resource property: The standard JSON format of a container. * @@ -163,6 +172,9 @@ public void validate() { } else { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(SqlContainerCreateUpdateParameters.class); @@ -175,6 +187,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", identity()); jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -207,6 +220,9 @@ public static SqlContainerCreateUpdateParameters fromJson(JsonReader jsonReader) } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedSqlContainerCreateUpdateParameters.withTags(tags); + } else if ("identity".equals(fieldName)) { + deserializedSqlContainerCreateUpdateParameters + .withIdentity(ManagedServiceIdentity.fromJson(reader)); } else if ("properties".equals(fieldName)) { deserializedSqlContainerCreateUpdateParameters.innerProperties = SqlContainerCreateUpdateProperties.fromJson(reader); diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerGetPropertiesOptions.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerGetPropertiesOptions.java index 974d855b844e..2dc038c1c100 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerGetPropertiesOptions.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerGetPropertiesOptions.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -13,30 +13,44 @@ /** * The SqlContainerGetPropertiesOptions model. */ -@Fluent +@Immutable public final class SqlContainerGetPropertiesOptions extends OptionsResource { + /* + * Specifies the Autoscale settings. + */ + private AutoscaleSettings autoscaleSettings; + + /* + * Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when + * retrieving offer details. + */ + private Integer throughput; + /** * Creates an instance of SqlContainerGetPropertiesOptions class. */ - public SqlContainerGetPropertiesOptions() { + private SqlContainerGetPropertiesOptions() { } /** - * {@inheritDoc} + * Get the autoscaleSettings property: Specifies the Autoscale settings. + * + * @return the autoscaleSettings value. */ @Override - public SqlContainerGetPropertiesOptions withThroughput(Integer throughput) { - super.withThroughput(throughput); - return this; + public AutoscaleSettings autoscaleSettings() { + return this.autoscaleSettings; } /** - * {@inheritDoc} + * Get the throughput property: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the + * ThroughputSetting resource when retrieving offer details. + * + * @return the throughput value. */ @Override - public SqlContainerGetPropertiesOptions withAutoscaleSettings(AutoscaleSettings autoscaleSettings) { - super.withAutoscaleSettings(autoscaleSettings); - return this; + public Integer throughput() { + return this.throughput; } /** @@ -79,10 +93,9 @@ public static SqlContainerGetPropertiesOptions fromJson(JsonReader jsonReader) t reader.nextToken(); if ("throughput".equals(fieldName)) { - deserializedSqlContainerGetPropertiesOptions.withThroughput(reader.getNullable(JsonReader::getInt)); + deserializedSqlContainerGetPropertiesOptions.throughput = reader.getNullable(JsonReader::getInt); } else if ("autoscaleSettings".equals(fieldName)) { - deserializedSqlContainerGetPropertiesOptions - .withAutoscaleSettings(AutoscaleSettings.fromJson(reader)); + deserializedSqlContainerGetPropertiesOptions.autoscaleSettings = AutoscaleSettings.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerGetPropertiesResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerGetPropertiesResource.java index a71316c90483..093463a95764 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerGetPropertiesResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerGetPropertiesResource.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -15,7 +15,7 @@ /** * The SqlContainerGetPropertiesResource model. */ -@Fluent +@Immutable public final class SqlContainerGetPropertiesResource extends SqlContainerResource { /* * A system generated property. A unique identifier. @@ -35,7 +35,7 @@ public final class SqlContainerGetPropertiesResource extends SqlContainerResourc /** * Creates an instance of SqlContainerGetPropertiesResource class. */ - public SqlContainerGetPropertiesResource() { + private SqlContainerGetPropertiesResource() { } /** @@ -66,124 +66,6 @@ public String etag() { return this.etag; } - /** - * {@inheritDoc} - */ - @Override - public SqlContainerGetPropertiesResource withId(String id) { - super.withId(id); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SqlContainerGetPropertiesResource withIndexingPolicy(IndexingPolicy indexingPolicy) { - super.withIndexingPolicy(indexingPolicy); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SqlContainerGetPropertiesResource withPartitionKey(ContainerPartitionKey partitionKey) { - super.withPartitionKey(partitionKey); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SqlContainerGetPropertiesResource withDefaultTtl(Integer defaultTtl) { - super.withDefaultTtl(defaultTtl); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SqlContainerGetPropertiesResource withUniqueKeyPolicy(UniqueKeyPolicy uniqueKeyPolicy) { - super.withUniqueKeyPolicy(uniqueKeyPolicy); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SqlContainerGetPropertiesResource - withConflictResolutionPolicy(ConflictResolutionPolicy conflictResolutionPolicy) { - super.withConflictResolutionPolicy(conflictResolutionPolicy); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SqlContainerGetPropertiesResource withClientEncryptionPolicy(ClientEncryptionPolicy clientEncryptionPolicy) { - super.withClientEncryptionPolicy(clientEncryptionPolicy); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SqlContainerGetPropertiesResource withAnalyticalStorageTtl(Long analyticalStorageTtl) { - super.withAnalyticalStorageTtl(analyticalStorageTtl); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SqlContainerGetPropertiesResource withRestoreParameters(ResourceRestoreParameters restoreParameters) { - super.withRestoreParameters(restoreParameters); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SqlContainerGetPropertiesResource withCreateMode(CreateMode createMode) { - super.withCreateMode(createMode); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SqlContainerGetPropertiesResource withComputedProperties(List computedProperties) { - super.withComputedProperties(computedProperties); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SqlContainerGetPropertiesResource withVectorEmbeddingPolicy(VectorEmbeddingPolicy vectorEmbeddingPolicy) { - super.withVectorEmbeddingPolicy(vectorEmbeddingPolicy); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SqlContainerGetPropertiesResource withFullTextPolicy(FullTextPolicy fullTextPolicy) { - super.withFullTextPolicy(fullTextPolicy); - return this; - } - /** * Validates the instance. * @@ -214,6 +96,15 @@ public void validate() { if (restoreParameters() != null) { restoreParameters().validate(); } + if (materializedViewDefinition() != null) { + materializedViewDefinition().validate(); + } + if (materializedViews() != null) { + materializedViews().forEach(e -> e.validate()); + } + if (materializedViewsProperties() != null) { + materializedViewsProperties().validate(); + } if (computedProperties() != null) { computedProperties().forEach(e -> e.validate()); } @@ -223,6 +114,9 @@ public void validate() { if (fullTextPolicy() != null) { fullTextPolicy().validate(); } + if (dataMaskingPolicy() != null) { + dataMaskingPolicy().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(SqlContainerGetPropertiesResource.class); @@ -243,10 +137,15 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeNumberField("analyticalStorageTtl", analyticalStorageTtl()); jsonWriter.writeJsonField("restoreParameters", restoreParameters()); jsonWriter.writeStringField("createMode", createMode() == null ? null : createMode().toString()); + jsonWriter.writeJsonField("materializedViewDefinition", materializedViewDefinition()); + jsonWriter.writeArrayField("materializedViews", materializedViews(), + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("materializedViewsProperties", materializedViewsProperties()); jsonWriter.writeArrayField("computedProperties", computedProperties(), (writer, element) -> writer.writeJson(element)); jsonWriter.writeJsonField("vectorEmbeddingPolicy", vectorEmbeddingPolicy()); jsonWriter.writeJsonField("fullTextPolicy", fullTextPolicy()); + jsonWriter.writeJsonField("dataMaskingPolicy", dataMaskingPolicy()); return jsonWriter.writeEndObject(); } @@ -294,6 +193,16 @@ public static SqlContainerGetPropertiesResource fromJson(JsonReader jsonReader) } else if ("createMode".equals(fieldName)) { deserializedSqlContainerGetPropertiesResource .withCreateMode(CreateMode.fromString(reader.getString())); + } else if ("materializedViewDefinition".equals(fieldName)) { + deserializedSqlContainerGetPropertiesResource + .withMaterializedViewDefinition(MaterializedViewDefinition.fromJson(reader)); + } else if ("materializedViews".equals(fieldName)) { + List materializedViews + = reader.readArray(reader1 -> MaterializedViewDetails.fromJson(reader1)); + deserializedSqlContainerGetPropertiesResource.withMaterializedViews(materializedViews); + } else if ("materializedViewsProperties".equals(fieldName)) { + deserializedSqlContainerGetPropertiesResource + .withMaterializedViewsProperties(MaterializedViewsProperties.fromJson(reader)); } else if ("computedProperties".equals(fieldName)) { List computedProperties = reader.readArray(reader1 -> ComputedProperty.fromJson(reader1)); @@ -303,6 +212,9 @@ public static SqlContainerGetPropertiesResource fromJson(JsonReader jsonReader) .withVectorEmbeddingPolicy(VectorEmbeddingPolicy.fromJson(reader)); } else if ("fullTextPolicy".equals(fieldName)) { deserializedSqlContainerGetPropertiesResource.withFullTextPolicy(FullTextPolicy.fromJson(reader)); + } else if ("dataMaskingPolicy".equals(fieldName)) { + deserializedSqlContainerGetPropertiesResource + .withDataMaskingPolicy(DataMaskingPolicy.fromJson(reader)); } else if ("_rid".equals(fieldName)) { deserializedSqlContainerGetPropertiesResource.rid = reader.getString(); } else if ("_ts".equals(fieldName)) { diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerResource.java index cce4cdb20414..d22ab8a72d7f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -66,10 +66,26 @@ public class SqlContainerResource implements JsonSerializable materializedViews; + + /* + * Materialized Views Properties defined for source container. + */ + private MaterializedViewsProperties materializedViewsProperties; + /* * List of computed properties */ @@ -85,6 +101,11 @@ public class SqlContainerResource implements JsonSerializable materializedViews() { + return this.materializedViews; + } + + /** + * Set the materializedViews property: Materialized Views defined on the container. + * + * @param materializedViews the materializedViews value to set. + * @return the SqlContainerResource object itself. + */ + public SqlContainerResource withMaterializedViews(List materializedViews) { + this.materializedViews = materializedViews; + return this; + } + + /** + * Get the materializedViewsProperties property: Materialized Views Properties defined for source container. + * + * @return the materializedViewsProperties value. + */ + public MaterializedViewsProperties materializedViewsProperties() { + return this.materializedViewsProperties; + } + + /** + * Set the materializedViewsProperties property: Materialized Views Properties defined for source container. + * + * @param materializedViewsProperties the materializedViewsProperties value to set. + * @return the SqlContainerResource object itself. + */ + public SqlContainerResource + withMaterializedViewsProperties(MaterializedViewsProperties materializedViewsProperties) { + this.materializedViewsProperties = materializedViewsProperties; + return this; + } + /** * Get the computedProperties property: List of computed properties. * @@ -357,6 +441,26 @@ public SqlContainerResource withFullTextPolicy(FullTextPolicy fullTextPolicy) { return this; } + /** + * Get the dataMaskingPolicy property: The Data Masking policy for the container. + * + * @return the dataMaskingPolicy value. + */ + public DataMaskingPolicy dataMaskingPolicy() { + return this.dataMaskingPolicy; + } + + /** + * Set the dataMaskingPolicy property: The Data Masking policy for the container. + * + * @param dataMaskingPolicy the dataMaskingPolicy value to set. + * @return the SqlContainerResource object itself. + */ + public SqlContainerResource withDataMaskingPolicy(DataMaskingPolicy dataMaskingPolicy) { + this.dataMaskingPolicy = dataMaskingPolicy; + return this; + } + /** * Validates the instance. * @@ -385,6 +489,15 @@ public void validate() { if (restoreParameters() != null) { restoreParameters().validate(); } + if (materializedViewDefinition() != null) { + materializedViewDefinition().validate(); + } + if (materializedViews() != null) { + materializedViews().forEach(e -> e.validate()); + } + if (materializedViewsProperties() != null) { + materializedViewsProperties().validate(); + } if (computedProperties() != null) { computedProperties().forEach(e -> e.validate()); } @@ -394,6 +507,9 @@ public void validate() { if (fullTextPolicy() != null) { fullTextPolicy().validate(); } + if (dataMaskingPolicy() != null) { + dataMaskingPolicy().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(SqlContainerResource.class); @@ -414,10 +530,15 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeNumberField("analyticalStorageTtl", this.analyticalStorageTtl); jsonWriter.writeJsonField("restoreParameters", this.restoreParameters); jsonWriter.writeStringField("createMode", this.createMode == null ? null : this.createMode.toString()); + jsonWriter.writeJsonField("materializedViewDefinition", this.materializedViewDefinition); + jsonWriter.writeArrayField("materializedViews", this.materializedViews, + (writer, element) -> writer.writeJson(element)); + jsonWriter.writeJsonField("materializedViewsProperties", this.materializedViewsProperties); jsonWriter.writeArrayField("computedProperties", this.computedProperties, (writer, element) -> writer.writeJson(element)); jsonWriter.writeJsonField("vectorEmbeddingPolicy", this.vectorEmbeddingPolicy); jsonWriter.writeJsonField("fullTextPolicy", this.fullTextPolicy); + jsonWriter.writeJsonField("dataMaskingPolicy", this.dataMaskingPolicy); return jsonWriter.writeEndObject(); } @@ -458,6 +579,16 @@ public static SqlContainerResource fromJson(JsonReader jsonReader) throws IOExce deserializedSqlContainerResource.restoreParameters = ResourceRestoreParameters.fromJson(reader); } else if ("createMode".equals(fieldName)) { deserializedSqlContainerResource.createMode = CreateMode.fromString(reader.getString()); + } else if ("materializedViewDefinition".equals(fieldName)) { + deserializedSqlContainerResource.materializedViewDefinition + = MaterializedViewDefinition.fromJson(reader); + } else if ("materializedViews".equals(fieldName)) { + List materializedViews + = reader.readArray(reader1 -> MaterializedViewDetails.fromJson(reader1)); + deserializedSqlContainerResource.materializedViews = materializedViews; + } else if ("materializedViewsProperties".equals(fieldName)) { + deserializedSqlContainerResource.materializedViewsProperties + = MaterializedViewsProperties.fromJson(reader); } else if ("computedProperties".equals(fieldName)) { List computedProperties = reader.readArray(reader1 -> ComputedProperty.fromJson(reader1)); @@ -466,6 +597,8 @@ public static SqlContainerResource fromJson(JsonReader jsonReader) throws IOExce deserializedSqlContainerResource.vectorEmbeddingPolicy = VectorEmbeddingPolicy.fromJson(reader); } else if ("fullTextPolicy".equals(fieldName)) { deserializedSqlContainerResource.fullTextPolicy = FullTextPolicy.fromJson(reader); + } else if ("dataMaskingPolicy".equals(fieldName)) { + deserializedSqlContainerResource.dataMaskingPolicy = DataMaskingPolicy.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseCreateUpdateParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseCreateUpdateParameters.java index 93f2ee0e2eba..f2d4782ebd6c 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseCreateUpdateParameters.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseCreateUpdateParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -24,17 +24,17 @@ public final class SqlDatabaseCreateUpdateParameters extends ArmResourceProperti private SqlDatabaseCreateUpdateProperties innerProperties = new SqlDatabaseCreateUpdateProperties(); /* - * The type of the resource. + * The type of Azure resource. */ private String type; /* - * The name of the resource. + * The name of the ARM resource. */ private String name; /* - * Fully qualified resource Id for the resource. + * The unique resource identifier of the ARM resource. */ private String id; @@ -54,7 +54,7 @@ private SqlDatabaseCreateUpdateProperties innerProperties() { } /** - * Get the type property: The type of the resource. + * Get the type property: The type of Azure resource. * * @return the type value. */ @@ -64,7 +64,7 @@ public String type() { } /** - * Get the name property: The name of the resource. + * Get the name property: The name of the ARM resource. * * @return the name value. */ @@ -74,7 +74,7 @@ public String name() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the id property: The unique resource identifier of the ARM resource. * * @return the id value. */ @@ -101,6 +101,15 @@ public SqlDatabaseCreateUpdateParameters withTags(Map tags) { return this; } + /** + * {@inheritDoc} + */ + @Override + public SqlDatabaseCreateUpdateParameters withIdentity(ManagedServiceIdentity identity) { + super.withIdentity(identity); + return this; + } + /** * Get the resource property: The standard JSON format of a SQL database. * @@ -163,6 +172,9 @@ public void validate() { } else { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(SqlDatabaseCreateUpdateParameters.class); @@ -175,6 +187,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", identity()); jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -207,6 +220,8 @@ public static SqlDatabaseCreateUpdateParameters fromJson(JsonReader jsonReader) } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedSqlDatabaseCreateUpdateParameters.withTags(tags); + } else if ("identity".equals(fieldName)) { + deserializedSqlDatabaseCreateUpdateParameters.withIdentity(ManagedServiceIdentity.fromJson(reader)); } else if ("properties".equals(fieldName)) { deserializedSqlDatabaseCreateUpdateParameters.innerProperties = SqlDatabaseCreateUpdateProperties.fromJson(reader); diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseGetPropertiesOptions.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseGetPropertiesOptions.java index c2d414933e99..585289511572 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseGetPropertiesOptions.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseGetPropertiesOptions.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -13,30 +13,44 @@ /** * The SqlDatabaseGetPropertiesOptions model. */ -@Fluent +@Immutable public final class SqlDatabaseGetPropertiesOptions extends OptionsResource { + /* + * Specifies the Autoscale settings. + */ + private AutoscaleSettings autoscaleSettings; + + /* + * Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when + * retrieving offer details. + */ + private Integer throughput; + /** * Creates an instance of SqlDatabaseGetPropertiesOptions class. */ - public SqlDatabaseGetPropertiesOptions() { + private SqlDatabaseGetPropertiesOptions() { } /** - * {@inheritDoc} + * Get the autoscaleSettings property: Specifies the Autoscale settings. + * + * @return the autoscaleSettings value. */ @Override - public SqlDatabaseGetPropertiesOptions withThroughput(Integer throughput) { - super.withThroughput(throughput); - return this; + public AutoscaleSettings autoscaleSettings() { + return this.autoscaleSettings; } /** - * {@inheritDoc} + * Get the throughput property: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the + * ThroughputSetting resource when retrieving offer details. + * + * @return the throughput value. */ @Override - public SqlDatabaseGetPropertiesOptions withAutoscaleSettings(AutoscaleSettings autoscaleSettings) { - super.withAutoscaleSettings(autoscaleSettings); - return this; + public Integer throughput() { + return this.throughput; } /** @@ -79,10 +93,9 @@ public static SqlDatabaseGetPropertiesOptions fromJson(JsonReader jsonReader) th reader.nextToken(); if ("throughput".equals(fieldName)) { - deserializedSqlDatabaseGetPropertiesOptions.withThroughput(reader.getNullable(JsonReader::getInt)); + deserializedSqlDatabaseGetPropertiesOptions.throughput = reader.getNullable(JsonReader::getInt); } else if ("autoscaleSettings".equals(fieldName)) { - deserializedSqlDatabaseGetPropertiesOptions - .withAutoscaleSettings(AutoscaleSettings.fromJson(reader)); + deserializedSqlDatabaseGetPropertiesOptions.autoscaleSettings = AutoscaleSettings.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseGetPropertiesResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseGetPropertiesResource.java index db1ac7335441..96b5a3cfe4ca 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseGetPropertiesResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseGetPropertiesResource.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -14,18 +14,8 @@ /** * The SqlDatabaseGetPropertiesResource model. */ -@Fluent +@Immutable public final class SqlDatabaseGetPropertiesResource extends SqlDatabaseResource { - /* - * A system generated property that specified the addressable path of the collections resource. - */ - private String colls; - - /* - * A system generated property that specifies the addressable path of the users resource. - */ - private String users; - /* * A system generated property. A unique identifier. */ @@ -41,52 +31,20 @@ public final class SqlDatabaseGetPropertiesResource extends SqlDatabaseResource */ private String etag; - /** - * Creates an instance of SqlDatabaseGetPropertiesResource class. - */ - public SqlDatabaseGetPropertiesResource() { - } - - /** - * Get the colls property: A system generated property that specified the addressable path of the collections - * resource. - * - * @return the colls value. - */ - public String colls() { - return this.colls; - } - - /** - * Set the colls property: A system generated property that specified the addressable path of the collections - * resource. - * - * @param colls the colls value to set. - * @return the SqlDatabaseGetPropertiesResource object itself. + /* + * A system generated property that specified the addressable path of the collections resource. */ - public SqlDatabaseGetPropertiesResource withColls(String colls) { - this.colls = colls; - return this; - } + private String colls; - /** - * Get the users property: A system generated property that specifies the addressable path of the users resource. - * - * @return the users value. + /* + * A system generated property that specifies the addressable path of the users resource. */ - public String users() { - return this.users; - } + private String users; /** - * Set the users property: A system generated property that specifies the addressable path of the users resource. - * - * @param users the users value to set. - * @return the SqlDatabaseGetPropertiesResource object itself. + * Creates an instance of SqlDatabaseGetPropertiesResource class. */ - public SqlDatabaseGetPropertiesResource withUsers(String users) { - this.users = users; - return this; + private SqlDatabaseGetPropertiesResource() { } /** @@ -118,30 +76,22 @@ public String etag() { } /** - * {@inheritDoc} - */ - @Override - public SqlDatabaseGetPropertiesResource withId(String id) { - super.withId(id); - return this; - } - - /** - * {@inheritDoc} + * Get the colls property: A system generated property that specified the addressable path of the collections + * resource. + * + * @return the colls value. */ - @Override - public SqlDatabaseGetPropertiesResource withRestoreParameters(ResourceRestoreParameters restoreParameters) { - super.withRestoreParameters(restoreParameters); - return this; + public String colls() { + return this.colls; } /** - * {@inheritDoc} + * Get the users property: A system generated property that specifies the addressable path of the users resource. + * + * @return the users value. */ - @Override - public SqlDatabaseGetPropertiesResource withCreateMode(CreateMode createMode) { - super.withCreateMode(createMode); - return this; + public String users() { + return this.users; } /** @@ -202,16 +152,16 @@ public static SqlDatabaseGetPropertiesResource fromJson(JsonReader jsonReader) t } else if ("createMode".equals(fieldName)) { deserializedSqlDatabaseGetPropertiesResource .withCreateMode(CreateMode.fromString(reader.getString())); - } else if ("_colls".equals(fieldName)) { - deserializedSqlDatabaseGetPropertiesResource.colls = reader.getString(); - } else if ("_users".equals(fieldName)) { - deserializedSqlDatabaseGetPropertiesResource.users = reader.getString(); } else if ("_rid".equals(fieldName)) { deserializedSqlDatabaseGetPropertiesResource.rid = reader.getString(); } else if ("_ts".equals(fieldName)) { deserializedSqlDatabaseGetPropertiesResource.ts = reader.getNullable(JsonReader::getFloat); } else if ("_etag".equals(fieldName)) { deserializedSqlDatabaseGetPropertiesResource.etag = reader.getString(); + } else if ("_colls".equals(fieldName)) { + deserializedSqlDatabaseGetPropertiesResource.colls = reader.getString(); + } else if ("_users".equals(fieldName)) { + deserializedSqlDatabaseGetPropertiesResource.users = reader.getString(); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseResource.java index 294ee18f4fea..3ea85efbe333 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -28,7 +28,7 @@ public class SqlDatabaseResource implements JsonSerializable locations() { return this.locations; } - /** - * {@inheritDoc} - */ - @Override - public SqlDedicatedGatewayServiceResourceProperties withInstanceSize(ServiceSize instanceSize) { - super.withInstanceSize(instanceSize); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SqlDedicatedGatewayServiceResourceProperties withInstanceCount(Integer instanceCount) { - super.withInstanceCount(instanceCount); - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlRoleAssignmentCreateUpdateParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlRoleAssignmentCreateUpdateParameters.java index 31e132b3bb6c..4d286bfc5bd5 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlRoleAssignmentCreateUpdateParameters.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlRoleAssignmentCreateUpdateParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlRoleDefinitionCreateUpdateParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlRoleDefinitionCreateUpdateParameters.java index d3e65665fe5d..540c49fe38be 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlRoleDefinitionCreateUpdateParameters.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlRoleDefinitionCreateUpdateParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlStoredProcedureCreateUpdateParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlStoredProcedureCreateUpdateParameters.java index 6e4719ec6d89..d90510cb85c3 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlStoredProcedureCreateUpdateParameters.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlStoredProcedureCreateUpdateParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -24,17 +24,17 @@ public final class SqlStoredProcedureCreateUpdateParameters extends ArmResourceP private SqlStoredProcedureCreateUpdateProperties innerProperties = new SqlStoredProcedureCreateUpdateProperties(); /* - * The type of the resource. + * The type of Azure resource. */ private String type; /* - * The name of the resource. + * The name of the ARM resource. */ private String name; /* - * Fully qualified resource Id for the resource. + * The unique resource identifier of the ARM resource. */ private String id; @@ -54,7 +54,7 @@ private SqlStoredProcedureCreateUpdateProperties innerProperties() { } /** - * Get the type property: The type of the resource. + * Get the type property: The type of Azure resource. * * @return the type value. */ @@ -64,7 +64,7 @@ public String type() { } /** - * Get the name property: The name of the resource. + * Get the name property: The name of the ARM resource. * * @return the name value. */ @@ -74,7 +74,7 @@ public String name() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the id property: The unique resource identifier of the ARM resource. * * @return the id value. */ @@ -101,6 +101,15 @@ public SqlStoredProcedureCreateUpdateParameters withTags(Map tag return this; } + /** + * {@inheritDoc} + */ + @Override + public SqlStoredProcedureCreateUpdateParameters withIdentity(ManagedServiceIdentity identity) { + super.withIdentity(identity); + return this; + } + /** * Get the resource property: The standard JSON format of a storedProcedure. * @@ -163,6 +172,9 @@ public void validate() { } else { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(SqlStoredProcedureCreateUpdateParameters.class); @@ -175,6 +187,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", identity()); jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -207,6 +220,9 @@ public static SqlStoredProcedureCreateUpdateParameters fromJson(JsonReader jsonR } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedSqlStoredProcedureCreateUpdateParameters.withTags(tags); + } else if ("identity".equals(fieldName)) { + deserializedSqlStoredProcedureCreateUpdateParameters + .withIdentity(ManagedServiceIdentity.fromJson(reader)); } else if ("properties".equals(fieldName)) { deserializedSqlStoredProcedureCreateUpdateParameters.innerProperties = SqlStoredProcedureCreateUpdateProperties.fromJson(reader); diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlStoredProcedureGetPropertiesResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlStoredProcedureGetPropertiesResource.java index e2ead1f7abce..7b0b98c46a81 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlStoredProcedureGetPropertiesResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlStoredProcedureGetPropertiesResource.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * The SqlStoredProcedureGetPropertiesResource model. */ -@Fluent +@Immutable public final class SqlStoredProcedureGetPropertiesResource extends SqlStoredProcedureResource { /* * A system generated property. A unique identifier. @@ -34,7 +34,7 @@ public final class SqlStoredProcedureGetPropertiesResource extends SqlStoredProc /** * Creates an instance of SqlStoredProcedureGetPropertiesResource class. */ - public SqlStoredProcedureGetPropertiesResource() { + private SqlStoredProcedureGetPropertiesResource() { } /** @@ -65,24 +65,6 @@ public String etag() { return this.etag; } - /** - * {@inheritDoc} - */ - @Override - public SqlStoredProcedureGetPropertiesResource withId(String id) { - super.withId(id); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SqlStoredProcedureGetPropertiesResource withBody(String body) { - super.withBody(body); - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlStoredProcedureResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlStoredProcedureResource.java index d518a4caf21d..10d6c50fb29a 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlStoredProcedureResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlStoredProcedureResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlTriggerCreateUpdateParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlTriggerCreateUpdateParameters.java index 84dfd71bbabf..dc49adb56f47 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlTriggerCreateUpdateParameters.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlTriggerCreateUpdateParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -24,17 +24,17 @@ public final class SqlTriggerCreateUpdateParameters extends ArmResourcePropertie private SqlTriggerCreateUpdateProperties innerProperties = new SqlTriggerCreateUpdateProperties(); /* - * The type of the resource. + * The type of Azure resource. */ private String type; /* - * The name of the resource. + * The name of the ARM resource. */ private String name; /* - * Fully qualified resource Id for the resource. + * The unique resource identifier of the ARM resource. */ private String id; @@ -54,7 +54,7 @@ private SqlTriggerCreateUpdateProperties innerProperties() { } /** - * Get the type property: The type of the resource. + * Get the type property: The type of Azure resource. * * @return the type value. */ @@ -64,7 +64,7 @@ public String type() { } /** - * Get the name property: The name of the resource. + * Get the name property: The name of the ARM resource. * * @return the name value. */ @@ -74,7 +74,7 @@ public String name() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the id property: The unique resource identifier of the ARM resource. * * @return the id value. */ @@ -101,6 +101,15 @@ public SqlTriggerCreateUpdateParameters withTags(Map tags) { return this; } + /** + * {@inheritDoc} + */ + @Override + public SqlTriggerCreateUpdateParameters withIdentity(ManagedServiceIdentity identity) { + super.withIdentity(identity); + return this; + } + /** * Get the resource property: The standard JSON format of a trigger. * @@ -163,6 +172,9 @@ public void validate() { } else { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(SqlTriggerCreateUpdateParameters.class); @@ -175,6 +187,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", identity()); jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -207,6 +220,8 @@ public static SqlTriggerCreateUpdateParameters fromJson(JsonReader jsonReader) t } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedSqlTriggerCreateUpdateParameters.withTags(tags); + } else if ("identity".equals(fieldName)) { + deserializedSqlTriggerCreateUpdateParameters.withIdentity(ManagedServiceIdentity.fromJson(reader)); } else if ("properties".equals(fieldName)) { deserializedSqlTriggerCreateUpdateParameters.innerProperties = SqlTriggerCreateUpdateProperties.fromJson(reader); diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlTriggerGetPropertiesResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlTriggerGetPropertiesResource.java index c4b152b7b3c1..bed032605e6d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlTriggerGetPropertiesResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlTriggerGetPropertiesResource.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * The SqlTriggerGetPropertiesResource model. */ -@Fluent +@Immutable public final class SqlTriggerGetPropertiesResource extends SqlTriggerResource { /* * A system generated property. A unique identifier. @@ -34,7 +34,7 @@ public final class SqlTriggerGetPropertiesResource extends SqlTriggerResource { /** * Creates an instance of SqlTriggerGetPropertiesResource class. */ - public SqlTriggerGetPropertiesResource() { + private SqlTriggerGetPropertiesResource() { } /** @@ -65,42 +65,6 @@ public String etag() { return this.etag; } - /** - * {@inheritDoc} - */ - @Override - public SqlTriggerGetPropertiesResource withId(String id) { - super.withId(id); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SqlTriggerGetPropertiesResource withBody(String body) { - super.withBody(body); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SqlTriggerGetPropertiesResource withTriggerType(TriggerType triggerType) { - super.withTriggerType(triggerType); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SqlTriggerGetPropertiesResource withTriggerOperation(TriggerOperation triggerOperation) { - super.withTriggerOperation(triggerOperation); - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlTriggerResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlTriggerResource.java index 4d95e6785eeb..213cd5350386 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlTriggerResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlTriggerResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlUserDefinedFunctionCreateUpdateParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlUserDefinedFunctionCreateUpdateParameters.java index 4d00ef716611..82718d9ecbff 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlUserDefinedFunctionCreateUpdateParameters.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlUserDefinedFunctionCreateUpdateParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -25,17 +25,17 @@ public final class SqlUserDefinedFunctionCreateUpdateParameters extends ArmResou = new SqlUserDefinedFunctionCreateUpdateProperties(); /* - * The type of the resource. + * The type of Azure resource. */ private String type; /* - * The name of the resource. + * The name of the ARM resource. */ private String name; /* - * Fully qualified resource Id for the resource. + * The unique resource identifier of the ARM resource. */ private String id; @@ -55,7 +55,7 @@ private SqlUserDefinedFunctionCreateUpdateProperties innerProperties() { } /** - * Get the type property: The type of the resource. + * Get the type property: The type of Azure resource. * * @return the type value. */ @@ -65,7 +65,7 @@ public String type() { } /** - * Get the name property: The name of the resource. + * Get the name property: The name of the ARM resource. * * @return the name value. */ @@ -75,7 +75,7 @@ public String name() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the id property: The unique resource identifier of the ARM resource. * * @return the id value. */ @@ -102,6 +102,15 @@ public SqlUserDefinedFunctionCreateUpdateParameters withTags(Map return this; } + /** + * {@inheritDoc} + */ + @Override + public SqlUserDefinedFunctionCreateUpdateParameters withIdentity(ManagedServiceIdentity identity) { + super.withIdentity(identity); + return this; + } + /** * Get the resource property: The standard JSON format of a userDefinedFunction. * @@ -164,6 +173,9 @@ public void validate() { } else { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(SqlUserDefinedFunctionCreateUpdateParameters.class); @@ -176,6 +188,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", identity()); jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -208,6 +221,9 @@ public static SqlUserDefinedFunctionCreateUpdateParameters fromJson(JsonReader j } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedSqlUserDefinedFunctionCreateUpdateParameters.withTags(tags); + } else if ("identity".equals(fieldName)) { + deserializedSqlUserDefinedFunctionCreateUpdateParameters + .withIdentity(ManagedServiceIdentity.fromJson(reader)); } else if ("properties".equals(fieldName)) { deserializedSqlUserDefinedFunctionCreateUpdateParameters.innerProperties = SqlUserDefinedFunctionCreateUpdateProperties.fromJson(reader); diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlUserDefinedFunctionGetPropertiesResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlUserDefinedFunctionGetPropertiesResource.java index 59bf2eed089b..35616d945868 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlUserDefinedFunctionGetPropertiesResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlUserDefinedFunctionGetPropertiesResource.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * The SqlUserDefinedFunctionGetPropertiesResource model. */ -@Fluent +@Immutable public final class SqlUserDefinedFunctionGetPropertiesResource extends SqlUserDefinedFunctionResource { /* * A system generated property. A unique identifier. @@ -34,7 +34,7 @@ public final class SqlUserDefinedFunctionGetPropertiesResource extends SqlUserDe /** * Creates an instance of SqlUserDefinedFunctionGetPropertiesResource class. */ - public SqlUserDefinedFunctionGetPropertiesResource() { + private SqlUserDefinedFunctionGetPropertiesResource() { } /** @@ -65,24 +65,6 @@ public String etag() { return this.etag; } - /** - * {@inheritDoc} - */ - @Override - public SqlUserDefinedFunctionGetPropertiesResource withId(String id) { - super.withId(id); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public SqlUserDefinedFunctionGetPropertiesResource withBody(String body) { - super.withBody(body); - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlUserDefinedFunctionResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlUserDefinedFunctionResource.java index a79f33c9b76b..514b88961a22 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlUserDefinedFunctionResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SqlUserDefinedFunctionResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Status.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Status.java index 3cb252839fc6..df3da5ea98f3 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Status.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Status.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -36,11 +36,6 @@ public final class Status extends ExpandableStringEnum { */ public static final Status DELETING = fromString("Deleting"); - /** - * Static value Creating for Status. - */ - public static final Status CREATING = fromString("Creating"); - /** * Static value Succeeded for Status. */ @@ -61,6 +56,11 @@ public final class Status extends ExpandableStringEnum { */ public static final Status UPDATING = fromString("Updating"); + /** + * Static value Creating for Status. + */ + public static final Status CREATING = fromString("Creating"); + /** * Creates a new instance of Status value. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SupportedActions.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SupportedActions.java new file mode 100644 index 000000000000..617ae00ef485 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/SupportedActions.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +/** + * Indicates whether what action to take for the Chaos Fault. + */ +public enum SupportedActions { + /** + * Enum value Enable. + */ + ENABLE("Enable"), + + /** + * Enum value Disable. + */ + DISABLE("Disable"); + + /** + * The actual serialized value for a SupportedActions instance. + */ + private final String value; + + SupportedActions(String value) { + this.value = value; + } + + /** + * Parses a serialized value to a SupportedActions instance. + * + * @param value the serialized value to parse. + * @return the parsed SupportedActions object, or null if unable to parse. + */ + public static SupportedActions fromString(String value) { + if (value == null) { + return null; + } + SupportedActions[] items = SupportedActions.values(); + for (SupportedActions item : items) { + if (item.toString().equalsIgnoreCase(value)) { + return item; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + @Override + public String toString() { + return this.value; + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/TableCreateUpdateParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/TableCreateUpdateParameters.java index 64b18f8422c3..e3e7f98b040d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/TableCreateUpdateParameters.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/TableCreateUpdateParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -24,17 +24,17 @@ public final class TableCreateUpdateParameters extends ArmResourceProperties { private TableCreateUpdateProperties innerProperties = new TableCreateUpdateProperties(); /* - * The type of the resource. + * The type of Azure resource. */ private String type; /* - * The name of the resource. + * The name of the ARM resource. */ private String name; /* - * Fully qualified resource Id for the resource. + * The unique resource identifier of the ARM resource. */ private String id; @@ -54,7 +54,7 @@ private TableCreateUpdateProperties innerProperties() { } /** - * Get the type property: The type of the resource. + * Get the type property: The type of Azure resource. * * @return the type value. */ @@ -64,7 +64,7 @@ public String type() { } /** - * Get the name property: The name of the resource. + * Get the name property: The name of the ARM resource. * * @return the name value. */ @@ -74,7 +74,7 @@ public String name() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the id property: The unique resource identifier of the ARM resource. * * @return the id value. */ @@ -101,6 +101,15 @@ public TableCreateUpdateParameters withTags(Map tags) { return this; } + /** + * {@inheritDoc} + */ + @Override + public TableCreateUpdateParameters withIdentity(ManagedServiceIdentity identity) { + super.withIdentity(identity); + return this; + } + /** * Get the resource property: The standard JSON format of a Table. * @@ -163,6 +172,9 @@ public void validate() { } else { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(TableCreateUpdateParameters.class); @@ -175,6 +187,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", identity()); jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -206,6 +219,8 @@ public static TableCreateUpdateParameters fromJson(JsonReader jsonReader) throws } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedTableCreateUpdateParameters.withTags(tags); + } else if ("identity".equals(fieldName)) { + deserializedTableCreateUpdateParameters.withIdentity(ManagedServiceIdentity.fromJson(reader)); } else if ("properties".equals(fieldName)) { deserializedTableCreateUpdateParameters.innerProperties = TableCreateUpdateProperties.fromJson(reader); diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/TableGetPropertiesOptions.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/TableGetPropertiesOptions.java index 6cb0a97a44ba..d8d98560c5a2 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/TableGetPropertiesOptions.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/TableGetPropertiesOptions.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; @@ -13,30 +13,44 @@ /** * The TableGetPropertiesOptions model. */ -@Fluent +@Immutable public final class TableGetPropertiesOptions extends OptionsResource { + /* + * Specifies the Autoscale settings. + */ + private AutoscaleSettings autoscaleSettings; + + /* + * Value of the Cosmos DB resource throughput or autoscaleSettings. Use the ThroughputSetting resource when + * retrieving offer details. + */ + private Integer throughput; + /** * Creates an instance of TableGetPropertiesOptions class. */ - public TableGetPropertiesOptions() { + private TableGetPropertiesOptions() { } /** - * {@inheritDoc} + * Get the autoscaleSettings property: Specifies the Autoscale settings. + * + * @return the autoscaleSettings value. */ @Override - public TableGetPropertiesOptions withThroughput(Integer throughput) { - super.withThroughput(throughput); - return this; + public AutoscaleSettings autoscaleSettings() { + return this.autoscaleSettings; } /** - * {@inheritDoc} + * Get the throughput property: Value of the Cosmos DB resource throughput or autoscaleSettings. Use the + * ThroughputSetting resource when retrieving offer details. + * + * @return the throughput value. */ @Override - public TableGetPropertiesOptions withAutoscaleSettings(AutoscaleSettings autoscaleSettings) { - super.withAutoscaleSettings(autoscaleSettings); - return this; + public Integer throughput() { + return this.throughput; } /** @@ -78,9 +92,9 @@ public static TableGetPropertiesOptions fromJson(JsonReader jsonReader) throws I reader.nextToken(); if ("throughput".equals(fieldName)) { - deserializedTableGetPropertiesOptions.withThroughput(reader.getNullable(JsonReader::getInt)); + deserializedTableGetPropertiesOptions.throughput = reader.getNullable(JsonReader::getInt); } else if ("autoscaleSettings".equals(fieldName)) { - deserializedTableGetPropertiesOptions.withAutoscaleSettings(AutoscaleSettings.fromJson(reader)); + deserializedTableGetPropertiesOptions.autoscaleSettings = AutoscaleSettings.fromJson(reader); } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/TableGetPropertiesResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/TableGetPropertiesResource.java index bf425824529c..737086f466c4 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/TableGetPropertiesResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/TableGetPropertiesResource.java @@ -1,10 +1,10 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.core.util.logging.ClientLogger; import com.azure.json.JsonReader; import com.azure.json.JsonToken; @@ -14,7 +14,7 @@ /** * The TableGetPropertiesResource model. */ -@Fluent +@Immutable public final class TableGetPropertiesResource extends TableResource { /* * A system generated property. A unique identifier. @@ -34,7 +34,7 @@ public final class TableGetPropertiesResource extends TableResource { /** * Creates an instance of TableGetPropertiesResource class. */ - public TableGetPropertiesResource() { + private TableGetPropertiesResource() { } /** @@ -65,33 +65,6 @@ public String etag() { return this.etag; } - /** - * {@inheritDoc} - */ - @Override - public TableGetPropertiesResource withId(String id) { - super.withId(id); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public TableGetPropertiesResource withRestoreParameters(ResourceRestoreParameters restoreParameters) { - super.withRestoreParameters(restoreParameters); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public TableGetPropertiesResource withCreateMode(CreateMode createMode) { - super.withCreateMode(createMode); - return this; - } - /** * Validates the instance. * diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/TableResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/TableResource.java index ec644d1c457e..c454c652a769 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/TableResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/TableResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -28,7 +28,7 @@ public class TableResource implements JsonSerializable { private ResourceRestoreParameters restoreParameters; /* - * Enum to indicate the mode of resource creation. + * Enum to indicate the mode of account creation. */ private CreateMode createMode; @@ -79,7 +79,7 @@ public TableResource withRestoreParameters(ResourceRestoreParameters restorePara } /** - * Get the createMode property: Enum to indicate the mode of resource creation. + * Get the createMode property: Enum to indicate the mode of account creation. * * @return the createMode value. */ @@ -88,7 +88,7 @@ public CreateMode createMode() { } /** - * Set the createMode property: Enum to indicate the mode of resource creation. + * Set the createMode property: Enum to indicate the mode of account creation. * * @param createMode the createMode value to set. * @return the TableResource object itself. diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputBucketResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputBucketResource.java new file mode 100644 index 000000000000..eabee2228d12 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputBucketResource.java @@ -0,0 +1,152 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import java.io.IOException; + +/** + * Cosmos DB throughput bucket object. + */ +@Fluent +public final class ThroughputBucketResource implements JsonSerializable { + /* + * Represents the throughput bucket id + */ + private int id; + + /* + * Represents maximum percentage throughput that can be used by the bucket + */ + private int maxThroughputPercentage; + + /* + * Indicates whether this is the default throughput bucket + */ + private Boolean isDefaultBucket; + + /** + * Creates an instance of ThroughputBucketResource class. + */ + public ThroughputBucketResource() { + } + + /** + * Get the id property: Represents the throughput bucket id. + * + * @return the id value. + */ + public int id() { + return this.id; + } + + /** + * Set the id property: Represents the throughput bucket id. + * + * @param id the id value to set. + * @return the ThroughputBucketResource object itself. + */ + public ThroughputBucketResource withId(int id) { + this.id = id; + return this; + } + + /** + * Get the maxThroughputPercentage property: Represents maximum percentage throughput that can be used by the + * bucket. + * + * @return the maxThroughputPercentage value. + */ + public int maxThroughputPercentage() { + return this.maxThroughputPercentage; + } + + /** + * Set the maxThroughputPercentage property: Represents maximum percentage throughput that can be used by the + * bucket. + * + * @param maxThroughputPercentage the maxThroughputPercentage value to set. + * @return the ThroughputBucketResource object itself. + */ + public ThroughputBucketResource withMaxThroughputPercentage(int maxThroughputPercentage) { + this.maxThroughputPercentage = maxThroughputPercentage; + return this; + } + + /** + * Get the isDefaultBucket property: Indicates whether this is the default throughput bucket. + * + * @return the isDefaultBucket value. + */ + public Boolean isDefaultBucket() { + return this.isDefaultBucket; + } + + /** + * Set the isDefaultBucket property: Indicates whether this is the default throughput bucket. + * + * @param isDefaultBucket the isDefaultBucket value to set. + * @return the ThroughputBucketResource object itself. + */ + public ThroughputBucketResource withIsDefaultBucket(Boolean isDefaultBucket) { + this.isDefaultBucket = isDefaultBucket; + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeIntField("id", this.id); + jsonWriter.writeIntField("maxThroughputPercentage", this.maxThroughputPercentage); + jsonWriter.writeBooleanField("isDefaultBucket", this.isDefaultBucket); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ThroughputBucketResource from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThroughputBucketResource if the JsonReader was pointing to an instance of it, or null if + * it was pointing to JSON null. + * @throws IllegalStateException If the deserialized JSON object was missing any required properties. + * @throws IOException If an error occurs while reading the ThroughputBucketResource. + */ + public static ThroughputBucketResource fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThroughputBucketResource deserializedThroughputBucketResource = new ThroughputBucketResource(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("id".equals(fieldName)) { + deserializedThroughputBucketResource.id = reader.getInt(); + } else if ("maxThroughputPercentage".equals(fieldName)) { + deserializedThroughputBucketResource.maxThroughputPercentage = reader.getInt(); + } else if ("isDefaultBucket".equals(fieldName)) { + deserializedThroughputBucketResource.isDefaultBucket = reader.getNullable(JsonReader::getBoolean); + } else { + reader.skipChildren(); + } + } + + return deserializedThroughputBucketResource; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputPolicyResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputPolicyResource.java index 6d4e7915469c..6c028df85611 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputPolicyResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputPolicyResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputPolicyType.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputPolicyType.java new file mode 100644 index 000000000000..4d62a4d263ba --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputPolicyType.java @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.util.ExpandableStringEnum; +import java.util.Collection; + +/** + * ThroughputPolicy to apply for throughput redistribution. + */ +public final class ThroughputPolicyType extends ExpandableStringEnum { + /** + * Static value none for ThroughputPolicyType. + */ + public static final ThroughputPolicyType NONE = fromString("none"); + + /** + * Static value equal for ThroughputPolicyType. + */ + public static final ThroughputPolicyType EQUAL = fromString("equal"); + + /** + * Static value custom for ThroughputPolicyType. + */ + public static final ThroughputPolicyType CUSTOM = fromString("custom"); + + /** + * Creates a new instance of ThroughputPolicyType value. + * + * @deprecated Use the {@link #fromString(String)} factory method. + */ + @Deprecated + public ThroughputPolicyType() { + } + + /** + * Creates or finds a ThroughputPolicyType from its string representation. + * + * @param name a name to look for. + * @return the corresponding ThroughputPolicyType. + */ + public static ThroughputPolicyType fromString(String name) { + return fromString(name, ThroughputPolicyType.class); + } + + /** + * Gets known ThroughputPolicyType values. + * + * @return known ThroughputPolicyType values. + */ + public static Collection values() { + return values(ThroughputPolicyType.class); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputPoolUpdate.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputPoolUpdate.java new file mode 100644 index 000000000000..95714c4d4a4e --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputPoolUpdate.java @@ -0,0 +1,132 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +// Code generated by Microsoft (R) TypeSpec Code Generator. + +package com.azure.resourcemanager.cosmos.models; + +import com.azure.core.annotation.Fluent; +import com.azure.json.JsonReader; +import com.azure.json.JsonSerializable; +import com.azure.json.JsonToken; +import com.azure.json.JsonWriter; +import com.azure.resourcemanager.cosmos.fluent.models.ThroughputPoolProperties; +import java.io.IOException; + +/** + * Represents a throughput pool resource for updates. + */ +@Fluent +public final class ThroughputPoolUpdate implements JsonSerializable { + /* + * Properties of the throughput pool. + */ + private ThroughputPoolProperties innerProperties; + + /** + * Creates an instance of ThroughputPoolUpdate class. + */ + public ThroughputPoolUpdate() { + } + + /** + * Get the innerProperties property: Properties of the throughput pool. + * + * @return the innerProperties value. + */ + private ThroughputPoolProperties innerProperties() { + return this.innerProperties; + } + + /** + * Get the provisioningState property: A provisioning state of the ThroughputPool. + * + * @return the provisioningState value. + */ + public Status provisioningState() { + return this.innerProperties() == null ? null : this.innerProperties().provisioningState(); + } + + /** + * Set the provisioningState property: A provisioning state of the ThroughputPool. + * + * @param provisioningState the provisioningState value to set. + * @return the ThroughputPoolUpdate object itself. + */ + public ThroughputPoolUpdate withProvisioningState(Status provisioningState) { + if (this.innerProperties() == null) { + this.innerProperties = new ThroughputPoolProperties(); + } + this.innerProperties().withProvisioningState(provisioningState); + return this; + } + + /** + * Get the maxThroughput property: Value for throughput to be shared among CosmosDB resources in the pool. + * + * @return the maxThroughput value. + */ + public Integer maxThroughput() { + return this.innerProperties() == null ? null : this.innerProperties().maxThroughput(); + } + + /** + * Set the maxThroughput property: Value for throughput to be shared among CosmosDB resources in the pool. + * + * @param maxThroughput the maxThroughput value to set. + * @return the ThroughputPoolUpdate object itself. + */ + public ThroughputPoolUpdate withMaxThroughput(Integer maxThroughput) { + if (this.innerProperties() == null) { + this.innerProperties = new ThroughputPoolProperties(); + } + this.innerProperties().withMaxThroughput(maxThroughput); + return this; + } + + /** + * Validates the instance. + * + * @throws IllegalArgumentException thrown if the instance is not valid. + */ + public void validate() { + if (innerProperties() != null) { + innerProperties().validate(); + } + } + + /** + * {@inheritDoc} + */ + @Override + public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { + jsonWriter.writeStartObject(); + jsonWriter.writeJsonField("properties", this.innerProperties); + return jsonWriter.writeEndObject(); + } + + /** + * Reads an instance of ThroughputPoolUpdate from the JsonReader. + * + * @param jsonReader The JsonReader being read. + * @return An instance of ThroughputPoolUpdate if the JsonReader was pointing to an instance of it, or null if it + * was pointing to JSON null. + * @throws IOException If an error occurs while reading the ThroughputPoolUpdate. + */ + public static ThroughputPoolUpdate fromJson(JsonReader jsonReader) throws IOException { + return jsonReader.readObject(reader -> { + ThroughputPoolUpdate deserializedThroughputPoolUpdate = new ThroughputPoolUpdate(); + while (reader.nextToken() != JsonToken.END_OBJECT) { + String fieldName = reader.getFieldName(); + reader.nextToken(); + + if ("properties".equals(fieldName)) { + deserializedThroughputPoolUpdate.innerProperties = ThroughputPoolProperties.fromJson(reader); + } else { + reader.skipChildren(); + } + } + + return deserializedThroughputPoolUpdate; + }); + } +} diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputSettingsGetPropertiesResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputSettingsGetPropertiesResource.java index b54cb0e1acea..0dcdcde8148b 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputSettingsGetPropertiesResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputSettingsGetPropertiesResource.java @@ -1,19 +1,20 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; -import com.azure.core.annotation.Fluent; +import com.azure.core.annotation.Immutable; import com.azure.json.JsonReader; import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.List; /** * The ThroughputSettingsGetPropertiesResource model. */ -@Fluent +@Immutable public final class ThroughputSettingsGetPropertiesResource extends ThroughputSettingsResource { /* * A system generated property. A unique identifier. @@ -53,7 +54,7 @@ public final class ThroughputSettingsGetPropertiesResource extends ThroughputSet /** * Creates an instance of ThroughputSettingsGetPropertiesResource class. */ - public ThroughputSettingsGetPropertiesResource() { + private ThroughputSettingsGetPropertiesResource() { } /** @@ -126,24 +127,6 @@ public String minimumThroughput() { return this.minimumThroughput; } - /** - * {@inheritDoc} - */ - @Override - public ThroughputSettingsGetPropertiesResource withThroughput(Integer throughput) { - super.withThroughput(throughput); - return this; - } - - /** - * {@inheritDoc} - */ - @Override - public ThroughputSettingsGetPropertiesResource withAutoscaleSettings(AutoscaleSettingsResource autoscaleSettings) { - super.withAutoscaleSettings(autoscaleSettings); - return this; - } - /** * Validates the instance. * @@ -154,6 +137,9 @@ public void validate() { if (autoscaleSettings() != null) { autoscaleSettings().validate(); } + if (throughputBuckets() != null) { + throughputBuckets().forEach(e -> e.validate()); + } } /** @@ -164,6 +150,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeNumberField("throughput", throughput()); jsonWriter.writeJsonField("autoscaleSettings", autoscaleSettings()); + jsonWriter.writeArrayField("throughputBuckets", throughputBuckets(), + (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -198,6 +186,10 @@ public static ThroughputSettingsGetPropertiesResource fromJson(JsonReader jsonRe } else if ("softAllowedMaximumThroughput".equals(fieldName)) { deserializedThroughputSettingsGetPropertiesResource.softAllowedMaximumThroughput = reader.getString(); + } else if ("throughputBuckets".equals(fieldName)) { + List throughputBuckets + = reader.readArray(reader1 -> ThroughputBucketResource.fromJson(reader1)); + deserializedThroughputSettingsGetPropertiesResource.withThroughputBuckets(throughputBuckets); } else if ("_rid".equals(fieldName)) { deserializedThroughputSettingsGetPropertiesResource.rid = reader.getString(); } else if ("_ts".equals(fieldName)) { diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputSettingsResource.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputSettingsResource.java index 8b0c79d60962..8dda4dd078ca 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputSettingsResource.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputSettingsResource.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -10,6 +10,7 @@ import com.azure.json.JsonToken; import com.azure.json.JsonWriter; import java.io.IOException; +import java.util.List; /** * Cosmos DB resource throughput object. Either throughput is required or autoscaleSettings is required, but not both. @@ -48,6 +49,11 @@ public class ThroughputSettingsResource implements JsonSerializable throughputBuckets; + /** * Creates an instance of ThroughputSettingsResource class. */ @@ -182,6 +188,26 @@ ThroughputSettingsResource withSoftAllowedMaximumThroughput(String softAllowedMa return this; } + /** + * Get the throughputBuckets property: Array of throughput bucket limits to be applied to the Cosmos DB container. + * + * @return the throughputBuckets value. + */ + public List throughputBuckets() { + return this.throughputBuckets; + } + + /** + * Set the throughputBuckets property: Array of throughput bucket limits to be applied to the Cosmos DB container. + * + * @param throughputBuckets the throughputBuckets value to set. + * @return the ThroughputSettingsResource object itself. + */ + public ThroughputSettingsResource withThroughputBuckets(List throughputBuckets) { + this.throughputBuckets = throughputBuckets; + return this; + } + /** * Validates the instance. * @@ -191,6 +217,9 @@ public void validate() { if (autoscaleSettings() != null) { autoscaleSettings().validate(); } + if (throughputBuckets() != null) { + throughputBuckets().forEach(e -> e.validate()); + } } /** @@ -201,6 +230,8 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeNumberField("throughput", this.throughput); jsonWriter.writeJsonField("autoscaleSettings", this.autoscaleSettings); + jsonWriter.writeArrayField("throughputBuckets", this.throughputBuckets, + (writer, element) -> writer.writeJson(element)); return jsonWriter.writeEndObject(); } @@ -232,6 +263,10 @@ public static ThroughputSettingsResource fromJson(JsonReader jsonReader) throws deserializedThroughputSettingsResource.instantMaximumThroughput = reader.getString(); } else if ("softAllowedMaximumThroughput".equals(fieldName)) { deserializedThroughputSettingsResource.softAllowedMaximumThroughput = reader.getString(); + } else if ("throughputBuckets".equals(fieldName)) { + List throughputBuckets + = reader.readArray(reader1 -> ThroughputBucketResource.fromJson(reader1)); + deserializedThroughputSettingsResource.throughputBuckets = throughputBuckets; } else { reader.skipChildren(); } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputSettingsUpdateParameters.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputSettingsUpdateParameters.java index 125ca21415f2..bf8608974269 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputSettingsUpdateParameters.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputSettingsUpdateParameters.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; @@ -24,17 +24,17 @@ public final class ThroughputSettingsUpdateParameters extends ArmResourcePropert private ThroughputSettingsUpdateProperties innerProperties = new ThroughputSettingsUpdateProperties(); /* - * The type of the resource. + * The type of Azure resource. */ private String type; /* - * The name of the resource. + * The name of the ARM resource. */ private String name; /* - * Fully qualified resource Id for the resource. + * The unique resource identifier of the ARM resource. */ private String id; @@ -54,7 +54,7 @@ private ThroughputSettingsUpdateProperties innerProperties() { } /** - * Get the type property: The type of the resource. + * Get the type property: The type of Azure resource. * * @return the type value. */ @@ -64,7 +64,7 @@ public String type() { } /** - * Get the name property: The name of the resource. + * Get the name property: The name of the ARM resource. * * @return the name value. */ @@ -74,7 +74,7 @@ public String name() { } /** - * Get the id property: Fully qualified resource Id for the resource. + * Get the id property: The unique resource identifier of the ARM resource. * * @return the id value. */ @@ -101,6 +101,15 @@ public ThroughputSettingsUpdateParameters withTags(Map tags) { return this; } + /** + * {@inheritDoc} + */ + @Override + public ThroughputSettingsUpdateParameters withIdentity(ManagedServiceIdentity identity) { + super.withIdentity(identity); + return this; + } + /** * Get the resource property: The standard JSON format of a resource throughput. * @@ -138,6 +147,9 @@ public void validate() { } else { innerProperties().validate(); } + if (identity() != null) { + identity().validate(); + } } private static final ClientLogger LOGGER = new ClientLogger(ThroughputSettingsUpdateParameters.class); @@ -150,6 +162,7 @@ public JsonWriter toJson(JsonWriter jsonWriter) throws IOException { jsonWriter.writeStartObject(); jsonWriter.writeStringField("location", location()); jsonWriter.writeMapField("tags", tags(), (writer, element) -> writer.writeString(element)); + jsonWriter.writeJsonField("identity", identity()); jsonWriter.writeJsonField("properties", this.innerProperties); return jsonWriter.writeEndObject(); } @@ -182,6 +195,9 @@ public static ThroughputSettingsUpdateParameters fromJson(JsonReader jsonReader) } else if ("tags".equals(fieldName)) { Map tags = reader.readMap(reader1 -> reader1.getString()); deserializedThroughputSettingsUpdateParameters.withTags(tags); + } else if ("identity".equals(fieldName)) { + deserializedThroughputSettingsUpdateParameters + .withIdentity(ManagedServiceIdentity.fromJson(reader)); } else if ("properties".equals(fieldName)) { deserializedThroughputSettingsUpdateParameters.innerProperties = ThroughputSettingsUpdateProperties.fromJson(reader); diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/TriggerOperation.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/TriggerOperation.java index 94fab826b80e..3f6852f6c4ad 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/TriggerOperation.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/TriggerOperation.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/TriggerType.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/TriggerType.java index 0fecf243192a..199103b81deb 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/TriggerType.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/TriggerType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Type.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Type.java index b10b5a4ac358..25ab53d86c30 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Type.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/Type.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/UniqueKey.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/UniqueKey.java index a0f2f80ea1c8..b1c21cd13b2f 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/UniqueKey.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/UniqueKey.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/UniqueKeyPolicy.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/UniqueKeyPolicy.java index 881e95106889..876bd22677c8 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/UniqueKeyPolicy.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/UniqueKeyPolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/UnitType.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/UnitType.java index 2087efe2e507..07f253a01714 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/UnitType.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/UnitType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/VectorDataType.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/VectorDataType.java index c541a0cd1aca..64b8a9237e11 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/VectorDataType.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/VectorDataType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/VectorEmbedding.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/VectorEmbedding.java index d8ae8df3a86d..a661376ec9d6 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/VectorEmbedding.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/VectorEmbedding.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/VectorEmbeddingPolicy.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/VectorEmbeddingPolicy.java index 0b6fef4e26e8..22f52e142812 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/VectorEmbeddingPolicy.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/VectorEmbeddingPolicy.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/VectorIndex.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/VectorIndex.java index 98c53abfe113..48a679382489 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/VectorIndex.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/VectorIndex.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/VectorIndexType.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/VectorIndexType.java index a085251e2fbb..b3f130249f30 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/VectorIndexType.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/VectorIndexType.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/VirtualNetworkRule.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/VirtualNetworkRule.java index 163425e867d2..2682bf5af37d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/VirtualNetworkRule.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/VirtualNetworkRule.java @@ -1,6 +1,6 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/package-info.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/package-info.java index e452609d364e..9e9630df5580 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/package-info.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/models/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the data models for CosmosDBManagementClient. - * Azure Cosmos DB Database Service Resource Provider REST API. + * Package containing the data models for DocumentDB. + * Azure Cosmos DB Throughput Pool REST API. */ package com.azure.resourcemanager.cosmos.models; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/package-info.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/package-info.java index 86a4e2fb72e4..2e0a03742f3d 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/package-info.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/com/azure/resourcemanager/cosmos/package-info.java @@ -1,9 +1,9 @@ // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. -// Code generated by Microsoft (R) AutoRest Code Generator. +// Code generated by Microsoft (R) TypeSpec Code Generator. /** - * Package containing the classes for CosmosDBManagementClient. - * Azure Cosmos DB Database Service Resource Provider REST API. + * Package containing the classes for DocumentDB. + * Azure Cosmos DB Throughput Pool REST API. */ package com.azure.resourcemanager.cosmos; diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/module-info.java b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/module-info.java index 62b7e7f6b9c5..aac2b3d0a1d7 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/module-info.java +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/java/module-info.java @@ -13,4 +13,5 @@ // open packages specifically for azure core opens com.azure.resourcemanager.cosmos.fluent.models to com.azure.core; opens com.azure.resourcemanager.cosmos.models to com.azure.core; + opens com.azure.resourcemanager.cosmos.implementation.models to com.azure.core; } diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/resources/META-INF/azure-resourcemanager-cosmos_metadata.json b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/resources/META-INF/azure-resourcemanager-cosmos_metadata.json new file mode 100644 index 000000000000..53abfdb0c0f5 --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/resources/META-INF/azure-resourcemanager-cosmos_metadata.json @@ -0,0 +1 @@ +{"flavor":"azure","apiVersions":{"Microsoft.DocumentDB":"2025-11-01-preview"},"generatedFiles":["src/main/java/com/azure/resourcemanager/cosmos/fluent/CassandraClustersClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/CassandraDataCentersClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/CassandraResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/ChaosFaultsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/CollectionPartitionRegionsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/CollectionPartitionsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/CollectionRegionsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/CollectionsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/CopyJobsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/CosmosDBManagementClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/DataTransferJobsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/DatabaseAccountRegionsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/DatabaseAccountsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/DatabasesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/FleetAnalyticsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/FleetsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/FleetspaceAccountsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/FleetspacesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/GarnetClustersClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/GraphResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/GremlinResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/LocationsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/MongoDBResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/MongoMIResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/NetworkSecurityPerimeterConfigurationsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/NotebookWorkspacesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/OperationsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/PartitionKeyRangeIdRegionsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/PartitionKeyRangeIdsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/PercentileSourceTargetsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/PercentileTargetsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/PercentilesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/PrivateEndpointConnectionsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/PrivateLinkResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableDatabaseAccountsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableGremlinDatabasesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableGremlinGraphsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableGremlinResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableMongodbCollectionsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableMongodbDatabasesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableMongodbResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableSqlContainersClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableSqlDatabasesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableSqlResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableTableResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/RestorableTablesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/ServicesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/SqlResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/TableResourcesClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolAccountsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolAccountsOperationsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/ThroughputPoolsOperationsClient.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/BackupInformationInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/BackupResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraClusterPublicStatusInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraKeyspaceCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraKeyspaceGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraKeyspaceGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraRoleAssignmentResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraRoleAssignmentResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraRoleDefinitionResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraRoleDefinitionResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraTableCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraTableGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraTableGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraViewCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraViewGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CassandraViewGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ChaosFaultProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ChaosFaultResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ClientEncryptionKeyCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ClientEncryptionKeyGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ClientEncryptionKeyGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ClusterResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CommandOutputInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CommandPublicResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/CopyJobGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DataCenterResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DataTransferJobGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DataTransferJobProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountListConnectionStringsResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountListKeysResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountListReadOnlyKeysResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/DatabaseAccountUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetAnalyticsProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetAnalyticsResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetspaceAccountProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetspaceAccountResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetspaceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/FleetspaceResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GarnetClusterResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GraphResourceCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GraphResourceGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GraphResourceGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinDatabaseCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinDatabaseGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinDatabaseGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinGraphCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinGraphGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinGraphGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinRoleAssignmentResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinRoleAssignmentResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinRoleDefinitionResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/GremlinRoleDefinitionResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/LocationGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MetricDefinitionInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MetricInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBCollectionCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBCollectionGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBCollectionGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBDatabaseCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBDatabaseGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoDBDatabaseGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoMIRoleAssignmentResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoMIRoleAssignmentResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoMIRoleDefinitionResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoMIRoleDefinitionResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoRoleDefinitionGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoRoleDefinitionResource.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoUserDefinitionGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/MongoUserDefinitionResource.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/NetworkSecurityPerimeterConfigurationInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/NotebookWorkspaceConnectionInfoResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/NotebookWorkspaceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/NotebookWorkspaceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/OperationInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PartitionMetricInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PartitionUsageInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PercentileMetricInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PhysicalPartitionStorageInfoCollectionInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PhysicalPartitionThroughputInfoResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PhysicalPartitionThroughputInfoResultProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PrivateEndpointConnectionInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PrivateEndpointConnectionProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PrivateLinkResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/PrivateLinkResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RedistributeThroughputProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableDatabaseAccountGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableDatabaseAccountProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinDatabaseGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinDatabaseProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinGraphGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinGraphProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableGremlinResourcesGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbCollectionGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbCollectionProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbDatabaseGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbDatabaseProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableMongodbResourcesGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlContainerGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlContainerProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlDatabaseGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlDatabaseProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableSqlResourcesGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableTableGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableTableProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RestorableTableResourcesGetResultInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/RetrieveThroughputProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ServiceResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlContainerCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlContainerGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlContainerGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlDatabaseCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlDatabaseGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlDatabaseGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlRoleAssignmentGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlRoleAssignmentResource.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlRoleDefinitionGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlRoleDefinitionResource.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlStoredProcedureCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlStoredProcedureGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlStoredProcedureGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlTriggerCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlTriggerGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlTriggerGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlUserDefinedFunctionCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlUserDefinedFunctionGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/SqlUserDefinedFunctionGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableRoleAssignmentResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableRoleAssignmentResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableRoleDefinitionResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/TableRoleDefinitionResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolAccountProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolAccountResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputPoolResourceInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputSettingsGetProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputSettingsGetResultsInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/ThroughputSettingsUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/UsageInner.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/models/package-info.java","src/main/java/com/azure/resourcemanager/cosmos/fluent/package-info.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/CassandraClustersClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/CassandraDataCentersClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/CassandraResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/ChaosFaultsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/CollectionPartitionRegionsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/CollectionPartitionsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/CollectionRegionsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/CollectionsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/CopyJobsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/CosmosDBManagementClientBuilder.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/CosmosDBManagementClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/DataTransferJobsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/DatabaseAccountRegionsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/DatabaseAccountsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/DatabasesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/FleetAnalyticsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/FleetsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/FleetspaceAccountsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/FleetspacesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/GarnetClustersClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/GraphResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/GremlinResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/LocationsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/MongoDBResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/MongoMIResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/NetworkSecurityPerimeterConfigurationsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/NotebookWorkspacesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/OperationsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/PartitionKeyRangeIdRegionsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/PartitionKeyRangeIdsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/PercentileSourceTargetsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/PercentileTargetsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/PercentilesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/PrivateEndpointConnectionsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/PrivateLinkResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableDatabaseAccountsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableGremlinDatabasesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableGremlinGraphsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableGremlinResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableMongodbCollectionsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableMongodbDatabasesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableMongodbResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableSqlContainersClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableSqlDatabasesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableSqlResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableTableResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/RestorableTablesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/ServicesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/SqlResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/TableResourcesClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolAccountsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolAccountsOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/ThroughputPoolsOperationsClientImpl.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraKeyspaceListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraRoleAssignmentListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraRoleDefinitionListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraTableListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CassandraViewListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ChaosFaultListResponse.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ClientEncryptionKeysListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/CopyJobFeedResults.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/DataTransferJobFeedResults.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/DatabaseAccountsListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/FleetAnalyticsListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/FleetListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/FleetspaceAccountListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/FleetspaceListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GraphResourcesListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GremlinDatabaseListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GremlinGraphListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GremlinRoleAssignmentListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/GremlinRoleDefinitionListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListBackups.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListClusters.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListCommands.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListDataCenters.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ListGarnetClusters.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/LocationListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MetricDefinitionsListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MetricListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoDBCollectionListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoDBDatabaseListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoMIRoleAssignmentListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoMIRoleDefinitionListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoRoleDefinitionListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/MongoUserDefinitionListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/NetworkSecurityPerimeterConfigurationListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/NotebookWorkspaceListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/OperationListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/PartitionMetricListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/PartitionUsagesResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/PercentileMetricListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/PrivateEndpointConnectionListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/PrivateLinkResourceListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableDatabaseAccountsListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableGremlinDatabasesListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableGremlinGraphsListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableGremlinResourcesListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableMongodbCollectionsListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableMongodbDatabasesListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableMongodbResourcesListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableSqlContainersListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableSqlDatabasesListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableSqlResourcesListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableTableResourcesListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/RestorableTablesListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ServiceResourceListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlContainerListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlDatabaseListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlRoleAssignmentListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlRoleDefinitionListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlStoredProcedureListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlTriggerListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/SqlUserDefinedFunctionListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/TableListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/TableRoleAssignmentListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/TableRoleDefinitionListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ThroughputPoolAccountsListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/ThroughputPoolsListResult.java","src/main/java/com/azure/resourcemanager/cosmos/implementation/models/UsagesResult.java","src/main/java/com/azure/resourcemanager/cosmos/models/AccessRule.java","src/main/java/com/azure/resourcemanager/cosmos/models/AccessRuleDirection.java","src/main/java/com/azure/resourcemanager/cosmos/models/AccessRuleProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/AccessRulePropertiesSubscription.java","src/main/java/com/azure/resourcemanager/cosmos/models/AccountKeyMetadata.java","src/main/java/com/azure/resourcemanager/cosmos/models/AllocationState.java","src/main/java/com/azure/resourcemanager/cosmos/models/AnalyticalStorageConfiguration.java","src/main/java/com/azure/resourcemanager/cosmos/models/AnalyticalStorageSchemaType.java","src/main/java/com/azure/resourcemanager/cosmos/models/ApiProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/ApiType.java","src/main/java/com/azure/resourcemanager/cosmos/models/ArmProxyResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/ArmResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/AuthenticationMethod.java","src/main/java/com/azure/resourcemanager/cosmos/models/AuthenticationMethodLdapProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/AutoReplicate.java","src/main/java/com/azure/resourcemanager/cosmos/models/AutoUpgradePolicyResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/AutoscaleSettings.java","src/main/java/com/azure/resourcemanager/cosmos/models/AutoscaleSettingsResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/AzureBlobContainer.java","src/main/java/com/azure/resourcemanager/cosmos/models/AzureBlobDataTransferDataSourceSink.java","src/main/java/com/azure/resourcemanager/cosmos/models/AzureBlobSourceSinkDetails.java","src/main/java/com/azure/resourcemanager/cosmos/models/AzureConnectionType.java","src/main/java/com/azure/resourcemanager/cosmos/models/BackupPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/BackupPolicyMigrationState.java","src/main/java/com/azure/resourcemanager/cosmos/models/BackupPolicyMigrationStatus.java","src/main/java/com/azure/resourcemanager/cosmos/models/BackupPolicyType.java","src/main/java/com/azure/resourcemanager/cosmos/models/BackupSchedule.java","src/main/java/com/azure/resourcemanager/cosmos/models/BackupState.java","src/main/java/com/azure/resourcemanager/cosmos/models/BackupStorageRedundancy.java","src/main/java/com/azure/resourcemanager/cosmos/models/BaseCopyJobProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/BaseCopyJobTask.java","src/main/java/com/azure/resourcemanager/cosmos/models/BlobToCassandraRUCopyJobProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/BlobToCassandraRUCopyJobTask.java","src/main/java/com/azure/resourcemanager/cosmos/models/Capability.java","src/main/java/com/azure/resourcemanager/cosmos/models/Capacity.java","src/main/java/com/azure/resourcemanager/cosmos/models/CapacityMode.java","src/main/java/com/azure/resourcemanager/cosmos/models/CapacityModeChangeTransitionState.java","src/main/java/com/azure/resourcemanager/cosmos/models/CapacityModeTransitionStatus.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraClusterPublicStatusDataCentersItem.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraClusterPublicStatusDataCentersItemNode.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraError.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraKeyspaceResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraPartitionKey.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToBlobCopyJobProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToBlobCopyJobTask.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToCassandraRUCopyJobProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraRUToCassandraRUCopyJobTask.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraSchema.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraTableResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/CassandraViewResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/Certificate.java","src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionIncludedPath.java","src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionKeyCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionKeyGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionKeyResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/ClientEncryptionPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/ClusterKey.java","src/main/java/com/azure/resourcemanager/cosmos/models/ClusterResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/ClusterType.java","src/main/java/com/azure/resourcemanager/cosmos/models/Column.java","src/main/java/com/azure/resourcemanager/cosmos/models/CommandAsyncPostBody.java","src/main/java/com/azure/resourcemanager/cosmos/models/CommandPostBody.java","src/main/java/com/azure/resourcemanager/cosmos/models/CommandStatus.java","src/main/java/com/azure/resourcemanager/cosmos/models/CompositePath.java","src/main/java/com/azure/resourcemanager/cosmos/models/CompositePathSortOrder.java","src/main/java/com/azure/resourcemanager/cosmos/models/ComputedProperty.java","src/main/java/com/azure/resourcemanager/cosmos/models/ConflictResolutionMode.java","src/main/java/com/azure/resourcemanager/cosmos/models/ConflictResolutionPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/ConnectionError.java","src/main/java/com/azure/resourcemanager/cosmos/models/ConnectionState.java","src/main/java/com/azure/resourcemanager/cosmos/models/ConnectorOffer.java","src/main/java/com/azure/resourcemanager/cosmos/models/ConsistencyPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/ContainerPartitionKey.java","src/main/java/com/azure/resourcemanager/cosmos/models/ContinuousBackupInformation.java","src/main/java/com/azure/resourcemanager/cosmos/models/ContinuousBackupRestoreLocation.java","src/main/java/com/azure/resourcemanager/cosmos/models/ContinuousModeBackupPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/ContinuousModeProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/ContinuousTier.java","src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobMode.java","src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobStatus.java","src/main/java/com/azure/resourcemanager/cosmos/models/CopyJobType.java","src/main/java/com/azure/resourcemanager/cosmos/models/CorsPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/CosmosCassandraDataTransferDataSourceSink.java","src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBCassandraTable.java","src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBMongoCollection.java","src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBMongoVCoreCollection.java","src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBNoSqlContainer.java","src/main/java/com/azure/resourcemanager/cosmos/models/CosmosDBSourceSinkDetails.java","src/main/java/com/azure/resourcemanager/cosmos/models/CosmosMongoDataTransferDataSourceSink.java","src/main/java/com/azure/resourcemanager/cosmos/models/CosmosMongoVCoreDataTransferDataSourceSink.java","src/main/java/com/azure/resourcemanager/cosmos/models/CosmosSqlDataTransferDataSourceSink.java","src/main/java/com/azure/resourcemanager/cosmos/models/CreateJobRequest.java","src/main/java/com/azure/resourcemanager/cosmos/models/CreateMode.java","src/main/java/com/azure/resourcemanager/cosmos/models/CreateUpdateOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/DataCenterResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/DataMaskingPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/DataMaskingPolicyExcludedPath.java","src/main/java/com/azure/resourcemanager/cosmos/models/DataMaskingPolicyIncludedPath.java","src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferComponent.java","src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferDataSourceSink.java","src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferJobMode.java","src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferRegionalServiceResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferServiceResourceCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/DataTransferServiceResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/DataType.java","src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountConnectionString.java","src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountKeysMetadata.java","src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountKind.java","src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountOfferType.java","src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountRegenerateKeyParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseAccountUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/DatabaseRestoreResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/DedicatedGatewayType.java","src/main/java/com/azure/resourcemanager/cosmos/models/DefaultConsistencyLevel.java","src/main/java/com/azure/resourcemanager/cosmos/models/DefaultPriorityLevel.java","src/main/java/com/azure/resourcemanager/cosmos/models/DiagnosticLogSettings.java","src/main/java/com/azure/resourcemanager/cosmos/models/DistanceFunction.java","src/main/java/com/azure/resourcemanager/cosmos/models/EnableFullTextQuery.java","src/main/java/com/azure/resourcemanager/cosmos/models/ExcludedPath.java","src/main/java/com/azure/resourcemanager/cosmos/models/FailoverPolicies.java","src/main/java/com/azure/resourcemanager/cosmos/models/FailoverPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/FleetAnalyticsPropertiesStorageLocationType.java","src/main/java/com/azure/resourcemanager/cosmos/models/FleetResourceUpdate.java","src/main/java/com/azure/resourcemanager/cosmos/models/FleetspaceAccountPropertiesGlobalDatabaseAccountProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/FleetspacePropertiesFleetspaceApiKind.java","src/main/java/com/azure/resourcemanager/cosmos/models/FleetspacePropertiesServiceTier.java","src/main/java/com/azure/resourcemanager/cosmos/models/FleetspacePropertiesThroughputPoolConfiguration.java","src/main/java/com/azure/resourcemanager/cosmos/models/FleetspaceUpdate.java","src/main/java/com/azure/resourcemanager/cosmos/models/FullTextIndexPath.java","src/main/java/com/azure/resourcemanager/cosmos/models/FullTextPath.java","src/main/java/com/azure/resourcemanager/cosmos/models/FullTextPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/GarnetCacheProvisioningState.java","src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterEndpoint.java","src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterResourcePatch.java","src/main/java/com/azure/resourcemanager/cosmos/models/GarnetClusterResourcePatchProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/GraphApiComputeRegionalServiceResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/GraphApiComputeServiceResourceCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/GraphApiComputeServiceResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/GraphResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/GraphResourceCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/GraphResourceGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/GraphResourceGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/GremlinDatabaseRestoreResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/GremlinGraphResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/IncludedPath.java","src/main/java/com/azure/resourcemanager/cosmos/models/IndexKind.java","src/main/java/com/azure/resourcemanager/cosmos/models/Indexes.java","src/main/java/com/azure/resourcemanager/cosmos/models/IndexingMode.java","src/main/java/com/azure/resourcemanager/cosmos/models/IndexingPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/IpAddressOrRange.java","src/main/java/com/azure/resourcemanager/cosmos/models/IssueType.java","src/main/java/com/azure/resourcemanager/cosmos/models/KeyKind.java","src/main/java/com/azure/resourcemanager/cosmos/models/KeyWrapMetadata.java","src/main/java/com/azure/resourcemanager/cosmos/models/Kind.java","src/main/java/com/azure/resourcemanager/cosmos/models/Location.java","src/main/java/com/azure/resourcemanager/cosmos/models/LocationProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/ManagedCassandraManagedServiceIdentity.java","src/main/java/com/azure/resourcemanager/cosmos/models/ManagedCassandraProvisioningState.java","src/main/java/com/azure/resourcemanager/cosmos/models/ManagedCassandraReaperStatus.java","src/main/java/com/azure/resourcemanager/cosmos/models/ManagedCassandraResourceIdentityType.java","src/main/java/com/azure/resourcemanager/cosmos/models/ManagedServiceIdentity.java","src/main/java/com/azure/resourcemanager/cosmos/models/ManagedServiceIdentityUserAssignedIdentities.java","src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewDefinition.java","src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewDetails.java","src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewsBuilderRegionalServiceResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewsBuilderServiceResourceCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewsBuilderServiceResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/MaterializedViewsProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/MergeParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/MetricAvailability.java","src/main/java/com/azure/resourcemanager/cosmos/models/MetricName.java","src/main/java/com/azure/resourcemanager/cosmos/models/MetricValue.java","src/main/java/com/azure/resourcemanager/cosmos/models/MinimalTlsVersion.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBCollectionResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoDBDatabaseResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoIndex.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoIndexKeys.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoIndexOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoRUCopyJobProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoRUCopyJobTask.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoVCoreCopyJobProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoRUToMongoVCoreCopyJobTask.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoRoleDefinitionCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoRoleDefinitionType.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoUserDefinitionCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/MongoVCoreSourceSinkDetails.java","src/main/java/com/azure/resourcemanager/cosmos/models/NetworkAclBypass.java","src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityPerimeter.java","src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityPerimeterConfigurationProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityPerimeterConfigurationProvisioningState.java","src/main/java/com/azure/resourcemanager/cosmos/models/NetworkSecurityProfile.java","src/main/java/com/azure/resourcemanager/cosmos/models/NoSqlRUToNoSqlRUCopyJobProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/NoSqlRUToNoSqlRUCopyJobTask.java","src/main/java/com/azure/resourcemanager/cosmos/models/NodeState.java","src/main/java/com/azure/resourcemanager/cosmos/models/NotebookWorkspaceCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/NotebookWorkspaceName.java","src/main/java/com/azure/resourcemanager/cosmos/models/OperationDisplay.java","src/main/java/com/azure/resourcemanager/cosmos/models/OperationType.java","src/main/java/com/azure/resourcemanager/cosmos/models/OptionsResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/PartitionKind.java","src/main/java/com/azure/resourcemanager/cosmos/models/PercentileMetricValue.java","src/main/java/com/azure/resourcemanager/cosmos/models/PeriodicModeBackupPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/PeriodicModeProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/Permission.java","src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionId.java","src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionStorageInfo.java","src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionThroughputInfoProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionThroughputInfoResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/PhysicalPartitionThroughputInfoResultPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/PrimaryAggregationType.java","src/main/java/com/azure/resourcemanager/cosmos/models/PrivateEndpointProperty.java","src/main/java/com/azure/resourcemanager/cosmos/models/PrivateLinkServiceConnectionStateProperty.java","src/main/java/com/azure/resourcemanager/cosmos/models/Privilege.java","src/main/java/com/azure/resourcemanager/cosmos/models/PrivilegeResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/ProvisioningIssue.java","src/main/java/com/azure/resourcemanager/cosmos/models/ProvisioningIssueProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/PublicNetworkAccess.java","src/main/java/com/azure/resourcemanager/cosmos/models/RedistributeThroughputParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/RedistributeThroughputPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/RegionForOnlineOffline.java","src/main/java/com/azure/resourcemanager/cosmos/models/RegionalServiceResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/ResourceAssociation.java","src/main/java/com/azure/resourcemanager/cosmos/models/ResourceAssociationAccessMode.java","src/main/java/com/azure/resourcemanager/cosmos/models/ResourceIdentityType.java","src/main/java/com/azure/resourcemanager/cosmos/models/ResourceRestoreParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestorableGremlinDatabasePropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestorableGremlinGraphPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestorableLocationResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestorableMongodbCollectionPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestorableMongodbDatabasePropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlContainerPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlContainerPropertiesResourceContainer.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlDatabasePropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestorableSqlDatabasePropertiesResourceDatabase.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestorableTablePropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestoreMode.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestoreParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/RestoreParametersBase.java","src/main/java/com/azure/resourcemanager/cosmos/models/RetrieveThroughputParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/RetrieveThroughputPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/Role.java","src/main/java/com/azure/resourcemanager/cosmos/models/RoleDefinitionType.java","src/main/java/com/azure/resourcemanager/cosmos/models/ScheduledEventStrategy.java","src/main/java/com/azure/resourcemanager/cosmos/models/SeedNode.java","src/main/java/com/azure/resourcemanager/cosmos/models/ServerVersion.java","src/main/java/com/azure/resourcemanager/cosmos/models/ServiceResourceCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/ServiceResourceCreateUpdateProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/ServiceResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/ServiceSize.java","src/main/java/com/azure/resourcemanager/cosmos/models/ServiceStatus.java","src/main/java/com/azure/resourcemanager/cosmos/models/ServiceType.java","src/main/java/com/azure/resourcemanager/cosmos/models/Severity.java","src/main/java/com/azure/resourcemanager/cosmos/models/SpatialSpec.java","src/main/java/com/azure/resourcemanager/cosmos/models/SpatialType.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlContainerResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlDatabaseResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlDedicatedGatewayRegionalServiceResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlDedicatedGatewayServiceResourceCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlDedicatedGatewayServiceResourceProperties.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlRoleAssignmentCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlRoleDefinitionCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlStoredProcedureCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlStoredProcedureGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlStoredProcedureResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlTriggerCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlTriggerGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlTriggerResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlUserDefinedFunctionCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlUserDefinedFunctionGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/SqlUserDefinedFunctionResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/Status.java","src/main/java/com/azure/resourcemanager/cosmos/models/SupportedActions.java","src/main/java/com/azure/resourcemanager/cosmos/models/TableCreateUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/TableGetPropertiesOptions.java","src/main/java/com/azure/resourcemanager/cosmos/models/TableGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/TableResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputBucketResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputPolicyResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputPolicyType.java","src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputPoolUpdate.java","src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputSettingsGetPropertiesResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputSettingsResource.java","src/main/java/com/azure/resourcemanager/cosmos/models/ThroughputSettingsUpdateParameters.java","src/main/java/com/azure/resourcemanager/cosmos/models/TriggerOperation.java","src/main/java/com/azure/resourcemanager/cosmos/models/TriggerType.java","src/main/java/com/azure/resourcemanager/cosmos/models/Type.java","src/main/java/com/azure/resourcemanager/cosmos/models/UniqueKey.java","src/main/java/com/azure/resourcemanager/cosmos/models/UniqueKeyPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/UnitType.java","src/main/java/com/azure/resourcemanager/cosmos/models/VectorDataType.java","src/main/java/com/azure/resourcemanager/cosmos/models/VectorEmbedding.java","src/main/java/com/azure/resourcemanager/cosmos/models/VectorEmbeddingPolicy.java","src/main/java/com/azure/resourcemanager/cosmos/models/VectorIndex.java","src/main/java/com/azure/resourcemanager/cosmos/models/VectorIndexType.java","src/main/java/com/azure/resourcemanager/cosmos/models/VirtualNetworkRule.java","src/main/java/com/azure/resourcemanager/cosmos/models/package-info.java","src/main/java/com/azure/resourcemanager/cosmos/package-info.java"]} \ No newline at end of file diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cosmos/proxy-config.json b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cosmos/proxy-config.json index e6eac6e2d46f..36d31c1da7c9 100644 --- a/sdk/cosmos/azure-resourcemanager-cosmos/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cosmos/proxy-config.json +++ b/sdk/cosmos/azure-resourcemanager-cosmos/src/main/resources/META-INF/native-image/com.azure.resourcemanager/azure-resourcemanager-cosmos/proxy-config.json @@ -1 +1 @@ -[["com.azure.resourcemanager.cosmos.implementation.CassandraClustersClientImpl$CassandraClustersService"],["com.azure.resourcemanager.cosmos.implementation.CassandraDataCentersClientImpl$CassandraDataCentersService"],["com.azure.resourcemanager.cosmos.implementation.CassandraResourcesClientImpl$CassandraResourcesService"],["com.azure.resourcemanager.cosmos.implementation.CollectionPartitionRegionsClientImpl$CollectionPartitionRegionsService"],["com.azure.resourcemanager.cosmos.implementation.CollectionPartitionsClientImpl$CollectionPartitionsService"],["com.azure.resourcemanager.cosmos.implementation.CollectionRegionsClientImpl$CollectionRegionsService"],["com.azure.resourcemanager.cosmos.implementation.CollectionsClientImpl$CollectionsService"],["com.azure.resourcemanager.cosmos.implementation.DatabaseAccountRegionsClientImpl$DatabaseAccountRegionsService"],["com.azure.resourcemanager.cosmos.implementation.DatabaseAccountsClientImpl$DatabaseAccountsService"],["com.azure.resourcemanager.cosmos.implementation.DatabasesClientImpl$DatabasesService"],["com.azure.resourcemanager.cosmos.implementation.FleetsClientImpl$FleetsService"],["com.azure.resourcemanager.cosmos.implementation.FleetspaceAccountsClientImpl$FleetspaceAccountsService"],["com.azure.resourcemanager.cosmos.implementation.FleetspacesClientImpl$FleetspacesService"],["com.azure.resourcemanager.cosmos.implementation.GremlinResourcesClientImpl$GremlinResourcesService"],["com.azure.resourcemanager.cosmos.implementation.LocationsClientImpl$LocationsService"],["com.azure.resourcemanager.cosmos.implementation.MongoDBResourcesClientImpl$MongoDBResourcesService"],["com.azure.resourcemanager.cosmos.implementation.NotebookWorkspacesClientImpl$NotebookWorkspacesService"],["com.azure.resourcemanager.cosmos.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.cosmos.implementation.PartitionKeyRangeIdRegionsClientImpl$PartitionKeyRangeIdRegionsService"],["com.azure.resourcemanager.cosmos.implementation.PartitionKeyRangeIdsClientImpl$PartitionKeyRangeIdsService"],["com.azure.resourcemanager.cosmos.implementation.PercentileSourceTargetsClientImpl$PercentileSourceTargetsService"],["com.azure.resourcemanager.cosmos.implementation.PercentileTargetsClientImpl$PercentileTargetsService"],["com.azure.resourcemanager.cosmos.implementation.PercentilesClientImpl$PercentilesService"],["com.azure.resourcemanager.cosmos.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.cosmos.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableDatabaseAccountsClientImpl$RestorableDatabaseAccountsService"],["com.azure.resourcemanager.cosmos.implementation.RestorableGremlinDatabasesClientImpl$RestorableGremlinDatabasesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableGremlinGraphsClientImpl$RestorableGremlinGraphsService"],["com.azure.resourcemanager.cosmos.implementation.RestorableGremlinResourcesClientImpl$RestorableGremlinResourcesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableMongodbCollectionsClientImpl$RestorableMongodbCollectionsService"],["com.azure.resourcemanager.cosmos.implementation.RestorableMongodbDatabasesClientImpl$RestorableMongodbDatabasesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableMongodbResourcesClientImpl$RestorableMongodbResourcesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableSqlContainersClientImpl$RestorableSqlContainersService"],["com.azure.resourcemanager.cosmos.implementation.RestorableSqlDatabasesClientImpl$RestorableSqlDatabasesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableSqlResourcesClientImpl$RestorableSqlResourcesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableTableResourcesClientImpl$RestorableTableResourcesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableTablesClientImpl$RestorableTablesService"],["com.azure.resourcemanager.cosmos.implementation.ServicesClientImpl$ServicesService"],["com.azure.resourcemanager.cosmos.implementation.SqlResourcesClientImpl$SqlResourcesService"],["com.azure.resourcemanager.cosmos.implementation.TableResourcesClientImpl$TableResourcesService"]] \ No newline at end of file +[["com.azure.resourcemanager.cosmos.implementation.CassandraClustersClientImpl$CassandraClustersService"],["com.azure.resourcemanager.cosmos.implementation.CassandraDataCentersClientImpl$CassandraDataCentersService"],["com.azure.resourcemanager.cosmos.implementation.CassandraResourcesClientImpl$CassandraResourcesService"],["com.azure.resourcemanager.cosmos.implementation.ChaosFaultsClientImpl$ChaosFaultsService"],["com.azure.resourcemanager.cosmos.implementation.CollectionPartitionRegionsClientImpl$CollectionPartitionRegionsService"],["com.azure.resourcemanager.cosmos.implementation.CollectionPartitionsClientImpl$CollectionPartitionsService"],["com.azure.resourcemanager.cosmos.implementation.CollectionRegionsClientImpl$CollectionRegionsService"],["com.azure.resourcemanager.cosmos.implementation.CollectionsClientImpl$CollectionsService"],["com.azure.resourcemanager.cosmos.implementation.CopyJobsClientImpl$CopyJobsService"],["com.azure.resourcemanager.cosmos.implementation.DataTransferJobsClientImpl$DataTransferJobsService"],["com.azure.resourcemanager.cosmos.implementation.DatabaseAccountRegionsClientImpl$DatabaseAccountRegionsService"],["com.azure.resourcemanager.cosmos.implementation.DatabaseAccountsClientImpl$DatabaseAccountsService"],["com.azure.resourcemanager.cosmos.implementation.DatabasesClientImpl$DatabasesService"],["com.azure.resourcemanager.cosmos.implementation.FleetAnalyticsClientImpl$FleetAnalyticsService"],["com.azure.resourcemanager.cosmos.implementation.FleetsClientImpl$FleetsService"],["com.azure.resourcemanager.cosmos.implementation.FleetspaceAccountsClientImpl$FleetspaceAccountsService"],["com.azure.resourcemanager.cosmos.implementation.FleetspacesClientImpl$FleetspacesService"],["com.azure.resourcemanager.cosmos.implementation.GarnetClustersClientImpl$GarnetClustersService"],["com.azure.resourcemanager.cosmos.implementation.GraphResourcesClientImpl$GraphResourcesService"],["com.azure.resourcemanager.cosmos.implementation.GremlinResourcesClientImpl$GremlinResourcesService"],["com.azure.resourcemanager.cosmos.implementation.LocationsClientImpl$LocationsService"],["com.azure.resourcemanager.cosmos.implementation.MongoDBResourcesClientImpl$MongoDBResourcesService"],["com.azure.resourcemanager.cosmos.implementation.MongoMIResourcesClientImpl$MongoMIResourcesService"],["com.azure.resourcemanager.cosmos.implementation.NetworkSecurityPerimeterConfigurationsClientImpl$NetworkSecurityPerimeterConfigurationsService"],["com.azure.resourcemanager.cosmos.implementation.NotebookWorkspacesClientImpl$NotebookWorkspacesService"],["com.azure.resourcemanager.cosmos.implementation.OperationsClientImpl$OperationsService"],["com.azure.resourcemanager.cosmos.implementation.PartitionKeyRangeIdRegionsClientImpl$PartitionKeyRangeIdRegionsService"],["com.azure.resourcemanager.cosmos.implementation.PartitionKeyRangeIdsClientImpl$PartitionKeyRangeIdsService"],["com.azure.resourcemanager.cosmos.implementation.PercentileSourceTargetsClientImpl$PercentileSourceTargetsService"],["com.azure.resourcemanager.cosmos.implementation.PercentileTargetsClientImpl$PercentileTargetsService"],["com.azure.resourcemanager.cosmos.implementation.PercentilesClientImpl$PercentilesService"],["com.azure.resourcemanager.cosmos.implementation.PrivateEndpointConnectionsClientImpl$PrivateEndpointConnectionsService"],["com.azure.resourcemanager.cosmos.implementation.PrivateLinkResourcesClientImpl$PrivateLinkResourcesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableDatabaseAccountsClientImpl$RestorableDatabaseAccountsService"],["com.azure.resourcemanager.cosmos.implementation.RestorableGremlinDatabasesClientImpl$RestorableGremlinDatabasesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableGremlinGraphsClientImpl$RestorableGremlinGraphsService"],["com.azure.resourcemanager.cosmos.implementation.RestorableGremlinResourcesClientImpl$RestorableGremlinResourcesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableMongodbCollectionsClientImpl$RestorableMongodbCollectionsService"],["com.azure.resourcemanager.cosmos.implementation.RestorableMongodbDatabasesClientImpl$RestorableMongodbDatabasesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableMongodbResourcesClientImpl$RestorableMongodbResourcesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableSqlContainersClientImpl$RestorableSqlContainersService"],["com.azure.resourcemanager.cosmos.implementation.RestorableSqlDatabasesClientImpl$RestorableSqlDatabasesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableSqlResourcesClientImpl$RestorableSqlResourcesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableTableResourcesClientImpl$RestorableTableResourcesService"],["com.azure.resourcemanager.cosmos.implementation.RestorableTablesClientImpl$RestorableTablesService"],["com.azure.resourcemanager.cosmos.implementation.ServicesClientImpl$ServicesService"],["com.azure.resourcemanager.cosmos.implementation.SqlResourcesClientImpl$SqlResourcesService"],["com.azure.resourcemanager.cosmos.implementation.TableResourcesClientImpl$TableResourcesService"],["com.azure.resourcemanager.cosmos.implementation.ThroughputPoolAccountsClientImpl$ThroughputPoolAccountsService"],["com.azure.resourcemanager.cosmos.implementation.ThroughputPoolAccountsOperationsClientImpl$ThroughputPoolAccountsOperationsService"],["com.azure.resourcemanager.cosmos.implementation.ThroughputPoolsClientImpl$ThroughputPoolsService"],["com.azure.resourcemanager.cosmos.implementation.ThroughputPoolsOperationsClientImpl$ThroughputPoolsOperationsService"]] \ No newline at end of file diff --git a/sdk/cosmos/azure-resourcemanager-cosmos/tsp-location.yaml b/sdk/cosmos/azure-resourcemanager-cosmos/tsp-location.yaml new file mode 100644 index 000000000000..1d89b1a068ab --- /dev/null +++ b/sdk/cosmos/azure-resourcemanager-cosmos/tsp-location.yaml @@ -0,0 +1,4 @@ +directory: specification/cosmos-db/CosmosDB.Management +commit: 5f2c8fbb205beb833f70e26595da526921025927 +repo: Azure/azure-rest-api-specs +additionalDirectories: diff --git a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersDeallocateSamples.java b/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersDeallocateSamples.java deleted file mode 100644 index c43cca66d3c5..000000000000 --- a/sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/cosmos/generated/CassandraClustersDeallocateSamples.java +++ /dev/null @@ -1,28 +0,0 @@ -// 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.generated; - -/** - * Samples for CassandraClusters Deallocate. - */ -public final class CassandraClustersDeallocateSamples { - /* - * x-ms-original-file: - * specification/cosmos-db/resource-manager/Microsoft.DocumentDB/DocumentDB/stable/2025-10-15/examples/ - * CosmosDBManagedCassandraClusterDeallocate.json - */ - /** - * Sample code: CosmosDBManagedCassandraClusterDeallocate. - * - * @param azure The entry point for accessing resource management APIs in Azure. - */ - public static void cosmosDBManagedCassandraClusterDeallocate(com.azure.resourcemanager.AzureResourceManager azure) { - azure.cosmosDBAccounts() - .manager() - .serviceClient() - .getCassandraClusters() - .deallocate("cassandra-prod-rg", "cassandra-prod", com.azure.core.util.Context.NONE); - } -}