diff --git a/eng/common/pipelines/templates/steps/set-default-branch.yml b/eng/common/pipelines/templates/steps/set-default-branch.yml
index e3eed4512d97..491edaa8b68d 100644
--- a/eng/common/pipelines/templates/steps/set-default-branch.yml
+++ b/eng/common/pipelines/templates/steps/set-default-branch.yml
@@ -5,8 +5,8 @@ steps:
- pwsh: |
$setDefaultBranch = (git remote show ${{ parameters.RemoteRepo }} | Out-String) -replace "(?ms).*HEAD branch: (\w+).*", '$1'
if ($LASTEXITCODE -ne 0) {
- Write-Host "Not able to fetch the default branch from git command. Set to master."
- $setDefaultBranch = 'master'
+ Write-Host "Not able to fetch the default branch from git command. Set to main."
+ $setDefaultBranch = 'main'
}
Write-Host "Setting DefaultBranch=$setDefaultBranch"
Write-Host "##vso[task.setvariable variable=DefaultBranch]$setDefaultBranch"
diff --git a/eng/common/scripts/update-docs-metadata.ps1 b/eng/common/scripts/update-docs-metadata.ps1
index fc16fea9e552..6154afd51591 100644
--- a/eng/common/scripts/update-docs-metadata.ps1
+++ b/eng/common/scripts/update-docs-metadata.ps1
@@ -24,7 +24,7 @@ param (
. (Join-Path $PSScriptRoot common.ps1)
-$releaseReplaceRegex = "(https://github.com/$RepoId/(?:blob|tree)/)master"
+$releaseReplaceRegex = "(https://github.com/$RepoId/(?:blob|tree)/)main"
function GetMetaData {
if (Test-Path Variable:MetadataUri) {
diff --git a/eng/mgmt/mgmtmetadata/cosmos-db_resource-manager.txt b/eng/mgmt/mgmtmetadata/cosmos-db_resource-manager.txt
index a169c744260d..10e8f7e4e681 100644
--- a/eng/mgmt/mgmtmetadata/cosmos-db_resource-manager.txt
+++ b/eng/mgmt/mgmtmetadata/cosmos-db_resource-manager.txt
@@ -3,12 +3,13 @@ AutoRest installed successfully.
Commencing code generation
Generating CSharp code
Executing AutoRest command
-cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cosmos-db/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=D:\azure-sdk-for-net\sdk
-2021-04-27 17:09:09 UTC
+cmd.exe /c autorest.cmd https://github.com/Azure/azure-rest-api-specs/blob/master/specification/cosmos-db/resource-manager/readme.md --csharp --version=v2 --reflect-api-versions --csharp-sdks-folder=E:\azure-sdk-for-net\sdk
+Autorest CSharp Version: 2.3.82
+2021-06-15 23:57:32 UTC
Azure-rest-api-specs repository information
GitHub fork: Azure
Branch: master
-Commit: c1f66424b3b3636ec4cdb6c911dc75ca9abbe146
+Commit: b392b4e5d04c73acde2c02ed034247ac55b8892f
AutoRest information
Requested version: v2
-Bootstrapper version: autorest@3.1.4
+Bootstrapper version: autorest@2.0.4413
diff --git a/eng/pipelines/aggregate-reports.yml b/eng/pipelines/aggregate-reports.yml
index 4746a51e1f03..943fe6353be9 100644
--- a/eng/pipelines/aggregate-reports.yml
+++ b/eng/pipelines/aggregate-reports.yml
@@ -3,7 +3,7 @@ resources:
- pipeline: net-core
project: internal
source: net - core
- branch: master
+ branch: main
tags:
- scheduled
@@ -13,6 +13,7 @@ pr:
branches:
include:
- master
+ - main
paths:
include:
- eng/pipelines/aggregate-reports.yml
diff --git a/eng/pipelines/mgmt.yml b/eng/pipelines/mgmt.yml
index 6419664f1345..42628c1d2a99 100644
--- a/eng/pipelines/mgmt.yml
+++ b/eng/pipelines/mgmt.yml
@@ -3,6 +3,7 @@ pr:
branches:
include:
- master
+ - main
- '*-preview'
- 'feature/cplat*'
paths:
diff --git a/eng/pipelines/templates/jobs/ci.yml b/eng/pipelines/templates/jobs/ci.yml
index cf92d54bd4cc..678e5851e6ce 100644
--- a/eng/pipelines/templates/jobs/ci.yml
+++ b/eng/pipelines/templates/jobs/ci.yml
@@ -48,10 +48,11 @@ jobs:
PackageName: "Azure.Template"
ServiceDirectory: "template"
TestPipeline: ${{ parameters.TestPipeline }}
+ - template: /eng/common/pipelines/templates/steps/set-default-branch.yml
- pwsh: |
echo "##vso[build.addbuildtag]Scheduled"
displayName: "Tag scheduled builds"
- condition: and(eq(variables['Build.SourceBranchName'],'master'),eq(variables['Build.Reason'],'Schedule'))
+ condition: and(eq(variables['Build.SourceBranchName'],variables['DefaultBranch']),eq(variables['Build.Reason'],'Schedule'))
- template: /eng/common/pipelines/templates/steps/daily-dev-build-variable.yml
parameters:
ServiceDirectory: ${{ parameters.ServiceDirectory }}
diff --git a/eng/scripts/Update-Mgmt-Yml.ps1 b/eng/scripts/Update-Mgmt-Yml.ps1
index d6fcf3d81ed0..e4503df207e5 100644
--- a/eng/scripts/Update-Mgmt-Yml.ps1
+++ b/eng/scripts/Update-Mgmt-Yml.ps1
@@ -57,6 +57,7 @@ foreach ($Item in $MgmtDirs) {
# Ci and Pr section
$PrIncludes.Add('master')
+$PrIncludes.Add('main')
$PrIncludes.Add('*-preview')
$PrBranches.Add("include", $PrIncludes)
$PrPaths.Add("include", $Includes)
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/AzSdk.RP.props b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/AzSdk.RP.props
index 0c984b8893f1..c479893ed2ab 100644
--- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/AzSdk.RP.props
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/AzSdk.RP.props
@@ -1,7 +1,7 @@
- CosmosDB_2021-04-15
+ CosmosDB_2021-06-15
$(PackageTags);$(CommonTags);$(AzureApiTag);
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CassandraResourcesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CassandraResourcesOperations.cs
index 3f02a6250fe7..ae3d1c82d4e3 100644
--- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CassandraResourcesOperations.cs
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CassandraResourcesOperations.cs
@@ -108,10 +108,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -352,10 +348,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -655,10 +647,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -986,10 +974,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -1239,10 +1223,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -1557,10 +1537,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -1905,10 +1881,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -2166,10 +2138,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -2401,10 +2369,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -2666,10 +2630,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -2916,10 +2876,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -3171,10 +3127,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -3441,10 +3393,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -3685,10 +3633,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -3959,10 +3903,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -4218,10 +4158,6 @@ internal CassandraResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionOperations.cs
index 9895b247cbbb..034262f0468e 100644
--- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionOperations.cs
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionOperations.cs
@@ -120,10 +120,6 @@ internal CollectionOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -392,10 +388,6 @@ internal CollectionOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -655,10 +647,6 @@ internal CollectionOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionPartitionOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionPartitionOperations.cs
index 19e56cbd3001..6e2217dd5eae 100644
--- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionPartitionOperations.cs
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionPartitionOperations.cs
@@ -120,10 +120,6 @@ internal CollectionPartitionOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -393,10 +389,6 @@ internal CollectionPartitionOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionPartitionRegionOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionPartitionRegionOperations.cs
index 920539d777ec..0dbae254a8ec 100644
--- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionPartitionRegionOperations.cs
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionPartitionRegionOperations.cs
@@ -123,10 +123,6 @@ internal CollectionPartitionRegionOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionRegionOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionRegionOperations.cs
index 02ff8134dfe1..99bfdd323a00 100644
--- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionRegionOperations.cs
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CollectionRegionOperations.cs
@@ -123,10 +123,6 @@ internal CollectionRegionOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CosmosDBManagementClient.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CosmosDBManagementClient.cs
index 25b7694ddf45..22336683cb88 100644
--- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CosmosDBManagementClient.cs
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CosmosDBManagementClient.cs
@@ -166,15 +166,50 @@ public partial class CosmosDBManagementClient : ServiceClient
public virtual INotebookWorkspacesOperations NotebookWorkspaces { get; private set; }
+ ///
+ /// Gets the IPrivateEndpointConnectionsOperations.
+ ///
+ public virtual IPrivateEndpointConnectionsOperations PrivateEndpointConnections { get; private set; }
+
///
/// Gets the IPrivateLinkResourcesOperations.
///
public virtual IPrivateLinkResourcesOperations PrivateLinkResources { get; private set; }
///
- /// Gets the IPrivateEndpointConnectionsOperations.
+ /// Gets the IRestorableDatabaseAccountsOperations.
///
- public virtual IPrivateEndpointConnectionsOperations PrivateEndpointConnections { get; private set; }
+ public virtual IRestorableDatabaseAccountsOperations RestorableDatabaseAccounts { get; private set; }
+
+ ///
+ /// Gets the IRestorableSqlDatabasesOperations.
+ ///
+ public virtual IRestorableSqlDatabasesOperations RestorableSqlDatabases { get; private set; }
+
+ ///
+ /// Gets the IRestorableSqlContainersOperations.
+ ///
+ public virtual IRestorableSqlContainersOperations RestorableSqlContainers { get; private set; }
+
+ ///
+ /// Gets the IRestorableSqlResourcesOperations.
+ ///
+ public virtual IRestorableSqlResourcesOperations RestorableSqlResources { get; private set; }
+
+ ///
+ /// Gets the IRestorableMongodbDatabasesOperations.
+ ///
+ public virtual IRestorableMongodbDatabasesOperations RestorableMongodbDatabases { get; private set; }
+
+ ///
+ /// Gets the IRestorableMongodbCollectionsOperations.
+ ///
+ public virtual IRestorableMongodbCollectionsOperations RestorableMongodbCollections { get; private set; }
+
+ ///
+ /// Gets the IRestorableMongodbResourcesOperations.
+ ///
+ public virtual IRestorableMongodbResourcesOperations RestorableMongodbResources { get; private set; }
///
/// Initializes a new instance of the CosmosDBManagementClient class.
@@ -436,10 +471,17 @@ private void Initialize()
CassandraResources = new CassandraResourcesOperations(this);
GremlinResources = new GremlinResourcesOperations(this);
NotebookWorkspaces = new NotebookWorkspacesOperations(this);
- PrivateLinkResources = new PrivateLinkResourcesOperations(this);
PrivateEndpointConnections = new PrivateEndpointConnectionsOperations(this);
+ PrivateLinkResources = new PrivateLinkResourcesOperations(this);
+ RestorableDatabaseAccounts = new RestorableDatabaseAccountsOperations(this);
+ RestorableSqlDatabases = new RestorableSqlDatabasesOperations(this);
+ RestorableSqlContainers = new RestorableSqlContainersOperations(this);
+ RestorableSqlResources = new RestorableSqlResourcesOperations(this);
+ RestorableMongodbDatabases = new RestorableMongodbDatabasesOperations(this);
+ RestorableMongodbCollections = new RestorableMongodbCollectionsOperations(this);
+ RestorableMongodbResources = new RestorableMongodbResourcesOperations(this);
BaseUri = new System.Uri("https://management.azure.com");
- ApiVersion = "2021-04-15";
+ ApiVersion = "2021-06-15";
AcceptLanguage = "en-US";
LongRunningOperationRetryTimeout = 30;
GenerateClientRequestId = true;
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseAccountRegionOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseAccountRegionOperations.cs
index 49d1bc40cb2c..17f4943dcb72 100644
--- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseAccountRegionOperations.cs
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseAccountRegionOperations.cs
@@ -117,10 +117,6 @@ internal DatabaseAccountRegionOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseAccountsOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseAccountsOperations.cs
index 22bfa79fb675..07a55df535a2 100644
--- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseAccountsOperations.cs
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseAccountsOperations.cs
@@ -107,10 +107,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -629,10 +625,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (Client.ApiVersion == null)
{
@@ -859,10 +851,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -1100,10 +1088,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -1393,10 +1377,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -1634,10 +1614,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -2093,10 +2069,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -2347,10 +2319,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -2592,10 +2560,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -2835,10 +2799,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -3090,10 +3050,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -3342,10 +3298,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -3568,10 +3520,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -3806,10 +3754,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -4039,10 +3983,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -4272,10 +4212,6 @@ internal DatabaseAccountsOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseOperations.cs
index 9355f5c552ba..541d6775a12d 100644
--- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseOperations.cs
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/DatabaseOperations.cs
@@ -117,10 +117,6 @@ internal DatabaseOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -380,10 +376,6 @@ internal DatabaseOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -634,10 +626,6 @@ internal DatabaseOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/GremlinResourcesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/GremlinResourcesOperations.cs
index fd62ef24aac7..d18fa497c4a8 100644
--- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/GremlinResourcesOperations.cs
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/GremlinResourcesOperations.cs
@@ -108,10 +108,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -352,10 +348,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -655,10 +647,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -985,10 +973,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -1237,10 +1221,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -1555,10 +1535,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -1903,10 +1879,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -2164,10 +2136,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -2399,10 +2367,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -2664,10 +2628,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -2914,10 +2874,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -3169,10 +3125,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -3439,10 +3391,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -3683,10 +3631,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -3957,10 +3901,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -4216,10 +4156,6 @@ internal GremlinResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICosmosDBManagementClient.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICosmosDBManagementClient.cs
index 6825f20dff2a..70be011f245b 100644
--- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICosmosDBManagementClient.cs
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ICosmosDBManagementClient.cs
@@ -163,15 +163,50 @@ public partial interface ICosmosDBManagementClient : System.IDisposable
///
INotebookWorkspacesOperations NotebookWorkspaces { get; }
+ ///
+ /// Gets the IPrivateEndpointConnectionsOperations.
+ ///
+ IPrivateEndpointConnectionsOperations PrivateEndpointConnections { get; }
+
///
/// Gets the IPrivateLinkResourcesOperations.
///
IPrivateLinkResourcesOperations PrivateLinkResources { get; }
///
- /// Gets the IPrivateEndpointConnectionsOperations.
+ /// Gets the IRestorableDatabaseAccountsOperations.
///
- IPrivateEndpointConnectionsOperations PrivateEndpointConnections { get; }
+ IRestorableDatabaseAccountsOperations RestorableDatabaseAccounts { get; }
+
+ ///
+ /// Gets the IRestorableSqlDatabasesOperations.
+ ///
+ IRestorableSqlDatabasesOperations RestorableSqlDatabases { get; }
+
+ ///
+ /// Gets the IRestorableSqlContainersOperations.
+ ///
+ IRestorableSqlContainersOperations RestorableSqlContainers { get; }
+
+ ///
+ /// Gets the IRestorableSqlResourcesOperations.
+ ///
+ IRestorableSqlResourcesOperations RestorableSqlResources { get; }
+
+ ///
+ /// Gets the IRestorableMongodbDatabasesOperations.
+ ///
+ IRestorableMongodbDatabasesOperations RestorableMongodbDatabases { get; }
+
+ ///
+ /// Gets the IRestorableMongodbCollectionsOperations.
+ ///
+ IRestorableMongodbCollectionsOperations RestorableMongodbCollections { get; }
+
+ ///
+ /// Gets the IRestorableMongodbResourcesOperations.
+ ///
+ IRestorableMongodbResourcesOperations RestorableMongodbResources { get; }
}
}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IRestorableDatabaseAccountsOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IRestorableDatabaseAccountsOperations.cs
new file mode 100644
index 000000000000..e1a26f87e10b
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IRestorableDatabaseAccountsOperations.cs
@@ -0,0 +1,105 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// RestorableDatabaseAccountsOperations operations.
+ ///
+ public partial interface IRestorableDatabaseAccountsOperations
+ {
+ ///
+ /// 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.
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word
+ /// capitalized.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListByLocationWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Lists all the restorable Azure Cosmos DB database accounts
+ /// available under the subscription. This call requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read'
+ /// permission.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Retrieves the properties of an existing Azure Cosmos DB restorable
+ /// database account. This call requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*'
+ /// permission.
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word
+ /// capitalized.
+ ///
+ ///
+ /// The instanceId GUID of a restorable database account.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> GetByLocationWithHttpMessagesAsync(string location, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IRestorableMongodbCollectionsOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IRestorableMongodbCollectionsOperations.cs
new file mode 100644
index 000000000000..b37c85352e82
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IRestorableMongodbCollectionsOperations.cs
@@ -0,0 +1,61 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// RestorableMongodbCollectionsOperations operations.
+ ///
+ public partial interface IRestorableMongodbCollectionsOperations
+ {
+ ///
+ /// Show the event feed of all mutations done on all the Azure Cosmos
+ /// DB MongoDB collections under a specific database. This helps in
+ /// scenario where container was accidentally deleted. This API
+ /// requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read'
+ /// permission
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word
+ /// capitalized.
+ ///
+ ///
+ /// The instanceId GUID of a restorable database account.
+ ///
+ ///
+ /// The resource ID of the MongoDB database.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restorableMongodbDatabaseRid = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IRestorableMongodbDatabasesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IRestorableMongodbDatabasesOperations.cs
new file mode 100644
index 000000000000..e448a153744b
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IRestorableMongodbDatabasesOperations.cs
@@ -0,0 +1,58 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// RestorableMongodbDatabasesOperations operations.
+ ///
+ public partial interface IRestorableMongodbDatabasesOperations
+ {
+ ///
+ /// Show the event feed of all mutations done on all the Azure Cosmos
+ /// DB MongoDB databases under the restorable account. This helps in
+ /// scenario where database was accidentally deleted to get the
+ /// deletion time. This API requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read'
+ /// permission
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word
+ /// capitalized.
+ ///
+ ///
+ /// The instanceId GUID of a restorable database account.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListWithHttpMessagesAsync(string location, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IRestorableMongodbResourcesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IRestorableMongodbResourcesOperations.cs
new file mode 100644
index 000000000000..c218372523e0
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IRestorableMongodbResourcesOperations.cs
@@ -0,0 +1,64 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// RestorableMongodbResourcesOperations operations.
+ ///
+ public partial interface IRestorableMongodbResourcesOperations
+ {
+ ///
+ /// Return a list of database and collection combo that exist on the
+ /// account at the given timestamp and location. This helps in
+ /// scenarios to validate what resources exist at given timestamp and
+ /// location. This API requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read'
+ /// permission.
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word
+ /// capitalized.
+ ///
+ ///
+ /// The instanceId GUID of a restorable database account.
+ ///
+ ///
+ /// The location where the restorable resources are located.
+ ///
+ ///
+ /// The timestamp when the restorable resources existed.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IRestorableSqlContainersOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IRestorableSqlContainersOperations.cs
new file mode 100644
index 000000000000..703b77b68312
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IRestorableSqlContainersOperations.cs
@@ -0,0 +1,69 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// RestorableSqlContainersOperations operations.
+ ///
+ public partial interface IRestorableSqlContainersOperations
+ {
+ ///
+ /// Show the event feed of all mutations done on all the Azure Cosmos
+ /// DB SQL containers under a specific database. This helps in
+ /// scenario where container was accidentally deleted. This API
+ /// requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read'
+ /// permission
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word
+ /// capitalized.
+ ///
+ ///
+ /// The instanceId GUID of a restorable database account.
+ ///
+ ///
+ /// The resource ID of the SQL database.
+ ///
+ ///
+ /// The snapshot create timestamp after which snapshots need to be
+ /// listed.
+ ///
+ ///
+ /// The snapshot create timestamp before which snapshots need to be
+ /// listed.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restorableSqlDatabaseRid = default(string), string startTime = default(string), string endTime = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IRestorableSqlDatabasesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IRestorableSqlDatabasesOperations.cs
new file mode 100644
index 000000000000..9e5f0df87d0f
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IRestorableSqlDatabasesOperations.cs
@@ -0,0 +1,58 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// RestorableSqlDatabasesOperations operations.
+ ///
+ public partial interface IRestorableSqlDatabasesOperations
+ {
+ ///
+ /// Show the event feed of all mutations done on all the Azure Cosmos
+ /// DB SQL databases under the restorable account. This helps in
+ /// scenario where database was accidentally deleted to get the
+ /// deletion time. This API requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read'
+ /// permission
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word
+ /// capitalized.
+ ///
+ ///
+ /// The instanceId GUID of a restorable database account.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListWithHttpMessagesAsync(string location, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IRestorableSqlResourcesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IRestorableSqlResourcesOperations.cs
new file mode 100644
index 000000000000..096ec270e22a
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/IRestorableSqlResourcesOperations.cs
@@ -0,0 +1,64 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// RestorableSqlResourcesOperations operations.
+ ///
+ public partial interface IRestorableSqlResourcesOperations
+ {
+ ///
+ /// Return a list of database and container combo that exist on the
+ /// account at the given timestamp and location. This helps in
+ /// scenarios to validate what resources exist at given timestamp and
+ /// location. This API requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read'
+ /// permission.
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word
+ /// capitalized.
+ ///
+ ///
+ /// The instanceId GUID of a restorable database account.
+ ///
+ ///
+ /// The location where the restorable resources are located.
+ ///
+ ///
+ /// The timestamp when the restorable resources existed.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ISqlResourcesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ISqlResourcesOperations.cs
index 1c70deb2f903..81ce9991bc6a 100644
--- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ISqlResourcesOperations.cs
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/ISqlResourcesOperations.cs
@@ -1133,6 +1133,40 @@ public partial interface ISqlResourcesOperations
///
Task>> ListSqlRoleAssignmentsWithHttpMessagesAsync(string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
///
+ /// Retrieves continuous backup information for a container resource.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// Cosmos DB database account name.
+ ///
+ ///
+ /// Cosmos DB database name.
+ ///
+ ///
+ /// Cosmos DB container name.
+ ///
+ ///
+ /// The name of the continuous backup restore location.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> RetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, ContinuousBackupRestoreLocation location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
/// Create or update an Azure Cosmos DB SQL database
///
///
@@ -1755,5 +1789,39 @@ public partial interface ISqlResourcesOperations
/// Thrown when a required parameter is null
///
Task BeginDeleteSqlRoleAssignmentWithHttpMessagesAsync(string roleAssignmentId, string resourceGroupName, string accountName, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
+ ///
+ /// Retrieves continuous backup information for a container resource.
+ ///
+ ///
+ /// The name of the resource group. The name is case insensitive.
+ ///
+ ///
+ /// Cosmos DB database account name.
+ ///
+ ///
+ /// Cosmos DB database name.
+ ///
+ ///
+ /// Cosmos DB container name.
+ ///
+ ///
+ /// The name of the continuous backup restore location.
+ ///
+ ///
+ /// The headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ Task> BeginRetrieveContinuousBackupInformationWithHttpMessagesAsync(string resourceGroupName, string accountName, string databaseName, string containerName, ContinuousBackupRestoreLocation location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken));
}
}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/AnalyticalStorageConfiguration.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/AnalyticalStorageConfiguration.cs
new file mode 100644
index 000000000000..e2f25b399e7d
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/AnalyticalStorageConfiguration.cs
@@ -0,0 +1,54 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Analytical storage specific properties.
+ ///
+ public partial class AnalyticalStorageConfiguration
+ {
+ ///
+ /// Initializes a new instance of the AnalyticalStorageConfiguration
+ /// class.
+ ///
+ public AnalyticalStorageConfiguration()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the AnalyticalStorageConfiguration
+ /// class.
+ ///
+ /// Possible values include: 'WellDefined',
+ /// 'FullFidelity'
+ public AnalyticalStorageConfiguration(string schemaType = default(string))
+ {
+ SchemaType = schemaType;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets possible values include: 'WellDefined', 'FullFidelity'
+ ///
+ [JsonProperty(PropertyName = "schemaType")]
+ public string SchemaType { get; set; }
+
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/AnalyticalStorageSchemaType.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/AnalyticalStorageSchemaType.cs
new file mode 100644
index 000000000000..4ae73b6f2567
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/AnalyticalStorageSchemaType.cs
@@ -0,0 +1,22 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB.Models
+{
+
+ ///
+ /// Defines values for AnalyticalStorageSchemaType.
+ ///
+ public static class AnalyticalStorageSchemaType
+ {
+ public const string WellDefined = "WellDefined";
+ public const string FullFidelity = "FullFidelity";
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/ApiType.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/ApiType.cs
new file mode 100644
index 000000000000..b263e9b9ec11
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/ApiType.cs
@@ -0,0 +1,26 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB.Models
+{
+
+ ///
+ /// Defines values for ApiType.
+ ///
+ public static class ApiType
+ {
+ public const string MongoDB = "MongoDB";
+ public const string Gremlin = "Gremlin";
+ public const string Cassandra = "Cassandra";
+ public const string Table = "Table";
+ public const string Sql = "Sql";
+ public const string GremlinV2 = "GremlinV2";
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/BackupInformation.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/BackupInformation.cs
new file mode 100644
index 000000000000..fd6ce1be799a
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/BackupInformation.cs
@@ -0,0 +1,52 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Backup information of a resource.
+ ///
+ public partial class BackupInformation
+ {
+ ///
+ /// Initializes a new instance of the BackupInformation class.
+ ///
+ public BackupInformation()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the BackupInformation class.
+ ///
+ /// Information about the
+ /// status of continuous backups.
+ public BackupInformation(ContinuousBackupInformation continuousBackupInformation = default(ContinuousBackupInformation))
+ {
+ ContinuousBackupInformation = continuousBackupInformation;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets information about the status of continuous backups.
+ ///
+ [JsonProperty(PropertyName = "continuousBackupInformation")]
+ public ContinuousBackupInformation ContinuousBackupInformation { get; set; }
+
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/BackupPolicy.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/BackupPolicy.cs
index 867cca31c5c9..f7840d7f6c17 100644
--- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/BackupPolicy.cs
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/BackupPolicy.cs
@@ -10,6 +10,7 @@
namespace Microsoft.Azure.Management.CosmosDB.Models
{
+ using Newtonsoft.Json;
using System.Linq;
///
@@ -25,11 +26,28 @@ public BackupPolicy()
CustomInit();
}
+ ///
+ /// Initializes a new instance of the BackupPolicy class.
+ ///
+ /// The object representing the state of
+ /// the migration between the backup policies.
+ public BackupPolicy(BackupPolicyMigrationState migrationState = default(BackupPolicyMigrationState))
+ {
+ MigrationState = migrationState;
+ CustomInit();
+ }
///
/// An initialization method that performs custom operations like setting defaults
///
partial void CustomInit();
+ ///
+ /// Gets or sets the object representing the state of the migration
+ /// between the backup policies.
+ ///
+ [JsonProperty(PropertyName = "migrationState")]
+ public BackupPolicyMigrationState MigrationState { get; set; }
+
}
}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/BackupPolicyMigrationState.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/BackupPolicyMigrationState.cs
new file mode 100644
index 000000000000..b063b6fc10b2
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/BackupPolicyMigrationState.cs
@@ -0,0 +1,77 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// The object representing the state of the migration between the backup
+ /// policies.
+ ///
+ public partial class BackupPolicyMigrationState
+ {
+ ///
+ /// Initializes a new instance of the BackupPolicyMigrationState class.
+ ///
+ public BackupPolicyMigrationState()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the BackupPolicyMigrationState class.
+ ///
+ /// Describes the status of migration between
+ /// backup policy types. Possible values include: 'Invalid',
+ /// 'InProgress', 'Completed', 'Failed'
+ /// Describes the target backup policy type of
+ /// the backup policy migration. Possible values include: 'Periodic',
+ /// 'Continuous'
+ /// Time at which the backup policy migration
+ /// started (ISO-8601 format).
+ public BackupPolicyMigrationState(string status = default(string), string targetType = default(string), System.DateTime? startTime = default(System.DateTime?))
+ {
+ Status = status;
+ TargetType = targetType;
+ StartTime = startTime;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets describes the status of migration between backup
+ /// policy types. Possible values include: 'Invalid', 'InProgress',
+ /// 'Completed', 'Failed'
+ ///
+ [JsonProperty(PropertyName = "status")]
+ public string Status { get; set; }
+
+ ///
+ /// Gets or sets describes the target backup policy type of the backup
+ /// policy migration. Possible values include: 'Periodic', 'Continuous'
+ ///
+ [JsonProperty(PropertyName = "targetType")]
+ public string TargetType { get; set; }
+
+ ///
+ /// Gets or sets time at which the backup policy migration started
+ /// (ISO-8601 format).
+ ///
+ [JsonProperty(PropertyName = "startTime")]
+ public System.DateTime? StartTime { get; set; }
+
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/BackupPolicyMigrationStatus.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/BackupPolicyMigrationStatus.cs
new file mode 100644
index 000000000000..c44e7638dbdb
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/BackupPolicyMigrationStatus.cs
@@ -0,0 +1,24 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB.Models
+{
+
+ ///
+ /// Defines values for BackupPolicyMigrationStatus.
+ ///
+ public static class BackupPolicyMigrationStatus
+ {
+ public const string Invalid = "Invalid";
+ public const string InProgress = "InProgress";
+ public const string Completed = "Completed";
+ public const string Failed = "Failed";
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/ContinuousBackupInformation.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/ContinuousBackupInformation.cs
new file mode 100644
index 000000000000..d3e1d0b8cbc4
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/ContinuousBackupInformation.cs
@@ -0,0 +1,54 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Information about the status of continuous backups.
+ ///
+ public partial class ContinuousBackupInformation
+ {
+ ///
+ /// Initializes a new instance of the ContinuousBackupInformation
+ /// class.
+ ///
+ public ContinuousBackupInformation()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ContinuousBackupInformation
+ /// class.
+ ///
+ /// The latest restorable
+ /// timestamp for a resource.
+ public ContinuousBackupInformation(string latestRestorableTimestamp = default(string))
+ {
+ LatestRestorableTimestamp = latestRestorableTimestamp;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the latest restorable timestamp for a resource.
+ ///
+ [JsonProperty(PropertyName = "latestRestorableTimestamp")]
+ public string LatestRestorableTimestamp { get; set; }
+
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/ContinuousBackupRestoreLocation.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/ContinuousBackupRestoreLocation.cs
new file mode 100644
index 000000000000..7025ac59194e
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/ContinuousBackupRestoreLocation.cs
@@ -0,0 +1,54 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Properties of the regional restorable account.
+ ///
+ public partial class ContinuousBackupRestoreLocation
+ {
+ ///
+ /// Initializes a new instance of the ContinuousBackupRestoreLocation
+ /// class.
+ ///
+ public ContinuousBackupRestoreLocation()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the ContinuousBackupRestoreLocation
+ /// class.
+ ///
+ /// The name of the continuous backup restore
+ /// location.
+ public ContinuousBackupRestoreLocation(string location = default(string))
+ {
+ Location = location;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the name of the continuous backup restore location.
+ ///
+ [JsonProperty(PropertyName = "location")]
+ public string Location { get; set; }
+
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/ContinuousModeBackupPolicy.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/ContinuousModeBackupPolicy.cs
index 0c4e775c04e5..c581ca350658 100644
--- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/ContinuousModeBackupPolicy.cs
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/ContinuousModeBackupPolicy.cs
@@ -27,6 +27,16 @@ public ContinuousModeBackupPolicy()
CustomInit();
}
+ ///
+ /// Initializes a new instance of the ContinuousModeBackupPolicy class.
+ ///
+ /// The object representing the state of
+ /// the migration between the backup policies.
+ public ContinuousModeBackupPolicy(BackupPolicyMigrationState migrationState = default(BackupPolicyMigrationState))
+ : base(migrationState)
+ {
+ CustomInit();
+ }
///
/// An initialization method that performs custom operations like setting defaults
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CreateMode.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CreateMode.cs
new file mode 100644
index 000000000000..59efcacc2735
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CreateMode.cs
@@ -0,0 +1,22 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB.Models
+{
+
+ ///
+ /// Defines values for CreateMode.
+ ///
+ public static class CreateMode
+ {
+ public const string Default = "Default";
+ public const string Restore = "Restore";
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CreatedByType.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CreatedByType.cs
new file mode 100644
index 000000000000..53a064c23e09
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/CreatedByType.cs
@@ -0,0 +1,24 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB.Models
+{
+
+ ///
+ /// Defines values for CreatedByType.
+ ///
+ public static class CreatedByType
+ {
+ public const string User = "User";
+ public const string Application = "Application";
+ public const string ManagedIdentity = "ManagedIdentity";
+ public const string Key = "Key";
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/DatabaseAccountCreateUpdateParameters.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/DatabaseAccountCreateUpdateParameters.cs
index e46e5b0b74bd..7e62fd3f2ca0 100644
--- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/DatabaseAccountCreateUpdateParameters.cs
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/DatabaseAccountCreateUpdateParameters.cs
@@ -85,6 +85,10 @@ public DatabaseAccountCreateUpdateParameters()
/// supported only for MongoDB API.
/// Flag to indicate whether to
/// enable storage analytics.
+ /// Analytical storage
+ /// specific properties.
+ /// Enum to indicate the mode of account
+ /// creation. Possible values include: 'Default', 'Restore'
/// The object representing the policy for
/// taking backups on an account.
/// The CORS policy for the Cosmos DB database
@@ -95,7 +99,12 @@ public DatabaseAccountCreateUpdateParameters()
/// An array that contains
/// the Resource Ids for Network Acl Bypass for the Cosmos DB
/// account.
- public DatabaseAccountCreateUpdateParameters(IList locations, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string kind = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), ConsistencyPolicy consistencyPolicy = default(ConsistencyPolicy), IList ipRules = default(IList), bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), IList capabilities = default(IList), IList virtualNetworkRules = default(IList), bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), string connectorOffer = default(string), bool? disableKeyBasedMetadataWriteAccess = default(bool?), string keyVaultKeyUri = default(string), string defaultIdentity = default(string), string publicNetworkAccess = default(string), bool? enableFreeTier = default(bool?), ApiProperties apiProperties = default(ApiProperties), bool? enableAnalyticalStorage = default(bool?), BackupPolicy backupPolicy = default(BackupPolicy), IList cors = default(IList), NetworkAclBypass? networkAclBypass = default(NetworkAclBypass?), IList networkAclBypassResourceIds = default(IList))
+ /// Opt-out of local authentication and
+ /// ensure only MSI and AAD can be used exclusively for
+ /// authentication.
+ /// Parameters to indicate the
+ /// information about the restore.
+ public DatabaseAccountCreateUpdateParameters(IList locations, string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string kind = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), ConsistencyPolicy consistencyPolicy = default(ConsistencyPolicy), IList ipRules = default(IList), bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), IList capabilities = default(IList), IList virtualNetworkRules = default(IList), bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), string connectorOffer = default(string), bool? disableKeyBasedMetadataWriteAccess = default(bool?), string keyVaultKeyUri = default(string), string defaultIdentity = default(string), string publicNetworkAccess = default(string), bool? enableFreeTier = default(bool?), ApiProperties apiProperties = default(ApiProperties), bool? enableAnalyticalStorage = default(bool?), AnalyticalStorageConfiguration analyticalStorageConfiguration = default(AnalyticalStorageConfiguration), string createMode = default(string), BackupPolicy backupPolicy = default(BackupPolicy), IList cors = default(IList), NetworkAclBypass? networkAclBypass = default(NetworkAclBypass?), IList networkAclBypassResourceIds = default(IList), bool? disableLocalAuth = default(bool?), RestoreParameters restoreParameters = default(RestoreParameters))
: base(id, name, type, location, tags)
{
Kind = kind;
@@ -117,10 +126,14 @@ public DatabaseAccountCreateUpdateParameters()
EnableFreeTier = enableFreeTier;
ApiProperties = apiProperties;
EnableAnalyticalStorage = enableAnalyticalStorage;
+ AnalyticalStorageConfiguration = analyticalStorageConfiguration;
+ CreateMode = createMode;
BackupPolicy = backupPolicy;
Cors = cors;
NetworkAclBypass = networkAclBypass;
NetworkAclBypassResourceIds = networkAclBypassResourceIds;
+ DisableLocalAuth = disableLocalAuth;
+ RestoreParameters = restoreParameters;
CustomInit();
}
///
@@ -266,6 +279,19 @@ static DatabaseAccountCreateUpdateParameters()
[JsonProperty(PropertyName = "properties.enableAnalyticalStorage")]
public bool? EnableAnalyticalStorage { get; set; }
+ ///
+ /// Gets or sets analytical storage specific properties.
+ ///
+ [JsonProperty(PropertyName = "properties.analyticalStorageConfiguration")]
+ public AnalyticalStorageConfiguration AnalyticalStorageConfiguration { get; set; }
+
+ ///
+ /// Gets or sets enum to indicate the mode of account creation.
+ /// Possible values include: 'Default', 'Restore'
+ ///
+ [JsonProperty(PropertyName = "properties.createMode")]
+ public string CreateMode { get; set; }
+
///
/// Gets or sets the object representing the policy for taking backups
/// on an account.
@@ -293,6 +319,20 @@ static DatabaseAccountCreateUpdateParameters()
[JsonProperty(PropertyName = "properties.networkAclBypassResourceIds")]
public IList NetworkAclBypassResourceIds { get; set; }
+ ///
+ /// Gets or sets opt-out of local authentication and ensure only MSI
+ /// and AAD can be used exclusively for authentication.
+ ///
+ [JsonProperty(PropertyName = "properties.disableLocalAuth")]
+ public bool? DisableLocalAuth { get; set; }
+
+ ///
+ /// Gets or sets parameters to indicate the information about the
+ /// restore.
+ ///
+ [JsonProperty(PropertyName = "properties.restoreParameters")]
+ public RestoreParameters RestoreParameters { get; set; }
+
///
/// The offer type for the database
///
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/DatabaseAccountGetResults.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/DatabaseAccountGetResults.cs
index 279ee25e4518..35d7da5ca574 100644
--- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/DatabaseAccountGetResults.cs
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/DatabaseAccountGetResults.cs
@@ -95,6 +95,14 @@ public DatabaseAccountGetResults()
/// API specific properties.
/// Flag to indicate whether to
/// enable storage analytics.
+ /// Analytical storage
+ /// specific properties.
+ /// A unique identifier assigned to the
+ /// database account
+ /// Enum to indicate the mode of account
+ /// creation. Possible values include: 'Default', 'Restore'
+ /// Parameters to indicate the
+ /// information about the restore.
/// The object representing the policy for
/// taking backups on an account.
/// The CORS policy for the Cosmos DB database
@@ -105,7 +113,12 @@ public DatabaseAccountGetResults()
/// An array that contains
/// the Resource Ids for Network Acl Bypass for the Cosmos DB
/// account.
- public DatabaseAccountGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string kind = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), string provisioningState = default(string), string documentEndpoint = default(string), DatabaseAccountOfferType? databaseAccountOfferType = default(DatabaseAccountOfferType?), IList ipRules = default(IList), bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), ConsistencyPolicy consistencyPolicy = default(ConsistencyPolicy), IList capabilities = default(IList), IList writeLocations = default(IList), IList readLocations = default(IList), IList locations = default(IList), IList failoverPolicies = default(IList), IList virtualNetworkRules = default(IList), IList privateEndpointConnections = default(IList), bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), string connectorOffer = default(string), bool? disableKeyBasedMetadataWriteAccess = default(bool?), string keyVaultKeyUri = default(string), string defaultIdentity = default(string), string publicNetworkAccess = default(string), bool? enableFreeTier = default(bool?), ApiProperties apiProperties = default(ApiProperties), bool? enableAnalyticalStorage = default(bool?), BackupPolicy backupPolicy = default(BackupPolicy), IList cors = default(IList), NetworkAclBypass? networkAclBypass = default(NetworkAclBypass?), IList networkAclBypassResourceIds = default(IList))
+ /// Opt-out of local authentication and
+ /// ensure only MSI and AAD can be used exclusively for
+ /// authentication.
+ /// The system meta data relating to this
+ /// resource.
+ public DatabaseAccountGetResults(string id = default(string), string name = default(string), string type = default(string), string location = default(string), IDictionary tags = default(IDictionary), string kind = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), string provisioningState = default(string), string documentEndpoint = default(string), DatabaseAccountOfferType? databaseAccountOfferType = default(DatabaseAccountOfferType?), IList ipRules = default(IList), bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), ConsistencyPolicy consistencyPolicy = default(ConsistencyPolicy), IList capabilities = default(IList), IList writeLocations = default(IList), IList readLocations = default(IList), IList locations = default(IList), IList failoverPolicies = default(IList), IList virtualNetworkRules = default(IList), IList privateEndpointConnections = default(IList), bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), string connectorOffer = default(string), bool? disableKeyBasedMetadataWriteAccess = default(bool?), string keyVaultKeyUri = default(string), string defaultIdentity = default(string), string publicNetworkAccess = default(string), bool? enableFreeTier = default(bool?), ApiProperties apiProperties = default(ApiProperties), bool? enableAnalyticalStorage = default(bool?), AnalyticalStorageConfiguration analyticalStorageConfiguration = default(AnalyticalStorageConfiguration), string instanceId = default(string), string createMode = default(string), RestoreParameters restoreParameters = default(RestoreParameters), BackupPolicy backupPolicy = default(BackupPolicy), IList cors = default(IList), NetworkAclBypass? networkAclBypass = default(NetworkAclBypass?), IList networkAclBypassResourceIds = default(IList), bool? disableLocalAuth = default(bool?), SystemData systemData = default(SystemData))
: base(id, name, type, location, tags)
{
Kind = kind;
@@ -134,10 +147,16 @@ public DatabaseAccountGetResults()
EnableFreeTier = enableFreeTier;
ApiProperties = apiProperties;
EnableAnalyticalStorage = enableAnalyticalStorage;
+ AnalyticalStorageConfiguration = analyticalStorageConfiguration;
+ InstanceId = instanceId;
+ CreateMode = createMode;
+ RestoreParameters = restoreParameters;
BackupPolicy = backupPolicy;
Cors = cors;
NetworkAclBypass = networkAclBypass;
NetworkAclBypassResourceIds = networkAclBypassResourceIds;
+ DisableLocalAuth = disableLocalAuth;
+ SystemData = systemData;
CustomInit();
}
@@ -322,6 +341,32 @@ public DatabaseAccountGetResults()
[JsonProperty(PropertyName = "properties.enableAnalyticalStorage")]
public bool? EnableAnalyticalStorage { get; set; }
+ ///
+ /// Gets or sets analytical storage specific properties.
+ ///
+ [JsonProperty(PropertyName = "properties.analyticalStorageConfiguration")]
+ public AnalyticalStorageConfiguration AnalyticalStorageConfiguration { get; set; }
+
+ ///
+ /// Gets a unique identifier assigned to the database account
+ ///
+ [JsonProperty(PropertyName = "properties.instanceId")]
+ public string InstanceId { get; private set; }
+
+ ///
+ /// Gets or sets enum to indicate the mode of account creation.
+ /// Possible values include: 'Default', 'Restore'
+ ///
+ [JsonProperty(PropertyName = "properties.createMode")]
+ public string CreateMode { get; set; }
+
+ ///
+ /// Gets or sets parameters to indicate the information about the
+ /// restore.
+ ///
+ [JsonProperty(PropertyName = "properties.restoreParameters")]
+ public RestoreParameters RestoreParameters { get; set; }
+
///
/// Gets or sets the object representing the policy for taking backups
/// on an account.
@@ -349,6 +394,19 @@ public DatabaseAccountGetResults()
[JsonProperty(PropertyName = "properties.networkAclBypassResourceIds")]
public IList NetworkAclBypassResourceIds { get; set; }
+ ///
+ /// Gets or sets opt-out of local authentication and ensure only MSI
+ /// and AAD can be used exclusively for authentication.
+ ///
+ [JsonProperty(PropertyName = "properties.disableLocalAuth")]
+ public bool? DisableLocalAuth { get; set; }
+
+ ///
+ /// Gets the system meta data relating to this resource.
+ ///
+ [JsonProperty(PropertyName = "systemData")]
+ public SystemData SystemData { get; private set; }
+
///
/// Validate the object.
///
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/DatabaseAccountUpdateParameters.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/DatabaseAccountUpdateParameters.cs
index 024a4c9e8ed0..b105d623d6b1 100644
--- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/DatabaseAccountUpdateParameters.cs
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/DatabaseAccountUpdateParameters.cs
@@ -78,6 +78,8 @@ public DatabaseAccountUpdateParameters()
/// supported only for MongoDB API.
/// Flag to indicate whether to
/// enable storage analytics.
+ /// Analytical storage
+ /// specific properties.
/// The object representing the policy for
/// taking backups on an account.
/// The CORS policy for the Cosmos DB database
@@ -88,7 +90,10 @@ public DatabaseAccountUpdateParameters()
/// An array that contains
/// the Resource Ids for Network Acl Bypass for the Cosmos DB
/// account.
- public DatabaseAccountUpdateParameters(IDictionary tags = default(IDictionary), string location = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), ConsistencyPolicy consistencyPolicy = default(ConsistencyPolicy), IList locations = default(IList), IList ipRules = default(IList), bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), IList capabilities = default(IList), IList virtualNetworkRules = default(IList), bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), string connectorOffer = default(string), bool? disableKeyBasedMetadataWriteAccess = default(bool?), string keyVaultKeyUri = default(string), string defaultIdentity = default(string), string publicNetworkAccess = default(string), bool? enableFreeTier = default(bool?), ApiProperties apiProperties = default(ApiProperties), bool? enableAnalyticalStorage = default(bool?), BackupPolicy backupPolicy = default(BackupPolicy), IList cors = default(IList), NetworkAclBypass? networkAclBypass = default(NetworkAclBypass?), IList networkAclBypassResourceIds = default(IList))
+ /// Opt-out of local authentication and
+ /// ensure only MSI and AAD can be used exclusively for
+ /// authentication.
+ public DatabaseAccountUpdateParameters(IDictionary tags = default(IDictionary), string location = default(string), ManagedServiceIdentity identity = default(ManagedServiceIdentity), ConsistencyPolicy consistencyPolicy = default(ConsistencyPolicy), IList locations = default(IList), IList ipRules = default(IList), bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), IList capabilities = default(IList), IList virtualNetworkRules = default(IList), bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), string connectorOffer = default(string), bool? disableKeyBasedMetadataWriteAccess = default(bool?), string keyVaultKeyUri = default(string), string defaultIdentity = default(string), string publicNetworkAccess = default(string), bool? enableFreeTier = default(bool?), ApiProperties apiProperties = default(ApiProperties), bool? enableAnalyticalStorage = default(bool?), AnalyticalStorageConfiguration analyticalStorageConfiguration = default(AnalyticalStorageConfiguration), BackupPolicy backupPolicy = default(BackupPolicy), IList cors = default(IList), NetworkAclBypass? networkAclBypass = default(NetworkAclBypass?), IList networkAclBypassResourceIds = default(IList), bool? disableLocalAuth = default(bool?))
{
Tags = tags;
Location = location;
@@ -110,10 +115,12 @@ public DatabaseAccountUpdateParameters()
EnableFreeTier = enableFreeTier;
ApiProperties = apiProperties;
EnableAnalyticalStorage = enableAnalyticalStorage;
+ AnalyticalStorageConfiguration = analyticalStorageConfiguration;
BackupPolicy = backupPolicy;
Cors = cors;
NetworkAclBypass = networkAclBypass;
NetworkAclBypassResourceIds = networkAclBypassResourceIds;
+ DisableLocalAuth = disableLocalAuth;
CustomInit();
}
@@ -256,6 +263,12 @@ public DatabaseAccountUpdateParameters()
[JsonProperty(PropertyName = "properties.enableAnalyticalStorage")]
public bool? EnableAnalyticalStorage { get; set; }
+ ///
+ /// Gets or sets analytical storage specific properties.
+ ///
+ [JsonProperty(PropertyName = "properties.analyticalStorageConfiguration")]
+ public AnalyticalStorageConfiguration AnalyticalStorageConfiguration { get; set; }
+
///
/// Gets or sets the object representing the policy for taking backups
/// on an account.
@@ -283,6 +296,13 @@ public DatabaseAccountUpdateParameters()
[JsonProperty(PropertyName = "properties.networkAclBypassResourceIds")]
public IList NetworkAclBypassResourceIds { get; set; }
+ ///
+ /// Gets or sets opt-out of local authentication and ensure only MSI
+ /// and AAD can be used exclusively for authentication.
+ ///
+ [JsonProperty(PropertyName = "properties.disableLocalAuth")]
+ public bool? DisableLocalAuth { get; set; }
+
///
/// Validate the object.
///
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/DatabaseRestoreResource.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/DatabaseRestoreResource.cs
new file mode 100644
index 000000000000..1a34d450130d
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/DatabaseRestoreResource.cs
@@ -0,0 +1,63 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Specific Databases to restore.
+ ///
+ public partial class DatabaseRestoreResource
+ {
+ ///
+ /// Initializes a new instance of the DatabaseRestoreResource class.
+ ///
+ public DatabaseRestoreResource()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the DatabaseRestoreResource class.
+ ///
+ /// The name of the database available for
+ /// restore.
+ /// The names of the collections
+ /// available for restore.
+ public DatabaseRestoreResource(string databaseName = default(string), IList collectionNames = default(IList))
+ {
+ DatabaseName = databaseName;
+ CollectionNames = collectionNames;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the name of the database available for restore.
+ ///
+ [JsonProperty(PropertyName = "databaseName")]
+ public string DatabaseName { get; set; }
+
+ ///
+ /// Gets or sets the names of the collections available for restore.
+ ///
+ [JsonProperty(PropertyName = "collectionNames")]
+ public IList CollectionNames { get; set; }
+
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/OperationType.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/OperationType.cs
new file mode 100644
index 000000000000..8fd9dcaeff9b
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/OperationType.cs
@@ -0,0 +1,24 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB.Models
+{
+
+ ///
+ /// Defines values for OperationType.
+ ///
+ public static class OperationType
+ {
+ public const string Create = "Create";
+ public const string Replace = "Replace";
+ public const string Delete = "Delete";
+ public const string SystemOperation = "SystemOperation";
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/PeriodicModeBackupPolicy.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/PeriodicModeBackupPolicy.cs
index 5415b93fbf75..348975c8a669 100644
--- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/PeriodicModeBackupPolicy.cs
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/PeriodicModeBackupPolicy.cs
@@ -30,9 +30,12 @@ public PeriodicModeBackupPolicy()
///
/// Initializes a new instance of the PeriodicModeBackupPolicy class.
///
+ /// The object representing the state of
+ /// the migration between the backup policies.
/// Configuration values for
/// periodic mode backup
- public PeriodicModeBackupPolicy(PeriodicModeProperties periodicModeProperties = default(PeriodicModeProperties))
+ public PeriodicModeBackupPolicy(BackupPolicyMigrationState migrationState = default(BackupPolicyMigrationState), PeriodicModeProperties periodicModeProperties = default(PeriodicModeProperties))
+ : base(migrationState)
{
PeriodicModeProperties = periodicModeProperties;
CustomInit();
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableDatabaseAccountGetResult.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableDatabaseAccountGetResult.cs
new file mode 100644
index 000000000000..6b06cc51ff4d
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableDatabaseAccountGetResult.cs
@@ -0,0 +1,136 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// A Azure Cosmos DB restorable database account.
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class RestorableDatabaseAccountGetResult
+ {
+ ///
+ /// Initializes a new instance of the
+ /// RestorableDatabaseAccountGetResult class.
+ ///
+ public RestorableDatabaseAccountGetResult()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the
+ /// RestorableDatabaseAccountGetResult class.
+ ///
+ /// The name of the global database
+ /// account
+ /// The creation time of the restorable
+ /// database account (ISO-8601 format).
+ /// The time at which the restorable
+ /// database account has been deleted (ISO-8601 format).
+ /// The API type of the restorable database
+ /// account. Possible values include: 'MongoDB', 'Gremlin',
+ /// 'Cassandra', 'Table', 'Sql', 'GremlinV2'
+ /// List of regions where the of the
+ /// database account can be restored from.
+ /// The unique resource identifier of the ARM
+ /// resource.
+ /// The name of the ARM resource.
+ /// The type of Azure resource.
+ /// The location of the resource group to which
+ /// the resource belongs.
+ public RestorableDatabaseAccountGetResult(string accountName = default(string), System.DateTime? creationTime = default(System.DateTime?), System.DateTime? deletionTime = default(System.DateTime?), string apiType = default(string), IList restorableLocations = default(IList), string id = default(string), string name = default(string), string type = default(string), string location = default(string))
+ {
+ AccountName = accountName;
+ CreationTime = creationTime;
+ DeletionTime = deletionTime;
+ ApiType = apiType;
+ RestorableLocations = restorableLocations;
+ Id = id;
+ Name = name;
+ Type = type;
+ Location = location;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the name of the global database account
+ ///
+ [JsonProperty(PropertyName = "properties.accountName")]
+ public string AccountName { get; set; }
+
+ ///
+ /// Gets or sets the creation time of the restorable database account
+ /// (ISO-8601 format).
+ ///
+ [JsonProperty(PropertyName = "properties.creationTime")]
+ public System.DateTime? CreationTime { get; set; }
+
+ ///
+ /// Gets or sets the time at which the restorable database account has
+ /// been deleted (ISO-8601 format).
+ ///
+ [JsonProperty(PropertyName = "properties.deletionTime")]
+ public System.DateTime? DeletionTime { get; set; }
+
+ ///
+ /// Gets the API type of the restorable database account. Possible
+ /// values include: 'MongoDB', 'Gremlin', 'Cassandra', 'Table', 'Sql',
+ /// 'GremlinV2'
+ ///
+ [JsonProperty(PropertyName = "properties.apiType")]
+ public string ApiType { get; private set; }
+
+ ///
+ /// Gets list of regions where the of the database account can be
+ /// restored from.
+ ///
+ [JsonProperty(PropertyName = "properties.restorableLocations")]
+ public IList RestorableLocations { get; private set; }
+
+ ///
+ /// Gets the unique resource identifier of the ARM resource.
+ ///
+ [JsonProperty(PropertyName = "id")]
+ public string Id { get; private set; }
+
+ ///
+ /// Gets the name of the ARM resource.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; private set; }
+
+ ///
+ /// Gets the type of Azure resource.
+ ///
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; private set; }
+
+ ///
+ /// Gets or sets the location of the resource group to which the
+ /// resource belongs.
+ ///
+ [JsonProperty(PropertyName = "location")]
+ public string Location { get; set; }
+
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableLocationResource.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableLocationResource.cs
new file mode 100644
index 000000000000..0c942ae55b61
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableLocationResource.cs
@@ -0,0 +1,82 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Properties of the regional restorable account.
+ ///
+ public partial class RestorableLocationResource
+ {
+ ///
+ /// Initializes a new instance of the RestorableLocationResource class.
+ ///
+ public RestorableLocationResource()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the RestorableLocationResource class.
+ ///
+ /// The location of the regional restorable
+ /// account.
+ /// The instance id of
+ /// the regional restorable account.
+ /// The creation time of the regional
+ /// restorable database account (ISO-8601 format).
+ /// The time at which the regional
+ /// restorable database account has been deleted (ISO-8601
+ /// format).
+ public RestorableLocationResource(string locationName = default(string), string regionalDatabaseAccountInstanceId = default(string), System.DateTime? creationTime = default(System.DateTime?), System.DateTime? deletionTime = default(System.DateTime?))
+ {
+ LocationName = locationName;
+ RegionalDatabaseAccountInstanceId = regionalDatabaseAccountInstanceId;
+ CreationTime = creationTime;
+ DeletionTime = deletionTime;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets the location of the regional restorable account.
+ ///
+ [JsonProperty(PropertyName = "locationName")]
+ public string LocationName { get; private set; }
+
+ ///
+ /// Gets the instance id of the regional restorable account.
+ ///
+ [JsonProperty(PropertyName = "regionalDatabaseAccountInstanceId")]
+ public string RegionalDatabaseAccountInstanceId { get; private set; }
+
+ ///
+ /// Gets the creation time of the regional restorable database account
+ /// (ISO-8601 format).
+ ///
+ [JsonProperty(PropertyName = "creationTime")]
+ public System.DateTime? CreationTime { get; private set; }
+
+ ///
+ /// Gets the time at which the regional restorable database account has
+ /// been deleted (ISO-8601 format).
+ ///
+ [JsonProperty(PropertyName = "deletionTime")]
+ public System.DateTime? DeletionTime { get; private set; }
+
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableMongodbCollectionGetResult.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableMongodbCollectionGetResult.cs
new file mode 100644
index 000000000000..4b39c95048b5
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableMongodbCollectionGetResult.cs
@@ -0,0 +1,83 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// An Azure Cosmos DB MongoDB collection event
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class RestorableMongodbCollectionGetResult
+ {
+ ///
+ /// Initializes a new instance of the
+ /// RestorableMongodbCollectionGetResult class.
+ ///
+ public RestorableMongodbCollectionGetResult()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the
+ /// RestorableMongodbCollectionGetResult class.
+ ///
+ /// The resource of an Azure Cosmos DB MongoDB
+ /// collection event
+ /// The unique resource Identifier of the ARM
+ /// resource.
+ /// The name of the ARM resource.
+ /// The type of Azure resource.
+ public RestorableMongodbCollectionGetResult(RestorableMongodbCollectionPropertiesResource resource = default(RestorableMongodbCollectionPropertiesResource), string id = default(string), string name = default(string), string type = default(string))
+ {
+ Resource = resource;
+ Id = id;
+ Name = name;
+ Type = type;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the resource of an Azure Cosmos DB MongoDB collection
+ /// event
+ ///
+ [JsonProperty(PropertyName = "properties.resource")]
+ public RestorableMongodbCollectionPropertiesResource Resource { get; set; }
+
+ ///
+ /// Gets the unique resource Identifier of the ARM resource.
+ ///
+ [JsonProperty(PropertyName = "id")]
+ public string Id { get; private set; }
+
+ ///
+ /// Gets the name of the ARM resource.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; private set; }
+
+ ///
+ /// Gets the type of Azure resource.
+ ///
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; private set; }
+
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableMongodbCollectionPropertiesResource.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableMongodbCollectionPropertiesResource.cs
new file mode 100644
index 000000000000..463b850ec05e
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableMongodbCollectionPropertiesResource.cs
@@ -0,0 +1,91 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// The resource of an Azure Cosmos DB MongoDB collection event
+ ///
+ public partial class RestorableMongodbCollectionPropertiesResource
+ {
+ ///
+ /// Initializes a new instance of the
+ /// RestorableMongodbCollectionPropertiesResource class.
+ ///
+ public RestorableMongodbCollectionPropertiesResource()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the
+ /// RestorableMongodbCollectionPropertiesResource class.
+ ///
+ /// A system generated property. A unique
+ /// identifier.
+ /// The operation type of this collection
+ /// event. Possible values include: 'Create', 'Replace', 'Delete',
+ /// 'SystemOperation'
+ /// The time when this collection event
+ /// happened.
+ /// The name of this MongoDB collection.
+ /// The resource ID of this MongoDB
+ /// collection.
+ public RestorableMongodbCollectionPropertiesResource(string _rid = default(string), string operationType = default(string), string eventTimestamp = default(string), string ownerId = default(string), string ownerResourceId = default(string))
+ {
+ this._rid = _rid;
+ OperationType = operationType;
+ EventTimestamp = eventTimestamp;
+ OwnerId = ownerId;
+ OwnerResourceId = ownerResourceId;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets a system generated property. A unique identifier.
+ ///
+ [JsonProperty(PropertyName = "_rid")]
+ public string _rid { get; private set; }
+
+ ///
+ /// Gets the operation type of this collection event. Possible values
+ /// include: 'Create', 'Replace', 'Delete', 'SystemOperation'
+ ///
+ [JsonProperty(PropertyName = "operationType")]
+ public string OperationType { get; private set; }
+
+ ///
+ /// Gets the time when this collection event happened.
+ ///
+ [JsonProperty(PropertyName = "eventTimestamp")]
+ public string EventTimestamp { get; private set; }
+
+ ///
+ /// Gets the name of this MongoDB collection.
+ ///
+ [JsonProperty(PropertyName = "ownerId")]
+ public string OwnerId { get; private set; }
+
+ ///
+ /// Gets the resource ID of this MongoDB collection.
+ ///
+ [JsonProperty(PropertyName = "ownerResourceId")]
+ public string OwnerResourceId { get; private set; }
+
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableMongodbDatabaseGetResult.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableMongodbDatabaseGetResult.cs
new file mode 100644
index 000000000000..b002f0197c38
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableMongodbDatabaseGetResult.cs
@@ -0,0 +1,83 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// An Azure Cosmos DB MongoDB database event
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class RestorableMongodbDatabaseGetResult
+ {
+ ///
+ /// Initializes a new instance of the
+ /// RestorableMongodbDatabaseGetResult class.
+ ///
+ public RestorableMongodbDatabaseGetResult()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the
+ /// RestorableMongodbDatabaseGetResult class.
+ ///
+ /// The resource of an Azure Cosmos DB MongoDB
+ /// database event
+ /// The unique resource Identifier of the ARM
+ /// resource.
+ /// The name of the ARM resource.
+ /// The type of Azure resource.
+ public RestorableMongodbDatabaseGetResult(RestorableMongodbDatabasePropertiesResource resource = default(RestorableMongodbDatabasePropertiesResource), string id = default(string), string name = default(string), string type = default(string))
+ {
+ Resource = resource;
+ Id = id;
+ Name = name;
+ Type = type;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the resource of an Azure Cosmos DB MongoDB database
+ /// event
+ ///
+ [JsonProperty(PropertyName = "properties.resource")]
+ public RestorableMongodbDatabasePropertiesResource Resource { get; set; }
+
+ ///
+ /// Gets the unique resource Identifier of the ARM resource.
+ ///
+ [JsonProperty(PropertyName = "id")]
+ public string Id { get; private set; }
+
+ ///
+ /// Gets the name of the ARM resource.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; private set; }
+
+ ///
+ /// Gets the type of Azure resource.
+ ///
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; private set; }
+
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableMongodbDatabasePropertiesResource.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableMongodbDatabasePropertiesResource.cs
new file mode 100644
index 000000000000..7c06c8643d71
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableMongodbDatabasePropertiesResource.cs
@@ -0,0 +1,91 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// The resource of an Azure Cosmos DB MongoDB database event
+ ///
+ public partial class RestorableMongodbDatabasePropertiesResource
+ {
+ ///
+ /// Initializes a new instance of the
+ /// RestorableMongodbDatabasePropertiesResource class.
+ ///
+ public RestorableMongodbDatabasePropertiesResource()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the
+ /// RestorableMongodbDatabasePropertiesResource class.
+ ///
+ /// A system generated property. A unique
+ /// identifier.
+ /// The operation type of this database
+ /// event. Possible values include: 'Create', 'Replace', 'Delete',
+ /// 'SystemOperation'
+ /// The time when this database event
+ /// happened.
+ /// The name of this MongoDB database.
+ /// The resource ID of this MongoDB
+ /// database.
+ public RestorableMongodbDatabasePropertiesResource(string _rid = default(string), string operationType = default(string), string eventTimestamp = default(string), string ownerId = default(string), string ownerResourceId = default(string))
+ {
+ this._rid = _rid;
+ OperationType = operationType;
+ EventTimestamp = eventTimestamp;
+ OwnerId = ownerId;
+ OwnerResourceId = ownerResourceId;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets a system generated property. A unique identifier.
+ ///
+ [JsonProperty(PropertyName = "_rid")]
+ public string _rid { get; private set; }
+
+ ///
+ /// Gets the operation type of this database event. Possible values
+ /// include: 'Create', 'Replace', 'Delete', 'SystemOperation'
+ ///
+ [JsonProperty(PropertyName = "operationType")]
+ public string OperationType { get; private set; }
+
+ ///
+ /// Gets the time when this database event happened.
+ ///
+ [JsonProperty(PropertyName = "eventTimestamp")]
+ public string EventTimestamp { get; private set; }
+
+ ///
+ /// Gets the name of this MongoDB database.
+ ///
+ [JsonProperty(PropertyName = "ownerId")]
+ public string OwnerId { get; private set; }
+
+ ///
+ /// Gets the resource ID of this MongoDB database.
+ ///
+ [JsonProperty(PropertyName = "ownerResourceId")]
+ public string OwnerResourceId { get; private set; }
+
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableSqlContainerGetResult.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableSqlContainerGetResult.cs
new file mode 100644
index 000000000000..fa5bf9dc46d2
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableSqlContainerGetResult.cs
@@ -0,0 +1,95 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// An Azure Cosmos DB SQL container event
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class RestorableSqlContainerGetResult
+ {
+ ///
+ /// Initializes a new instance of the RestorableSqlContainerGetResult
+ /// class.
+ ///
+ public RestorableSqlContainerGetResult()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the RestorableSqlContainerGetResult
+ /// class.
+ ///
+ /// The resource of an Azure Cosmos DB SQL
+ /// container event
+ /// The unique resource Identifier of the ARM
+ /// resource.
+ /// The name of the ARM resource.
+ /// The type of Azure resource.
+ public RestorableSqlContainerGetResult(RestorableSqlContainerPropertiesResource resource = default(RestorableSqlContainerPropertiesResource), string id = default(string), string name = default(string), string type = default(string))
+ {
+ Resource = resource;
+ Id = id;
+ Name = name;
+ Type = type;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the resource of an Azure Cosmos DB SQL container event
+ ///
+ [JsonProperty(PropertyName = "properties.resource")]
+ public RestorableSqlContainerPropertiesResource Resource { get; set; }
+
+ ///
+ /// Gets the unique resource Identifier of the ARM resource.
+ ///
+ [JsonProperty(PropertyName = "id")]
+ public string Id { get; private set; }
+
+ ///
+ /// Gets the name of the ARM resource.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; private set; }
+
+ ///
+ /// Gets the type of Azure resource.
+ ///
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; private set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Resource != null)
+ {
+ Resource.Validate();
+ }
+ }
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResource.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResource.cs
new file mode 100644
index 000000000000..511fea7331af
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResource.cs
@@ -0,0 +1,113 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// The resource of an Azure Cosmos DB SQL container event
+ ///
+ public partial class RestorableSqlContainerPropertiesResource
+ {
+ ///
+ /// Initializes a new instance of the
+ /// RestorableSqlContainerPropertiesResource class.
+ ///
+ public RestorableSqlContainerPropertiesResource()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the
+ /// RestorableSqlContainerPropertiesResource class.
+ ///
+ /// A system generated property. A unique
+ /// identifier.
+ /// The operation type of this container
+ /// event. Possible values include: 'Create', 'Replace', 'Delete',
+ /// 'SystemOperation'
+ /// The when this container event
+ /// happened.
+ /// The name of this SQL container.
+ /// The resource ID of this SQL
+ /// container.
+ /// Cosmos DB SQL container resource
+ /// object
+ public RestorableSqlContainerPropertiesResource(string _rid = default(string), string operationType = default(string), string eventTimestamp = default(string), string ownerId = default(string), string ownerResourceId = default(string), RestorableSqlContainerPropertiesResourceContainer container = default(RestorableSqlContainerPropertiesResourceContainer))
+ {
+ this._rid = _rid;
+ OperationType = operationType;
+ EventTimestamp = eventTimestamp;
+ OwnerId = ownerId;
+ OwnerResourceId = ownerResourceId;
+ Container = container;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets a system generated property. A unique identifier.
+ ///
+ [JsonProperty(PropertyName = "_rid")]
+ public string _rid { get; private set; }
+
+ ///
+ /// Gets the operation type of this container event. Possible values
+ /// include: 'Create', 'Replace', 'Delete', 'SystemOperation'
+ ///
+ [JsonProperty(PropertyName = "operationType")]
+ public string OperationType { get; private set; }
+
+ ///
+ /// Gets the when this container event happened.
+ ///
+ [JsonProperty(PropertyName = "eventTimestamp")]
+ public string EventTimestamp { get; private set; }
+
+ ///
+ /// Gets the name of this SQL container.
+ ///
+ [JsonProperty(PropertyName = "ownerId")]
+ public string OwnerId { get; private set; }
+
+ ///
+ /// Gets the resource ID of this SQL container.
+ ///
+ [JsonProperty(PropertyName = "ownerResourceId")]
+ public string OwnerResourceId { get; private set; }
+
+ ///
+ /// Gets or sets cosmos DB SQL container resource object
+ ///
+ [JsonProperty(PropertyName = "container")]
+ public RestorableSqlContainerPropertiesResourceContainer Container { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Container != null)
+ {
+ Container.Validate();
+ }
+ }
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs
new file mode 100644
index 000000000000..57f76559317f
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs
@@ -0,0 +1,169 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB.Models
+{
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Cosmos DB SQL container resource object
+ ///
+ public partial class RestorableSqlContainerPropertiesResourceContainer
+ {
+ ///
+ /// Initializes a new instance of the
+ /// RestorableSqlContainerPropertiesResourceContainer class.
+ ///
+ public RestorableSqlContainerPropertiesResourceContainer()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the
+ /// RestorableSqlContainerPropertiesResourceContainer class.
+ ///
+ /// Name of the Cosmos DB SQL container
+ /// The configuration of the indexing
+ /// policy. By default, the indexing is automatic for all document
+ /// paths within the container
+ /// The configuration of the partition key
+ /// to be used for partitioning data into multiple partitions
+ /// Default time to live
+ /// The unique key policy configuration
+ /// for specifying uniqueness constraints on documents in the
+ /// collection in the Azure Cosmos DB service.
+ /// The conflict resolution
+ /// policy for the container.
+ /// Analytical TTL.
+ /// A system generated property. A unique
+ /// identifier.
+ /// A system generated property that denotes the last
+ /// updated timestamp of the resource.
+ /// A system generated property representing the
+ /// resource etag required for optimistic concurrency control.
+ /// A system generated property that specifies the
+ /// addressable path of the container resource.
+ public RestorableSqlContainerPropertiesResourceContainer(string id, IndexingPolicy indexingPolicy = default(IndexingPolicy), ContainerPartitionKey partitionKey = default(ContainerPartitionKey), int? defaultTtl = default(int?), UniqueKeyPolicy uniqueKeyPolicy = default(UniqueKeyPolicy), ConflictResolutionPolicy conflictResolutionPolicy = default(ConflictResolutionPolicy), long? analyticalStorageTtl = default(long?), string _rid = default(string), double? _ts = default(double?), string _etag = default(string), string _self = default(string))
+ {
+ Id = id;
+ IndexingPolicy = indexingPolicy;
+ PartitionKey = partitionKey;
+ DefaultTtl = defaultTtl;
+ UniqueKeyPolicy = uniqueKeyPolicy;
+ ConflictResolutionPolicy = conflictResolutionPolicy;
+ AnalyticalStorageTtl = analyticalStorageTtl;
+ this._rid = _rid;
+ this._ts = _ts;
+ this._etag = _etag;
+ this._self = _self;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets name of the Cosmos DB SQL container
+ ///
+ [JsonProperty(PropertyName = "id")]
+ public string Id { get; set; }
+
+ ///
+ /// Gets or sets the configuration of the indexing policy. By default,
+ /// the indexing is automatic for all document paths within the
+ /// container
+ ///
+ [JsonProperty(PropertyName = "indexingPolicy")]
+ public IndexingPolicy IndexingPolicy { get; set; }
+
+ ///
+ /// Gets or sets the configuration of the partition key to be used for
+ /// partitioning data into multiple partitions
+ ///
+ [JsonProperty(PropertyName = "partitionKey")]
+ public ContainerPartitionKey PartitionKey { get; set; }
+
+ ///
+ /// Gets or sets default time to live
+ ///
+ [JsonProperty(PropertyName = "defaultTtl")]
+ public int? DefaultTtl { get; set; }
+
+ ///
+ /// Gets or sets the unique key policy configuration for specifying
+ /// uniqueness constraints on documents in the collection in the Azure
+ /// Cosmos DB service.
+ ///
+ [JsonProperty(PropertyName = "uniqueKeyPolicy")]
+ public UniqueKeyPolicy UniqueKeyPolicy { get; set; }
+
+ ///
+ /// Gets or sets the conflict resolution policy for the container.
+ ///
+ [JsonProperty(PropertyName = "conflictResolutionPolicy")]
+ public ConflictResolutionPolicy ConflictResolutionPolicy { get; set; }
+
+ ///
+ /// Gets or sets analytical TTL.
+ ///
+ [JsonProperty(PropertyName = "analyticalStorageTtl")]
+ public long? AnalyticalStorageTtl { get; set; }
+
+ ///
+ /// Gets a system generated property. A unique identifier.
+ ///
+ [JsonProperty(PropertyName = "_rid")]
+ public string _rid { get; private set; }
+
+ ///
+ /// Gets a system generated property that denotes the last updated
+ /// timestamp of the resource.
+ ///
+ [JsonProperty(PropertyName = "_ts")]
+ public double? _ts { get; private set; }
+
+ ///
+ /// Gets a system generated property representing the resource etag
+ /// required for optimistic concurrency control.
+ ///
+ [JsonProperty(PropertyName = "_etag")]
+ public string _etag { get; private set; }
+
+ ///
+ /// Gets a system generated property that specifies the addressable
+ /// path of the container resource.
+ ///
+ [JsonProperty(PropertyName = "_self")]
+ public string _self { get; private set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Id == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Id");
+ }
+ if (PartitionKey != null)
+ {
+ PartitionKey.Validate();
+ }
+ }
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableSqlDatabaseGetResult.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableSqlDatabaseGetResult.cs
new file mode 100644
index 000000000000..b9b9a715c381
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableSqlDatabaseGetResult.cs
@@ -0,0 +1,95 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB.Models
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Serialization;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// An Azure Cosmos DB SQL database event
+ ///
+ [Rest.Serialization.JsonTransformation]
+ public partial class RestorableSqlDatabaseGetResult
+ {
+ ///
+ /// Initializes a new instance of the RestorableSqlDatabaseGetResult
+ /// class.
+ ///
+ public RestorableSqlDatabaseGetResult()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the RestorableSqlDatabaseGetResult
+ /// class.
+ ///
+ /// The resource of an Azure Cosmos DB SQL
+ /// database event
+ /// The unique resource Identifier of the ARM
+ /// resource.
+ /// The name of the ARM resource.
+ /// The type of Azure resource.
+ public RestorableSqlDatabaseGetResult(RestorableSqlDatabasePropertiesResource resource = default(RestorableSqlDatabasePropertiesResource), string id = default(string), string name = default(string), string type = default(string))
+ {
+ Resource = resource;
+ Id = id;
+ Name = name;
+ Type = type;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the resource of an Azure Cosmos DB SQL database event
+ ///
+ [JsonProperty(PropertyName = "properties.resource")]
+ public RestorableSqlDatabasePropertiesResource Resource { get; set; }
+
+ ///
+ /// Gets the unique resource Identifier of the ARM resource.
+ ///
+ [JsonProperty(PropertyName = "id")]
+ public string Id { get; private set; }
+
+ ///
+ /// Gets the name of the ARM resource.
+ ///
+ [JsonProperty(PropertyName = "name")]
+ public string Name { get; private set; }
+
+ ///
+ /// Gets the type of Azure resource.
+ ///
+ [JsonProperty(PropertyName = "type")]
+ public string Type { get; private set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Resource != null)
+ {
+ Resource.Validate();
+ }
+ }
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableSqlDatabasePropertiesResource.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableSqlDatabasePropertiesResource.cs
new file mode 100644
index 000000000000..ba9bbcbdb6f9
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableSqlDatabasePropertiesResource.cs
@@ -0,0 +1,113 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// The resource of an Azure Cosmos DB SQL database event
+ ///
+ public partial class RestorableSqlDatabasePropertiesResource
+ {
+ ///
+ /// Initializes a new instance of the
+ /// RestorableSqlDatabasePropertiesResource class.
+ ///
+ public RestorableSqlDatabasePropertiesResource()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the
+ /// RestorableSqlDatabasePropertiesResource class.
+ ///
+ /// A system generated property. A unique
+ /// identifier.
+ /// The operation type of this database
+ /// event. Possible values include: 'Create', 'Replace', 'Delete',
+ /// 'SystemOperation'
+ /// The time when this database event
+ /// happened.
+ /// The name of the SQL database.
+ /// The resource ID of the SQL
+ /// database.
+ /// Cosmos DB SQL database resource
+ /// object
+ public RestorableSqlDatabasePropertiesResource(string _rid = default(string), string operationType = default(string), string eventTimestamp = default(string), string ownerId = default(string), string ownerResourceId = default(string), RestorableSqlDatabasePropertiesResourceDatabase database = default(RestorableSqlDatabasePropertiesResourceDatabase))
+ {
+ this._rid = _rid;
+ OperationType = operationType;
+ EventTimestamp = eventTimestamp;
+ OwnerId = ownerId;
+ OwnerResourceId = ownerResourceId;
+ Database = database;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets a system generated property. A unique identifier.
+ ///
+ [JsonProperty(PropertyName = "_rid")]
+ public string _rid { get; private set; }
+
+ ///
+ /// Gets the operation type of this database event. Possible values
+ /// include: 'Create', 'Replace', 'Delete', 'SystemOperation'
+ ///
+ [JsonProperty(PropertyName = "operationType")]
+ public string OperationType { get; private set; }
+
+ ///
+ /// Gets the time when this database event happened.
+ ///
+ [JsonProperty(PropertyName = "eventTimestamp")]
+ public string EventTimestamp { get; private set; }
+
+ ///
+ /// Gets the name of the SQL database.
+ ///
+ [JsonProperty(PropertyName = "ownerId")]
+ public string OwnerId { get; private set; }
+
+ ///
+ /// Gets the resource ID of the SQL database.
+ ///
+ [JsonProperty(PropertyName = "ownerResourceId")]
+ public string OwnerResourceId { get; private set; }
+
+ ///
+ /// Gets or sets cosmos DB SQL database resource object
+ ///
+ [JsonProperty(PropertyName = "database")]
+ public RestorableSqlDatabasePropertiesResourceDatabase Database { get; set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Database != null)
+ {
+ Database.Validate();
+ }
+ }
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableSqlDatabasePropertiesResourceDatabase.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableSqlDatabasePropertiesResourceDatabase.cs
new file mode 100644
index 000000000000..d17a30ea4a3e
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestorableSqlDatabasePropertiesResourceDatabase.cs
@@ -0,0 +1,126 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB.Models
+{
+ using Microsoft.Rest;
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Cosmos DB SQL database resource object
+ ///
+ public partial class RestorableSqlDatabasePropertiesResourceDatabase
+ {
+ ///
+ /// Initializes a new instance of the
+ /// RestorableSqlDatabasePropertiesResourceDatabase class.
+ ///
+ public RestorableSqlDatabasePropertiesResourceDatabase()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the
+ /// RestorableSqlDatabasePropertiesResourceDatabase class.
+ ///
+ /// Name of the Cosmos DB SQL database
+ /// A system generated property. A unique
+ /// identifier.
+ /// A system generated property that denotes the last
+ /// updated timestamp of the resource.
+ /// A system generated property representing the
+ /// resource etag required for optimistic concurrency control.
+ /// A system generated property that specified the
+ /// addressable path of the collections resource.
+ /// A system generated property that specifies the
+ /// addressable path of the users resource.
+ /// A system generated property that specifies the
+ /// addressable path of the database resource.
+ public RestorableSqlDatabasePropertiesResourceDatabase(string id, string _rid = default(string), double? _ts = default(double?), string _etag = default(string), string _colls = default(string), string _users = default(string), string _self = default(string))
+ {
+ Id = id;
+ this._rid = _rid;
+ this._ts = _ts;
+ this._etag = _etag;
+ this._colls = _colls;
+ this._users = _users;
+ this._self = _self;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets name of the Cosmos DB SQL database
+ ///
+ [JsonProperty(PropertyName = "id")]
+ public string Id { get; set; }
+
+ ///
+ /// Gets a system generated property. A unique identifier.
+ ///
+ [JsonProperty(PropertyName = "_rid")]
+ public string _rid { get; private set; }
+
+ ///
+ /// Gets a system generated property that denotes the last updated
+ /// timestamp of the resource.
+ ///
+ [JsonProperty(PropertyName = "_ts")]
+ public double? _ts { get; private set; }
+
+ ///
+ /// Gets a system generated property representing the resource etag
+ /// required for optimistic concurrency control.
+ ///
+ [JsonProperty(PropertyName = "_etag")]
+ public string _etag { get; private set; }
+
+ ///
+ /// Gets a system generated property that specified the addressable
+ /// path of the collections resource.
+ ///
+ [JsonProperty(PropertyName = "_colls")]
+ public string _colls { get; private set; }
+
+ ///
+ /// Gets a system generated property that specifies the addressable
+ /// path of the users resource.
+ ///
+ [JsonProperty(PropertyName = "_users")]
+ public string _users { get; private set; }
+
+ ///
+ /// Gets a system generated property that specifies the addressable
+ /// path of the database resource.
+ ///
+ [JsonProperty(PropertyName = "_self")]
+ public string _self { get; private set; }
+
+ ///
+ /// Validate the object.
+ ///
+ ///
+ /// Thrown if validation fails
+ ///
+ public virtual void Validate()
+ {
+ if (Id == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "Id");
+ }
+ }
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestoreMode.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestoreMode.cs
new file mode 100644
index 000000000000..347b1a4033f2
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestoreMode.cs
@@ -0,0 +1,21 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB.Models
+{
+
+ ///
+ /// Defines values for RestoreMode.
+ ///
+ public static class RestoreMode
+ {
+ public const string PointInTime = "PointInTime";
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestoreParameters.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestoreParameters.cs
new file mode 100644
index 000000000000..2fd078b19f03
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/RestoreParameters.cs
@@ -0,0 +1,86 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB.Models
+{
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+
+ ///
+ /// Parameters to indicate the information about the restore.
+ ///
+ public partial class RestoreParameters
+ {
+ ///
+ /// Initializes a new instance of the RestoreParameters class.
+ ///
+ public RestoreParameters()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the RestoreParameters class.
+ ///
+ /// Describes the mode of the restore.
+ /// Possible values include: 'PointInTime'
+ /// 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}
+ /// Time to which the account has
+ /// to be restored (ISO-8601 format).
+ /// List of specific databases
+ /// available for restore.
+ public RestoreParameters(string restoreMode = default(string), string restoreSource = default(string), System.DateTime? restoreTimestampInUtc = default(System.DateTime?), IList databasesToRestore = default(IList))
+ {
+ RestoreMode = restoreMode;
+ RestoreSource = restoreSource;
+ RestoreTimestampInUtc = restoreTimestampInUtc;
+ DatabasesToRestore = databasesToRestore;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets describes the mode of the restore. Possible values
+ /// include: 'PointInTime'
+ ///
+ [JsonProperty(PropertyName = "restoreMode")]
+ public string RestoreMode { get; set; }
+
+ ///
+ /// Gets or sets 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}
+ ///
+ [JsonProperty(PropertyName = "restoreSource")]
+ public string RestoreSource { get; set; }
+
+ ///
+ /// Gets or sets time to which the account has to be restored (ISO-8601
+ /// format).
+ ///
+ [JsonProperty(PropertyName = "restoreTimestampInUtc")]
+ public System.DateTime? RestoreTimestampInUtc { get; set; }
+
+ ///
+ /// Gets or sets list of specific databases available for restore.
+ ///
+ [JsonProperty(PropertyName = "databasesToRestore")]
+ public IList DatabasesToRestore { get; set; }
+
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SystemData.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SystemData.cs
new file mode 100644
index 000000000000..9cb1fb8254a0
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/Models/SystemData.cs
@@ -0,0 +1,103 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB.Models
+{
+ using Newtonsoft.Json;
+ using System.Linq;
+
+ ///
+ /// Metadata pertaining to creation and last modification of the resource.
+ ///
+ public partial class SystemData
+ {
+ ///
+ /// Initializes a new instance of the SystemData class.
+ ///
+ public SystemData()
+ {
+ CustomInit();
+ }
+
+ ///
+ /// Initializes a new instance of the SystemData class.
+ ///
+ /// The identity that created the
+ /// resource.
+ /// The type of identity that created the
+ /// resource. Possible values include: 'User', 'Application',
+ /// 'ManagedIdentity', 'Key'
+ /// The timestamp of resource creation
+ /// (UTC).
+ /// The identity that last modified the
+ /// resource.
+ /// The type of identity that last
+ /// modified the resource. Possible values include: 'User',
+ /// 'Application', 'ManagedIdentity', 'Key'
+ /// The timestamp of resource last
+ /// modification (UTC)
+ public SystemData(string createdBy = default(string), string createdByType = default(string), System.DateTime? createdAt = default(System.DateTime?), string lastModifiedBy = default(string), string lastModifiedByType = default(string), System.DateTime? lastModifiedAt = default(System.DateTime?))
+ {
+ CreatedBy = createdBy;
+ CreatedByType = createdByType;
+ CreatedAt = createdAt;
+ LastModifiedBy = lastModifiedBy;
+ LastModifiedByType = lastModifiedByType;
+ LastModifiedAt = lastModifiedAt;
+ CustomInit();
+ }
+
+ ///
+ /// An initialization method that performs custom operations like setting defaults
+ ///
+ partial void CustomInit();
+
+ ///
+ /// Gets or sets the identity that created the resource.
+ ///
+ [JsonProperty(PropertyName = "createdBy")]
+ public string CreatedBy { get; set; }
+
+ ///
+ /// Gets or sets the type of identity that created the resource.
+ /// Possible values include: 'User', 'Application', 'ManagedIdentity',
+ /// 'Key'
+ ///
+ [JsonProperty(PropertyName = "createdByType")]
+ public string CreatedByType { get; set; }
+
+ ///
+ /// Gets or sets the timestamp of resource creation (UTC).
+ ///
+ [JsonProperty(PropertyName = "createdAt")]
+ public System.DateTime? CreatedAt { get; set; }
+
+ ///
+ /// Gets or sets the identity that last modified the resource.
+ ///
+ [JsonProperty(PropertyName = "lastModifiedBy")]
+ public string LastModifiedBy { get; set; }
+
+ ///
+ /// Gets or sets the type of identity that last modified the resource.
+ /// Possible values include: 'User', 'Application', 'ManagedIdentity',
+ /// 'Key'
+ ///
+ [JsonProperty(PropertyName = "lastModifiedByType")]
+ public string LastModifiedByType { get; set; }
+
+ ///
+ /// Gets or sets the timestamp of resource last modification (UTC)
+ ///
+ [JsonProperty(PropertyName = "lastModifiedAt")]
+ public System.DateTime? LastModifiedAt { get; set; }
+
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/MongoDBResourcesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/MongoDBResourcesOperations.cs
index 465fb26b1ef6..18646bec6c93 100644
--- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/MongoDBResourcesOperations.cs
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/MongoDBResourcesOperations.cs
@@ -108,10 +108,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -352,10 +348,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -655,10 +647,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -986,10 +974,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -1239,10 +1223,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -1557,10 +1537,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -1905,10 +1881,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -2166,10 +2138,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -2401,10 +2369,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -2666,10 +2630,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -2916,10 +2876,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -3171,10 +3127,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -3441,10 +3393,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -3685,10 +3633,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -3959,10 +3903,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
@@ -4218,10 +4158,6 @@ internal MongoDBResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/NotebookWorkspacesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/NotebookWorkspacesOperations.cs
index cd345eace5e0..44f42b376404 100644
--- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/NotebookWorkspacesOperations.cs
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/NotebookWorkspacesOperations.cs
@@ -107,10 +107,6 @@ internal NotebookWorkspacesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (Client.ApiVersion == null)
{
@@ -342,10 +338,6 @@ internal NotebookWorkspacesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (Client.ApiVersion == null)
{
@@ -624,10 +616,6 @@ internal NotebookWorkspacesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (Client.ApiVersion == null)
{
@@ -906,10 +894,6 @@ internal NotebookWorkspacesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (Client.ApiVersion == null)
{
@@ -1149,10 +1133,6 @@ internal NotebookWorkspacesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (Client.ApiVersion == null)
{
@@ -1366,10 +1346,6 @@ internal NotebookWorkspacesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (Client.ApiVersion == null)
{
@@ -1583,10 +1559,6 @@ internal NotebookWorkspacesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (Client.ApiVersion == null)
{
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PartitionKeyRangeIdOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PartitionKeyRangeIdOperations.cs
index 1590e2151a3a..911e686adeae 100644
--- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PartitionKeyRangeIdOperations.cs
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PartitionKeyRangeIdOperations.cs
@@ -123,10 +123,6 @@ internal PartitionKeyRangeIdOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PartitionKeyRangeIdRegionOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PartitionKeyRangeIdRegionOperations.cs
index 6a118c9fda03..1214ed73af45 100644
--- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PartitionKeyRangeIdRegionOperations.cs
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PartitionKeyRangeIdRegionOperations.cs
@@ -126,10 +126,6 @@ internal PartitionKeyRangeIdRegionOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileOperations.cs
index 8c37a40f2cb1..85cf19d0558a 100644
--- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileOperations.cs
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileOperations.cs
@@ -114,10 +114,6 @@ internal PercentileOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileSourceTargetOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileSourceTargetOperations.cs
index 125a8300bd6a..80dc89af3033 100644
--- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileSourceTargetOperations.cs
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileSourceTargetOperations.cs
@@ -123,10 +123,6 @@ internal PercentileSourceTargetOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileTargetOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileTargetOperations.cs
index 3170cdfc1754..8fdead41d1f2 100644
--- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileTargetOperations.cs
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PercentileTargetOperations.cs
@@ -118,10 +118,6 @@ internal PercentileTargetOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (accountName == null)
{
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PrivateEndpointConnectionsOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PrivateEndpointConnectionsOperations.cs
index 04d3107596df..f0312253fad4 100644
--- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PrivateEndpointConnectionsOperations.cs
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PrivateEndpointConnectionsOperations.cs
@@ -107,10 +107,6 @@ internal PrivateEndpointConnectionsOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (Client.ApiVersion == null)
{
@@ -350,10 +346,6 @@ internal PrivateEndpointConnectionsOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (Client.ApiVersion == null)
{
@@ -653,10 +645,6 @@ internal PrivateEndpointConnectionsOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (Client.ApiVersion == null)
{
@@ -905,10 +893,6 @@ internal PrivateEndpointConnectionsOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (Client.ApiVersion == null)
{
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PrivateLinkResourcesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PrivateLinkResourcesOperations.cs
index 254571ca6f4d..68094748b27b 100644
--- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PrivateLinkResourcesOperations.cs
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/PrivateLinkResourcesOperations.cs
@@ -108,10 +108,6 @@ internal PrivateLinkResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (Client.ApiVersion == null)
{
@@ -352,10 +348,6 @@ internal PrivateLinkResourcesOperations(CosmosDBManagementClient client)
{
throw new ValidationException(ValidationRules.MinLength, "resourceGroupName", 1);
}
- if (!System.Text.RegularExpressions.Regex.IsMatch(resourceGroupName, "^[-\\w\\._\\(\\)]+$"))
- {
- throw new ValidationException(ValidationRules.Pattern, "resourceGroupName", "^[-\\w\\._\\(\\)]+$");
- }
}
if (Client.ApiVersion == null)
{
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableDatabaseAccountsOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableDatabaseAccountsOperations.cs
new file mode 100644
index 000000000000..ff6c0c1e5ac1
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableDatabaseAccountsOperations.cs
@@ -0,0 +1,666 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Net;
+ using System.Net.Http;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// RestorableDatabaseAccountsOperations operations.
+ ///
+ internal partial class RestorableDatabaseAccountsOperations : IServiceOperations, IRestorableDatabaseAccountsOperations
+ {
+ ///
+ /// Initializes a new instance of the RestorableDatabaseAccountsOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal RestorableDatabaseAccountsOperations(CosmosDBManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the CosmosDBManagementClient
+ ///
+ public CosmosDBManagementClient Client { get; private set; }
+
+ ///
+ /// 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.
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word capitalized.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListByLocationWithHttpMessagesAsync(string location, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
+ if (location == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "location");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("location", location);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "ListByLocation", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{location}", System.Uri.EscapeDataString(location));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Lists all the restorable Azure Cosmos DB database accounts available under
+ /// the subscription. This call requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read'
+ /// permission.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListWithHttpMessagesAsync(Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/restorableDatabaseAccounts").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ ///
+ /// Retrieves the properties of an existing Azure Cosmos DB restorable database
+ /// account. This call requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*'
+ /// permission.
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word capitalized.
+ ///
+ ///
+ /// The instanceId GUID of a restorable database account.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task> GetByLocationWithHttpMessagesAsync(string location, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
+ if (location == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "location");
+ }
+ if (instanceId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "instanceId");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("location", location);
+ tracingParameters.Add("instanceId", instanceId);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "GetByLocation", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{location}", System.Uri.EscapeDataString(location));
+ _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableDatabaseAccountsOperationsExtensions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableDatabaseAccountsOperationsExtensions.cs
new file mode 100644
index 000000000000..3de1f9e51ec1
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableDatabaseAccountsOperationsExtensions.cs
@@ -0,0 +1,147 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for RestorableDatabaseAccountsOperations.
+ ///
+ public static partial class RestorableDatabaseAccountsOperationsExtensions
+ {
+ ///
+ /// 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.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word capitalized.
+ ///
+ public static IEnumerable ListByLocation(this IRestorableDatabaseAccountsOperations operations, string location)
+ {
+ return operations.ListByLocationAsync(location).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// 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.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word capitalized.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListByLocationAsync(this IRestorableDatabaseAccountsOperations operations, string location, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListByLocationWithHttpMessagesAsync(location, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Lists all the restorable Azure Cosmos DB database accounts available under
+ /// the subscription. This call requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read'
+ /// permission.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ public static IEnumerable List(this IRestorableDatabaseAccountsOperations operations)
+ {
+ return operations.ListAsync().GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Lists all the restorable Azure Cosmos DB database accounts available under
+ /// the subscription. This call requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read'
+ /// permission.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListAsync(this IRestorableDatabaseAccountsOperations operations, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ ///
+ /// Retrieves the properties of an existing Azure Cosmos DB restorable database
+ /// account. This call requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*'
+ /// permission.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word capitalized.
+ ///
+ ///
+ /// The instanceId GUID of a restorable database account.
+ ///
+ public static RestorableDatabaseAccountGetResult GetByLocation(this IRestorableDatabaseAccountsOperations operations, string location, string instanceId)
+ {
+ return operations.GetByLocationAsync(location, instanceId).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Retrieves the properties of an existing Azure Cosmos DB restorable database
+ /// account. This call requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read/*'
+ /// permission.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word capitalized.
+ ///
+ ///
+ /// The instanceId GUID of a restorable database account.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task GetByLocationAsync(this IRestorableDatabaseAccountsOperations operations, string location, string instanceId, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.GetByLocationWithHttpMessagesAsync(location, instanceId, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableMongodbCollectionsOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableMongodbCollectionsOperations.cs
new file mode 100644
index 000000000000..d2ba923127ec
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableMongodbCollectionsOperations.cs
@@ -0,0 +1,276 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Net;
+ using System.Net.Http;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// RestorableMongodbCollectionsOperations operations.
+ ///
+ internal partial class RestorableMongodbCollectionsOperations : IServiceOperations, IRestorableMongodbCollectionsOperations
+ {
+ ///
+ /// Initializes a new instance of the RestorableMongodbCollectionsOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal RestorableMongodbCollectionsOperations(CosmosDBManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the CosmosDBManagementClient
+ ///
+ public CosmosDBManagementClient Client { get; private set; }
+
+ ///
+ /// Show the event feed of all mutations done on all the Azure Cosmos DB
+ /// MongoDB collections under a specific database. This helps in scenario
+ /// where container was accidentally deleted. This API requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read'
+ /// permission
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word capitalized.
+ ///
+ ///
+ /// The instanceId GUID of a restorable database account.
+ ///
+ ///
+ /// The resource ID of the MongoDB database.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restorableMongodbDatabaseRid = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
+ if (location == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "location");
+ }
+ if (instanceId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "instanceId");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("location", location);
+ tracingParameters.Add("instanceId", instanceId);
+ tracingParameters.Add("restorableMongodbDatabaseRid", restorableMongodbDatabaseRid);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbCollections").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{location}", System.Uri.EscapeDataString(location));
+ _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (restorableMongodbDatabaseRid != null)
+ {
+ _queryParameters.Add(string.Format("restorableMongodbDatabaseRid={0}", System.Uri.EscapeDataString(restorableMongodbDatabaseRid)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableMongodbCollectionsOperationsExtensions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableMongodbCollectionsOperationsExtensions.cs
new file mode 100644
index 000000000000..65d92af706a9
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableMongodbCollectionsOperationsExtensions.cs
@@ -0,0 +1,81 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for RestorableMongodbCollectionsOperations.
+ ///
+ public static partial class RestorableMongodbCollectionsOperationsExtensions
+ {
+ ///
+ /// Show the event feed of all mutations done on all the Azure Cosmos DB
+ /// MongoDB collections under a specific database. This helps in scenario
+ /// where container was accidentally deleted. This API requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read'
+ /// permission
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word capitalized.
+ ///
+ ///
+ /// The instanceId GUID of a restorable database account.
+ ///
+ ///
+ /// The resource ID of the MongoDB database.
+ ///
+ public static IEnumerable List(this IRestorableMongodbCollectionsOperations operations, string location, string instanceId, string restorableMongodbDatabaseRid = default(string))
+ {
+ return operations.ListAsync(location, instanceId, restorableMongodbDatabaseRid).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Show the event feed of all mutations done on all the Azure Cosmos DB
+ /// MongoDB collections under a specific database. This helps in scenario
+ /// where container was accidentally deleted. This API requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read'
+ /// permission
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word capitalized.
+ ///
+ ///
+ /// The instanceId GUID of a restorable database account.
+ ///
+ ///
+ /// The resource ID of the MongoDB database.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListAsync(this IRestorableMongodbCollectionsOperations operations, string location, string instanceId, string restorableMongodbDatabaseRid = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(location, instanceId, restorableMongodbDatabaseRid, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableMongodbDatabasesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableMongodbDatabasesOperations.cs
new file mode 100644
index 000000000000..873426f77faf
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableMongodbDatabasesOperations.cs
@@ -0,0 +1,269 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Net;
+ using System.Net.Http;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// RestorableMongodbDatabasesOperations operations.
+ ///
+ internal partial class RestorableMongodbDatabasesOperations : IServiceOperations, IRestorableMongodbDatabasesOperations
+ {
+ ///
+ /// Initializes a new instance of the RestorableMongodbDatabasesOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal RestorableMongodbDatabasesOperations(CosmosDBManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the CosmosDBManagementClient
+ ///
+ public CosmosDBManagementClient Client { get; private set; }
+
+ ///
+ /// Show the event feed of all mutations done on all the Azure Cosmos DB
+ /// MongoDB databases under the restorable account. This helps in scenario
+ /// where database was accidentally deleted to get the deletion time. This API
+ /// requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read'
+ /// permission
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word capitalized.
+ ///
+ ///
+ /// The instanceId GUID of a restorable database account.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListWithHttpMessagesAsync(string location, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
+ if (location == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "location");
+ }
+ if (instanceId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "instanceId");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("location", location);
+ tracingParameters.Add("instanceId", instanceId);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbDatabases").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{location}", System.Uri.EscapeDataString(location));
+ _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableMongodbDatabasesOperationsExtensions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableMongodbDatabasesOperationsExtensions.cs
new file mode 100644
index 000000000000..60d7154789b1
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableMongodbDatabasesOperationsExtensions.cs
@@ -0,0 +1,77 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for RestorableMongodbDatabasesOperations.
+ ///
+ public static partial class RestorableMongodbDatabasesOperationsExtensions
+ {
+ ///
+ /// Show the event feed of all mutations done on all the Azure Cosmos DB
+ /// MongoDB databases under the restorable account. This helps in scenario
+ /// where database was accidentally deleted to get the deletion time. This API
+ /// requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read'
+ /// permission
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word capitalized.
+ ///
+ ///
+ /// The instanceId GUID of a restorable database account.
+ ///
+ public static IEnumerable List(this IRestorableMongodbDatabasesOperations operations, string location, string instanceId)
+ {
+ return operations.ListAsync(location, instanceId).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Show the event feed of all mutations done on all the Azure Cosmos DB
+ /// MongoDB databases under the restorable account. This helps in scenario
+ /// where database was accidentally deleted to get the deletion time. This API
+ /// requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read'
+ /// permission
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word capitalized.
+ ///
+ ///
+ /// The instanceId GUID of a restorable database account.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListAsync(this IRestorableMongodbDatabasesOperations operations, string location, string instanceId, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(location, instanceId, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableMongodbResourcesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableMongodbResourcesOperations.cs
new file mode 100644
index 000000000000..2ee2f8209e4f
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableMongodbResourcesOperations.cs
@@ -0,0 +1,284 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Net;
+ using System.Net.Http;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// RestorableMongodbResourcesOperations operations.
+ ///
+ internal partial class RestorableMongodbResourcesOperations : IServiceOperations, IRestorableMongodbResourcesOperations
+ {
+ ///
+ /// Initializes a new instance of the RestorableMongodbResourcesOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal RestorableMongodbResourcesOperations(CosmosDBManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the CosmosDBManagementClient
+ ///
+ public CosmosDBManagementClient Client { get; private set; }
+
+ ///
+ /// Return a list of database and collection combo that exist on the account at
+ /// the given timestamp and location. This helps in scenarios to validate what
+ /// resources exist at given timestamp and location. This API requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read'
+ /// permission.
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word capitalized.
+ ///
+ ///
+ /// The instanceId GUID of a restorable database account.
+ ///
+ ///
+ /// The location where the restorable resources are located.
+ ///
+ ///
+ /// The timestamp when the restorable resources existed.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
+ if (location == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "location");
+ }
+ if (instanceId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "instanceId");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("location", location);
+ tracingParameters.Add("instanceId", instanceId);
+ tracingParameters.Add("restoreLocation", restoreLocation);
+ tracingParameters.Add("restoreTimestampInUtc", restoreTimestampInUtc);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableMongodbResources").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{location}", System.Uri.EscapeDataString(location));
+ _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (restoreLocation != null)
+ {
+ _queryParameters.Add(string.Format("restoreLocation={0}", System.Uri.EscapeDataString(restoreLocation)));
+ }
+ if (restoreTimestampInUtc != null)
+ {
+ _queryParameters.Add(string.Format("restoreTimestampInUtc={0}", System.Uri.EscapeDataString(restoreTimestampInUtc)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableMongodbResourcesOperationsExtensions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableMongodbResourcesOperationsExtensions.cs
new file mode 100644
index 000000000000..52725d0a663c
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableMongodbResourcesOperationsExtensions.cs
@@ -0,0 +1,87 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for RestorableMongodbResourcesOperations.
+ ///
+ public static partial class RestorableMongodbResourcesOperationsExtensions
+ {
+ ///
+ /// Return a list of database and collection combo that exist on the account at
+ /// the given timestamp and location. This helps in scenarios to validate what
+ /// resources exist at given timestamp and location. This API requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read'
+ /// permission.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word capitalized.
+ ///
+ ///
+ /// The instanceId GUID of a restorable database account.
+ ///
+ ///
+ /// The location where the restorable resources are located.
+ ///
+ ///
+ /// The timestamp when the restorable resources existed.
+ ///
+ public static IEnumerable List(this IRestorableMongodbResourcesOperations operations, string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string))
+ {
+ return operations.ListAsync(location, instanceId, restoreLocation, restoreTimestampInUtc).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Return a list of database and collection combo that exist on the account at
+ /// the given timestamp and location. This helps in scenarios to validate what
+ /// resources exist at given timestamp and location. This API requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read'
+ /// permission.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word capitalized.
+ ///
+ ///
+ /// The instanceId GUID of a restorable database account.
+ ///
+ ///
+ /// The location where the restorable resources are located.
+ ///
+ ///
+ /// The timestamp when the restorable resources existed.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListAsync(this IRestorableMongodbResourcesOperations operations, string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(location, instanceId, restoreLocation, restoreTimestampInUtc, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableSqlContainersOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableSqlContainersOperations.cs
new file mode 100644
index 000000000000..67279345471b
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableSqlContainersOperations.cs
@@ -0,0 +1,292 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Net;
+ using System.Net.Http;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// RestorableSqlContainersOperations operations.
+ ///
+ internal partial class RestorableSqlContainersOperations : IServiceOperations, IRestorableSqlContainersOperations
+ {
+ ///
+ /// Initializes a new instance of the RestorableSqlContainersOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal RestorableSqlContainersOperations(CosmosDBManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the CosmosDBManagementClient
+ ///
+ public CosmosDBManagementClient Client { get; private set; }
+
+ ///
+ /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL
+ /// containers under a specific database. This helps in scenario where
+ /// container was accidentally deleted. This API requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read'
+ /// permission
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word capitalized.
+ ///
+ ///
+ /// The instanceId GUID of a restorable database account.
+ ///
+ ///
+ /// The resource ID of the SQL database.
+ ///
+ ///
+ /// The snapshot create timestamp after which snapshots need to be listed.
+ ///
+ ///
+ /// The snapshot create timestamp before which snapshots need to be listed.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restorableSqlDatabaseRid = default(string), string startTime = default(string), string endTime = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
+ if (location == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "location");
+ }
+ if (instanceId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "instanceId");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("location", location);
+ tracingParameters.Add("instanceId", instanceId);
+ tracingParameters.Add("restorableSqlDatabaseRid", restorableSqlDatabaseRid);
+ tracingParameters.Add("startTime", startTime);
+ tracingParameters.Add("endTime", endTime);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlContainers").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{location}", System.Uri.EscapeDataString(location));
+ _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (restorableSqlDatabaseRid != null)
+ {
+ _queryParameters.Add(string.Format("restorableSqlDatabaseRid={0}", System.Uri.EscapeDataString(restorableSqlDatabaseRid)));
+ }
+ if (startTime != null)
+ {
+ _queryParameters.Add(string.Format("startTime={0}", System.Uri.EscapeDataString(startTime)));
+ }
+ if (endTime != null)
+ {
+ _queryParameters.Add(string.Format("endTime={0}", System.Uri.EscapeDataString(endTime)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableSqlContainersOperationsExtensions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableSqlContainersOperationsExtensions.cs
new file mode 100644
index 000000000000..d0798f918273
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableSqlContainersOperationsExtensions.cs
@@ -0,0 +1,93 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for RestorableSqlContainersOperations.
+ ///
+ public static partial class RestorableSqlContainersOperationsExtensions
+ {
+ ///
+ /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL
+ /// containers under a specific database. This helps in scenario where
+ /// container was accidentally deleted. This API requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read'
+ /// permission
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word capitalized.
+ ///
+ ///
+ /// The instanceId GUID of a restorable database account.
+ ///
+ ///
+ /// The resource ID of the SQL database.
+ ///
+ ///
+ /// The snapshot create timestamp after which snapshots need to be listed.
+ ///
+ ///
+ /// The snapshot create timestamp before which snapshots need to be listed.
+ ///
+ public static IEnumerable List(this IRestorableSqlContainersOperations operations, string location, string instanceId, string restorableSqlDatabaseRid = default(string), string startTime = default(string), string endTime = default(string))
+ {
+ return operations.ListAsync(location, instanceId, restorableSqlDatabaseRid, startTime, endTime).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL
+ /// containers under a specific database. This helps in scenario where
+ /// container was accidentally deleted. This API requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read'
+ /// permission
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word capitalized.
+ ///
+ ///
+ /// The instanceId GUID of a restorable database account.
+ ///
+ ///
+ /// The resource ID of the SQL database.
+ ///
+ ///
+ /// The snapshot create timestamp after which snapshots need to be listed.
+ ///
+ ///
+ /// The snapshot create timestamp before which snapshots need to be listed.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListAsync(this IRestorableSqlContainersOperations operations, string location, string instanceId, string restorableSqlDatabaseRid = default(string), string startTime = default(string), string endTime = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(location, instanceId, restorableSqlDatabaseRid, startTime, endTime, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableSqlDatabasesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableSqlDatabasesOperations.cs
new file mode 100644
index 000000000000..db23ce64f1b8
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableSqlDatabasesOperations.cs
@@ -0,0 +1,269 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Net;
+ using System.Net.Http;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// RestorableSqlDatabasesOperations operations.
+ ///
+ internal partial class RestorableSqlDatabasesOperations : IServiceOperations, IRestorableSqlDatabasesOperations
+ {
+ ///
+ /// Initializes a new instance of the RestorableSqlDatabasesOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal RestorableSqlDatabasesOperations(CosmosDBManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the CosmosDBManagementClient
+ ///
+ public CosmosDBManagementClient Client { get; private set; }
+
+ ///
+ /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL
+ /// databases under the restorable account. This helps in scenario where
+ /// database was accidentally deleted to get the deletion time. This API
+ /// requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read'
+ /// permission
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word capitalized.
+ ///
+ ///
+ /// The instanceId GUID of a restorable database account.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListWithHttpMessagesAsync(string location, string instanceId, Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
+ if (location == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "location");
+ }
+ if (instanceId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "instanceId");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("location", location);
+ tracingParameters.Add("instanceId", instanceId);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlDatabases").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{location}", System.Uri.EscapeDataString(location));
+ _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableSqlDatabasesOperationsExtensions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableSqlDatabasesOperationsExtensions.cs
new file mode 100644
index 000000000000..1466ae87bed7
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableSqlDatabasesOperationsExtensions.cs
@@ -0,0 +1,77 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for RestorableSqlDatabasesOperations.
+ ///
+ public static partial class RestorableSqlDatabasesOperationsExtensions
+ {
+ ///
+ /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL
+ /// databases under the restorable account. This helps in scenario where
+ /// database was accidentally deleted to get the deletion time. This API
+ /// requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read'
+ /// permission
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word capitalized.
+ ///
+ ///
+ /// The instanceId GUID of a restorable database account.
+ ///
+ public static IEnumerable List(this IRestorableSqlDatabasesOperations operations, string location, string instanceId)
+ {
+ return operations.ListAsync(location, instanceId).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Show the event feed of all mutations done on all the Azure Cosmos DB SQL
+ /// databases under the restorable account. This helps in scenario where
+ /// database was accidentally deleted to get the deletion time. This API
+ /// requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read'
+ /// permission
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word capitalized.
+ ///
+ ///
+ /// The instanceId GUID of a restorable database account.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListAsync(this IRestorableSqlDatabasesOperations operations, string location, string instanceId, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(location, instanceId, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableSqlResourcesOperations.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableSqlResourcesOperations.cs
new file mode 100644
index 000000000000..e59fb7d25429
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableSqlResourcesOperations.cs
@@ -0,0 +1,284 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using Newtonsoft.Json;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Linq;
+ using System.Net;
+ using System.Net.Http;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// RestorableSqlResourcesOperations operations.
+ ///
+ internal partial class RestorableSqlResourcesOperations : IServiceOperations, IRestorableSqlResourcesOperations
+ {
+ ///
+ /// Initializes a new instance of the RestorableSqlResourcesOperations class.
+ ///
+ ///
+ /// Reference to the service client.
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ internal RestorableSqlResourcesOperations(CosmosDBManagementClient client)
+ {
+ if (client == null)
+ {
+ throw new System.ArgumentNullException("client");
+ }
+ Client = client;
+ }
+
+ ///
+ /// Gets a reference to the CosmosDBManagementClient
+ ///
+ public CosmosDBManagementClient Client { get; private set; }
+
+ ///
+ /// Return a list of database and container combo that exist on the account at
+ /// the given timestamp and location. This helps in scenarios to validate what
+ /// resources exist at given timestamp and location. This API requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read'
+ /// permission.
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word capitalized.
+ ///
+ ///
+ /// The instanceId GUID of a restorable database account.
+ ///
+ ///
+ /// The location where the restorable resources are located.
+ ///
+ ///
+ /// The timestamp when the restorable resources existed.
+ ///
+ ///
+ /// Headers that will be added to request.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ ///
+ /// Thrown when the operation returned an invalid status code
+ ///
+ ///
+ /// Thrown when unable to deserialize the response
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// Thrown when a required parameter is null
+ ///
+ ///
+ /// A response object containing the response body and response headers.
+ ///
+ public async Task>> ListWithHttpMessagesAsync(string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string), Dictionary> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
+ {
+ if (Client.ApiVersion == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.ApiVersion");
+ }
+ if (Client.ApiVersion != null)
+ {
+ if (Client.ApiVersion.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.ApiVersion", 1);
+ }
+ }
+ if (Client.SubscriptionId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "this.Client.SubscriptionId");
+ }
+ if (Client.SubscriptionId != null)
+ {
+ if (Client.SubscriptionId.Length < 1)
+ {
+ throw new ValidationException(ValidationRules.MinLength, "Client.SubscriptionId", 1);
+ }
+ }
+ if (location == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "location");
+ }
+ if (instanceId == null)
+ {
+ throw new ValidationException(ValidationRules.CannotBeNull, "instanceId");
+ }
+ // Tracing
+ bool _shouldTrace = ServiceClientTracing.IsEnabled;
+ string _invocationId = null;
+ if (_shouldTrace)
+ {
+ _invocationId = ServiceClientTracing.NextInvocationId.ToString();
+ Dictionary tracingParameters = new Dictionary();
+ tracingParameters.Add("location", location);
+ tracingParameters.Add("instanceId", instanceId);
+ tracingParameters.Add("restoreLocation", restoreLocation);
+ tracingParameters.Add("restoreTimestampInUtc", restoreTimestampInUtc);
+ tracingParameters.Add("cancellationToken", cancellationToken);
+ ServiceClientTracing.Enter(_invocationId, this, "List", tracingParameters);
+ }
+ // Construct URL
+ var _baseUrl = Client.BaseUri.AbsoluteUri;
+ var _url = new System.Uri(new System.Uri(_baseUrl + (_baseUrl.EndsWith("/") ? "" : "/")), "subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/restorableDatabaseAccounts/{instanceId}/restorableSqlResources").ToString();
+ _url = _url.Replace("{subscriptionId}", System.Uri.EscapeDataString(Client.SubscriptionId));
+ _url = _url.Replace("{location}", System.Uri.EscapeDataString(location));
+ _url = _url.Replace("{instanceId}", System.Uri.EscapeDataString(instanceId));
+ List _queryParameters = new List();
+ if (Client.ApiVersion != null)
+ {
+ _queryParameters.Add(string.Format("api-version={0}", System.Uri.EscapeDataString(Client.ApiVersion)));
+ }
+ if (restoreLocation != null)
+ {
+ _queryParameters.Add(string.Format("restoreLocation={0}", System.Uri.EscapeDataString(restoreLocation)));
+ }
+ if (restoreTimestampInUtc != null)
+ {
+ _queryParameters.Add(string.Format("restoreTimestampInUtc={0}", System.Uri.EscapeDataString(restoreTimestampInUtc)));
+ }
+ if (_queryParameters.Count > 0)
+ {
+ _url += (_url.Contains("?") ? "&" : "?") + string.Join("&", _queryParameters);
+ }
+ // Create HTTP transport objects
+ var _httpRequest = new HttpRequestMessage();
+ HttpResponseMessage _httpResponse = null;
+ _httpRequest.Method = new HttpMethod("GET");
+ _httpRequest.RequestUri = new System.Uri(_url);
+ // Set Headers
+ if (Client.GenerateClientRequestId != null && Client.GenerateClientRequestId.Value)
+ {
+ _httpRequest.Headers.TryAddWithoutValidation("x-ms-client-request-id", System.Guid.NewGuid().ToString());
+ }
+ if (Client.AcceptLanguage != null)
+ {
+ if (_httpRequest.Headers.Contains("accept-language"))
+ {
+ _httpRequest.Headers.Remove("accept-language");
+ }
+ _httpRequest.Headers.TryAddWithoutValidation("accept-language", Client.AcceptLanguage);
+ }
+
+
+ if (customHeaders != null)
+ {
+ foreach(var _header in customHeaders)
+ {
+ if (_httpRequest.Headers.Contains(_header.Key))
+ {
+ _httpRequest.Headers.Remove(_header.Key);
+ }
+ _httpRequest.Headers.TryAddWithoutValidation(_header.Key, _header.Value);
+ }
+ }
+
+ // Serialize Request
+ string _requestContent = null;
+ // Set Credentials
+ if (Client.Credentials != null)
+ {
+ cancellationToken.ThrowIfCancellationRequested();
+ await Client.Credentials.ProcessHttpRequestAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ }
+ // Send Request
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.SendRequest(_invocationId, _httpRequest);
+ }
+ cancellationToken.ThrowIfCancellationRequested();
+ _httpResponse = await Client.HttpClient.SendAsync(_httpRequest, cancellationToken).ConfigureAwait(false);
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.ReceiveResponse(_invocationId, _httpResponse);
+ }
+ HttpStatusCode _statusCode = _httpResponse.StatusCode;
+ cancellationToken.ThrowIfCancellationRequested();
+ string _responseContent = null;
+ if ((int)_statusCode != 200)
+ {
+ var ex = new CloudException(string.Format("Operation returned an invalid status code '{0}'", _statusCode));
+ try
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ CloudError _errorBody = Rest.Serialization.SafeJsonConvert.DeserializeObject(_responseContent, Client.DeserializationSettings);
+ if (_errorBody != null)
+ {
+ ex = new CloudException(_errorBody.Message);
+ ex.Body = _errorBody;
+ }
+ }
+ catch (JsonException)
+ {
+ // Ignore the exception
+ }
+ ex.Request = new HttpRequestMessageWrapper(_httpRequest, _requestContent);
+ ex.Response = new HttpResponseMessageWrapper(_httpResponse, _responseContent);
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ ex.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Error(_invocationId, ex);
+ }
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw ex;
+ }
+ // Create Result
+ var _result = new AzureOperationResponse>();
+ _result.Request = _httpRequest;
+ _result.Response = _httpResponse;
+ if (_httpResponse.Headers.Contains("x-ms-request-id"))
+ {
+ _result.RequestId = _httpResponse.Headers.GetValues("x-ms-request-id").FirstOrDefault();
+ }
+ // Deserialize Response
+ if ((int)_statusCode == 200)
+ {
+ _responseContent = await _httpResponse.Content.ReadAsStringAsync().ConfigureAwait(false);
+ try
+ {
+ _result.Body = Rest.Serialization.SafeJsonConvert.DeserializeObject>(_responseContent, Client.DeserializationSettings);
+ }
+ catch (JsonException ex)
+ {
+ _httpRequest.Dispose();
+ if (_httpResponse != null)
+ {
+ _httpResponse.Dispose();
+ }
+ throw new SerializationException("Unable to deserialize the response.", _responseContent, ex);
+ }
+ }
+ if (_shouldTrace)
+ {
+ ServiceClientTracing.Exit(_invocationId, _result);
+ }
+ return _result;
+ }
+
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableSqlResourcesOperationsExtensions.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableSqlResourcesOperationsExtensions.cs
new file mode 100644
index 000000000000..367fe6bce803
--- /dev/null
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/RestorableSqlResourcesOperationsExtensions.cs
@@ -0,0 +1,87 @@
+//
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for
+// license information.
+//
+// Code generated by Microsoft (R) AutoRest Code Generator.
+// Changes may cause incorrect behavior and will be lost if the code is
+// regenerated.
+//
+
+namespace Microsoft.Azure.Management.CosmosDB
+{
+ using Microsoft.Rest;
+ using Microsoft.Rest.Azure;
+ using Models;
+ using System.Collections;
+ using System.Collections.Generic;
+ using System.Threading;
+ using System.Threading.Tasks;
+
+ ///
+ /// Extension methods for RestorableSqlResourcesOperations.
+ ///
+ public static partial class RestorableSqlResourcesOperationsExtensions
+ {
+ ///
+ /// Return a list of database and container combo that exist on the account at
+ /// the given timestamp and location. This helps in scenarios to validate what
+ /// resources exist at given timestamp and location. This API requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read'
+ /// permission.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word capitalized.
+ ///
+ ///
+ /// The instanceId GUID of a restorable database account.
+ ///
+ ///
+ /// The location where the restorable resources are located.
+ ///
+ ///
+ /// The timestamp when the restorable resources existed.
+ ///
+ public static IEnumerable List(this IRestorableSqlResourcesOperations operations, string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string))
+ {
+ return operations.ListAsync(location, instanceId, restoreLocation, restoreTimestampInUtc).GetAwaiter().GetResult();
+ }
+
+ ///
+ /// Return a list of database and container combo that exist on the account at
+ /// the given timestamp and location. This helps in scenarios to validate what
+ /// resources exist at given timestamp and location. This API requires
+ /// 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/.../read'
+ /// permission.
+ ///
+ ///
+ /// The operations group for this extension method.
+ ///
+ ///
+ /// Cosmos DB region, with spaces between words and each word capitalized.
+ ///
+ ///
+ /// The instanceId GUID of a restorable database account.
+ ///
+ ///
+ /// The location where the restorable resources are located.
+ ///
+ ///
+ /// The timestamp when the restorable resources existed.
+ ///
+ ///
+ /// The cancellation token.
+ ///
+ public static async Task> ListAsync(this IRestorableSqlResourcesOperations operations, string location, string instanceId, string restoreLocation = default(string), string restoreTimestampInUtc = default(string), CancellationToken cancellationToken = default(CancellationToken))
+ {
+ using (var _result = await operations.ListWithHttpMessagesAsync(location, instanceId, restoreLocation, restoreTimestampInUtc, null, cancellationToken).ConfigureAwait(false))
+ {
+ return _result.Body;
+ }
+ }
+
+ }
+}
diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/SdkInfo_CosmosDBManagementClient.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/SdkInfo_CosmosDBManagementClient.cs
index dbd05d2ed84a..9b41da805a54 100644
--- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/SdkInfo_CosmosDBManagementClient.cs
+++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/SdkInfo_CosmosDBManagementClient.cs
@@ -19,37 +19,44 @@ public static IEnumerable> ApiInfo_CosmosDBManagem
{
return new Tuple[]
{
- new Tuple("DocumentDB", "CassandraResources", "2021-04-15"),
- new Tuple("DocumentDB", "Collection", "2021-04-15"),
- new Tuple("DocumentDB", "CollectionPartition", "2021-04-15"),
- new Tuple("DocumentDB", "CollectionPartitionRegion", "2021-04-15"),
- new Tuple