diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/CHANGELOG.md b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/CHANGELOG.md index 8212b2f34d229..332af7e93436a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/CHANGELOG.md +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/CHANGELOG.md @@ -1,15 +1,11 @@ # Release History -## 1.4.0-beta.3 (Unreleased) +## 1.4.0-beta.3 (2023-07-31) ### Features Added - -### Breaking Changes - -### Bugs Fixed - -### Other Changes - + - Updated Microsoft.DocumentDB RP API version to `2023-03-15-preview` + - Adds support for Database partition merge operation. + - Adds support for Materialized view in Collections. ## 1.4.0-beta.2 (2023-05-29) ### Features Added @@ -29,7 +25,7 @@ ### Features Added - Updated Microsoft.DocumentDB RP API version to `2022-11-15-preview` -- Added support for restoring deleted table and gremlin resources within the same account +- Added support for restoring deleted table and gremlin resources within the same account - Added support for cross region restore - Added support for enabling burst capacity of the CosmosDB account diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/api/Azure.ResourceManager.CosmosDB.netstandard2.0.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/api/Azure.ResourceManager.CosmosDB.netstandard2.0.cs index ccd90df154c21..8221a54a03568 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/api/Azure.ResourceManager.CosmosDB.netstandard2.0.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/api/Azure.ResourceManager.CosmosDB.netstandard2.0.cs @@ -517,6 +517,7 @@ public static partial class CosmosDBExtensions public static Azure.ResourceManager.CosmosDB.CosmosDBAccountCollection GetCosmosDBAccounts(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } public static Azure.Pageable GetCosmosDBAccounts(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetCosmosDBAccountsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.CosmosDB.CosmosDBFirewallRuleResource GetCosmosDBFirewallRuleResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.Response GetCosmosDBLocation(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static System.Threading.Tasks.Task> GetCosmosDBLocationAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, Azure.Core.AzureLocation location, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.CosmosDB.CosmosDBLocationResource GetCosmosDBLocationResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -542,6 +543,12 @@ public static partial class CosmosDBExtensions public static Azure.ResourceManager.CosmosDB.GremlinDatabaseThroughputSettingResource GetGremlinDatabaseThroughputSettingResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.GremlinGraphResource GetGremlinGraphResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.GremlinGraphThroughputSettingResource GetGremlinGraphThroughputSettingResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.Response GetMongoCluster(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string mongoClusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static System.Threading.Tasks.Task> GetMongoClusterAsync(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource, string mongoClusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.ResourceManager.CosmosDB.MongoClusterResource GetMongoClusterResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } + public static Azure.ResourceManager.CosmosDB.MongoClusterCollection GetMongoClusters(this Azure.ResourceManager.Resources.ResourceGroupResource resourceGroupResource) { throw null; } + public static Azure.Pageable GetMongoClusters(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.AsyncPageable GetMongoClustersAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.ResourceManager.CosmosDB.MongoDBCollectionResource GetMongoDBCollectionResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.MongoDBCollectionThroughputSettingResource GetMongoDBCollectionThroughputSettingResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } public static Azure.ResourceManager.CosmosDB.MongoDBDatabaseResource GetMongoDBDatabaseResource(this Azure.ResourceManager.ArmClient client, Azure.Core.ResourceIdentifier id) { throw null; } @@ -552,6 +559,42 @@ public static partial class CosmosDBExtensions public static Azure.Pageable GetRestorableCosmosDBAccounts(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.AsyncPageable GetRestorableCosmosDBAccountsAsync(this Azure.ResourceManager.Resources.SubscriptionResource subscriptionResource, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class CosmosDBFirewallRuleCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected CosmosDBFirewallRuleCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string firewallRuleName, Azure.ResourceManager.CosmosDB.CosmosDBFirewallRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string firewallRuleName, Azure.ResourceManager.CosmosDB.CosmosDBFirewallRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class CosmosDBFirewallRuleData : Azure.ResourceManager.Models.ResourceData + { + public CosmosDBFirewallRuleData(string startIPAddress, string endIPAddress) { } + public string EndIPAddress { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBProvisioningState? ProvisioningState { get { throw null; } } + public string StartIPAddress { get { throw null; } set { } } + } + public partial class CosmosDBFirewallRuleResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected CosmosDBFirewallRuleResource() { } + public virtual Azure.ResourceManager.CosmosDB.CosmosDBFirewallRuleData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string mongoClusterName, string firewallRuleName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.CosmosDBFirewallRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.CosmosDBFirewallRuleData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class CosmosDBLocationCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected CosmosDBLocationCollection() { } @@ -576,6 +619,8 @@ public partial class CosmosDBLocationResource : Azure.ResourceManager.ArmResourc protected CosmosDBLocationResource() { } public virtual Azure.ResourceManager.CosmosDB.CosmosDBLocationData Data { get { throw null; } } public virtual bool HasData { get { throw null; } } + public virtual Azure.Response CheckMongoClusterNameAailability(Azure.ResourceManager.CosmosDB.Models.CheckCosmosDBNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CheckMongoClusterNameAailabilityAsync(Azure.ResourceManager.CosmosDB.Models.CheckCosmosDBNameAvailabilityContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, Azure.Core.AzureLocation location) { throw null; } public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -844,6 +889,8 @@ protected CosmosDBSqlDatabaseResource() { } public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation SqlDatabasePartitionMerge(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.Models.MergeParameters mergeParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SqlDatabasePartitionMergeAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.Models.MergeParameters mergeParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlDatabaseCreateOrUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlDatabaseCreateOrUpdateContent content, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } @@ -1359,6 +1406,60 @@ protected GremlinGraphThroughputSettingResource() { } public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } } + public partial class MongoClusterCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable + { + protected MongoClusterCollection() { } + public virtual Azure.ResourceManager.ArmOperation CreateOrUpdate(Azure.WaitUntil waitUntil, string mongoClusterName, Azure.ResourceManager.CosmosDB.MongoClusterData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> CreateOrUpdateAsync(Azure.WaitUntil waitUntil, string mongoClusterName, Azure.ResourceManager.CosmosDB.MongoClusterData data, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Exists(string mongoClusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> ExistsAsync(string mongoClusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(string mongoClusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Pageable GetAll(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.AsyncPageable GetAllAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(string mongoClusterName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + System.Collections.Generic.IAsyncEnumerator System.Collections.Generic.IAsyncEnumerable.GetAsyncEnumerator(System.Threading.CancellationToken cancellationToken) { throw null; } + System.Collections.Generic.IEnumerator System.Collections.Generic.IEnumerable.GetEnumerator() { throw null; } + System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator() { throw null; } + } + public partial class MongoClusterData : Azure.ResourceManager.Models.TrackedResourceData + { + public MongoClusterData(Azure.Core.AzureLocation location) : base (default(Azure.Core.AzureLocation)) { } + public string AdministratorLogin { get { throw null; } set { } } + public string AdministratorLoginPassword { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.MongoClusterStatus? ClusterStatus { get { throw null; } } + public string ConnectionString { get { throw null; } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? CreateMode { get { throw null; } set { } } + public string EarliestRestoreTime { get { throw null; } } + public System.Collections.Generic.IList NodeGroupSpecs { get { throw null; } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.CosmosDB.Models.MongoClusterRestoreParameters RestoreParameters { get { throw null; } set { } } + public string ServerVersion { get { throw null; } set { } } + } + public partial class MongoClusterResource : Azure.ResourceManager.ArmResource + { + public static readonly Azure.Core.ResourceType ResourceType; + protected MongoClusterResource() { } + public virtual Azure.ResourceManager.CosmosDB.MongoClusterData Data { get { throw null; } } + public virtual bool HasData { get { throw null; } } + public virtual Azure.Response AddTag(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> AddTagAsync(string key, string value, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public static Azure.Core.ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string mongoClusterName) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Delete(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task DeleteAsync(Azure.WaitUntil waitUntil, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response Get(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetConnectionStrings(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetConnectionStringsAsync(System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response GetCosmosDBFirewallRule(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> GetCosmosDBFirewallRuleAsync(string firewallRuleName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.CosmosDB.CosmosDBFirewallRuleCollection GetCosmosDBFirewallRules() { throw null; } + public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> SetTagsAsync(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual Azure.ResourceManager.ArmOperation Update(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.Models.MongoClusterPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> UpdateAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.Models.MongoClusterPatch patch, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + } public partial class MongoDBCollectionCollection : Azure.ResourceManager.ArmCollection, System.Collections.Generic.IAsyncEnumerable, System.Collections.Generic.IEnumerable, System.Collections.IEnumerable { protected MongoDBCollectionCollection() { } @@ -1471,6 +1572,8 @@ protected MongoDBDatabaseResource() { } public virtual System.Threading.Tasks.Task> GetMongoDBCollectionAsync(string collectionName, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.ResourceManager.CosmosDB.MongoDBCollectionCollection GetMongoDBCollections() { throw null; } public virtual Azure.ResourceManager.CosmosDB.MongoDBDatabaseThroughputSettingResource GetMongoDBDatabaseThroughputSetting() { throw null; } + public virtual Azure.ResourceManager.ArmOperation MongoDBDatabasePartitionMerge(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.Models.MergeParameters mergeParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } + public virtual System.Threading.Tasks.Task> MongoDBDatabasePartitionMergeAsync(Azure.WaitUntil waitUntil, Azure.ResourceManager.CosmosDB.Models.MergeParameters mergeParameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response RemoveTag(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual System.Threading.Tasks.Task> RemoveTagAsync(string key, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } public virtual Azure.Response SetTags(System.Collections.Generic.IDictionary tags, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) { throw null; } @@ -1683,14 +1786,14 @@ public static partial class ArmCosmosDBModelFactory public static Azure.ResourceManager.CosmosDB.Models.AutoscaleSettingsResourceInfo AutoscaleSettingsResourceInfo(int maxThroughput = 0, Azure.ResourceManager.CosmosDB.Models.ThroughputPolicyResourceInfo autoUpgradeThroughputPolicy = null, int? targetMaxThroughput = default(int?)) { throw null; } public static Azure.ResourceManager.CosmosDB.CassandraClusterBackupResourceData CassandraClusterBackupResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.DateTimeOffset? backupResourceTimestamp = default(System.DateTimeOffset?)) { throw null; } public static Azure.ResourceManager.CosmosDB.CassandraClusterData CassandraClusterData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.CosmosDB.Models.CassandraClusterProperties properties = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } - public static Azure.ResourceManager.CosmosDB.Models.CassandraClusterDataCenterNodeItem CassandraClusterDataCenterNodeItem(string address = null, Azure.ResourceManager.CosmosDB.Models.CassandraNodeState? state = default(Azure.ResourceManager.CosmosDB.Models.CassandraNodeState?), string status = null, string load = null, System.Collections.Generic.IEnumerable tokens = null, int? size = default(int?), System.Guid? hostId = default(System.Guid?), string rack = null, string timestamp = null, long? diskUsedKB = default(long?), long? diskFreeKB = default(long?), long? memoryUsedKB = default(long?), long? memoryBuffersAndCachedKB = default(long?), long? memoryFreeKB = default(long?), long? memoryTotalKB = default(long?), double? cpuUsage = default(double?)) { throw null; } - public static Azure.ResourceManager.CosmosDB.Models.CassandraClusterProperties CassandraClusterProperties(Azure.ResourceManager.CosmosDB.Models.CassandraProvisioningState? provisioningState = default(Azure.ResourceManager.CosmosDB.Models.CassandraProvisioningState?), string restoreFromBackupId = null, Azure.Core.ResourceIdentifier delegatedManagementSubnetId = null, string cassandraVersion = null, string clusterNameOverride = null, Azure.ResourceManager.CosmosDB.Models.CassandraAuthenticationMethod? authenticationMethod = default(Azure.ResourceManager.CosmosDB.Models.CassandraAuthenticationMethod?), string initialCassandraAdminPassword = null, string prometheusEndpointIPAddress = null, bool? isRepairEnabled = default(bool?), System.Collections.Generic.IEnumerable clientCertificates = null, System.Collections.Generic.IEnumerable externalGossipCertificates = null, System.Collections.Generic.IEnumerable gossipCertificates = null, System.Collections.Generic.IEnumerable externalSeedNodes = null, System.Collections.Generic.IEnumerable seedNodes = null, int? hoursBetweenBackups = default(int?), bool? isDeallocated = default(bool?), bool? isCassandraAuditLoggingEnabled = default(bool?)) { throw null; } - public static Azure.ResourceManager.CosmosDB.Models.CassandraClusterPublicStatus CassandraClusterPublicStatus(Azure.ETag? etag = default(Azure.ETag?), Azure.ResourceManager.CosmosDB.Models.CassandraReaperStatus reaperStatus = null, System.Collections.Generic.IEnumerable connectionErrors = null, System.Collections.Generic.IEnumerable dataCenters = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.CassandraClusterDataCenterNodeItem CassandraClusterDataCenterNodeItem(string address = null, Azure.ResourceManager.CosmosDB.Models.CassandraNodeState? state = default(Azure.ResourceManager.CosmosDB.Models.CassandraNodeState?), string status = null, string cassandraProcessStatus = null, string load = null, System.Collections.Generic.IEnumerable tokens = null, int? size = default(int?), System.Guid? hostId = default(System.Guid?), string rack = null, string timestamp = null, long? diskUsedKB = default(long?), long? diskFreeKB = default(long?), long? memoryUsedKB = default(long?), long? memoryBuffersAndCachedKB = default(long?), long? memoryFreeKB = default(long?), long? memoryTotalKB = default(long?), double? cpuUsage = default(double?)) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.CassandraClusterProperties CassandraClusterProperties(Azure.ResourceManager.CosmosDB.Models.CassandraProvisioningState? provisioningState = default(Azure.ResourceManager.CosmosDB.Models.CassandraProvisioningState?), string restoreFromBackupId = null, Azure.Core.ResourceIdentifier delegatedManagementSubnetId = null, string cassandraVersion = null, string clusterNameOverride = null, Azure.ResourceManager.CosmosDB.Models.CassandraAuthenticationMethod? authenticationMethod = default(Azure.ResourceManager.CosmosDB.Models.CassandraAuthenticationMethod?), string initialCassandraAdminPassword = null, string prometheusEndpointIPAddress = null, bool? isRepairEnabled = default(bool?), System.Collections.Generic.IEnumerable clientCertificates = null, System.Collections.Generic.IEnumerable externalGossipCertificates = null, System.Collections.Generic.IEnumerable gossipCertificates = null, System.Collections.Generic.IEnumerable externalSeedNodes = null, System.Collections.Generic.IEnumerable seedNodes = null, int? hoursBetweenBackups = default(int?), bool? isDeallocated = default(bool?), bool? isCassandraAuditLoggingEnabled = default(bool?), Azure.ResourceManager.CosmosDB.Models.CassandraError provisionError = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.CassandraClusterPublicStatus CassandraClusterPublicStatus(Azure.ETag? etag = default(Azure.ETag?), Azure.ResourceManager.CosmosDB.Models.CassandraReaperStatus reaperStatus = null, System.Collections.Generic.IEnumerable connectionErrors = null, System.Collections.Generic.IEnumerable errors = null, System.Collections.Generic.IEnumerable dataCenters = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CassandraClusterPublicStatusDataCentersItem CassandraClusterPublicStatusDataCentersItem(string name = null, System.Collections.Generic.IEnumerable seedNodes = null, System.Collections.Generic.IEnumerable nodes = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CassandraCommandOutput CassandraCommandOutput(string commandOutput = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CassandraConnectionError CassandraConnectionError(Azure.ResourceManager.CosmosDB.Models.CassandraConnectionState? connectionState = default(Azure.ResourceManager.CosmosDB.Models.CassandraConnectionState?), string ipFrom = null, string ipTo = null, int? port = default(int?), string exception = null) { throw null; } public static Azure.ResourceManager.CosmosDB.CassandraDataCenterData CassandraDataCenterData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.CosmosDB.Models.CassandraDataCenterProperties properties = null) { throw null; } - public static Azure.ResourceManager.CosmosDB.Models.CassandraDataCenterProperties CassandraDataCenterProperties(Azure.ResourceManager.CosmosDB.Models.CassandraProvisioningState? provisioningState = default(Azure.ResourceManager.CosmosDB.Models.CassandraProvisioningState?), Azure.Core.AzureLocation? dataCenterLocation = default(Azure.Core.AzureLocation?), Azure.Core.ResourceIdentifier delegatedSubnetId = null, int? nodeCount = default(int?), System.Collections.Generic.IEnumerable seedNodes = null, string base64EncodedCassandraYamlFragment = null, System.Uri managedDiskCustomerKeyUri = null, System.Uri backupStorageCustomerKeyUri = null, string sku = null, string diskSku = null, int? diskCapacity = default(int?), bool? doesSupportAvailabilityZone = default(bool?), Azure.ResourceManager.CosmosDB.Models.AuthenticationMethodLdapProperties authenticationMethodLdapProperties = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.CassandraDataCenterProperties CassandraDataCenterProperties(Azure.ResourceManager.CosmosDB.Models.CassandraProvisioningState? provisioningState = default(Azure.ResourceManager.CosmosDB.Models.CassandraProvisioningState?), Azure.Core.AzureLocation? dataCenterLocation = default(Azure.Core.AzureLocation?), Azure.Core.ResourceIdentifier delegatedSubnetId = null, int? nodeCount = default(int?), System.Collections.Generic.IEnumerable seedNodes = null, string base64EncodedCassandraYamlFragment = null, System.Uri managedDiskCustomerKeyUri = null, System.Uri backupStorageCustomerKeyUri = null, string sku = null, string diskSku = null, int? diskCapacity = default(int?), bool? doesSupportAvailabilityZone = default(bool?), Azure.ResourceManager.CosmosDB.Models.AuthenticationMethodLdapProperties authenticationMethodLdapProperties = null, bool? deallocated = default(bool?), Azure.ResourceManager.CosmosDB.Models.CassandraError provisionError = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CassandraKeyspaceCreateOrUpdateContent CassandraKeyspaceCreateOrUpdateContent(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), string resourceKeyspaceName = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.CosmosDB.CassandraKeyspaceData CassandraKeyspaceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.CosmosDB.Models.ExtendedCassandraKeyspaceResourceInfo resource = null, Azure.ResourceManager.CosmosDB.Models.CassandraKeyspacePropertiesConfig options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CassandraReaperStatus CassandraReaperStatus(bool? isHealthy = default(bool?), System.Collections.Generic.IReadOnlyDictionary repairRunIds = null, System.Collections.Generic.IReadOnlyDictionary repairSchedules = null) { throw null; } @@ -1699,7 +1802,8 @@ public static partial class ArmCosmosDBModelFactory public static Azure.ResourceManager.CosmosDB.Models.CassandraViewGetPropertiesResource CassandraViewGetPropertiesResource(string id = null, string viewDefinition = null, string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CassandraViewGetResultCreateOrUpdateContent CassandraViewGetResultCreateOrUpdateContent(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.CosmosDB.Models.CassandraViewResource resource = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.CosmosDB.CassandraViewGetResultData CassandraViewGetResultData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.CosmosDB.Models.CassandraViewGetPropertiesResource resource = null, Azure.ResourceManager.CosmosDB.Models.CassandraViewGetPropertiesOptions options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } - public static Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountConnectionString CosmosDBAccountConnectionString(string connectionString = null, string description = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.CheckCosmosDBNameAvailabilityResponse CheckCosmosDBNameAvailabilityResponse(bool? nameAvailable = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBNameUnavailableReason? reason = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBNameUnavailableReason?), string message = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountConnectionString CosmosDBAccountConnectionString(string connectionString = null, string description = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBKind? keyKind = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBKind?), Azure.ResourceManager.CosmosDB.Models.CosmosDBType? keyType = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBType?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateOrUpdateContent CosmosDBAccountCreateOrUpdateContent(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountKind? kind = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountKind?), Azure.ResourceManager.CosmosDB.Models.ConsistencyPolicy consistencyPolicy = null, System.Collections.Generic.IEnumerable locations = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountOfferType databaseAccountOfferType = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountOfferType), System.Collections.Generic.IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), System.Collections.Generic.IEnumerable capabilities = null, System.Collections.Generic.IEnumerable virtualNetworkRules = null, bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), Azure.ResourceManager.CosmosDB.Models.ConnectorOffer? connectorOffer = default(Azure.ResourceManager.CosmosDB.Models.ConnectorOffer?), bool? disableKeyBasedMetadataWriteAccess = default(bool?), System.Uri keyVaultKeyUri = null, string defaultIdentity = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBPublicNetworkAccess?), bool? isFreeTierEnabled = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServerVersion? apiServerVersion = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServerVersion?), bool? isAnalyticalStorageEnabled = default(bool?), Azure.ResourceManager.CosmosDB.Models.AnalyticalStorageSchemaType? analyticalStorageSchemaType = default(Azure.ResourceManager.CosmosDB.Models.AnalyticalStorageSchemaType?), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? createMode = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode?), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountBackupPolicy backupPolicy = null, System.Collections.Generic.IEnumerable cors = null, Azure.ResourceManager.CosmosDB.Models.NetworkAclBypass? networkAclBypass = default(Azure.ResourceManager.CosmosDB.Models.NetworkAclBypass?), System.Collections.Generic.IEnumerable networkAclBypassResourceIds = null, Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery? diagnosticLogEnableFullTextQuery = default(Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery?), bool? disableLocalAuth = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountRestoreParameters restoreParameters = null, int? capacityTotalThroughputLimit = default(int?), bool? enableMaterializedViews = default(bool?), Azure.ResourceManager.CosmosDB.Models.DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = default(bool?), bool? enableBurstCapacity = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion? minimalTlsVersion = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.CosmosDB.CosmosDBAccountData CosmosDBAccountData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountKind? kind = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountKind?), string provisioningState = null, string documentEndpoint = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountOfferType? databaseAccountOfferType = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountOfferType?), System.Collections.Generic.IEnumerable ipRules = null, bool? isVirtualNetworkFilterEnabled = default(bool?), bool? enableAutomaticFailover = default(bool?), Azure.ResourceManager.CosmosDB.Models.ConsistencyPolicy consistencyPolicy = null, System.Collections.Generic.IEnumerable capabilities = null, System.Collections.Generic.IEnumerable writeLocations = null, System.Collections.Generic.IEnumerable readLocations = null, System.Collections.Generic.IEnumerable locations = null, System.Collections.Generic.IEnumerable failoverPolicies = null, System.Collections.Generic.IEnumerable virtualNetworkRules = null, System.Collections.Generic.IEnumerable privateEndpointConnections = null, bool? enableMultipleWriteLocations = default(bool?), bool? enableCassandraConnector = default(bool?), Azure.ResourceManager.CosmosDB.Models.ConnectorOffer? connectorOffer = default(Azure.ResourceManager.CosmosDB.Models.ConnectorOffer?), bool? disableKeyBasedMetadataWriteAccess = default(bool?), System.Uri keyVaultKeyUri = null, string defaultIdentity = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBPublicNetworkAccess? publicNetworkAccess = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBPublicNetworkAccess?), bool? isFreeTierEnabled = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServerVersion? apiServerVersion = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServerVersion?), bool? isAnalyticalStorageEnabled = default(bool?), Azure.ResourceManager.CosmosDB.Models.AnalyticalStorageSchemaType? analyticalStorageSchemaType = default(Azure.ResourceManager.CosmosDB.Models.AnalyticalStorageSchemaType?), System.Guid? instanceId = default(System.Guid?), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? createMode = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode?), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountRestoreParameters restoreParameters = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountBackupPolicy backupPolicy = null, System.Collections.Generic.IEnumerable cors = null, Azure.ResourceManager.CosmosDB.Models.NetworkAclBypass? networkAclBypass = default(Azure.ResourceManager.CosmosDB.Models.NetworkAclBypass?), System.Collections.Generic.IEnumerable networkAclBypassResourceIds = null, Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery? diagnosticLogEnableFullTextQuery = default(Azure.ResourceManager.CosmosDB.Models.EnableFullTextQuery?), bool? disableLocalAuth = default(bool?), int? capacityTotalThroughputLimit = default(int?), bool? enableMaterializedViews = default(bool?), Azure.ResourceManager.CosmosDB.Models.DatabaseAccountKeysMetadata keysMetadata = null, bool? enablePartitionMerge = default(bool?), bool? enableBurstCapacity = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion? minimalTlsVersion = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBMinimalTlsVersion?), Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountKeyList CosmosDBAccountKeyList(string primaryReadonlyMasterKey = null, string secondaryReadonlyMasterKey = null, string primaryMasterKey = null, string secondaryMasterKey = null) { throw null; } @@ -1708,10 +1812,12 @@ public static partial class ArmCosmosDBModelFactory public static Azure.ResourceManager.CosmosDB.Models.CosmosDBBackupInformation CosmosDBBackupInformation(System.DateTimeOffset? continuousBackupInformationLatestRestorableTimestamp = default(System.DateTimeOffset?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBBaseMetric CosmosDBBaseMetric(System.DateTimeOffset? startOn = default(System.DateTimeOffset?), System.DateTimeOffset? endOn = default(System.DateTimeOffset?), string timeGrain = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricUnitType? unit = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricUnitType?), Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricName name = null, System.Collections.Generic.IEnumerable metricValues = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBBaseUsage CosmosDBBaseUsage(Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricUnitType? unit = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricUnitType?), Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricName name = null, string quotaPeriod = null, long? limit = default(long?), long? currentValue = default(long?)) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBConnectionString CosmosDBConnectionString(string connectionString = null, string description = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBContainerPartitionKey CosmosDBContainerPartitionKey(System.Collections.Generic.IEnumerable paths = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBPartitionKind? kind = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBPartitionKind?), int? version = default(int?), bool? isSystemKey = default(bool?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBFailoverPolicy CosmosDBFailoverPolicy(string id = null, Azure.Core.AzureLocation? locationName = default(Azure.Core.AzureLocation?), int? failoverPriority = default(int?)) { throw null; } + public static Azure.ResourceManager.CosmosDB.CosmosDBFirewallRuleData CosmosDBFirewallRuleData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBProvisioningState? provisioningState = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBProvisioningState?), string startIPAddress = null, string endIPAddress = null) { throw null; } public static Azure.ResourceManager.CosmosDB.CosmosDBLocationData CosmosDBLocationData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBLocationProperties properties = null) { throw null; } - public static Azure.ResourceManager.CosmosDB.Models.CosmosDBLocationProperties CosmosDBLocationProperties(string status = null, bool? doesSupportAvailabilityZone = default(bool?), bool? isResidencyRestricted = default(bool?), System.Collections.Generic.IEnumerable backupStorageRedundancies = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBLocationProperties CosmosDBLocationProperties(bool? doesSupportAvailabilityZone = default(bool?), bool? isResidencyRestricted = default(bool?), System.Collections.Generic.IEnumerable backupStorageRedundancies = null, bool? isSubscriptionRegionAccessAllowedForRegular = default(bool?), bool? isSubscriptionRegionAccessAllowedForAz = default(bool?), Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus? status = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricAvailability CosmosDBMetricAvailability(string timeGrain = null, string retention = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricDefinition CosmosDBMetricDefinition(System.Collections.Generic.IEnumerable metricAvailabilities = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricPrimaryAggregationType? primaryAggregationType = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricPrimaryAggregationType?), Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricUnitType? unit = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricUnitType?), Azure.Core.ResourceIdentifier resourceId = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricName name = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricName CosmosDBMetricName(string value = null, string localizedValue = null) { throw null; } @@ -1749,7 +1855,7 @@ public static partial class ArmCosmosDBModelFactory public static Azure.ResourceManager.CosmosDB.Models.ErrorResponse ErrorResponse(string code = null, string message = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.ExtendedCassandraKeyspaceResourceInfo ExtendedCassandraKeyspaceResourceInfo(string keyspaceName = null, string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.ExtendedCassandraTableResourceInfo ExtendedCassandraTableResourceInfo(string tableName = null, int? defaultTtl = default(int?), Azure.ResourceManager.CosmosDB.Models.CassandraSchema schema = null, int? analyticalStorageTtl = default(int?), string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } - public static Azure.ResourceManager.CosmosDB.Models.ExtendedCosmosDBSqlContainerResourceInfo ExtendedCosmosDBSqlContainerResourceInfo(string containerName = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBIndexingPolicy indexingPolicy = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = default(int?), System.Collections.Generic.IEnumerable uniqueKeys = null, Azure.ResourceManager.CosmosDB.Models.ConflictResolutionPolicy conflictResolutionPolicy = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = default(long?), Azure.ResourceManager.CosmosDB.Models.ResourceRestoreParameters restoreParameters = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? createMode = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode?), string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.ExtendedCosmosDBSqlContainerResourceInfo ExtendedCosmosDBSqlContainerResourceInfo(string containerName = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBIndexingPolicy indexingPolicy = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = default(int?), System.Collections.Generic.IEnumerable uniqueKeys = null, Azure.ResourceManager.CosmosDB.Models.ConflictResolutionPolicy conflictResolutionPolicy = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = default(long?), Azure.ResourceManager.CosmosDB.Models.ResourceRestoreParameters restoreParameters = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? createMode = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode?), Azure.ResourceManager.CosmosDB.Models.MaterializedViewDefinition materializedViewDefinition = null, string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.ExtendedCosmosDBSqlDatabaseResourceInfo ExtendedCosmosDBSqlDatabaseResourceInfo(string databaseName = null, Azure.ResourceManager.CosmosDB.Models.ResourceRestoreParameters restoreParameters = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? createMode = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode?), string colls = null, string users = null, string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.ExtendedCosmosDBSqlStoredProcedureResourceInfo ExtendedCosmosDBSqlStoredProcedureResourceInfo(string storedProcedureName = null, string body = null, string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.ExtendedCosmosDBSqlTriggerResourceInfo ExtendedCosmosDBSqlTriggerResourceInfo(string triggerName = null, string body = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlTriggerType? triggerType = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlTriggerType?), Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlTriggerOperation? triggerOperation = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlTriggerOperation?), string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } @@ -1774,8 +1880,11 @@ public static partial class ArmCosmosDBModelFactory public static Azure.ResourceManager.CosmosDB.GremlinDatabaseData GremlinDatabaseData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.CosmosDB.Models.ExtendedGremlinDatabaseResourceInfo resource = null, Azure.ResourceManager.CosmosDB.Models.GremlinDatabasePropertiesConfig options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.GremlinGraphCreateOrUpdateContent GremlinGraphCreateOrUpdateContent(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.CosmosDB.Models.GremlinGraphResourceInfo resource = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.CosmosDB.GremlinGraphData GremlinGraphData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.CosmosDB.Models.ExtendedGremlinGraphResourceInfo resource = null, Azure.ResourceManager.CosmosDB.Models.GremlinGraphPropertiesConfig options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.ListConnectionStringsResult ListConnectionStringsResult(System.Collections.Generic.IEnumerable connectionStrings = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.MaterializedViewDefinition MaterializedViewDefinition(string sourceCollectionRid = null, string sourceCollectionId = null, string definition = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.MaterializedViewsBuilderRegionalService MaterializedViewsBuilderRegionalService(string name = null, Azure.Core.AzureLocation? location = default(Azure.Core.AzureLocation?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceStatus? status = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceStatus?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.MaterializedViewsBuilderServiceProperties MaterializedViewsBuilderServiceProperties(System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceSize? instanceSize = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceSize?), int? instanceCount = default(int?), Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceStatus? status = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceStatus?), System.Collections.Generic.IDictionary additionalProperties = null, System.Collections.Generic.IEnumerable locations = null) { throw null; } + public static Azure.ResourceManager.CosmosDB.MongoClusterData MongoClusterData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? createMode = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode?), Azure.ResourceManager.CosmosDB.Models.MongoClusterRestoreParameters restoreParameters = null, string administratorLogin = null, string administratorLoginPassword = null, string serverVersion = null, string connectionString = null, string earliestRestoreTime = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBProvisioningState? provisioningState = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBProvisioningState?), Azure.ResourceManager.CosmosDB.Models.MongoClusterStatus? clusterStatus = default(Azure.ResourceManager.CosmosDB.Models.MongoClusterStatus?), System.Collections.Generic.IEnumerable nodeGroupSpecs = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.MongoDBCollectionCreateOrUpdateContent MongoDBCollectionCreateOrUpdateContent(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.CosmosDB.Models.MongoDBCollectionResourceInfo resource = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.CosmosDB.MongoDBCollectionData MongoDBCollectionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.CosmosDB.Models.ExtendedMongoDBCollectionResourceInfo resource = null, Azure.ResourceManager.CosmosDB.Models.MongoDBCollectionPropertiesConfig options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.MongoDBDatabaseCreateOrUpdateContent MongoDBDatabaseCreateOrUpdateContent(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, System.Collections.Generic.IDictionary tags = null, Azure.Core.AzureLocation location = default(Azure.Core.AzureLocation), Azure.ResourceManager.CosmosDB.Models.MongoDBDatabaseResourceInfo resource = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig options = null, Azure.ResourceManager.Models.ManagedServiceIdentity identity = null) { throw null; } @@ -1798,7 +1907,7 @@ public static partial class ArmCosmosDBModelFactory public static Azure.ResourceManager.CosmosDB.Models.RestorableMongoDBDatabase RestorableMongoDBDatabase(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableMongoDBDatabaseResourceInfo resource = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.RestorableMongoDBResourceData RestorableMongoDBResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string databaseName = null, System.Collections.Generic.IEnumerable collectionNames = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.RestorableSqlContainer RestorableSqlContainer(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableSqlContainerResourceInfo resource = null) { throw null; } - public static Azure.ResourceManager.CosmosDB.Models.RestorableSqlContainerPropertiesResourceContainer RestorableSqlContainerPropertiesResourceContainer(string containerName = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBIndexingPolicy indexingPolicy = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = default(int?), System.Collections.Generic.IEnumerable uniqueKeys = null, Azure.ResourceManager.CosmosDB.Models.ConflictResolutionPolicy conflictResolutionPolicy = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = default(long?), Azure.ResourceManager.CosmosDB.Models.ResourceRestoreParameters restoreParameters = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? createMode = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode?), string self = null, string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.RestorableSqlContainerPropertiesResourceContainer RestorableSqlContainerPropertiesResourceContainer(string containerName = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBIndexingPolicy indexingPolicy = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = default(int?), System.Collections.Generic.IEnumerable uniqueKeys = null, Azure.ResourceManager.CosmosDB.Models.ConflictResolutionPolicy conflictResolutionPolicy = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = default(long?), Azure.ResourceManager.CosmosDB.Models.ResourceRestoreParameters restoreParameters = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? createMode = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode?), Azure.ResourceManager.CosmosDB.Models.MaterializedViewDefinition materializedViewDefinition = null, string self = null, string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.RestorableSqlDatabase RestorableSqlDatabase(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableSqlDatabaseResourceInfo resource = null) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.RestorableSqlDatabasePropertiesResourceDatabase RestorableSqlDatabasePropertiesResourceDatabase(string databaseName = null, Azure.ResourceManager.CosmosDB.Models.ResourceRestoreParameters restoreParameters = null, Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? createMode = default(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode?), string colls = null, string users = null, string self = null, string rid = null, float? timestamp = default(float?), Azure.ETag? etag = default(Azure.ETag?)) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.RestorableSqlResourceData RestorableSqlResourceData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string databaseName = null, System.Collections.Generic.IEnumerable collectionNames = null) { throw null; } @@ -1814,6 +1923,7 @@ public static partial class ArmCosmosDBModelFactory public partial class AuthenticationMethodLdapProperties { public AuthenticationMethodLdapProperties() { } + public int? ConnectionTimeoutInMs { get { throw null; } set { } } public string SearchBaseDistinguishedName { get { throw null; } set { } } public string SearchFilterTemplate { get { throw null; } set { } } public System.Collections.Generic.IList ServerCertificates { get { throw null; } } @@ -1908,6 +2018,7 @@ public partial class CassandraClusterDataCenterNodeItem { internal CassandraClusterDataCenterNodeItem() { } public string Address { get { throw null; } } + public string CassandraProcessStatus { get { throw null; } } public double? CpuUsage { get { throw null; } } public long? DiskFreeKB { get { throw null; } } public long? DiskUsedKB { get { throw null; } } @@ -1947,6 +2058,7 @@ public CassandraClusterProperties() { } public bool? IsDeallocated { get { throw null; } set { } } public bool? IsRepairEnabled { get { throw null; } set { } } public string PrometheusEndpointIPAddress { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.CassandraError ProvisionError { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CassandraProvisioningState? ProvisioningState { get { throw null; } set { } } public string RestoreFromBackupId { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList SeedNodes { get { throw null; } } @@ -1956,6 +2068,7 @@ public partial class CassandraClusterPublicStatus internal CassandraClusterPublicStatus() { } public System.Collections.Generic.IReadOnlyList ConnectionErrors { get { throw null; } } public System.Collections.Generic.IReadOnlyList DataCenters { get { throw null; } } + public System.Collections.Generic.IReadOnlyList Errors { get { throw null; } } public Azure.ETag? ETag { get { throw null; } } public Azure.ResourceManager.CosmosDB.Models.CassandraReaperStatus ReaperStatus { get { throw null; } } } @@ -2024,12 +2137,14 @@ public CassandraDataCenterProperties() { } public System.Uri BackupStorageCustomerKeyUri { get { throw null; } set { } } public string Base64EncodedCassandraYamlFragment { get { throw null; } set { } } public Azure.Core.AzureLocation? DataCenterLocation { get { throw null; } set { } } + public bool? Deallocated { get { throw null; } set { } } public Azure.Core.ResourceIdentifier DelegatedSubnetId { get { throw null; } set { } } public int? DiskCapacity { get { throw null; } set { } } public string DiskSku { get { throw null; } set { } } public bool? DoesSupportAvailabilityZone { get { throw null; } set { } } public System.Uri ManagedDiskCustomerKeyUri { get { throw null; } set { } } public int? NodeCount { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.CassandraError ProvisionError { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CassandraProvisioningState? ProvisioningState { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList SeedNodes { get { throw null; } } public string Sku { get { throw null; } set { } } @@ -2039,6 +2154,14 @@ public partial class CassandraDataCenterSeedNode public CassandraDataCenterSeedNode() { } public string IPAddress { get { throw null; } set { } } } + public partial class CassandraError + { + public CassandraError() { } + public string AdditionalErrorInfo { get { throw null; } set { } } + public string Code { get { throw null; } set { } } + public string Message { get { throw null; } set { } } + public string Target { get { throw null; } set { } } + } public partial class CassandraKeyspaceCreateOrUpdateContent : Azure.ResourceManager.Models.TrackedResourceData { public CassandraKeyspaceCreateOrUpdateContent(Azure.Core.AzureLocation location, Azure.ResourceManager.CosmosDB.Models.CassandraKeyspaceResourceInfo resource) : base (default(Azure.Core.AzureLocation)) { } @@ -2160,6 +2283,19 @@ public CassandraViewResource(string id, string viewDefinition) { } public string Id { get { throw null; } set { } } public string ViewDefinition { get { throw null; } set { } } } + public partial class CheckCosmosDBNameAvailabilityContent + { + public CheckCosmosDBNameAvailabilityContent() { } + public string Name { get { throw null; } set { } } + public string ResourceType { get { throw null; } set { } } + } + public partial class CheckCosmosDBNameAvailabilityResponse + { + internal CheckCosmosDBNameAvailabilityResponse() { } + public string Message { get { throw null; } } + public bool? NameAvailable { get { throw null; } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBNameUnavailableReason? Reason { get { throw null; } } + } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct CompositePathSortOrder : System.IEquatable { @@ -2276,6 +2412,8 @@ public partial class CosmosDBAccountConnectionString internal CosmosDBAccountConnectionString() { } public string ConnectionString { get { throw null; } } public string Description { get { throw null; } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBKind? KeyKind { get { throw null; } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBType? KeyType { get { throw null; } } } public partial class CosmosDBAccountCorsPolicy { @@ -2293,6 +2431,7 @@ public CosmosDBAccountCorsPolicy(string allowedOrigins) { } private readonly int _dummyPrimitive; public CosmosDBAccountCreateMode(string value) { throw null; } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode Default { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode PointInTimeRestore { get { throw null; } } public static Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode Restore { get { throw null; } } public bool Equals(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode other) { throw null; } [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] @@ -2580,6 +2719,12 @@ public CosmosDBCompositePath() { } public Azure.ResourceManager.CosmosDB.Models.CompositePathSortOrder? Order { get { throw null; } set { } } public string Path { get { throw null; } set { } } } + public partial class CosmosDBConnectionString + { + internal CosmosDBConnectionString() { } + public string ConnectionString { get { throw null; } } + public string Description { get { throw null; } } + } public partial class CosmosDBContainerPartitionKey { public CosmosDBContainerPartitionKey() { } @@ -2700,13 +2845,35 @@ public CosmosDBKeyWrapMetadata() { } public string Name { get { throw null; } set { } } public string Value { get { throw null; } set { } } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CosmosDBKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CosmosDBKind(string value) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBKind Primary { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBKind PrimaryReadonly { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBKind Secondary { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBKind SecondaryReadonly { get { throw null; } } + public bool Equals(Azure.ResourceManager.CosmosDB.Models.CosmosDBKind other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.CosmosDB.Models.CosmosDBKind left, Azure.ResourceManager.CosmosDB.Models.CosmosDBKind right) { throw null; } + public static implicit operator Azure.ResourceManager.CosmosDB.Models.CosmosDBKind (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CosmosDB.Models.CosmosDBKind left, Azure.ResourceManager.CosmosDB.Models.CosmosDBKind right) { throw null; } + public override string ToString() { throw null; } + } public partial class CosmosDBLocationProperties { public CosmosDBLocationProperties() { } public System.Collections.Generic.IReadOnlyList BackupStorageRedundancies { get { throw null; } } public bool? DoesSupportAvailabilityZone { get { throw null; } } public bool? IsResidencyRestricted { get { throw null; } } - public string Status { get { throw null; } } + public bool? IsSubscriptionRegionAccessAllowedForAz { get { throw null; } } + public bool? IsSubscriptionRegionAccessAllowedForRegular { get { throw null; } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus? Status { get { throw null; } } } public partial class CosmosDBMetricAvailability { @@ -2804,6 +2971,24 @@ internal CosmosDBMetricValue() { } public override string ToString() { throw null; } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CosmosDBNameUnavailableReason : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CosmosDBNameUnavailableReason(string value) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBNameUnavailableReason AlreadyExists { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBNameUnavailableReason Invalid { get { throw null; } } + public bool Equals(Azure.ResourceManager.CosmosDB.Models.CosmosDBNameUnavailableReason other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.CosmosDB.Models.CosmosDBNameUnavailableReason left, Azure.ResourceManager.CosmosDB.Models.CosmosDBNameUnavailableReason right) { throw null; } + public static implicit operator Azure.ResourceManager.CosmosDB.Models.CosmosDBNameUnavailableReason (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CosmosDB.Models.CosmosDBNameUnavailableReason left, Azure.ResourceManager.CosmosDB.Models.CosmosDBNameUnavailableReason right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct CosmosDBOperationType : System.IEquatable { private readonly object _dummy; @@ -2868,6 +3053,28 @@ public CosmosDBPrivateLinkServiceConnectionStateProperty() { } public string Status { get { throw null; } set { } } } [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CosmosDBProvisioningState : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CosmosDBProvisioningState(string value) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBProvisioningState Canceled { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBProvisioningState Dropping { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBProvisioningState Failed { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBProvisioningState InProgress { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBProvisioningState Succeeded { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBProvisioningState Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.CosmosDB.Models.CosmosDBProvisioningState other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.CosmosDB.Models.CosmosDBProvisioningState left, Azure.ResourceManager.CosmosDB.Models.CosmosDBProvisioningState right) { throw null; } + public static implicit operator Azure.ResourceManager.CosmosDB.Models.CosmosDBProvisioningState (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CosmosDB.Models.CosmosDBProvisioningState left, Azure.ResourceManager.CosmosDB.Models.CosmosDBProvisioningState right) { throw null; } + public override string ToString() { throw null; } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] public readonly partial struct CosmosDBPublicNetworkAccess : System.IEquatable { private readonly object _dummy; @@ -3050,6 +3257,7 @@ public CosmosDBSqlContainerResourceInfo(string containerName) { } public Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? CreateMode { get { throw null; } set { } } public int? DefaultTtl { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBIndexingPolicy IndexingPolicy { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.MaterializedViewDefinition MaterializedViewDefinition { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBContainerPartitionKey PartitionKey { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.ResourceRestoreParameters RestoreParameters { get { throw null; } set { } } public System.Collections.Generic.IList UniqueKeys { get { throw null; } } @@ -3179,6 +3387,27 @@ public CosmosDBSqlUserDefinedFunctionResourceInfo(string functionName) { } public string Body { get { throw null; } set { } } public string FunctionName { get { throw null; } set { } } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CosmosDBStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CosmosDBStatus(string value) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus Deleting { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus Initializing { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus InternallyReady { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus Online { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus Uninitialized { get { throw null; } } + public bool Equals(Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus left, Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus left, Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus right) { throw null; } + public override string ToString() { throw null; } + } public partial class CosmosDBTableCreateOrUpdateContent : Azure.ResourceManager.Models.TrackedResourceData { public CosmosDBTableCreateOrUpdateContent(Azure.Core.AzureLocation location, Azure.ResourceManager.CosmosDB.Models.CosmosDBTableResourceInfo resource) : base (default(Azure.Core.AzureLocation)) { } @@ -3205,6 +3434,31 @@ public CosmosDBTableResourceInfo(string tableName) { } public Azure.ResourceManager.CosmosDB.Models.ResourceRestoreParameters RestoreParameters { get { throw null; } set { } } public string TableName { get { throw null; } set { } } } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct CosmosDBType : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public CosmosDBType(string value) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBType Cassandra { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBType CassandraConnectorMetadata { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBType Gremlin { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBType GremlinV2 { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBType MongoDB { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBType Sql { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBType SqlDedicatedGateway { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBType Table { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.CosmosDBType Undefined { get { throw null; } } + public bool Equals(Azure.ResourceManager.CosmosDB.Models.CosmosDBType other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.CosmosDB.Models.CosmosDBType left, Azure.ResourceManager.CosmosDB.Models.CosmosDBType right) { throw null; } + public static implicit operator Azure.ResourceManager.CosmosDB.Models.CosmosDBType (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CosmosDB.Models.CosmosDBType left, Azure.ResourceManager.CosmosDB.Models.CosmosDBType right) { throw null; } + public override string ToString() { throw null; } + } public partial class CosmosDBUniqueKey { public CosmosDBUniqueKey() { } @@ -3216,6 +3470,12 @@ public CosmosDBVirtualNetworkRule() { } public Azure.Core.ResourceIdentifier Id { get { throw null; } set { } } public bool? IgnoreMissingVnetServiceEndpoint { get { throw null; } set { } } } + public partial class CosmosMongoDataTransferDataSourceSink : Azure.ResourceManager.CosmosDB.Models.DataTransferDataSourceSink + { + public CosmosMongoDataTransferDataSourceSink(string databaseName, string collectionName) { } + public string CollectionName { get { throw null; } set { } } + public string DatabaseName { get { throw null; } set { } } + } public partial class CosmosSqlDataTransferDataSourceSink : Azure.ResourceManager.CosmosDB.Models.DataTransferDataSourceSink { public CosmosSqlDataTransferDataSourceSink(string databaseName, string containerName) { } @@ -3509,6 +3769,18 @@ public GremlinGraphResourceInfo(string graphName) { } public Azure.ResourceManager.CosmosDB.Models.ResourceRestoreParameters RestoreParameters { get { throw null; } set { } } public System.Collections.Generic.IList UniqueKeys { get { throw null; } } } + public partial class ListConnectionStringsResult + { + internal ListConnectionStringsResult() { } + public System.Collections.Generic.IReadOnlyList ConnectionStrings { get { throw null; } } + } + public partial class MaterializedViewDefinition + { + public MaterializedViewDefinition(string sourceCollectionId, string definition) { } + public string Definition { get { throw null; } set { } } + public string SourceCollectionId { get { throw null; } set { } } + public string SourceCollectionRid { get { throw null; } } + } public partial class MaterializedViewsBuilderRegionalService : Azure.ResourceManager.CosmosDB.Models.CosmosDBRegionalService { internal MaterializedViewsBuilderRegionalService() { } @@ -3523,6 +3795,50 @@ public partial class MergeParameters public MergeParameters() { } public bool? IsDryRun { get { throw null; } set { } } } + public partial class MongoClusterPatch + { + public MongoClusterPatch() { } + public string AdministratorLogin { get { throw null; } set { } } + public string AdministratorLoginPassword { get { throw null; } set { } } + public Azure.ResourceManager.CosmosDB.Models.MongoClusterStatus? ClusterStatus { get { throw null; } } + public string ConnectionString { get { throw null; } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? CreateMode { get { throw null; } set { } } + public string EarliestRestoreTime { get { throw null; } } + public System.Collections.Generic.IList NodeGroupSpecs { get { throw null; } } + public Azure.ResourceManager.CosmosDB.Models.CosmosDBProvisioningState? ProvisioningState { get { throw null; } } + public Azure.ResourceManager.CosmosDB.Models.MongoClusterRestoreParameters RestoreParameters { get { throw null; } set { } } + public string ServerVersion { get { throw null; } set { } } + public System.Collections.Generic.IDictionary Tags { get { throw null; } } + } + public partial class MongoClusterRestoreParameters + { + public MongoClusterRestoreParameters() { } + public System.DateTimeOffset? PointInTimeUTC { get { throw null; } set { } } + public string SourceResourceId { get { throw null; } set { } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct MongoClusterStatus : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public MongoClusterStatus(string value) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.MongoClusterStatus Dropping { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.MongoClusterStatus Provisioning { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.MongoClusterStatus Ready { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.MongoClusterStatus Starting { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.MongoClusterStatus Stopped { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.MongoClusterStatus Stopping { get { throw null; } } + public static Azure.ResourceManager.CosmosDB.Models.MongoClusterStatus Updating { get { throw null; } } + public bool Equals(Azure.ResourceManager.CosmosDB.Models.MongoClusterStatus other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.CosmosDB.Models.MongoClusterStatus left, Azure.ResourceManager.CosmosDB.Models.MongoClusterStatus right) { throw null; } + public static implicit operator Azure.ResourceManager.CosmosDB.Models.MongoClusterStatus (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CosmosDB.Models.MongoClusterStatus left, Azure.ResourceManager.CosmosDB.Models.MongoClusterStatus right) { throw null; } + public override string ToString() { throw null; } + } public partial class MongoDBCollectionCreateOrUpdateContent : Azure.ResourceManager.Models.TrackedResourceData { public MongoDBCollectionCreateOrUpdateContent(Azure.Core.AzureLocation location, Azure.ResourceManager.CosmosDB.Models.MongoDBCollectionResourceInfo resource) : base (default(Azure.Core.AzureLocation)) { } @@ -3622,6 +3938,36 @@ public enum NetworkAclBypass None = 0, AzureServices = 1, } + public partial class NodeGroupProperties + { + public NodeGroupProperties() { } + public long? DiskSizeInGB { get { throw null; } set { } } + public bool? EnableHa { get { throw null; } set { } } + public string Sku { get { throw null; } set { } } + } + public partial class NodeGroupSpec : Azure.ResourceManager.CosmosDB.Models.NodeGroupProperties + { + public NodeGroupSpec() { } + public Azure.ResourceManager.CosmosDB.Models.NodeKind? Kind { get { throw null; } set { } } + public int? NodeCount { get { throw null; } set { } } + } + [System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)] + public readonly partial struct NodeKind : System.IEquatable + { + private readonly object _dummy; + private readonly int _dummyPrimitive; + public NodeKind(string value) { throw null; } + public static Azure.ResourceManager.CosmosDB.Models.NodeKind Shard { get { throw null; } } + public bool Equals(Azure.ResourceManager.CosmosDB.Models.NodeKind other) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override bool Equals(object obj) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public override int GetHashCode() { throw null; } + public static bool operator ==(Azure.ResourceManager.CosmosDB.Models.NodeKind left, Azure.ResourceManager.CosmosDB.Models.NodeKind right) { throw null; } + public static implicit operator Azure.ResourceManager.CosmosDB.Models.NodeKind (string value) { throw null; } + public static bool operator !=(Azure.ResourceManager.CosmosDB.Models.NodeKind left, Azure.ResourceManager.CosmosDB.Models.NodeKind right) { throw null; } + public override string ToString() { throw null; } + } public partial class PartitionMetric : Azure.ResourceManager.CosmosDB.Models.CosmosDBBaseMetric { internal PartitionMetric() { } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/assets.json b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/assets.json index d5a48ca262f34..89099a3ac05bf 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/assets.json +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/assets.json @@ -2,5 +2,5 @@ "AssetsRepo": "Azure/azure-sdk-assets", "AssetsRepoPrefixPath": "net", "TagPrefix": "net/cosmosdb/Azure.ResourceManager.CosmosDB", - "Tag": "net/cosmosdb/Azure.ResourceManager.CosmosDB_4e6ae070a0" + "Tag": "net/cosmosdb/Azure.ResourceManager.CosmosDB_136ec94563" } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ArmCosmosDBModelFactory.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ArmCosmosDBModelFactory.cs index 1680d8c5aec6f..eb6270daaa542 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ArmCosmosDBModelFactory.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ArmCosmosDBModelFactory.cs @@ -232,10 +232,12 @@ public static CosmosDBAccountReadOnlyKeyList CosmosDBAccountReadOnlyKeyList(stri /// Initializes a new instance of CosmosDBAccountConnectionString. /// Value of the connection string. /// Description of the connection string. + /// Kind of the connection string key. + /// Type of the connection string. /// A new instance for mocking. - public static CosmosDBAccountConnectionString CosmosDBAccountConnectionString(string connectionString = null, string description = null) + public static CosmosDBAccountConnectionString CosmosDBAccountConnectionString(string connectionString = null, string description = null, CosmosDBKind? keyKind = null, CosmosDBType? keyType = null) { - return new CosmosDBAccountConnectionString(connectionString, description); + return new CosmosDBAccountConnectionString(connectionString, description, keyKind, keyType); } /// Initializes a new instance of ErrorResponse. @@ -596,15 +598,16 @@ public static CosmosDBSqlContainerData CosmosDBSqlContainerData(ResourceIdentifi /// Analytical TTL. /// Parameters to indicate the information about the restore. /// Enum to indicate the mode of resource creation. + /// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. /// 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 new instance for mocking. - public static ExtendedCosmosDBSqlContainerResourceInfo ExtendedCosmosDBSqlContainerResourceInfo(string containerName = null, CosmosDBIndexingPolicy indexingPolicy = null, CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = null, IEnumerable uniqueKeys = null, ConflictResolutionPolicy conflictResolutionPolicy = null, CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = null, ResourceRestoreParameters restoreParameters = null, CosmosDBAccountCreateMode? createMode = null, string rid = null, float? timestamp = null, ETag? etag = null) + public static ExtendedCosmosDBSqlContainerResourceInfo ExtendedCosmosDBSqlContainerResourceInfo(string containerName = null, CosmosDBIndexingPolicy indexingPolicy = null, CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = null, IEnumerable uniqueKeys = null, ConflictResolutionPolicy conflictResolutionPolicy = null, CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = null, ResourceRestoreParameters restoreParameters = null, CosmosDBAccountCreateMode? createMode = null, MaterializedViewDefinition materializedViewDefinition = null, string rid = null, float? timestamp = null, ETag? etag = null) { uniqueKeys ??= new List(); - return new ExtendedCosmosDBSqlContainerResourceInfo(containerName, indexingPolicy, partitionKey, defaultTtl, uniqueKeys != null ? new CosmosDBUniqueKeyPolicy(uniqueKeys?.ToList()) : null, conflictResolutionPolicy, clientEncryptionPolicy, analyticalStorageTtl, restoreParameters, createMode, rid, timestamp, etag); + return new ExtendedCosmosDBSqlContainerResourceInfo(containerName, indexingPolicy, partitionKey, defaultTtl, uniqueKeys != null ? new CosmosDBUniqueKeyPolicy(uniqueKeys?.ToList()) : null, conflictResolutionPolicy, clientEncryptionPolicy, analyticalStorageTtl, restoreParameters, createMode, materializedViewDefinition, rid, timestamp, etag); } /// Initializes a new instance of CosmosDBContainerPartitionKey. @@ -620,6 +623,16 @@ public static CosmosDBContainerPartitionKey CosmosDBContainerPartitionKey(IEnume return new CosmosDBContainerPartitionKey(paths?.ToList(), kind, version, isSystemKey); } + /// Initializes a new instance of MaterializedViewDefinition. + /// An unique identifier for the source collection. This is a system generated property. + /// The name of the source container on which the Materialized View will be created. + /// The definition should be an SQL query which would be used to fetch data from the source container to populate into the Materialized View container. + /// A new instance for mocking. + public static MaterializedViewDefinition MaterializedViewDefinition(string sourceCollectionRid = null, string sourceCollectionId = null, string definition = null) + { + return new MaterializedViewDefinition(sourceCollectionRid, sourceCollectionId, definition); + } + /// Initializes a new instance of CosmosDBSqlContainerCreateOrUpdateContent. /// The id. /// The name. @@ -1228,16 +1241,18 @@ public static CosmosDBLocationData CosmosDBLocationData(ResourceIdentifier id = } /// Initializes a new instance of CosmosDBLocationProperties. - /// The current status of location in Azure. /// Flag indicating whether the location supports availability zones or not. /// Flag indicating whether the location is residency sensitive. /// The properties of available backup storage redundancies. + /// Flag indicating whether the subscription have access in region for Non-Availability Zones. + /// Flag indicating whether the subscription have access in region for Availability Zones(Az). + /// Enum to indicate current buildout status of the region. /// A new instance for mocking. - public static CosmosDBLocationProperties CosmosDBLocationProperties(string status = null, bool? doesSupportAvailabilityZone = null, bool? isResidencyRestricted = null, IEnumerable backupStorageRedundancies = null) + public static CosmosDBLocationProperties CosmosDBLocationProperties(bool? doesSupportAvailabilityZone = null, bool? isResidencyRestricted = null, IEnumerable backupStorageRedundancies = null, bool? isSubscriptionRegionAccessAllowedForRegular = null, bool? isSubscriptionRegionAccessAllowedForAz = null, CosmosDBStatus? status = null) { backupStorageRedundancies ??= new List(); - return new CosmosDBLocationProperties(status, doesSupportAvailabilityZone, isResidencyRestricted, backupStorageRedundancies?.ToList()); + return new CosmosDBLocationProperties(doesSupportAvailabilityZone, isResidencyRestricted, backupStorageRedundancies?.ToList(), isSubscriptionRegionAccessAllowedForRegular, isSubscriptionRegionAccessAllowedForAz, status); } /// Initializes a new instance of CassandraViewGetResultData. @@ -1315,12 +1330,12 @@ public static DataTransferJobGetResultCreateOrUpdateContent DataTransferJobGetRe /// /// Source DataStore details /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , , and . /// /// /// Destination DataStore details /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , , and . /// /// Job Status. /// Processed Count. @@ -1343,12 +1358,12 @@ public static DataTransferJobProperties DataTransferJobProperties(string jobName /// /// Source DataStore details /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , , and . /// /// /// Destination DataStore details /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , , and . /// /// Job Status. /// Processed Count. @@ -1385,7 +1400,7 @@ public static CassandraClusterData CassandraClusterData(ResourceIdentifier id = /// Resource id of a subnet that this cluster's management service should have its network interface attached to. The subnet must be routable to all subnets that will be delegated to data centers. The resource id must be of the form '/subscriptions/<subscription id>/resourceGroups/<resource group>/providers/Microsoft.Network/virtualNetworks/<virtual network>/subnets/<subnet>'. /// Which version of Cassandra should this cluster converge to running (e.g., 3.11). When updated, the cluster may take some time to migrate to the new version. /// If you need to set the clusterName property in cassandra.yaml to something besides the resource name of the cluster, set the value to use on this property. - /// Which authentication method Cassandra should use to authenticate clients. 'None' turns off authentication, so should not be used except in emergencies. 'Cassandra' is the default password based authentication. The default is 'Cassandra'. 'Ldap' is in preview. + /// Which authentication method Cassandra should use to authenticate clients. 'None' turns off authentication, so should not be used except in emergencies. 'Cassandra' is the default password based authentication. The default is 'Cassandra'. /// Initial password for clients connecting as admin to the cluster. Should be changed after cluster creation. Returns null on GET. This field only applies when the authenticationMethod field is 'Cassandra'. /// Hostname or IP address where the Prometheus endpoint containing data about the managed Cassandra nodes can be reached. /// Should automatic repairs run on this cluster? If omitted, this is true, and should stay true unless you are running a hybrid cluster where you are already doing your own repairs. @@ -1394,11 +1409,12 @@ public static CassandraClusterData CassandraClusterData(ResourceIdentifier id = /// List of TLS certificates that unmanaged nodes must trust for gossip with managed nodes. All managed nodes will present TLS client certificates that are verifiable using one of the certificates provided in this property. /// List of IP addresses of seed nodes in unmanaged data centers. These will be added to the seed node lists of all managed nodes. /// List of IP addresses of seed nodes in the managed data centers. These should be added to the seed node lists of all unmanaged nodes. - /// Number of hours to wait between taking a backup of the cluster. To disable backups, set this property to 0. + /// (Deprecated) Number of hours to wait between taking a backup of the cluster. /// Whether the cluster and associated data centers has been deallocated. /// Whether Cassandra audit logging is enabled. + /// Error related to resource provisioning. /// A new instance for mocking. - public static CassandraClusterProperties CassandraClusterProperties(CassandraProvisioningState? provisioningState = null, string restoreFromBackupId = null, ResourceIdentifier delegatedManagementSubnetId = null, string cassandraVersion = null, string clusterNameOverride = null, CassandraAuthenticationMethod? authenticationMethod = null, string initialCassandraAdminPassword = null, string prometheusEndpointIPAddress = null, bool? isRepairEnabled = null, IEnumerable clientCertificates = null, IEnumerable externalGossipCertificates = null, IEnumerable gossipCertificates = null, IEnumerable externalSeedNodes = null, IEnumerable seedNodes = null, int? hoursBetweenBackups = null, bool? isDeallocated = null, bool? isCassandraAuditLoggingEnabled = null) + public static CassandraClusterProperties CassandraClusterProperties(CassandraProvisioningState? provisioningState = null, string restoreFromBackupId = null, ResourceIdentifier delegatedManagementSubnetId = null, string cassandraVersion = null, string clusterNameOverride = null, CassandraAuthenticationMethod? authenticationMethod = null, string initialCassandraAdminPassword = null, string prometheusEndpointIPAddress = null, bool? isRepairEnabled = null, IEnumerable clientCertificates = null, IEnumerable externalGossipCertificates = null, IEnumerable gossipCertificates = null, IEnumerable externalSeedNodes = null, IEnumerable seedNodes = null, int? hoursBetweenBackups = null, bool? isDeallocated = null, bool? isCassandraAuditLoggingEnabled = null, CassandraError provisionError = null) { clientCertificates ??= new List(); externalGossipCertificates ??= new List(); @@ -1406,7 +1422,7 @@ public static CassandraClusterProperties CassandraClusterProperties(CassandraPro externalSeedNodes ??= new List(); seedNodes ??= new List(); - return new CassandraClusterProperties(provisioningState, restoreFromBackupId, delegatedManagementSubnetId, cassandraVersion, clusterNameOverride, authenticationMethod, initialCassandraAdminPassword, prometheusEndpointIPAddress != null ? new CassandraDataCenterSeedNode(prometheusEndpointIPAddress) : null, isRepairEnabled, clientCertificates?.ToList(), externalGossipCertificates?.ToList(), gossipCertificates?.ToList(), externalSeedNodes?.ToList(), seedNodes?.ToList(), hoursBetweenBackups, isDeallocated, isCassandraAuditLoggingEnabled); + return new CassandraClusterProperties(provisioningState, restoreFromBackupId, delegatedManagementSubnetId, cassandraVersion, clusterNameOverride, authenticationMethod, initialCassandraAdminPassword, prometheusEndpointIPAddress != null ? new CassandraDataCenterSeedNode(prometheusEndpointIPAddress) : null, isRepairEnabled, clientCertificates?.ToList(), externalGossipCertificates?.ToList(), gossipCertificates?.ToList(), externalSeedNodes?.ToList(), seedNodes?.ToList(), hoursBetweenBackups, isDeallocated, isCassandraAuditLoggingEnabled, provisionError); } /// Initializes a new instance of CassandraCommandOutput. @@ -1452,29 +1468,33 @@ public static CassandraDataCenterData CassandraDataCenterData(ResourceIdentifier /// Indicates the Key Uri of the customer key to use for encryption of the backup storage account. /// Virtual Machine SKU used for data centers. Default value is Standard_DS14_v2. /// Disk SKU used for data centers. Default value is P30. - /// Number of disk used for data centers. Default value is 4. - /// If the data center has Availability Zone feature, apply it to the Virtual Machine ScaleSet that host the cassandra data center virtual machines. + /// Number of disks attached to each node. Default is 4. + /// If the data center has Availability Zone support, apply it to the Virtual Machine ScaleSet that host the cassandra data center virtual machines. /// Ldap authentication method properties. This feature is in preview. + /// Whether the data center has been deallocated. + /// Error related to resource provisioning. /// A new instance for mocking. - public static CassandraDataCenterProperties CassandraDataCenterProperties(CassandraProvisioningState? provisioningState = null, AzureLocation? dataCenterLocation = null, ResourceIdentifier delegatedSubnetId = null, int? nodeCount = null, IEnumerable seedNodes = null, string base64EncodedCassandraYamlFragment = null, Uri managedDiskCustomerKeyUri = null, Uri backupStorageCustomerKeyUri = null, string sku = null, string diskSku = null, int? diskCapacity = null, bool? doesSupportAvailabilityZone = null, AuthenticationMethodLdapProperties authenticationMethodLdapProperties = null) + public static CassandraDataCenterProperties CassandraDataCenterProperties(CassandraProvisioningState? provisioningState = null, AzureLocation? dataCenterLocation = null, ResourceIdentifier delegatedSubnetId = null, int? nodeCount = null, IEnumerable seedNodes = null, string base64EncodedCassandraYamlFragment = null, Uri managedDiskCustomerKeyUri = null, Uri backupStorageCustomerKeyUri = null, string sku = null, string diskSku = null, int? diskCapacity = null, bool? doesSupportAvailabilityZone = null, AuthenticationMethodLdapProperties authenticationMethodLdapProperties = null, bool? deallocated = null, CassandraError provisionError = null) { seedNodes ??= new List(); - return new CassandraDataCenterProperties(provisioningState, dataCenterLocation, delegatedSubnetId, nodeCount, seedNodes?.ToList(), base64EncodedCassandraYamlFragment, managedDiskCustomerKeyUri, backupStorageCustomerKeyUri, sku, diskSku, diskCapacity, doesSupportAvailabilityZone, authenticationMethodLdapProperties); + return new CassandraDataCenterProperties(provisioningState, dataCenterLocation, delegatedSubnetId, nodeCount, seedNodes?.ToList(), base64EncodedCassandraYamlFragment, managedDiskCustomerKeyUri, backupStorageCustomerKeyUri, sku, diskSku, diskCapacity, doesSupportAvailabilityZone, authenticationMethodLdapProperties, deallocated, provisionError); } /// Initializes a new instance of CassandraClusterPublicStatus. /// /// /// List relevant information about any connection errors to the Datacenters. + /// List relevant information about any errors about cluster, data center and connection error. /// List of the status of each datacenter in this cluster. /// A new instance for mocking. - public static CassandraClusterPublicStatus CassandraClusterPublicStatus(ETag? etag = null, CassandraReaperStatus reaperStatus = null, IEnumerable connectionErrors = null, IEnumerable dataCenters = null) + public static CassandraClusterPublicStatus CassandraClusterPublicStatus(ETag? etag = null, CassandraReaperStatus reaperStatus = null, IEnumerable connectionErrors = null, IEnumerable errors = null, IEnumerable dataCenters = null) { connectionErrors ??= new List(); + errors ??= new List(); dataCenters ??= new List(); - return new CassandraClusterPublicStatus(etag, reaperStatus, connectionErrors?.ToList(), dataCenters?.ToList()); + return new CassandraClusterPublicStatus(etag, reaperStatus, connectionErrors?.ToList(), errors?.ToList(), dataCenters?.ToList()); } /// Initializes a new instance of CassandraReaperStatus. @@ -1519,12 +1539,13 @@ public static CassandraClusterPublicStatusDataCentersItem CassandraClusterPublic /// The node's IP address. /// The state of the node in Cassandra ring. /// + /// Cassandra service status on this node. /// The amount of file system data in the data directory (e.g., 47.66 kB), excluding all content in the snapshots subdirectories. Because all SSTable data files are included, any data that is not cleaned up (such as TTL-expired cells or tombstones) is counted. /// List of tokens this node covers. /// /// The network ID of the node. /// The rack this node is part of. - /// The timestamp at which that snapshot of these usage statistics were taken. + /// The timestamp when these statistics were captured. /// The amount of disk used, in kB, of the directory /var/lib/cassandra. /// The amount of disk free, in kB, of the directory /var/lib/cassandra. /// Used memory (calculated as total - free - buffers - cache), in kB. @@ -1533,11 +1554,80 @@ public static CassandraClusterPublicStatusDataCentersItem CassandraClusterPublic /// Total installed memory (MemTotal and SwapTotal in /proc/meminfo), in kB. /// A float representing the current system-wide CPU utilization as a percentage. /// A new instance for mocking. - public static CassandraClusterDataCenterNodeItem CassandraClusterDataCenterNodeItem(string address = null, CassandraNodeState? state = null, string status = null, string load = null, IEnumerable tokens = null, int? size = null, Guid? hostId = null, string rack = null, string timestamp = null, long? diskUsedKB = null, long? diskFreeKB = null, long? memoryUsedKB = null, long? memoryBuffersAndCachedKB = null, long? memoryFreeKB = null, long? memoryTotalKB = null, double? cpuUsage = null) + public static CassandraClusterDataCenterNodeItem CassandraClusterDataCenterNodeItem(string address = null, CassandraNodeState? state = null, string status = null, string cassandraProcessStatus = null, string load = null, IEnumerable tokens = null, int? size = null, Guid? hostId = null, string rack = null, string timestamp = null, long? diskUsedKB = null, long? diskFreeKB = null, long? memoryUsedKB = null, long? memoryBuffersAndCachedKB = null, long? memoryFreeKB = null, long? memoryTotalKB = null, double? cpuUsage = null) { tokens ??= new List(); - return new CassandraClusterDataCenterNodeItem(address, state, status, load, tokens?.ToList(), size, hostId, rack, timestamp, diskUsedKB, diskFreeKB, memoryUsedKB, memoryBuffersAndCachedKB, memoryFreeKB, memoryTotalKB, cpuUsage); + return new CassandraClusterDataCenterNodeItem(address, state, status, cassandraProcessStatus, load, tokens?.ToList(), size, hostId, rack, timestamp, diskUsedKB, diskFreeKB, memoryUsedKB, memoryBuffersAndCachedKB, memoryFreeKB, memoryTotalKB, cpuUsage); + } + + /// Initializes a new instance of MongoClusterData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The mode to create a mongo cluster. + /// Parameters used for restore operations. + /// The administrator's login for the mongo cluster. + /// The password of the administrator login. + /// The Mongo DB server version. Defaults to the latest available version if not specified. + /// The default mongo connection string for the cluster. + /// Earliest restore timestamp in UTC ISO8601 format. + /// A provisioning state of the mongo cluster. + /// A status of the mongo cluster. + /// The list of node group specs in the cluster. + /// A new instance for mocking. + public static MongoClusterData MongoClusterData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, CosmosDBAccountCreateMode? createMode = null, MongoClusterRestoreParameters restoreParameters = null, string administratorLogin = null, string administratorLoginPassword = null, string serverVersion = null, string connectionString = null, string earliestRestoreTime = null, CosmosDBProvisioningState? provisioningState = null, MongoClusterStatus? clusterStatus = null, IEnumerable nodeGroupSpecs = null) + { + tags ??= new Dictionary(); + nodeGroupSpecs ??= new List(); + + return new MongoClusterData(id, name, resourceType, systemData, tags, location, createMode, restoreParameters, administratorLogin, administratorLoginPassword, serverVersion, connectionString, earliestRestoreTime, provisioningState, clusterStatus, nodeGroupSpecs?.ToList()); + } + + /// Initializes a new instance of CosmosDBFirewallRuleData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The provisioning state of the firewall rule. + /// The start IP address of the mongo cluster firewall rule. Must be IPv4 format. + /// The end IP address of the mongo cluster firewall rule. Must be IPv4 format. + /// A new instance for mocking. + public static CosmosDBFirewallRuleData CosmosDBFirewallRuleData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, CosmosDBProvisioningState? provisioningState = null, string startIPAddress = null, string endIPAddress = null) + { + return new CosmosDBFirewallRuleData(id, name, resourceType, systemData, provisioningState, startIPAddress, endIPAddress); + } + + /// Initializes a new instance of CheckCosmosDBNameAvailabilityResponse. + /// Indicates if the resource name is available. + /// The reason why the given name is not available. + /// Detailed reason why the given name is available. + /// A new instance for mocking. + public static CheckCosmosDBNameAvailabilityResponse CheckCosmosDBNameAvailabilityResponse(bool? nameAvailable = null, CosmosDBNameUnavailableReason? reason = null, string message = null) + { + return new CheckCosmosDBNameAvailabilityResponse(nameAvailable, reason, message); + } + + /// Initializes a new instance of ListConnectionStringsResult. + /// An array that contains the connection strings for a mongo cluster. + /// A new instance for mocking. + public static ListConnectionStringsResult ListConnectionStringsResult(IEnumerable connectionStrings = null) + { + connectionStrings ??= new List(); + + return new ListConnectionStringsResult(connectionStrings?.ToList()); + } + + /// Initializes a new instance of CosmosDBConnectionString. + /// Value of the connection string. + /// Description of the connection string. + /// A new instance for mocking. + public static CosmosDBConnectionString CosmosDBConnectionString(string connectionString = null, string description = null) + { + return new CosmosDBConnectionString(connectionString, description); } /// Initializes a new instance of MongoDBRoleDefinitionData. @@ -1743,16 +1833,17 @@ public static ExtendedRestorableSqlContainerResourceInfo ExtendedRestorableSqlCo /// Analytical TTL. /// Parameters to indicate the information about the restore. /// Enum to indicate the mode of resource creation. + /// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. /// A system generated property that specifies the addressable path of the container resource. /// 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 new instance for mocking. - public static RestorableSqlContainerPropertiesResourceContainer RestorableSqlContainerPropertiesResourceContainer(string containerName = null, CosmosDBIndexingPolicy indexingPolicy = null, CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = null, IEnumerable uniqueKeys = null, ConflictResolutionPolicy conflictResolutionPolicy = null, CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = null, ResourceRestoreParameters restoreParameters = null, CosmosDBAccountCreateMode? createMode = null, string self = null, string rid = null, float? timestamp = null, ETag? etag = null) + public static RestorableSqlContainerPropertiesResourceContainer RestorableSqlContainerPropertiesResourceContainer(string containerName = null, CosmosDBIndexingPolicy indexingPolicy = null, CosmosDBContainerPartitionKey partitionKey = null, int? defaultTtl = null, IEnumerable uniqueKeys = null, ConflictResolutionPolicy conflictResolutionPolicy = null, CosmosDBClientEncryptionPolicy clientEncryptionPolicy = null, long? analyticalStorageTtl = null, ResourceRestoreParameters restoreParameters = null, CosmosDBAccountCreateMode? createMode = null, MaterializedViewDefinition materializedViewDefinition = null, string self = null, string rid = null, float? timestamp = null, ETag? etag = null) { uniqueKeys ??= new List(); - return new RestorableSqlContainerPropertiesResourceContainer(containerName, indexingPolicy, partitionKey, defaultTtl, uniqueKeys != null ? new CosmosDBUniqueKeyPolicy(uniqueKeys?.ToList()) : null, conflictResolutionPolicy, clientEncryptionPolicy, analyticalStorageTtl, restoreParameters, createMode, self, rid, timestamp, etag); + return new RestorableSqlContainerPropertiesResourceContainer(containerName, indexingPolicy, partitionKey, defaultTtl, uniqueKeys != null ? new CosmosDBUniqueKeyPolicy(uniqueKeys?.ToList()) : null, conflictResolutionPolicy, clientEncryptionPolicy, analyticalStorageTtl, restoreParameters, createMode, materializedViewDefinition, self, rid, timestamp, etag); } /// Initializes a new instance of RestorableSqlResourceData. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBFirewallRuleCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBFirewallRuleCollection.cs new file mode 100644 index 0000000000000..64ac908b47d8d --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBFirewallRuleCollection.cs @@ -0,0 +1,340 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetCosmosDBFirewallRules method from an instance of . + /// + public partial class CosmosDBFirewallRuleCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _cosmosDBFirewallRuleMongoClustersClientDiagnostics; + private readonly MongoClustersRestOperations _cosmosDBFirewallRuleMongoClustersRestClient; + + /// Initializes a new instance of the class for mocking. + protected CosmosDBFirewallRuleCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal CosmosDBFirewallRuleCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _cosmosDBFirewallRuleMongoClustersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", CosmosDBFirewallRuleResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(CosmosDBFirewallRuleResource.ResourceType, out string cosmosDBFirewallRuleMongoClustersApiVersion); + _cosmosDBFirewallRuleMongoClustersRestClient = new MongoClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cosmosDBFirewallRuleMongoClustersApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != MongoClusterResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, MongoClusterResource.ResourceType), nameof(id)); + } + + /// + /// Creates a new firewall rule or updates an existing firewall rule on a mongo cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// MongoClusters_CreateOrUpdateFirewallRule + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the mongo cluster firewall rule. + /// The required parameters for creating or updating a firewall rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string firewallRuleName, CosmosDBFirewallRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _cosmosDBFirewallRuleMongoClustersClientDiagnostics.CreateScope("CosmosDBFirewallRuleCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _cosmosDBFirewallRuleMongoClustersRestClient.CreateOrUpdateFirewallRuleAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, firewallRuleName, data, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(new CosmosDBFirewallRuleOperationSource(Client), _cosmosDBFirewallRuleMongoClustersClientDiagnostics, Pipeline, _cosmosDBFirewallRuleMongoClustersRestClient.CreateCreateOrUpdateFirewallRuleRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, firewallRuleName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a new firewall rule or updates an existing firewall rule on a mongo cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// MongoClusters_CreateOrUpdateFirewallRule + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the mongo cluster firewall rule. + /// The required parameters for creating or updating a firewall rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string firewallRuleName, CosmosDBFirewallRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _cosmosDBFirewallRuleMongoClustersClientDiagnostics.CreateScope("CosmosDBFirewallRuleCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _cosmosDBFirewallRuleMongoClustersRestClient.CreateOrUpdateFirewallRule(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, firewallRuleName, data, cancellationToken); + var operation = new CosmosDBArmOperation(new CosmosDBFirewallRuleOperationSource(Client), _cosmosDBFirewallRuleMongoClustersClientDiagnostics, Pipeline, _cosmosDBFirewallRuleMongoClustersRestClient.CreateCreateOrUpdateFirewallRuleRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, firewallRuleName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets information about a mongo cluster firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// MongoClusters_GetFirewallRule + /// + /// + /// + /// The name of the mongo cluster firewall rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var scope = _cosmosDBFirewallRuleMongoClustersClientDiagnostics.CreateScope("CosmosDBFirewallRuleCollection.Get"); + scope.Start(); + try + { + var response = await _cosmosDBFirewallRuleMongoClustersRestClient.GetFirewallRuleAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, firewallRuleName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CosmosDBFirewallRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets information about a mongo cluster firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// MongoClusters_GetFirewallRule + /// + /// + /// + /// The name of the mongo cluster firewall rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var scope = _cosmosDBFirewallRuleMongoClustersClientDiagnostics.CreateScope("CosmosDBFirewallRuleCollection.Get"); + scope.Start(); + try + { + var response = _cosmosDBFirewallRuleMongoClustersRestClient.GetFirewallRule(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, firewallRuleName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CosmosDBFirewallRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List all the firewall rules in a given mongo cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules + /// + /// + /// Operation Id + /// MongoClusters_ListFirewallRules + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _cosmosDBFirewallRuleMongoClustersRestClient.CreateListFirewallRulesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cosmosDBFirewallRuleMongoClustersRestClient.CreateListFirewallRulesNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new CosmosDBFirewallRuleResource(Client, CosmosDBFirewallRuleData.DeserializeCosmosDBFirewallRuleData(e)), _cosmosDBFirewallRuleMongoClustersClientDiagnostics, Pipeline, "CosmosDBFirewallRuleCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List all the firewall rules in a given mongo cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules + /// + /// + /// Operation Id + /// MongoClusters_ListFirewallRules + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _cosmosDBFirewallRuleMongoClustersRestClient.CreateListFirewallRulesRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _cosmosDBFirewallRuleMongoClustersRestClient.CreateListFirewallRulesNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName, Id.Name); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new CosmosDBFirewallRuleResource(Client, CosmosDBFirewallRuleData.DeserializeCosmosDBFirewallRuleData(e)), _cosmosDBFirewallRuleMongoClustersClientDiagnostics, Pipeline, "CosmosDBFirewallRuleCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// MongoClusters_GetFirewallRule + /// + /// + /// + /// The name of the mongo cluster firewall rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var scope = _cosmosDBFirewallRuleMongoClustersClientDiagnostics.CreateScope("CosmosDBFirewallRuleCollection.Exists"); + scope.Start(); + try + { + var response = await _cosmosDBFirewallRuleMongoClustersRestClient.GetFirewallRuleAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, firewallRuleName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// MongoClusters_GetFirewallRule + /// + /// + /// + /// The name of the mongo cluster firewall rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var scope = _cosmosDBFirewallRuleMongoClustersClientDiagnostics.CreateScope("CosmosDBFirewallRuleCollection.Exists"); + scope.Start(); + try + { + var response = _cosmosDBFirewallRuleMongoClustersRestClient.GetFirewallRule(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, firewallRuleName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBFirewallRuleData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBFirewallRuleData.cs new file mode 100644 index 0000000000000..5d5b980ee7576 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBFirewallRuleData.cs @@ -0,0 +1,56 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; +using Azure.ResourceManager.CosmosDB.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A class representing the CosmosDBFirewallRule data model. + /// Represents a mongo cluster firewall rule. + /// + public partial class CosmosDBFirewallRuleData : ResourceData + { + /// Initializes a new instance of CosmosDBFirewallRuleData. + /// The start IP address of the mongo cluster firewall rule. Must be IPv4 format. + /// The end IP address of the mongo cluster firewall rule. Must be IPv4 format. + /// or is null. + public CosmosDBFirewallRuleData(string startIPAddress, string endIPAddress) + { + Argument.AssertNotNull(startIPAddress, nameof(startIPAddress)); + Argument.AssertNotNull(endIPAddress, nameof(endIPAddress)); + + StartIPAddress = startIPAddress; + EndIPAddress = endIPAddress; + } + + /// Initializes a new instance of CosmosDBFirewallRuleData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The provisioning state of the firewall rule. + /// The start IP address of the mongo cluster firewall rule. Must be IPv4 format. + /// The end IP address of the mongo cluster firewall rule. Must be IPv4 format. + internal CosmosDBFirewallRuleData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, CosmosDBProvisioningState? provisioningState, string startIPAddress, string endIPAddress) : base(id, name, resourceType, systemData) + { + ProvisioningState = provisioningState; + StartIPAddress = startIPAddress; + EndIPAddress = endIPAddress; + } + + /// The provisioning state of the firewall rule. + public CosmosDBProvisioningState? ProvisioningState { get; } + /// The start IP address of the mongo cluster firewall rule. Must be IPv4 format. + public string StartIPAddress { get; set; } + /// The end IP address of the mongo cluster firewall rule. Must be IPv4 format. + public string EndIPAddress { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBFirewallRuleResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBFirewallRuleResource.cs new file mode 100644 index 0000000000000..1066bd1d37b73 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBFirewallRuleResource.cs @@ -0,0 +1,297 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A Class representing a CosmosDBFirewallRule along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetCosmosDBFirewallRuleResource method. + /// Otherwise you can get one from its parent resource using the GetCosmosDBFirewallRule method. + /// + public partial class CosmosDBFirewallRuleResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string mongoClusterName, string firewallRuleName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _cosmosDBFirewallRuleMongoClustersClientDiagnostics; + private readonly MongoClustersRestOperations _cosmosDBFirewallRuleMongoClustersRestClient; + private readonly CosmosDBFirewallRuleData _data; + + /// Initializes a new instance of the class for mocking. + protected CosmosDBFirewallRuleResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal CosmosDBFirewallRuleResource(ArmClient client, CosmosDBFirewallRuleData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal CosmosDBFirewallRuleResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _cosmosDBFirewallRuleMongoClustersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string cosmosDBFirewallRuleMongoClustersApiVersion); + _cosmosDBFirewallRuleMongoClustersRestClient = new MongoClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cosmosDBFirewallRuleMongoClustersApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/mongoClusters/firewallRules"; + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual CosmosDBFirewallRuleData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// + /// Gets information about a mongo cluster firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// MongoClusters_GetFirewallRule + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _cosmosDBFirewallRuleMongoClustersClientDiagnostics.CreateScope("CosmosDBFirewallRuleResource.Get"); + scope.Start(); + try + { + var response = await _cosmosDBFirewallRuleMongoClustersRestClient.GetFirewallRuleAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CosmosDBFirewallRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets information about a mongo cluster firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// MongoClusters_GetFirewallRule + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _cosmosDBFirewallRuleMongoClustersClientDiagnostics.CreateScope("CosmosDBFirewallRuleResource.Get"); + scope.Start(); + try + { + var response = _cosmosDBFirewallRuleMongoClustersRestClient.GetFirewallRule(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new CosmosDBFirewallRuleResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a mongo cluster firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// MongoClusters_DeleteFirewallRule + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _cosmosDBFirewallRuleMongoClustersClientDiagnostics.CreateScope("CosmosDBFirewallRuleResource.Delete"); + scope.Start(); + try + { + var response = await _cosmosDBFirewallRuleMongoClustersRestClient.DeleteFirewallRuleAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(_cosmosDBFirewallRuleMongoClustersClientDiagnostics, Pipeline, _cosmosDBFirewallRuleMongoClustersRestClient.CreateDeleteFirewallRuleRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a mongo cluster firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// MongoClusters_DeleteFirewallRule + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _cosmosDBFirewallRuleMongoClustersClientDiagnostics.CreateScope("CosmosDBFirewallRuleResource.Delete"); + scope.Start(); + try + { + var response = _cosmosDBFirewallRuleMongoClustersRestClient.DeleteFirewallRule(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); + var operation = new CosmosDBArmOperation(_cosmosDBFirewallRuleMongoClustersClientDiagnostics, Pipeline, _cosmosDBFirewallRuleMongoClustersRestClient.CreateDeleteFirewallRuleRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a new firewall rule or updates an existing firewall rule on a mongo cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// MongoClusters_CreateOrUpdateFirewallRule + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The required parameters for creating or updating a firewall rule. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, CosmosDBFirewallRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _cosmosDBFirewallRuleMongoClustersClientDiagnostics.CreateScope("CosmosDBFirewallRuleResource.Update"); + scope.Start(); + try + { + var response = await _cosmosDBFirewallRuleMongoClustersRestClient.CreateOrUpdateFirewallRuleAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(new CosmosDBFirewallRuleOperationSource(Client), _cosmosDBFirewallRuleMongoClustersClientDiagnostics, Pipeline, _cosmosDBFirewallRuleMongoClustersRestClient.CreateCreateOrUpdateFirewallRuleRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Creates a new firewall rule or updates an existing firewall rule on a mongo cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// MongoClusters_CreateOrUpdateFirewallRule + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The required parameters for creating or updating a firewall rule. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, CosmosDBFirewallRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _cosmosDBFirewallRuleMongoClustersClientDiagnostics.CreateScope("CosmosDBFirewallRuleResource.Update"); + scope.Start(); + try + { + var response = _cosmosDBFirewallRuleMongoClustersRestClient.CreateOrUpdateFirewallRule(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data, cancellationToken); + var operation = new CosmosDBArmOperation(new CosmosDBFirewallRuleOperationSource(Client), _cosmosDBFirewallRuleMongoClustersClientDiagnostics, Pipeline, _cosmosDBFirewallRuleMongoClustersRestClient.CreateCreateOrUpdateFirewallRuleRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationResource.cs index ef15670996944..7dd363e107a0a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationResource.cs @@ -13,6 +13,7 @@ using Azure.Core; using Azure.Core.Pipeline; using Azure.ResourceManager; +using Azure.ResourceManager.CosmosDB.Models; using Azure.ResourceManager.Resources; namespace Azure.ResourceManager.CosmosDB @@ -34,6 +35,8 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, private readonly ClientDiagnostics _cosmosDBLocationLocationsClientDiagnostics; private readonly LocationsRestOperations _cosmosDBLocationLocationsRestClient; + private readonly ClientDiagnostics _mongoClustersClientDiagnostics; + private readonly MongoClustersRestOperations _mongoClustersRestClient; private readonly CosmosDBLocationData _data; /// Initializes a new instance of the class for mocking. @@ -58,6 +61,8 @@ internal CosmosDBLocationResource(ArmClient client, ResourceIdentifier id) : bas _cosmosDBLocationLocationsClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); TryGetApiVersion(ResourceType, out string cosmosDBLocationLocationsApiVersion); _cosmosDBLocationLocationsRestClient = new LocationsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, cosmosDBLocationLocationsApiVersion); + _mongoClustersClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ProviderConstants.DefaultProviderNamespace, Diagnostics); + _mongoClustersRestClient = new MongoClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint); #if DEBUG ValidateResourceId(Id); #endif @@ -199,5 +204,73 @@ public virtual Response Get(CancellationToken cancella throw; } } + + /// + /// Check the availability of name for resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/checkMongoClusterNameAvailability + /// + /// + /// Operation Id + /// MongoClusters_CheckNameAvailability + /// + /// + /// + /// The required parameters for checking if resource name is available. + /// The cancellation token to use. + /// is null. + public virtual async Task> CheckMongoClusterNameAailabilityAsync(CheckCosmosDBNameAvailabilityContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _mongoClustersClientDiagnostics.CreateScope("CosmosDBLocationResource.CheckMongoClusterNameAailability"); + scope.Start(); + try + { + var response = await _mongoClustersRestClient.CheckNameAvailabilityAsync(Id.SubscriptionId, new AzureLocation(Id.Name), content, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Check the availability of name for resource + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/locations/{location}/checkMongoClusterNameAvailability + /// + /// + /// Operation Id + /// MongoClusters_CheckNameAvailability + /// + /// + /// + /// The required parameters for checking if resource name is available. + /// The cancellation token to use. + /// is null. + public virtual Response CheckMongoClusterNameAailability(CheckCosmosDBNameAvailabilityContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(content, nameof(content)); + + using var scope = _mongoClustersClientDiagnostics.CreateScope("CosmosDBLocationResource.CheckMongoClusterNameAailability"); + scope.Start(); + try + { + var response = _mongoClustersRestClient.CheckNameAvailability(Id.SubscriptionId, new AzureLocation(Id.Name), content, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseResource.cs index cb50d1626243d..76c3613af7c8b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseResource.cs @@ -409,6 +409,82 @@ public virtual ArmOperation Update(WaitUntil waitUn } } + /// + /// Merges the partitions of a SQL database + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/partitionMerge + /// + /// + /// Operation Id + /// SqlResources_SqlDatabasePartitionMerge + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters for the merge operation. + /// The cancellation token to use. + /// is null. + public virtual async Task> SqlDatabasePartitionMergeAsync(WaitUntil waitUntil, MergeParameters mergeParameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); + + using var scope = _cosmosDBSqlDatabaseSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlDatabaseResource.SqlDatabasePartitionMerge"); + scope.Start(); + try + { + var response = await _cosmosDBSqlDatabaseSqlResourcesRestClient.SqlDatabasePartitionMergeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(new PhysicalPartitionStorageInfoCollectionOperationSource(), _cosmosDBSqlDatabaseSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlDatabaseSqlResourcesRestClient.CreateSqlDatabasePartitionMergeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Merges the partitions of a SQL database + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/sqlDatabases/{databaseName}/partitionMerge + /// + /// + /// Operation Id + /// SqlResources_SqlDatabasePartitionMerge + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters for the merge operation. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation SqlDatabasePartitionMerge(WaitUntil waitUntil, MergeParameters mergeParameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); + + using var scope = _cosmosDBSqlDatabaseSqlResourcesClientDiagnostics.CreateScope("CosmosDBSqlDatabaseResource.SqlDatabasePartitionMerge"); + scope.Start(); + try + { + var response = _cosmosDBSqlDatabaseSqlResourcesRestClient.SqlDatabasePartitionMerge(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters, cancellationToken); + var operation = new CosmosDBArmOperation(new PhysicalPartitionStorageInfoCollectionOperationSource(), _cosmosDBSqlDatabaseSqlResourcesClientDiagnostics, Pipeline, _cosmosDBSqlDatabaseSqlResourcesRestClient.CreateSqlDatabasePartitionMergeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Add a tag to the current resource. /// diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultData.cs index 912306cfc791b..335de32d2db23 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultData.cs @@ -32,12 +32,12 @@ public DataTransferJobGetResultData() /// /// Source DataStore details /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , , and . /// /// /// Destination DataStore details /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , , and . /// /// Job Status. /// Processed Count. @@ -63,13 +63,13 @@ internal DataTransferJobGetResultData(ResourceIdentifier id, string name, Resour /// /// Source DataStore details /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , , and . /// public DataTransferDataSourceSink Source { get; set; } /// /// Destination DataStore details /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , , and . /// public DataTransferDataSourceSink Destination { get; set; } /// Job Status. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBExtensions.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBExtensions.cs index 4732d2165cdd7..b1a35e4957e02 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBExtensions.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/CosmosDBExtensions.cs @@ -730,6 +730,44 @@ public static CassandraDataCenterResource GetCassandraDataCenterResource(this Ar } #endregion + #region MongoClusterResource + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static MongoClusterResource GetMongoClusterResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + MongoClusterResource.ValidateResourceId(id); + return new MongoClusterResource(client, id); + } + ); + } + #endregion + + #region CosmosDBFirewallRuleResource + /// + /// Gets an object representing a along with the instance operations that can be performed on it but with no data. + /// You can use to create a from its components. + /// + /// The instance the method will execute against. + /// The resource ID of the resource to get. + /// Returns a object. + public static CosmosDBFirewallRuleResource GetCosmosDBFirewallRuleResource(this ArmClient client, ResourceIdentifier id) + { + return client.GetResourceClient(() => + { + CosmosDBFirewallRuleResource.ValidateResourceId(id); + return new CosmosDBFirewallRuleResource(client, id); + } + ); + } + #endregion + #region CosmosDBPrivateEndpointConnectionResource /// /// Gets an object representing a along with the instance operations that can be performed on it but with no data. @@ -918,6 +956,62 @@ public static Response GetCassandraCluster(this Resour return resourceGroupResource.GetCassandraClusters().Get(clusterName, cancellationToken); } + /// Gets a collection of MongoClusterResources in the ResourceGroupResource. + /// The instance the method will execute against. + /// An object representing collection of MongoClusterResources and their operations over a MongoClusterResource. + public static MongoClusterCollection GetMongoClusters(this ResourceGroupResource resourceGroupResource) + { + return GetResourceGroupResourceExtensionClient(resourceGroupResource).GetMongoClusters(); + } + + /// + /// Gets information about a mongo cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName} + /// + /// + /// Operation Id + /// MongoClusters_Get + /// + /// + /// + /// The instance the method will execute against. + /// The name of the mongo cluster. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public static async Task> GetMongoClusterAsync(this ResourceGroupResource resourceGroupResource, string mongoClusterName, CancellationToken cancellationToken = default) + { + return await resourceGroupResource.GetMongoClusters().GetAsync(mongoClusterName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about a mongo cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName} + /// + /// + /// Operation Id + /// MongoClusters_Get + /// + /// + /// + /// The instance the method will execute against. + /// The name of the mongo cluster. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public static Response GetMongoCluster(this ResourceGroupResource resourceGroupResource, string mongoClusterName, CancellationToken cancellationToken = default) + { + return resourceGroupResource.GetMongoClusters().Get(mongoClusterName, cancellationToken); + } + /// Gets a collection of CosmosDBLocationResources in the SubscriptionResource. /// The instance the method will execute against. /// An object representing collection of CosmosDBLocationResources and their operations over a CosmosDBLocationResource. @@ -1054,6 +1148,48 @@ public static Pageable GetCassandraClusters(this Subsc return GetSubscriptionResourceExtensionClient(subscriptionResource).GetCassandraClusters(cancellationToken); } + /// + /// List all the mongo clusters in a given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/mongoClusters + /// + /// + /// Operation Id + /// MongoClusters_List + /// + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public static AsyncPageable GetMongoClustersAsync(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMongoClustersAsync(cancellationToken); + } + + /// + /// List all the mongo clusters in a given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/mongoClusters + /// + /// + /// Operation Id + /// MongoClusters_List + /// + /// + /// + /// The instance the method will execute against. + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public static Pageable GetMongoClusters(this SubscriptionResource subscriptionResource, CancellationToken cancellationToken = default) + { + return GetSubscriptionResourceExtensionClient(subscriptionResource).GetMongoClusters(cancellationToken); + } + /// /// Lists all the restorable Azure Cosmos DB database accounts available under the subscription. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. /// diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs index 7e3f846bf4fec..16288351d9588 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/ResourceGroupResourceExtensionClient.cs @@ -44,5 +44,12 @@ public virtual CassandraClusterCollection GetCassandraClusters() { return GetCachedClient(Client => new CassandraClusterCollection(Client, Id)); } + + /// Gets a collection of MongoClusterResources in the ResourceGroupResource. + /// An object representing collection of MongoClusterResources and their operations over a MongoClusterResource. + public virtual MongoClusterCollection GetMongoClusters() + { + return GetCachedClient(Client => new MongoClusterCollection(Client, Id)); + } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs index f21376ad168cd..0819db0205f41 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Extensions/SubscriptionResourceExtensionClient.cs @@ -20,6 +20,8 @@ internal partial class SubscriptionResourceExtensionClient : ArmResource private DatabaseAccountsRestOperations _cosmosDBAccountDatabaseAccountsRestClient; private ClientDiagnostics _cassandraClusterClientDiagnostics; private CassandraClustersRestOperations _cassandraClusterRestClient; + private ClientDiagnostics _mongoClusterClientDiagnostics; + private MongoClustersRestOperations _mongoClusterRestClient; private ClientDiagnostics _restorableCosmosDBAccountRestorableDatabaseAccountsClientDiagnostics; private RestorableDatabaseAccountsRestOperations _restorableCosmosDBAccountRestorableDatabaseAccountsRestClient; @@ -39,6 +41,8 @@ internal SubscriptionResourceExtensionClient(ArmClient client, ResourceIdentifie private DatabaseAccountsRestOperations CosmosDBAccountDatabaseAccountsRestClient => _cosmosDBAccountDatabaseAccountsRestClient ??= new DatabaseAccountsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(CosmosDBAccountResource.ResourceType)); private ClientDiagnostics CassandraClusterClientDiagnostics => _cassandraClusterClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.CosmosDB", CassandraClusterResource.ResourceType.Namespace, Diagnostics); private CassandraClustersRestOperations CassandraClusterRestClient => _cassandraClusterRestClient ??= new CassandraClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(CassandraClusterResource.ResourceType)); + private ClientDiagnostics MongoClusterClientDiagnostics => _mongoClusterClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.CosmosDB", MongoClusterResource.ResourceType.Namespace, Diagnostics); + private MongoClustersRestOperations MongoClusterRestClient => _mongoClusterRestClient ??= new MongoClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(MongoClusterResource.ResourceType)); private ClientDiagnostics RestorableCosmosDBAccountRestorableDatabaseAccountsClientDiagnostics => _restorableCosmosDBAccountRestorableDatabaseAccountsClientDiagnostics ??= new ClientDiagnostics("Azure.ResourceManager.CosmosDB", RestorableCosmosDBAccountResource.ResourceType.Namespace, Diagnostics); private RestorableDatabaseAccountsRestOperations RestorableCosmosDBAccountRestorableDatabaseAccountsRestClient => _restorableCosmosDBAccountRestorableDatabaseAccountsRestClient ??= new RestorableDatabaseAccountsRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, GetApiVersionOrNull(RestorableCosmosDBAccountResource.ResourceType)); @@ -139,6 +143,50 @@ public virtual Pageable GetCassandraClusters(Cancellat return PageableHelpers.CreatePageable(FirstPageRequest, null, e => new CassandraClusterResource(Client, CassandraClusterData.DeserializeCassandraClusterData(e)), CassandraClusterClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetCassandraClusters", "value", null, cancellationToken); } + /// + /// List all the mongo clusters in a given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/mongoClusters + /// + /// + /// Operation Id + /// MongoClusters_List + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetMongoClustersAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => MongoClusterRestClient.CreateListRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MongoClusterRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MongoClusterResource(Client, MongoClusterData.DeserializeMongoClusterData(e)), MongoClusterClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMongoClusters", "value", "nextLink", cancellationToken); + } + + /// + /// List all the mongo clusters in a given subscription. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/providers/Microsoft.DocumentDB/mongoClusters + /// + /// + /// Operation Id + /// MongoClusters_List + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetMongoClusters(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => MongoClusterRestClient.CreateListRequest(Id.SubscriptionId); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => MongoClusterRestClient.CreateListNextPageRequest(nextLink, Id.SubscriptionId); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MongoClusterResource(Client, MongoClusterData.DeserializeMongoClusterData(e)), MongoClusterClientDiagnostics, Pipeline, "SubscriptionResourceExtensionClient.GetMongoClusters", "value", "nextLink", cancellationToken); + } + /// /// Lists all the restorable Azure Cosmos DB database accounts available under the subscription. This call requires 'Microsoft.DocumentDB/locations/restorableDatabaseAccounts/read' permission. /// diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBFirewallRuleOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBFirewallRuleOperationSource.cs new file mode 100644 index 0000000000000..0e5dbc79f64cd --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/CosmosDBFirewallRuleOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.CosmosDB +{ + internal class CosmosDBFirewallRuleOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal CosmosDBFirewallRuleOperationSource(ArmClient client) + { + _client = client; + } + + CosmosDBFirewallRuleResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = CosmosDBFirewallRuleData.DeserializeCosmosDBFirewallRuleData(document.RootElement); + return new CosmosDBFirewallRuleResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = CosmosDBFirewallRuleData.DeserializeCosmosDBFirewallRuleData(document.RootElement); + return new CosmosDBFirewallRuleResource(_client, data); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoClusterOperationSource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoClusterOperationSource.cs new file mode 100644 index 0000000000000..41a2039c3e064 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/LongRunningOperation/MongoClusterOperationSource.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.ResourceManager; + +namespace Azure.ResourceManager.CosmosDB +{ + internal class MongoClusterOperationSource : IOperationSource + { + private readonly ArmClient _client; + + internal MongoClusterOperationSource(ArmClient client) + { + _client = client; + } + + MongoClusterResource IOperationSource.CreateResult(Response response, CancellationToken cancellationToken) + { + using var document = JsonDocument.Parse(response.ContentStream); + var data = MongoClusterData.DeserializeMongoClusterData(document.RootElement); + return new MongoClusterResource(_client, data); + } + + async ValueTask IOperationSource.CreateResultAsync(Response response, CancellationToken cancellationToken) + { + using var document = await JsonDocument.ParseAsync(response.ContentStream, default, cancellationToken).ConfigureAwait(false); + var data = MongoClusterData.DeserializeMongoClusterData(document.RootElement); + return new MongoClusterResource(_client, data); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AuthenticationMethodLdapProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AuthenticationMethodLdapProperties.Serialization.cs index 79b247aaedb44..cf95ef14d1492 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AuthenticationMethodLdapProperties.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AuthenticationMethodLdapProperties.Serialization.cs @@ -56,6 +56,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) } writer.WriteEndArray(); } + if (Optional.IsDefined(ConnectionTimeoutInMs)) + { + writer.WritePropertyName("connectionTimeoutInMs"u8); + writer.WriteNumberValue(ConnectionTimeoutInMs.Value); + } writer.WriteEndObject(); } @@ -72,6 +77,7 @@ internal static AuthenticationMethodLdapProperties DeserializeAuthenticationMeth Optional searchBaseDistinguishedName = default; Optional searchFilterTemplate = default; Optional> serverCertificates = default; + Optional connectionTimeoutInMs = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("serverHostname"u8)) @@ -122,8 +128,17 @@ internal static AuthenticationMethodLdapProperties DeserializeAuthenticationMeth serverCertificates = array; continue; } + if (property.NameEquals("connectionTimeoutInMs"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + connectionTimeoutInMs = property.Value.GetInt32(); + continue; + } } - return new AuthenticationMethodLdapProperties(serverHostname.Value, Optional.ToNullable(serverPort), serviceUserDistinguishedName.Value, serviceUserPassword.Value, searchBaseDistinguishedName.Value, searchFilterTemplate.Value, Optional.ToList(serverCertificates)); + return new AuthenticationMethodLdapProperties(serverHostname.Value, Optional.ToNullable(serverPort), serviceUserDistinguishedName.Value, serviceUserPassword.Value, searchBaseDistinguishedName.Value, searchFilterTemplate.Value, Optional.ToList(serverCertificates), Optional.ToNullable(connectionTimeoutInMs)); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AuthenticationMethodLdapProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AuthenticationMethodLdapProperties.cs index b47d86346b2ce..d30c58972d738 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AuthenticationMethodLdapProperties.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AuthenticationMethodLdapProperties.cs @@ -27,7 +27,8 @@ public AuthenticationMethodLdapProperties() /// Distinguished name of the object to start the recursive search of users from. /// Template to use for searching. Defaults to (cn=%s) where %s will be replaced by the username used to login. /// - internal AuthenticationMethodLdapProperties(string serverHostname, int? serverPort, string serviceUserDistinguishedName, string serviceUserPassword, string searchBaseDistinguishedName, string searchFilterTemplate, IList serverCertificates) + /// Timeout for connecting to the LDAP server in miliseconds. The default is 5000 ms. + internal AuthenticationMethodLdapProperties(string serverHostname, int? serverPort, string serviceUserDistinguishedName, string serviceUserPassword, string searchBaseDistinguishedName, string searchFilterTemplate, IList serverCertificates, int? connectionTimeoutInMs) { ServerHostname = serverHostname; ServerPort = serverPort; @@ -36,6 +37,7 @@ internal AuthenticationMethodLdapProperties(string serverHostname, int? serverPo SearchBaseDistinguishedName = searchBaseDistinguishedName; SearchFilterTemplate = searchFilterTemplate; ServerCertificates = serverCertificates; + ConnectionTimeoutInMs = connectionTimeoutInMs; } /// Hostname of the LDAP server. @@ -52,5 +54,7 @@ internal AuthenticationMethodLdapProperties(string serverHostname, int? serverPo public string SearchFilterTemplate { get; set; } /// Gets the server certificates. public IList ServerCertificates { get; } + /// Timeout for connecting to the LDAP server in miliseconds. The default is 5000 ms. + public int? ConnectionTimeoutInMs { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraAuthenticationMethod.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraAuthenticationMethod.cs index c5d9fe62afd14..0ef7a02cfa3d8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraAuthenticationMethod.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraAuthenticationMethod.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.CosmosDB.Models { - /// Which authentication method Cassandra should use to authenticate clients. 'None' turns off authentication, so should not be used except in emergencies. 'Cassandra' is the default password based authentication. The default is 'Cassandra'. 'Ldap' is in preview. + /// Which authentication method Cassandra should use to authenticate clients. 'None' turns off authentication, so should not be used except in emergencies. 'Cassandra' is the default password based authentication. The default is 'Cassandra'. public readonly partial struct CassandraAuthenticationMethod : IEquatable { private readonly string _value; diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.Serialization.cs index 55fe3772cc51c..4559539d64a1a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.Serialization.cs @@ -23,6 +23,7 @@ internal static CassandraClusterDataCenterNodeItem DeserializeCassandraClusterDa Optional address = default; Optional state = default; Optional status = default; + Optional cassandraProcessStatus = default; Optional load = default; Optional> tokens = default; Optional size = default; @@ -57,6 +58,11 @@ internal static CassandraClusterDataCenterNodeItem DeserializeCassandraClusterDa status = property.Value.GetString(); continue; } + if (property.NameEquals("cassandraProcessStatus"u8)) + { + cassandraProcessStatus = property.Value.GetString(); + continue; + } if (property.NameEquals("load"u8)) { load = property.Value.GetString(); @@ -168,7 +174,7 @@ internal static CassandraClusterDataCenterNodeItem DeserializeCassandraClusterDa continue; } } - return new CassandraClusterDataCenterNodeItem(address.Value, Optional.ToNullable(state), status.Value, load.Value, Optional.ToList(tokens), Optional.ToNullable(size), Optional.ToNullable(hostId), rack.Value, timestamp.Value, Optional.ToNullable(diskUsedKB), Optional.ToNullable(diskFreeKB), Optional.ToNullable(memoryUsedKB), Optional.ToNullable(memoryBuffersAndCachedKB), Optional.ToNullable(memoryFreeKB), Optional.ToNullable(memoryTotalKB), Optional.ToNullable(cpuUsage)); + return new CassandraClusterDataCenterNodeItem(address.Value, Optional.ToNullable(state), status.Value, cassandraProcessStatus.Value, load.Value, Optional.ToList(tokens), Optional.ToNullable(size), Optional.ToNullable(hostId), rack.Value, timestamp.Value, Optional.ToNullable(diskUsedKB), Optional.ToNullable(diskFreeKB), Optional.ToNullable(memoryUsedKB), Optional.ToNullable(memoryBuffersAndCachedKB), Optional.ToNullable(memoryFreeKB), Optional.ToNullable(memoryTotalKB), Optional.ToNullable(cpuUsage)); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.cs index b1429a8cdb468..a1ee7125f2ccc 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterDataCenterNodeItem.cs @@ -24,12 +24,13 @@ internal CassandraClusterDataCenterNodeItem() /// The node's IP address. /// The state of the node in Cassandra ring. /// + /// Cassandra service status on this node. /// The amount of file system data in the data directory (e.g., 47.66 kB), excluding all content in the snapshots subdirectories. Because all SSTable data files are included, any data that is not cleaned up (such as TTL-expired cells or tombstones) is counted. /// List of tokens this node covers. /// /// The network ID of the node. /// The rack this node is part of. - /// The timestamp at which that snapshot of these usage statistics were taken. + /// The timestamp when these statistics were captured. /// The amount of disk used, in kB, of the directory /var/lib/cassandra. /// The amount of disk free, in kB, of the directory /var/lib/cassandra. /// Used memory (calculated as total - free - buffers - cache), in kB. @@ -37,11 +38,12 @@ internal CassandraClusterDataCenterNodeItem() /// Unused memory (MemFree and SwapFree in /proc/meminfo), in kB. /// Total installed memory (MemTotal and SwapTotal in /proc/meminfo), in kB. /// A float representing the current system-wide CPU utilization as a percentage. - internal CassandraClusterDataCenterNodeItem(string address, CassandraNodeState? state, string status, string load, IReadOnlyList tokens, int? size, Guid? hostId, string rack, string timestamp, long? diskUsedKB, long? diskFreeKB, long? memoryUsedKB, long? memoryBuffersAndCachedKB, long? memoryFreeKB, long? memoryTotalKB, double? cpuUsage) + internal CassandraClusterDataCenterNodeItem(string address, CassandraNodeState? state, string status, string cassandraProcessStatus, string load, IReadOnlyList tokens, int? size, Guid? hostId, string rack, string timestamp, long? diskUsedKB, long? diskFreeKB, long? memoryUsedKB, long? memoryBuffersAndCachedKB, long? memoryFreeKB, long? memoryTotalKB, double? cpuUsage) { Address = address; State = state; Status = status; + CassandraProcessStatus = cassandraProcessStatus; Load = load; Tokens = tokens; Size = size; @@ -63,6 +65,8 @@ internal CassandraClusterDataCenterNodeItem(string address, CassandraNodeState? public CassandraNodeState? State { get; } /// Gets the status. public string Status { get; } + /// Cassandra service status on this node. + public string CassandraProcessStatus { get; } /// The amount of file system data in the data directory (e.g., 47.66 kB), excluding all content in the snapshots subdirectories. Because all SSTable data files are included, any data that is not cleaned up (such as TTL-expired cells or tombstones) is counted. public string Load { get; } /// List of tokens this node covers. @@ -73,7 +77,7 @@ internal CassandraClusterDataCenterNodeItem(string address, CassandraNodeState? public Guid? HostId { get; } /// The rack this node is part of. public string Rack { get; } - /// The timestamp at which that snapshot of these usage statistics were taken. + /// The timestamp when these statistics were captured. public string Timestamp { get; } /// The amount of disk used, in kB, of the directory /var/lib/cassandra. public long? DiskUsedKB { get; } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.Serialization.cs index 2debb76b5e205..e388325d8e83f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.Serialization.cs @@ -106,6 +106,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("cassandraAuditLoggingEnabled"u8); writer.WriteBooleanValue(IsCassandraAuditLoggingEnabled.Value); } + if (Optional.IsDefined(ProvisionError)) + { + writer.WritePropertyName("provisionError"u8); + writer.WriteObjectValue(ProvisionError); + } writer.WriteEndObject(); } @@ -132,6 +137,7 @@ internal static CassandraClusterProperties DeserializeCassandraClusterProperties Optional hoursBetweenBackups = default; Optional deallocated = default; Optional cassandraAuditLoggingEnabled = default; + Optional provisionError = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("provisioningState"u8)) @@ -296,8 +302,17 @@ internal static CassandraClusterProperties DeserializeCassandraClusterProperties cassandraAuditLoggingEnabled = property.Value.GetBoolean(); continue; } + if (property.NameEquals("provisionError"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisionError = CassandraError.DeserializeCassandraError(property.Value); + continue; + } } - return new CassandraClusterProperties(Optional.ToNullable(provisioningState), restoreFromBackupId.Value, delegatedManagementSubnetId.Value, cassandraVersion.Value, clusterNameOverride.Value, Optional.ToNullable(authenticationMethod), initialCassandraAdminPassword.Value, prometheusEndpoint.Value, Optional.ToNullable(repairEnabled), Optional.ToList(clientCertificates), Optional.ToList(externalGossipCertificates), Optional.ToList(gossipCertificates), Optional.ToList(externalSeedNodes), Optional.ToList(seedNodes), Optional.ToNullable(hoursBetweenBackups), Optional.ToNullable(deallocated), Optional.ToNullable(cassandraAuditLoggingEnabled)); + return new CassandraClusterProperties(Optional.ToNullable(provisioningState), restoreFromBackupId.Value, delegatedManagementSubnetId.Value, cassandraVersion.Value, clusterNameOverride.Value, Optional.ToNullable(authenticationMethod), initialCassandraAdminPassword.Value, prometheusEndpoint.Value, Optional.ToNullable(repairEnabled), Optional.ToList(clientCertificates), Optional.ToList(externalGossipCertificates), Optional.ToList(gossipCertificates), Optional.ToList(externalSeedNodes), Optional.ToList(seedNodes), Optional.ToNullable(hoursBetweenBackups), Optional.ToNullable(deallocated), Optional.ToNullable(cassandraAuditLoggingEnabled), provisionError.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.cs index 938983e52b8bf..eb9ad28e5a7c8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterProperties.cs @@ -29,7 +29,7 @@ public CassandraClusterProperties() /// Resource id of a subnet that this cluster's management service should have its network interface attached to. The subnet must be routable to all subnets that will be delegated to data centers. The resource id must be of the form '/subscriptions/<subscription id>/resourceGroups/<resource group>/providers/Microsoft.Network/virtualNetworks/<virtual network>/subnets/<subnet>'. /// Which version of Cassandra should this cluster converge to running (e.g., 3.11). When updated, the cluster may take some time to migrate to the new version. /// If you need to set the clusterName property in cassandra.yaml to something besides the resource name of the cluster, set the value to use on this property. - /// Which authentication method Cassandra should use to authenticate clients. 'None' turns off authentication, so should not be used except in emergencies. 'Cassandra' is the default password based authentication. The default is 'Cassandra'. 'Ldap' is in preview. + /// Which authentication method Cassandra should use to authenticate clients. 'None' turns off authentication, so should not be used except in emergencies. 'Cassandra' is the default password based authentication. The default is 'Cassandra'. /// Initial password for clients connecting as admin to the cluster. Should be changed after cluster creation. Returns null on GET. This field only applies when the authenticationMethod field is 'Cassandra'. /// Hostname or IP address where the Prometheus endpoint containing data about the managed Cassandra nodes can be reached. /// Should automatic repairs run on this cluster? If omitted, this is true, and should stay true unless you are running a hybrid cluster where you are already doing your own repairs. @@ -38,10 +38,11 @@ public CassandraClusterProperties() /// List of TLS certificates that unmanaged nodes must trust for gossip with managed nodes. All managed nodes will present TLS client certificates that are verifiable using one of the certificates provided in this property. /// List of IP addresses of seed nodes in unmanaged data centers. These will be added to the seed node lists of all managed nodes. /// List of IP addresses of seed nodes in the managed data centers. These should be added to the seed node lists of all unmanaged nodes. - /// Number of hours to wait between taking a backup of the cluster. To disable backups, set this property to 0. + /// (Deprecated) Number of hours to wait between taking a backup of the cluster. /// Whether the cluster and associated data centers has been deallocated. /// Whether Cassandra audit logging is enabled. - internal CassandraClusterProperties(CassandraProvisioningState? provisioningState, string restoreFromBackupId, ResourceIdentifier delegatedManagementSubnetId, string cassandraVersion, string clusterNameOverride, CassandraAuthenticationMethod? authenticationMethod, string initialCassandraAdminPassword, CassandraDataCenterSeedNode prometheusEndpoint, bool? isRepairEnabled, IList clientCertificates, IList externalGossipCertificates, IReadOnlyList gossipCertificates, IList externalSeedNodes, IReadOnlyList seedNodes, int? hoursBetweenBackups, bool? isDeallocated, bool? isCassandraAuditLoggingEnabled) + /// Error related to resource provisioning. + internal CassandraClusterProperties(CassandraProvisioningState? provisioningState, string restoreFromBackupId, ResourceIdentifier delegatedManagementSubnetId, string cassandraVersion, string clusterNameOverride, CassandraAuthenticationMethod? authenticationMethod, string initialCassandraAdminPassword, CassandraDataCenterSeedNode prometheusEndpoint, bool? isRepairEnabled, IList clientCertificates, IList externalGossipCertificates, IReadOnlyList gossipCertificates, IList externalSeedNodes, IReadOnlyList seedNodes, int? hoursBetweenBackups, bool? isDeallocated, bool? isCassandraAuditLoggingEnabled, CassandraError provisionError) { ProvisioningState = provisioningState; RestoreFromBackupId = restoreFromBackupId; @@ -60,6 +61,7 @@ internal CassandraClusterProperties(CassandraProvisioningState? provisioningStat HoursBetweenBackups = hoursBetweenBackups; IsDeallocated = isDeallocated; IsCassandraAuditLoggingEnabled = isCassandraAuditLoggingEnabled; + ProvisionError = provisionError; } /// The status of the resource at the time the operation was called. @@ -72,7 +74,7 @@ internal CassandraClusterProperties(CassandraProvisioningState? provisioningStat public string CassandraVersion { get; set; } /// If you need to set the clusterName property in cassandra.yaml to something besides the resource name of the cluster, set the value to use on this property. public string ClusterNameOverride { get; set; } - /// Which authentication method Cassandra should use to authenticate clients. 'None' turns off authentication, so should not be used except in emergencies. 'Cassandra' is the default password based authentication. The default is 'Cassandra'. 'Ldap' is in preview. + /// Which authentication method Cassandra should use to authenticate clients. 'None' turns off authentication, so should not be used except in emergencies. 'Cassandra' is the default password based authentication. The default is 'Cassandra'. public CassandraAuthenticationMethod? AuthenticationMethod { get; set; } /// Initial password for clients connecting as admin to the cluster. Should be changed after cluster creation. Returns null on GET. This field only applies when the authenticationMethod field is 'Cassandra'. public string InitialCassandraAdminPassword { get; set; } @@ -102,11 +104,13 @@ public string PrometheusEndpointIPAddress public IList ExternalSeedNodes { get; } /// List of IP addresses of seed nodes in the managed data centers. These should be added to the seed node lists of all unmanaged nodes. public IReadOnlyList SeedNodes { get; } - /// Number of hours to wait between taking a backup of the cluster. To disable backups, set this property to 0. + /// (Deprecated) Number of hours to wait between taking a backup of the cluster. public int? HoursBetweenBackups { get; set; } /// Whether the cluster and associated data centers has been deallocated. public bool? IsDeallocated { get; set; } /// Whether Cassandra audit logging is enabled. public bool? IsCassandraAuditLoggingEnabled { get; set; } + /// Error related to resource provisioning. + public CassandraError ProvisionError { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterPublicStatus.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterPublicStatus.Serialization.cs index 0986a87042f9c..6d53ecada5d86 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterPublicStatus.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterPublicStatus.Serialization.cs @@ -23,6 +23,7 @@ internal static CassandraClusterPublicStatus DeserializeCassandraClusterPublicSt Optional eTag = default; Optional reaperStatus = default; Optional> connectionErrors = default; + Optional> errors = default; Optional> dataCenters = default; foreach (var property in element.EnumerateObject()) { @@ -58,6 +59,20 @@ internal static CassandraClusterPublicStatus DeserializeCassandraClusterPublicSt connectionErrors = array; continue; } + if (property.NameEquals("errors"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CassandraError.DeserializeCassandraError(item)); + } + errors = array; + continue; + } if (property.NameEquals("dataCenters"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -73,7 +88,7 @@ internal static CassandraClusterPublicStatus DeserializeCassandraClusterPublicSt continue; } } - return new CassandraClusterPublicStatus(Optional.ToNullable(eTag), reaperStatus.Value, Optional.ToList(connectionErrors), Optional.ToList(dataCenters)); + return new CassandraClusterPublicStatus(Optional.ToNullable(eTag), reaperStatus.Value, Optional.ToList(connectionErrors), Optional.ToList(errors), Optional.ToList(dataCenters)); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterPublicStatus.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterPublicStatus.cs index 992ce5ac5db12..f70e1b562dc3a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterPublicStatus.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterPublicStatus.cs @@ -18,6 +18,7 @@ public partial class CassandraClusterPublicStatus internal CassandraClusterPublicStatus() { ConnectionErrors = new ChangeTrackingList(); + Errors = new ChangeTrackingList(); DataCenters = new ChangeTrackingList(); } @@ -25,12 +26,14 @@ internal CassandraClusterPublicStatus() /// /// /// List relevant information about any connection errors to the Datacenters. + /// List relevant information about any errors about cluster, data center and connection error. /// List of the status of each datacenter in this cluster. - internal CassandraClusterPublicStatus(ETag? etag, CassandraReaperStatus reaperStatus, IReadOnlyList connectionErrors, IReadOnlyList dataCenters) + internal CassandraClusterPublicStatus(ETag? etag, CassandraReaperStatus reaperStatus, IReadOnlyList connectionErrors, IReadOnlyList errors, IReadOnlyList dataCenters) { ETag = etag; ReaperStatus = reaperStatus; ConnectionErrors = connectionErrors; + Errors = errors; DataCenters = dataCenters; } @@ -40,6 +43,8 @@ internal CassandraClusterPublicStatus(ETag? etag, CassandraReaperStatus reaperSt public CassandraReaperStatus ReaperStatus { get; } /// List relevant information about any connection errors to the Datacenters. public IReadOnlyList ConnectionErrors { get; } + /// List relevant information about any errors about cluster, data center and connection error. + public IReadOnlyList Errors { get; } /// List of the status of each datacenter in this cluster. public IReadOnlyList DataCenters { get; } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraDataCenterProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraDataCenterProperties.Serialization.cs index a41754c8acc49..084d9d927dacd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraDataCenterProperties.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraDataCenterProperties.Serialization.cs @@ -77,6 +77,16 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("authenticationMethodLdapProperties"u8); writer.WriteObjectValue(AuthenticationMethodLdapProperties); } + if (Optional.IsDefined(Deallocated)) + { + writer.WritePropertyName("deallocated"u8); + writer.WriteBooleanValue(Deallocated.Value); + } + if (Optional.IsDefined(ProvisionError)) + { + writer.WritePropertyName("provisionError"u8); + writer.WriteObjectValue(ProvisionError); + } writer.WriteEndObject(); } @@ -99,6 +109,8 @@ internal static CassandraDataCenterProperties DeserializeCassandraDataCenterProp Optional diskCapacity = default; Optional availabilityZone = default; Optional authenticationMethodLdapProperties = default; + Optional deallocated = default; + Optional provisionError = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("provisioningState"u8)) @@ -211,8 +223,26 @@ internal static CassandraDataCenterProperties DeserializeCassandraDataCenterProp authenticationMethodLdapProperties = AuthenticationMethodLdapProperties.DeserializeAuthenticationMethodLdapProperties(property.Value); continue; } + if (property.NameEquals("deallocated"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + deallocated = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("provisionError"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisionError = CassandraError.DeserializeCassandraError(property.Value); + continue; + } } - return new CassandraDataCenterProperties(Optional.ToNullable(provisioningState), Optional.ToNullable(dataCenterLocation), delegatedSubnetId.Value, Optional.ToNullable(nodeCount), Optional.ToList(seedNodes), base64EncodedCassandraYamlFragment.Value, managedDiskCustomerKeyUri.Value, backupStorageCustomerKeyUri.Value, sku.Value, diskSku.Value, Optional.ToNullable(diskCapacity), Optional.ToNullable(availabilityZone), authenticationMethodLdapProperties.Value); + return new CassandraDataCenterProperties(Optional.ToNullable(provisioningState), Optional.ToNullable(dataCenterLocation), delegatedSubnetId.Value, Optional.ToNullable(nodeCount), Optional.ToList(seedNodes), base64EncodedCassandraYamlFragment.Value, managedDiskCustomerKeyUri.Value, backupStorageCustomerKeyUri.Value, sku.Value, diskSku.Value, Optional.ToNullable(diskCapacity), Optional.ToNullable(availabilityZone), authenticationMethodLdapProperties.Value, Optional.ToNullable(deallocated), provisionError.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraDataCenterProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraDataCenterProperties.cs index b72c3a909d86e..1b8186440b810 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraDataCenterProperties.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraDataCenterProperties.cs @@ -31,10 +31,12 @@ public CassandraDataCenterProperties() /// Indicates the Key Uri of the customer key to use for encryption of the backup storage account. /// Virtual Machine SKU used for data centers. Default value is Standard_DS14_v2. /// Disk SKU used for data centers. Default value is P30. - /// Number of disk used for data centers. Default value is 4. - /// If the data center has Availability Zone feature, apply it to the Virtual Machine ScaleSet that host the cassandra data center virtual machines. + /// Number of disks attached to each node. Default is 4. + /// If the data center has Availability Zone support, apply it to the Virtual Machine ScaleSet that host the cassandra data center virtual machines. /// Ldap authentication method properties. This feature is in preview. - internal CassandraDataCenterProperties(CassandraProvisioningState? provisioningState, AzureLocation? dataCenterLocation, ResourceIdentifier delegatedSubnetId, int? nodeCount, IReadOnlyList seedNodes, string base64EncodedCassandraYamlFragment, Uri managedDiskCustomerKeyUri, Uri backupStorageCustomerKeyUri, string sku, string diskSku, int? diskCapacity, bool? doesSupportAvailabilityZone, AuthenticationMethodLdapProperties authenticationMethodLdapProperties) + /// Whether the data center has been deallocated. + /// Error related to resource provisioning. + internal CassandraDataCenterProperties(CassandraProvisioningState? provisioningState, AzureLocation? dataCenterLocation, ResourceIdentifier delegatedSubnetId, int? nodeCount, IReadOnlyList seedNodes, string base64EncodedCassandraYamlFragment, Uri managedDiskCustomerKeyUri, Uri backupStorageCustomerKeyUri, string sku, string diskSku, int? diskCapacity, bool? doesSupportAvailabilityZone, AuthenticationMethodLdapProperties authenticationMethodLdapProperties, bool? deallocated, CassandraError provisionError) { ProvisioningState = provisioningState; DataCenterLocation = dataCenterLocation; @@ -49,6 +51,8 @@ internal CassandraDataCenterProperties(CassandraProvisioningState? provisioningS DiskCapacity = diskCapacity; DoesSupportAvailabilityZone = doesSupportAvailabilityZone; AuthenticationMethodLdapProperties = authenticationMethodLdapProperties; + Deallocated = deallocated; + ProvisionError = provisionError; } /// The status of the resource at the time the operation was called. @@ -71,11 +75,15 @@ internal CassandraDataCenterProperties(CassandraProvisioningState? provisioningS public string Sku { get; set; } /// Disk SKU used for data centers. Default value is P30. public string DiskSku { get; set; } - /// Number of disk used for data centers. Default value is 4. + /// Number of disks attached to each node. Default is 4. public int? DiskCapacity { get; set; } - /// If the data center has Availability Zone feature, apply it to the Virtual Machine ScaleSet that host the cassandra data center virtual machines. + /// If the data center has Availability Zone support, apply it to the Virtual Machine ScaleSet that host the cassandra data center virtual machines. public bool? DoesSupportAvailabilityZone { get; set; } /// Ldap authentication method properties. This feature is in preview. public AuthenticationMethodLdapProperties AuthenticationMethodLdapProperties { get; set; } + /// Whether the data center has been deallocated. + public bool? Deallocated { get; set; } + /// Error related to resource provisioning. + public CassandraError ProvisionError { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraError.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraError.Serialization.cs new file mode 100644 index 0000000000000..b710cb81b61b7 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraError.Serialization.cs @@ -0,0 +1,77 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class CassandraError : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Code)) + { + writer.WritePropertyName("code"u8); + writer.WriteStringValue(Code); + } + if (Optional.IsDefined(Message)) + { + writer.WritePropertyName("message"u8); + writer.WriteStringValue(Message); + } + if (Optional.IsDefined(Target)) + { + writer.WritePropertyName("target"u8); + writer.WriteStringValue(Target); + } + if (Optional.IsDefined(AdditionalErrorInfo)) + { + writer.WritePropertyName("additionalErrorInfo"u8); + writer.WriteStringValue(AdditionalErrorInfo); + } + writer.WriteEndObject(); + } + + internal static CassandraError DeserializeCassandraError(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional code = default; + Optional message = default; + Optional target = default; + Optional additionalErrorInfo = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("code"u8)) + { + code = property.Value.GetString(); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + if (property.NameEquals("target"u8)) + { + target = property.Value.GetString(); + continue; + } + if (property.NameEquals("additionalErrorInfo"u8)) + { + additionalErrorInfo = property.Value.GetString(); + continue; + } + } + return new CassandraError(code.Value, message.Value, target.Value, additionalErrorInfo.Value); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraError.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraError.cs new file mode 100644 index 0000000000000..cd955ff7dccc9 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraError.cs @@ -0,0 +1,40 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The CassandraError. + public partial class CassandraError + { + /// Initializes a new instance of CassandraError. + public CassandraError() + { + } + + /// Initializes a new instance of CassandraError. + /// The code of error that occurred. + /// The message of the error. + /// The target resource of the error. + /// Additional information about the error. + internal CassandraError(string code, string message, string target, string additionalErrorInfo) + { + Code = code; + Message = message; + Target = target; + AdditionalErrorInfo = additionalErrorInfo; + } + + /// The code of error that occurred. + public string Code { get; set; } + /// The message of the error. + public string Message { get; set; } + /// The target resource of the error. + public string Target { get; set; } + /// Additional information about the error. + public string AdditionalErrorInfo { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CheckCosmosDBNameAvailabilityContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CheckCosmosDBNameAvailabilityContent.Serialization.cs new file mode 100644 index 0000000000000..bc32d76703d10 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CheckCosmosDBNameAvailabilityContent.Serialization.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class CheckCosmosDBNameAvailabilityContent : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Name)) + { + writer.WritePropertyName("name"u8); + writer.WriteStringValue(Name); + } + if (Optional.IsDefined(ResourceType)) + { + writer.WritePropertyName("type"u8); + writer.WriteStringValue(ResourceType); + } + writer.WriteEndObject(); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CheckCosmosDBNameAvailabilityContent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CheckCosmosDBNameAvailabilityContent.cs new file mode 100644 index 0000000000000..0aef1e039e099 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CheckCosmosDBNameAvailabilityContent.cs @@ -0,0 +1,23 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The check availability request body. + public partial class CheckCosmosDBNameAvailabilityContent + { + /// Initializes a new instance of CheckCosmosDBNameAvailabilityContent. + public CheckCosmosDBNameAvailabilityContent() + { + } + + /// The name of the resource for which availability needs to be checked. + public string Name { get; set; } + /// The resource type. + public string ResourceType { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CheckCosmosDBNameAvailabilityResponse.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CheckCosmosDBNameAvailabilityResponse.Serialization.cs new file mode 100644 index 0000000000000..d2568f41395c4 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CheckCosmosDBNameAvailabilityResponse.Serialization.cs @@ -0,0 +1,53 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class CheckCosmosDBNameAvailabilityResponse + { + internal static CheckCosmosDBNameAvailabilityResponse DeserializeCheckCosmosDBNameAvailabilityResponse(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional nameAvailable = default; + Optional reason = default; + Optional message = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("nameAvailable"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nameAvailable = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("reason"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + reason = new CosmosDBNameUnavailableReason(property.Value.GetString()); + continue; + } + if (property.NameEquals("message"u8)) + { + message = property.Value.GetString(); + continue; + } + } + return new CheckCosmosDBNameAvailabilityResponse(Optional.ToNullable(nameAvailable), Optional.ToNullable(reason), message.Value); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CheckCosmosDBNameAvailabilityResponse.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CheckCosmosDBNameAvailabilityResponse.cs new file mode 100644 index 0000000000000..56fe22c174782 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CheckCosmosDBNameAvailabilityResponse.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The check availability result. + public partial class CheckCosmosDBNameAvailabilityResponse + { + /// Initializes a new instance of CheckCosmosDBNameAvailabilityResponse. + internal CheckCosmosDBNameAvailabilityResponse() + { + } + + /// Initializes a new instance of CheckCosmosDBNameAvailabilityResponse. + /// Indicates if the resource name is available. + /// The reason why the given name is not available. + /// Detailed reason why the given name is available. + internal CheckCosmosDBNameAvailabilityResponse(bool? nameAvailable, CosmosDBNameUnavailableReason? reason, string message) + { + NameAvailable = nameAvailable; + Reason = reason; + Message = message; + } + + /// Indicates if the resource name is available. + public bool? NameAvailable { get; } + /// The reason why the given name is not available. + public CosmosDBNameUnavailableReason? Reason { get; } + /// Detailed reason why the given name is available. + public string Message { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountConnectionString.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountConnectionString.Serialization.cs index 04ac7ff5f0c91..0bf12446be275 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountConnectionString.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountConnectionString.Serialization.cs @@ -20,6 +20,8 @@ internal static CosmosDBAccountConnectionString DeserializeCosmosDBAccountConnec } Optional connectionString = default; Optional description = default; + Optional keyKind = default; + Optional type = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("connectionString"u8)) @@ -32,8 +34,26 @@ internal static CosmosDBAccountConnectionString DeserializeCosmosDBAccountConnec description = property.Value.GetString(); continue; } + if (property.NameEquals("keyKind"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + keyKind = new CosmosDBKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("type"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + type = new CosmosDBType(property.Value.GetString()); + continue; + } } - return new CosmosDBAccountConnectionString(connectionString.Value, description.Value); + return new CosmosDBAccountConnectionString(connectionString.Value, description.Value, Optional.ToNullable(keyKind), Optional.ToNullable(type)); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountConnectionString.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountConnectionString.cs index 327c6b648dc91..8b2136134f3f8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountConnectionString.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountConnectionString.cs @@ -18,15 +18,23 @@ internal CosmosDBAccountConnectionString() /// Initializes a new instance of CosmosDBAccountConnectionString. /// Value of the connection string. /// Description of the connection string. - internal CosmosDBAccountConnectionString(string connectionString, string description) + /// Kind of the connection string key. + /// Type of the connection string. + internal CosmosDBAccountConnectionString(string connectionString, string description, CosmosDBKind? keyKind, CosmosDBType? keyType) { ConnectionString = connectionString; Description = description; + KeyKind = keyKind; + KeyType = keyType; } /// Value of the connection string. public string ConnectionString { get; } /// Description of the connection string. public string Description { get; } + /// Kind of the connection string key. + public CosmosDBKind? KeyKind { get; } + /// Type of the connection string. + public CosmosDBType? KeyType { get; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateMode.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateMode.cs index 34650997e7675..a71314a6225cb 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateMode.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateMode.cs @@ -24,11 +24,14 @@ public CosmosDBAccountCreateMode(string value) private const string DefaultValue = "Default"; private const string RestoreValue = "Restore"; + private const string PointInTimeRestoreValue = "PointInTimeRestore"; /// Default. public static CosmosDBAccountCreateMode Default { get; } = new CosmosDBAccountCreateMode(DefaultValue); /// Restore. public static CosmosDBAccountCreateMode Restore { get; } = new CosmosDBAccountCreateMode(RestoreValue); + /// PointInTimeRestore. + public static CosmosDBAccountCreateMode PointInTimeRestore { get; } = new CosmosDBAccountCreateMode(PointInTimeRestoreValue); /// Determines if two values are the same. public static bool operator ==(CosmosDBAccountCreateMode left, CosmosDBAccountCreateMode right) => left.Equals(right); /// Determines if two values are not the same. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBConnectionString.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBConnectionString.Serialization.cs new file mode 100644 index 0000000000000..714ac877206b9 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBConnectionString.Serialization.cs @@ -0,0 +1,39 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class CosmosDBConnectionString + { + internal static CosmosDBConnectionString DeserializeCosmosDBConnectionString(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional connectionString = default; + Optional description = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("connectionString"u8)) + { + connectionString = property.Value.GetString(); + continue; + } + if (property.NameEquals("description"u8)) + { + description = property.Value.GetString(); + continue; + } + } + return new CosmosDBConnectionString(connectionString.Value, description.Value); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBConnectionString.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBConnectionString.cs new file mode 100644 index 0000000000000..66e63581d2264 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBConnectionString.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Connection string for the mongo cluster. + public partial class CosmosDBConnectionString + { + /// Initializes a new instance of CosmosDBConnectionString. + internal CosmosDBConnectionString() + { + } + + /// Initializes a new instance of CosmosDBConnectionString. + /// Value of the connection string. + /// Description of the connection string. + internal CosmosDBConnectionString(string connectionString, string description) + { + ConnectionString = connectionString; + Description = description; + } + + /// Value of the connection string. + public string ConnectionString { get; } + /// Description of the connection string. + public string Description { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBFirewallRuleData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBFirewallRuleData.Serialization.cs new file mode 100644 index 0000000000000..86ddfbd60f836 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBFirewallRuleData.Serialization.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.CosmosDB.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + public partial class CosmosDBFirewallRuleData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + writer.WritePropertyName("startIpAddress"u8); + writer.WriteStringValue(StartIPAddress); + writer.WritePropertyName("endIpAddress"u8); + writer.WriteStringValue(EndIPAddress); + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static CosmosDBFirewallRuleData DeserializeCosmosDBFirewallRuleData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + Optional provisioningState = default; + string startIPAddress = default; + string endIPAddress = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new CosmosDBProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("startIpAddress"u8)) + { + startIPAddress = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("endIpAddress"u8)) + { + endIPAddress = property0.Value.GetString(); + continue; + } + } + continue; + } + } + return new CosmosDBFirewallRuleData(id, name, type, systemData.Value, Optional.ToNullable(provisioningState), startIPAddress, endIPAddress); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBKind.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBKind.cs new file mode 100644 index 0000000000000..b135f2cc3bebe --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBKind.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Kind of the connection string key. + public readonly partial struct CosmosDBKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CosmosDBKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string PrimaryValue = "Primary"; + private const string SecondaryValue = "Secondary"; + private const string PrimaryReadonlyValue = "PrimaryReadonly"; + private const string SecondaryReadonlyValue = "SecondaryReadonly"; + + /// Primary. + public static CosmosDBKind Primary { get; } = new CosmosDBKind(PrimaryValue); + /// Secondary. + public static CosmosDBKind Secondary { get; } = new CosmosDBKind(SecondaryValue); + /// PrimaryReadonly. + public static CosmosDBKind PrimaryReadonly { get; } = new CosmosDBKind(PrimaryReadonlyValue); + /// SecondaryReadonly. + public static CosmosDBKind SecondaryReadonly { get; } = new CosmosDBKind(SecondaryReadonlyValue); + /// Determines if two values are the same. + public static bool operator ==(CosmosDBKind left, CosmosDBKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CosmosDBKind left, CosmosDBKind right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator CosmosDBKind(string value) => new CosmosDBKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CosmosDBKind other && Equals(other); + /// + public bool Equals(CosmosDBKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBLocationProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBLocationProperties.Serialization.cs index 0f399c257d95b..9c4ab9daa00d1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBLocationProperties.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBLocationProperties.Serialization.cs @@ -25,17 +25,14 @@ internal static CosmosDBLocationProperties DeserializeCosmosDBLocationProperties { return null; } - Optional status = default; Optional supportsAvailabilityZone = default; Optional isResidencyRestricted = default; Optional> backupStorageRedundancies = default; + Optional isSubscriptionRegionAccessAllowedForRegular = default; + Optional isSubscriptionRegionAccessAllowedForAz = default; + Optional status = default; foreach (var property in element.EnumerateObject()) { - if (property.NameEquals("status"u8)) - { - status = property.Value.GetString(); - continue; - } if (property.NameEquals("supportsAvailabilityZone"u8)) { if (property.Value.ValueKind == JsonValueKind.Null) @@ -68,8 +65,35 @@ internal static CosmosDBLocationProperties DeserializeCosmosDBLocationProperties backupStorageRedundancies = array; continue; } + if (property.NameEquals("isSubscriptionRegionAccessAllowedForRegular"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSubscriptionRegionAccessAllowedForRegular = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("isSubscriptionRegionAccessAllowedForAz"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + isSubscriptionRegionAccessAllowedForAz = property.Value.GetBoolean(); + continue; + } + if (property.NameEquals("status"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + status = new CosmosDBStatus(property.Value.GetString()); + continue; + } } - return new CosmosDBLocationProperties(status.Value, Optional.ToNullable(supportsAvailabilityZone), Optional.ToNullable(isResidencyRestricted), Optional.ToList(backupStorageRedundancies)); + return new CosmosDBLocationProperties(Optional.ToNullable(supportsAvailabilityZone), Optional.ToNullable(isResidencyRestricted), Optional.ToList(backupStorageRedundancies), Optional.ToNullable(isSubscriptionRegionAccessAllowedForRegular), Optional.ToNullable(isSubscriptionRegionAccessAllowedForAz), Optional.ToNullable(status)); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBLocationProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBLocationProperties.cs index 942ba890601f8..7620d40f55eeb 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBLocationProperties.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBLocationProperties.cs @@ -20,25 +20,33 @@ public CosmosDBLocationProperties() } /// Initializes a new instance of CosmosDBLocationProperties. - /// The current status of location in Azure. /// Flag indicating whether the location supports availability zones or not. /// Flag indicating whether the location is residency sensitive. /// The properties of available backup storage redundancies. - internal CosmosDBLocationProperties(string status, bool? doesSupportAvailabilityZone, bool? isResidencyRestricted, IReadOnlyList backupStorageRedundancies) + /// Flag indicating whether the subscription have access in region for Non-Availability Zones. + /// Flag indicating whether the subscription have access in region for Availability Zones(Az). + /// Enum to indicate current buildout status of the region. + internal CosmosDBLocationProperties(bool? doesSupportAvailabilityZone, bool? isResidencyRestricted, IReadOnlyList backupStorageRedundancies, bool? isSubscriptionRegionAccessAllowedForRegular, bool? isSubscriptionRegionAccessAllowedForAz, CosmosDBStatus? status) { - Status = status; DoesSupportAvailabilityZone = doesSupportAvailabilityZone; IsResidencyRestricted = isResidencyRestricted; BackupStorageRedundancies = backupStorageRedundancies; + IsSubscriptionRegionAccessAllowedForRegular = isSubscriptionRegionAccessAllowedForRegular; + IsSubscriptionRegionAccessAllowedForAz = isSubscriptionRegionAccessAllowedForAz; + Status = status; } - /// The current status of location in Azure. - public string Status { get; } /// Flag indicating whether the location supports availability zones or not. public bool? DoesSupportAvailabilityZone { get; } /// Flag indicating whether the location is residency sensitive. public bool? IsResidencyRestricted { get; } /// The properties of available backup storage redundancies. public IReadOnlyList BackupStorageRedundancies { get; } + /// Flag indicating whether the subscription have access in region for Non-Availability Zones. + public bool? IsSubscriptionRegionAccessAllowedForRegular { get; } + /// Flag indicating whether the subscription have access in region for Availability Zones(Az). + public bool? IsSubscriptionRegionAccessAllowedForAz { get; } + /// Enum to indicate current buildout status of the region. + public CosmosDBStatus? Status { get; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBNameUnavailableReason.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBNameUnavailableReason.cs new file mode 100644 index 0000000000000..c3f7e62f00cd7 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBNameUnavailableReason.cs @@ -0,0 +1,51 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The reason why the given name is not available. + public readonly partial struct CosmosDBNameUnavailableReason : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CosmosDBNameUnavailableReason(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string InvalidValue = "Invalid"; + private const string AlreadyExistsValue = "AlreadyExists"; + + /// Invalid. + public static CosmosDBNameUnavailableReason Invalid { get; } = new CosmosDBNameUnavailableReason(InvalidValue); + /// AlreadyExists. + public static CosmosDBNameUnavailableReason AlreadyExists { get; } = new CosmosDBNameUnavailableReason(AlreadyExistsValue); + /// Determines if two values are the same. + public static bool operator ==(CosmosDBNameUnavailableReason left, CosmosDBNameUnavailableReason right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CosmosDBNameUnavailableReason left, CosmosDBNameUnavailableReason right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator CosmosDBNameUnavailableReason(string value) => new CosmosDBNameUnavailableReason(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CosmosDBNameUnavailableReason other && Equals(other); + /// + public bool Equals(CosmosDBNameUnavailableReason other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBProvisioningState.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBProvisioningState.cs new file mode 100644 index 0000000000000..7f222cc7e07be --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBProvisioningState.cs @@ -0,0 +1,63 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The provisioning state of the resource. + public readonly partial struct CosmosDBProvisioningState : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CosmosDBProvisioningState(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SucceededValue = "Succeeded"; + private const string FailedValue = "Failed"; + private const string CanceledValue = "Canceled"; + private const string InProgressValue = "InProgress"; + private const string UpdatingValue = "Updating"; + private const string DroppingValue = "Dropping"; + + /// Succeeded. + public static CosmosDBProvisioningState Succeeded { get; } = new CosmosDBProvisioningState(SucceededValue); + /// Failed. + public static CosmosDBProvisioningState Failed { get; } = new CosmosDBProvisioningState(FailedValue); + /// Canceled. + public static CosmosDBProvisioningState Canceled { get; } = new CosmosDBProvisioningState(CanceledValue); + /// InProgress. + public static CosmosDBProvisioningState InProgress { get; } = new CosmosDBProvisioningState(InProgressValue); + /// Updating. + public static CosmosDBProvisioningState Updating { get; } = new CosmosDBProvisioningState(UpdatingValue); + /// Dropping. + public static CosmosDBProvisioningState Dropping { get; } = new CosmosDBProvisioningState(DroppingValue); + /// Determines if two values are the same. + public static bool operator ==(CosmosDBProvisioningState left, CosmosDBProvisioningState right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CosmosDBProvisioningState left, CosmosDBProvisioningState right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator CosmosDBProvisioningState(string value) => new CosmosDBProvisioningState(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CosmosDBProvisioningState other && Equals(other); + /// + public bool Equals(CosmosDBProvisioningState other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.Serialization.cs index 84f83a7d55a75..faabf08d6e9e7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.Serialization.cs @@ -62,6 +62,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("createMode"u8); writer.WriteStringValue(CreateMode.Value.ToString()); } + if (Optional.IsDefined(MaterializedViewDefinition)) + { + writer.WritePropertyName("materializedViewDefinition"u8); + writer.WriteObjectValue(MaterializedViewDefinition); + } writer.WriteEndObject(); } @@ -81,6 +86,7 @@ internal static CosmosDBSqlContainerResourceInfo DeserializeCosmosDBSqlContainer Optional analyticalStorageTtl = default; Optional restoreParameters = default; Optional createMode = default; + Optional materializedViewDefinition = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("id"u8)) @@ -169,8 +175,17 @@ internal static CosmosDBSqlContainerResourceInfo DeserializeCosmosDBSqlContainer createMode = new CosmosDBAccountCreateMode(property.Value.GetString()); continue; } + if (property.NameEquals("materializedViewDefinition"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + materializedViewDefinition = MaterializedViewDefinition.DeserializeMaterializedViewDefinition(property.Value); + continue; + } } - return new CosmosDBSqlContainerResourceInfo(id, indexingPolicy.Value, partitionKey.Value, Optional.ToNullable(defaultTtl), uniqueKeyPolicy.Value, conflictResolutionPolicy.Value, clientEncryptionPolicy.Value, Optional.ToNullable(analyticalStorageTtl), restoreParameters.Value, Optional.ToNullable(createMode)); + return new CosmosDBSqlContainerResourceInfo(id, indexingPolicy.Value, partitionKey.Value, Optional.ToNullable(defaultTtl), uniqueKeyPolicy.Value, conflictResolutionPolicy.Value, clientEncryptionPolicy.Value, Optional.ToNullable(analyticalStorageTtl), restoreParameters.Value, Optional.ToNullable(createMode), materializedViewDefinition.Value); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.cs index c042ca4245dae..f024dbec8af6e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerResourceInfo.cs @@ -35,7 +35,8 @@ public CosmosDBSqlContainerResourceInfo(string containerName) /// Analytical TTL. /// Parameters to indicate the information about the restore. /// Enum to indicate the mode of resource creation. - internal CosmosDBSqlContainerResourceInfo(string containerName, CosmosDBIndexingPolicy indexingPolicy, CosmosDBContainerPartitionKey partitionKey, int? defaultTtl, CosmosDBUniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, CosmosDBClientEncryptionPolicy clientEncryptionPolicy, long? analyticalStorageTtl, ResourceRestoreParameters restoreParameters, CosmosDBAccountCreateMode? createMode) + /// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. + internal CosmosDBSqlContainerResourceInfo(string containerName, CosmosDBIndexingPolicy indexingPolicy, CosmosDBContainerPartitionKey partitionKey, int? defaultTtl, CosmosDBUniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, CosmosDBClientEncryptionPolicy clientEncryptionPolicy, long? analyticalStorageTtl, ResourceRestoreParameters restoreParameters, CosmosDBAccountCreateMode? createMode, MaterializedViewDefinition materializedViewDefinition) { ContainerName = containerName; IndexingPolicy = indexingPolicy; @@ -47,6 +48,7 @@ internal CosmosDBSqlContainerResourceInfo(string containerName, CosmosDBIndexing AnalyticalStorageTtl = analyticalStorageTtl; RestoreParameters = restoreParameters; CreateMode = createMode; + MaterializedViewDefinition = materializedViewDefinition; } /// Name of the Cosmos DB SQL container. @@ -80,5 +82,7 @@ public IList UniqueKeys public ResourceRestoreParameters RestoreParameters { get; set; } /// Enum to indicate the mode of resource creation. public CosmosDBAccountCreateMode? CreateMode { get; set; } + /// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. + public MaterializedViewDefinition MaterializedViewDefinition { get; set; } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBStatus.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBStatus.cs new file mode 100644 index 0000000000000..a46b41f6b9280 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBStatus.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Enum to indicate current buildout status of the region. + public readonly partial struct CosmosDBStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CosmosDBStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string UninitializedValue = "Uninitialized"; + private const string InitializingValue = "Initializing"; + private const string InternallyReadyValue = "InternallyReady"; + private const string OnlineValue = "Online"; + private const string DeletingValue = "Deleting"; + + /// Uninitialized. + public static CosmosDBStatus Uninitialized { get; } = new CosmosDBStatus(UninitializedValue); + /// Initializing. + public static CosmosDBStatus Initializing { get; } = new CosmosDBStatus(InitializingValue); + /// InternallyReady. + public static CosmosDBStatus InternallyReady { get; } = new CosmosDBStatus(InternallyReadyValue); + /// Online. + public static CosmosDBStatus Online { get; } = new CosmosDBStatus(OnlineValue); + /// Deleting. + public static CosmosDBStatus Deleting { get; } = new CosmosDBStatus(DeletingValue); + /// Determines if two values are the same. + public static bool operator ==(CosmosDBStatus left, CosmosDBStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CosmosDBStatus left, CosmosDBStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator CosmosDBStatus(string value) => new CosmosDBStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CosmosDBStatus other && Equals(other); + /// + public bool Equals(CosmosDBStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBType.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBType.cs new file mode 100644 index 0000000000000..373e5b95128d9 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBType.cs @@ -0,0 +1,72 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Type of the connection string. + public readonly partial struct CosmosDBType : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public CosmosDBType(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string SqlValue = "Sql"; + private const string TableValue = "Table"; + private const string MongoDBValue = "MongoDB"; + private const string CassandraValue = "Cassandra"; + private const string CassandraConnectorMetadataValue = "CassandraConnectorMetadata"; + private const string GremlinValue = "Gremlin"; + private const string SqlDedicatedGatewayValue = "SqlDedicatedGateway"; + private const string GremlinV2Value = "GremlinV2"; + private const string UndefinedValue = "Undefined"; + + /// Sql. + public static CosmosDBType Sql { get; } = new CosmosDBType(SqlValue); + /// Table. + public static CosmosDBType Table { get; } = new CosmosDBType(TableValue); + /// MongoDB. + public static CosmosDBType MongoDB { get; } = new CosmosDBType(MongoDBValue); + /// Cassandra. + public static CosmosDBType Cassandra { get; } = new CosmosDBType(CassandraValue); + /// CassandraConnectorMetadata. + public static CosmosDBType CassandraConnectorMetadata { get; } = new CosmosDBType(CassandraConnectorMetadataValue); + /// Gremlin. + public static CosmosDBType Gremlin { get; } = new CosmosDBType(GremlinValue); + /// SqlDedicatedGateway. + public static CosmosDBType SqlDedicatedGateway { get; } = new CosmosDBType(SqlDedicatedGatewayValue); + /// GremlinV2. + public static CosmosDBType GremlinV2 { get; } = new CosmosDBType(GremlinV2Value); + /// Undefined. + public static CosmosDBType Undefined { get; } = new CosmosDBType(UndefinedValue); + /// Determines if two values are the same. + public static bool operator ==(CosmosDBType left, CosmosDBType right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(CosmosDBType left, CosmosDBType right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator CosmosDBType(string value) => new CosmosDBType(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is CosmosDBType other && Equals(other); + /// + public bool Equals(CosmosDBType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoDataTransferDataSourceSink.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoDataTransferDataSourceSink.Serialization.cs new file mode 100644 index 0000000000000..77100d389fd98 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoDataTransferDataSourceSink.Serialization.cs @@ -0,0 +1,57 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class CosmosMongoDataTransferDataSourceSink : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("databaseName"u8); + writer.WriteStringValue(DatabaseName); + writer.WritePropertyName("collectionName"u8); + writer.WriteStringValue(CollectionName); + writer.WritePropertyName("component"u8); + writer.WriteStringValue(Component.ToString()); + writer.WriteEndObject(); + } + + internal static CosmosMongoDataTransferDataSourceSink DeserializeCosmosMongoDataTransferDataSourceSink(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + string databaseName = default; + string collectionName = default; + DataTransferComponent component = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("databaseName"u8)) + { + databaseName = property.Value.GetString(); + continue; + } + if (property.NameEquals("collectionName"u8)) + { + collectionName = property.Value.GetString(); + continue; + } + if (property.NameEquals("component"u8)) + { + component = new DataTransferComponent(property.Value.GetString()); + continue; + } + } + return new CosmosMongoDataTransferDataSourceSink(component, databaseName, collectionName); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoDataTransferDataSourceSink.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoDataTransferDataSourceSink.cs new file mode 100644 index 0000000000000..e6277f0c865c9 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoDataTransferDataSourceSink.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// A CosmosDB Cassandra API data source/sink. + public partial class CosmosMongoDataTransferDataSourceSink : DataTransferDataSourceSink + { + /// Initializes a new instance of CosmosMongoDataTransferDataSourceSink. + /// + /// + /// or is null. + public CosmosMongoDataTransferDataSourceSink(string databaseName, string collectionName) + { + Argument.AssertNotNull(databaseName, nameof(databaseName)); + Argument.AssertNotNull(collectionName, nameof(collectionName)); + + DatabaseName = databaseName; + CollectionName = collectionName; + Component = DataTransferComponent.CosmosDBMongo; + } + + /// Initializes a new instance of CosmosMongoDataTransferDataSourceSink. + /// + /// + /// + internal CosmosMongoDataTransferDataSourceSink(DataTransferComponent component, string databaseName, string collectionName) : base(component) + { + DatabaseName = databaseName; + CollectionName = collectionName; + Component = component; + } + + /// Gets or sets the database name. + public string DatabaseName { get; set; } + /// Gets or sets the collection name. + public string CollectionName { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferComponent.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferComponent.cs index ca10d79061271..8fe52133c90c8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferComponent.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferComponent.cs @@ -23,11 +23,14 @@ public DataTransferComponent(string value) } private const string CosmosDBCassandraValue = "CosmosDBCassandra"; + private const string CosmosDBMongoValue = "CosmosDBMongo"; private const string CosmosDBSqlValue = "CosmosDBSql"; private const string AzureBlobStorageValue = "AzureBlobStorage"; /// CosmosDBCassandra. public static DataTransferComponent CosmosDBCassandra { get; } = new DataTransferComponent(CosmosDBCassandraValue); + /// CosmosDBMongo. + public static DataTransferComponent CosmosDBMongo { get; } = new DataTransferComponent(CosmosDBMongoValue); /// CosmosDBSql. public static DataTransferComponent CosmosDBSql { get; } = new DataTransferComponent(CosmosDBSqlValue); /// AzureBlobStorage. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferDataSourceSink.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferDataSourceSink.Serialization.cs index e14c8b7b4a02a..18b7e82150b98 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferDataSourceSink.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferDataSourceSink.Serialization.cs @@ -32,6 +32,7 @@ internal static DataTransferDataSourceSink DeserializeDataTransferDataSourceSink { case "AzureBlobStorage": return AzureBlobDataTransferDataSourceSink.DeserializeAzureBlobDataTransferDataSourceSink(element); case "CosmosDBCassandra": return CosmosCassandraDataTransferDataSourceSink.DeserializeCosmosCassandraDataTransferDataSourceSink(element); + case "CosmosDBMongo": return CosmosMongoDataTransferDataSourceSink.DeserializeCosmosMongoDataTransferDataSourceSink(element); case "CosmosDBSql": return CosmosSqlDataTransferDataSourceSink.DeserializeCosmosSqlDataTransferDataSourceSink(element); } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferDataSourceSink.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferDataSourceSink.cs index a2f61b240f14e..059b843564a17 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferDataSourceSink.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferDataSourceSink.cs @@ -10,7 +10,7 @@ namespace Azure.ResourceManager.CosmosDB.Models /// /// Base class for all DataTransfer source/sink /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , , and . /// public abstract partial class DataTransferDataSourceSink { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobProperties.cs index 0135da7b14655..89b16311715fd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobProperties.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobProperties.cs @@ -17,12 +17,12 @@ public partial class DataTransferJobProperties /// /// Source DataStore details /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , , and . /// /// /// Destination DataStore details /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , , and . /// /// or is null. public DataTransferJobProperties(DataTransferDataSourceSink source, DataTransferDataSourceSink destination) @@ -39,12 +39,12 @@ public DataTransferJobProperties(DataTransferDataSourceSink source, DataTransfer /// /// Source DataStore details /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , , and . /// /// /// Destination DataStore details /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , , and . /// /// Job Status. /// Processed Count. @@ -70,13 +70,13 @@ internal DataTransferJobProperties(string jobName, DataTransferDataSourceSink so /// /// Source DataStore details /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , , and . /// public DataTransferDataSourceSink Source { get; set; } /// /// Destination DataStore details /// Please note is the base class. According to the scenario, a derived class of the base class might need to be assigned here, or this property needs to be casted to one of the possible derived classes. - /// The available derived classes include , and . + /// The available derived classes include , , and . /// public DataTransferDataSourceSink Destination { get; set; } /// Job Status. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.Serialization.cs index 0e9b42a807caa..89be68ef783cd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.Serialization.cs @@ -63,6 +63,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("createMode"u8); writer.WriteStringValue(CreateMode.Value.ToString()); } + if (Optional.IsDefined(MaterializedViewDefinition)) + { + writer.WritePropertyName("materializedViewDefinition"u8); + writer.WriteObjectValue(MaterializedViewDefinition); + } writer.WriteEndObject(); } @@ -85,6 +90,7 @@ internal static ExtendedCosmosDBSqlContainerResourceInfo DeserializeExtendedCosm Optional analyticalStorageTtl = default; Optional restoreParameters = default; Optional createMode = default; + Optional materializedViewDefinition = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("_rid"u8)) @@ -196,8 +202,17 @@ internal static ExtendedCosmosDBSqlContainerResourceInfo DeserializeExtendedCosm createMode = new CosmosDBAccountCreateMode(property.Value.GetString()); continue; } + if (property.NameEquals("materializedViewDefinition"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + materializedViewDefinition = MaterializedViewDefinition.DeserializeMaterializedViewDefinition(property.Value); + continue; + } } - return new ExtendedCosmosDBSqlContainerResourceInfo(id, indexingPolicy.Value, partitionKey.Value, Optional.ToNullable(defaultTtl), uniqueKeyPolicy.Value, conflictResolutionPolicy.Value, clientEncryptionPolicy.Value, Optional.ToNullable(analyticalStorageTtl), restoreParameters.Value, Optional.ToNullable(createMode), rid.Value, Optional.ToNullable(ts), Optional.ToNullable(etag)); + return new ExtendedCosmosDBSqlContainerResourceInfo(id, indexingPolicy.Value, partitionKey.Value, Optional.ToNullable(defaultTtl), uniqueKeyPolicy.Value, conflictResolutionPolicy.Value, clientEncryptionPolicy.Value, Optional.ToNullable(analyticalStorageTtl), restoreParameters.Value, Optional.ToNullable(createMode), materializedViewDefinition.Value, rid.Value, Optional.ToNullable(ts), Optional.ToNullable(etag)); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.cs index 3cfe0415a7ce4..0aa13a3dc1c26 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlContainerResourceInfo.cs @@ -33,10 +33,11 @@ public ExtendedCosmosDBSqlContainerResourceInfo(string containerName) : base(con /// Analytical TTL. /// Parameters to indicate the information about the restore. /// Enum to indicate the mode of resource creation. + /// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. /// 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. - internal ExtendedCosmosDBSqlContainerResourceInfo(string containerName, CosmosDBIndexingPolicy indexingPolicy, CosmosDBContainerPartitionKey partitionKey, int? defaultTtl, CosmosDBUniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, CosmosDBClientEncryptionPolicy clientEncryptionPolicy, long? analyticalStorageTtl, ResourceRestoreParameters restoreParameters, CosmosDBAccountCreateMode? createMode, string rid, float? timestamp, ETag? etag) : base(containerName, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy, clientEncryptionPolicy, analyticalStorageTtl, restoreParameters, createMode) + internal ExtendedCosmosDBSqlContainerResourceInfo(string containerName, CosmosDBIndexingPolicy indexingPolicy, CosmosDBContainerPartitionKey partitionKey, int? defaultTtl, CosmosDBUniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, CosmosDBClientEncryptionPolicy clientEncryptionPolicy, long? analyticalStorageTtl, ResourceRestoreParameters restoreParameters, CosmosDBAccountCreateMode? createMode, MaterializedViewDefinition materializedViewDefinition, string rid, float? timestamp, ETag? etag) : base(containerName, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy, clientEncryptionPolicy, analyticalStorageTtl, restoreParameters, createMode, materializedViewDefinition) { Rid = rid; Timestamp = timestamp; diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FirewallRuleListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FirewallRuleListResult.Serialization.cs new file mode 100644 index 0000000000000..4abf0d4bd83db --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FirewallRuleListResult.Serialization.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.CosmosDB; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + internal partial class FirewallRuleListResult + { + internal static FirewallRuleListResult DeserializeFirewallRuleListResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CosmosDBFirewallRuleData.DeserializeCosmosDBFirewallRuleData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new FirewallRuleListResult(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FirewallRuleListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FirewallRuleListResult.cs new file mode 100644 index 0000000000000..3b68f54eaea4b --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FirewallRuleListResult.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.CosmosDB; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// A list of firewall rules. + internal partial class FirewallRuleListResult + { + /// Initializes a new instance of FirewallRuleListResult. + internal FirewallRuleListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of FirewallRuleListResult. + /// The list of firewall rules in a mongo cluster. + /// The link used to get the next page of results. + internal FirewallRuleListResult(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// The list of firewall rules in a mongo cluster. + public IReadOnlyList Value { get; } + /// The link used to get the next page of results. + public string NextLink { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListConnectionStringsResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListConnectionStringsResult.Serialization.cs new file mode 100644 index 0000000000000..ac39ee4744034 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListConnectionStringsResult.Serialization.cs @@ -0,0 +1,43 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class ListConnectionStringsResult + { + internal static ListConnectionStringsResult DeserializeListConnectionStringsResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> connectionStrings = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("connectionStrings"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(CosmosDBConnectionString.DeserializeCosmosDBConnectionString(item)); + } + connectionStrings = array; + continue; + } + } + return new ListConnectionStringsResult(Optional.ToList(connectionStrings)); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListConnectionStringsResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListConnectionStringsResult.cs new file mode 100644 index 0000000000000..1fbcd9855bcc8 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListConnectionStringsResult.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The connection strings for the given mongo cluster. + public partial class ListConnectionStringsResult + { + /// Initializes a new instance of ListConnectionStringsResult. + internal ListConnectionStringsResult() + { + ConnectionStrings = new ChangeTrackingList(); + } + + /// Initializes a new instance of ListConnectionStringsResult. + /// An array that contains the connection strings for a mongo cluster. + internal ListConnectionStringsResult(IReadOnlyList connectionStrings) + { + ConnectionStrings = connectionStrings; + } + + /// An array that contains the connection strings for a mongo cluster. + public IReadOnlyList ConnectionStrings { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.Serialization.cs new file mode 100644 index 0000000000000..61e0620d9c496 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.Serialization.cs @@ -0,0 +1,55 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class MaterializedViewDefinition : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + writer.WritePropertyName("sourceCollectionId"u8); + writer.WriteStringValue(SourceCollectionId); + writer.WritePropertyName("definition"u8); + writer.WriteStringValue(Definition); + writer.WriteEndObject(); + } + + internal static MaterializedViewDefinition DeserializeMaterializedViewDefinition(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional sourceCollectionRid = default; + string sourceCollectionId = default; + string definition = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sourceCollectionRid"u8)) + { + sourceCollectionRid = property.Value.GetString(); + continue; + } + if (property.NameEquals("sourceCollectionId"u8)) + { + sourceCollectionId = property.Value.GetString(); + continue; + } + if (property.NameEquals("definition"u8)) + { + definition = property.Value.GetString(); + continue; + } + } + return new MaterializedViewDefinition(sourceCollectionRid.Value, sourceCollectionId, definition); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.cs new file mode 100644 index 0000000000000..1df98d984e852 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.cs @@ -0,0 +1,47 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Materialized View definition for the container. + public partial class MaterializedViewDefinition + { + /// Initializes a new instance of MaterializedViewDefinition. + /// The name of the source container on which the Materialized View will be created. + /// The definition should be an SQL query which would be used to fetch data from the source container to populate into the Materialized View container. + /// or is null. + public MaterializedViewDefinition(string sourceCollectionId, string definition) + { + Argument.AssertNotNull(sourceCollectionId, nameof(sourceCollectionId)); + Argument.AssertNotNull(definition, nameof(definition)); + + SourceCollectionId = sourceCollectionId; + Definition = definition; + } + + /// Initializes a new instance of MaterializedViewDefinition. + /// An unique identifier for the source collection. This is a system generated property. + /// The name of the source container on which the Materialized View will be created. + /// The definition should be an SQL query which would be used to fetch data from the source container to populate into the Materialized View container. + internal MaterializedViewDefinition(string sourceCollectionRid, string sourceCollectionId, string definition) + { + SourceCollectionRid = sourceCollectionRid; + SourceCollectionId = sourceCollectionId; + Definition = definition; + } + + /// An unique identifier for the source collection. This is a system generated property. + public string SourceCollectionRid { get; } + /// The name of the source container on which the Materialized View will be created. + public string SourceCollectionId { get; set; } + /// The definition should be an SQL query which would be used to fetch data from the source container to populate into the Materialized View container. + public string Definition { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoClusterData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoClusterData.Serialization.cs new file mode 100644 index 0000000000000..ea554cbcd68fb --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoClusterData.Serialization.cs @@ -0,0 +1,233 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.CosmosDB.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + public partial class MongoClusterData : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("location"u8); + writer.WriteStringValue(Location); + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(CreateMode)) + { + writer.WritePropertyName("createMode"u8); + writer.WriteStringValue(CreateMode.Value.ToString()); + } + if (Optional.IsDefined(RestoreParameters)) + { + writer.WritePropertyName("restoreParameters"u8); + writer.WriteObjectValue(RestoreParameters); + } + if (Optional.IsDefined(AdministratorLogin)) + { + writer.WritePropertyName("administratorLogin"u8); + writer.WriteStringValue(AdministratorLogin); + } + if (Optional.IsDefined(AdministratorLoginPassword)) + { + writer.WritePropertyName("administratorLoginPassword"u8); + writer.WriteStringValue(AdministratorLoginPassword); + } + if (Optional.IsDefined(ServerVersion)) + { + writer.WritePropertyName("serverVersion"u8); + writer.WriteStringValue(ServerVersion); + } + if (Optional.IsCollectionDefined(NodeGroupSpecs)) + { + writer.WritePropertyName("nodeGroupSpecs"u8); + writer.WriteStartArray(); + foreach (var item in NodeGroupSpecs) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + + internal static MongoClusterData DeserializeMongoClusterData(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> tags = default; + AzureLocation location = default; + ResourceIdentifier id = default; + string name = default; + ResourceType type = default; + Optional systemData = default; + Optional createMode = default; + Optional restoreParameters = default; + Optional administratorLogin = default; + Optional administratorLoginPassword = default; + Optional serverVersion = default; + Optional connectionString = default; + Optional earliestRestoreTime = default; + Optional provisioningState = default; + Optional clusterStatus = default; + Optional> nodeGroupSpecs = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("tags"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + Dictionary dictionary = new Dictionary(); + foreach (var property0 in property.Value.EnumerateObject()) + { + dictionary.Add(property0.Name, property0.Value.GetString()); + } + tags = dictionary; + continue; + } + if (property.NameEquals("location"u8)) + { + location = new AzureLocation(property.Value.GetString()); + continue; + } + if (property.NameEquals("id"u8)) + { + id = new ResourceIdentifier(property.Value.GetString()); + continue; + } + if (property.NameEquals("name"u8)) + { + name = property.Value.GetString(); + continue; + } + if (property.NameEquals("type"u8)) + { + type = new ResourceType(property.Value.GetString()); + continue; + } + if (property.NameEquals("systemData"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + systemData = JsonSerializer.Deserialize(property.Value.GetRawText()); + continue; + } + if (property.NameEquals("properties"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + property.ThrowNonNullablePropertyIsNull(); + continue; + } + foreach (var property0 in property.Value.EnumerateObject()) + { + if (property0.NameEquals("createMode"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createMode = new CosmosDBAccountCreateMode(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("restoreParameters"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + restoreParameters = MongoClusterRestoreParameters.DeserializeMongoClusterRestoreParameters(property0.Value); + continue; + } + if (property0.NameEquals("administratorLogin"u8)) + { + administratorLogin = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("administratorLoginPassword"u8)) + { + administratorLoginPassword = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("serverVersion"u8)) + { + serverVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("connectionString"u8)) + { + connectionString = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("earliestRestoreTime"u8)) + { + earliestRestoreTime = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("provisioningState"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + provisioningState = new CosmosDBProvisioningState(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("clusterStatus"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + clusterStatus = new MongoClusterStatus(property0.Value.GetString()); + continue; + } + if (property0.NameEquals("nodeGroupSpecs"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property0.Value.EnumerateArray()) + { + array.Add(NodeGroupSpec.DeserializeNodeGroupSpec(item)); + } + nodeGroupSpecs = array; + continue; + } + } + continue; + } + } + return new MongoClusterData(id, name, type, systemData.Value, Optional.ToDictionary(tags), location, Optional.ToNullable(createMode), restoreParameters.Value, administratorLogin.Value, administratorLoginPassword.Value, serverVersion.Value, connectionString.Value, earliestRestoreTime.Value, Optional.ToNullable(provisioningState), Optional.ToNullable(clusterStatus), Optional.ToList(nodeGroupSpecs)); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoClusterListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoClusterListResult.Serialization.cs new file mode 100644 index 0000000000000..07277be5f4748 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoClusterListResult.Serialization.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using System.Text.Json; +using Azure.Core; +using Azure.ResourceManager.CosmosDB; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + internal partial class MongoClusterListResult + { + internal static MongoClusterListResult DeserializeMongoClusterListResult(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional> value = default; + Optional nextLink = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("value"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + List array = new List(); + foreach (var item in property.Value.EnumerateArray()) + { + array.Add(MongoClusterData.DeserializeMongoClusterData(item)); + } + value = array; + continue; + } + if (property.NameEquals("nextLink"u8)) + { + nextLink = property.Value.GetString(); + continue; + } + } + return new MongoClusterListResult(Optional.ToList(value), nextLink.Value); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoClusterListResult.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoClusterListResult.cs new file mode 100644 index 0000000000000..f7ea3f66429e8 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoClusterListResult.cs @@ -0,0 +1,37 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.CosmosDB; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// A list of mongo clusters. + internal partial class MongoClusterListResult + { + /// Initializes a new instance of MongoClusterListResult. + internal MongoClusterListResult() + { + Value = new ChangeTrackingList(); + } + + /// Initializes a new instance of MongoClusterListResult. + /// The list of mongo clusters. + /// The link used to get the next page of results. + internal MongoClusterListResult(IReadOnlyList value, string nextLink) + { + Value = value; + NextLink = nextLink; + } + + /// The list of mongo clusters. + public IReadOnlyList Value { get; } + /// The link used to get the next page of results. + public string NextLink { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoClusterPatch.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoClusterPatch.Serialization.cs new file mode 100644 index 0000000000000..ae5b07a7e364b --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoClusterPatch.Serialization.cs @@ -0,0 +1,70 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class MongoClusterPatch : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsCollectionDefined(Tags)) + { + writer.WritePropertyName("tags"u8); + writer.WriteStartObject(); + foreach (var item in Tags) + { + writer.WritePropertyName(item.Key); + writer.WriteStringValue(item.Value); + } + writer.WriteEndObject(); + } + writer.WritePropertyName("properties"u8); + writer.WriteStartObject(); + if (Optional.IsDefined(CreateMode)) + { + writer.WritePropertyName("createMode"u8); + writer.WriteStringValue(CreateMode.Value.ToString()); + } + if (Optional.IsDefined(RestoreParameters)) + { + writer.WritePropertyName("restoreParameters"u8); + writer.WriteObjectValue(RestoreParameters); + } + if (Optional.IsDefined(AdministratorLogin)) + { + writer.WritePropertyName("administratorLogin"u8); + writer.WriteStringValue(AdministratorLogin); + } + if (Optional.IsDefined(AdministratorLoginPassword)) + { + writer.WritePropertyName("administratorLoginPassword"u8); + writer.WriteStringValue(AdministratorLoginPassword); + } + if (Optional.IsDefined(ServerVersion)) + { + writer.WritePropertyName("serverVersion"u8); + writer.WriteStringValue(ServerVersion); + } + if (Optional.IsCollectionDefined(NodeGroupSpecs)) + { + writer.WritePropertyName("nodeGroupSpecs"u8); + writer.WriteStartArray(); + foreach (var item in NodeGroupSpecs) + { + writer.WriteObjectValue(item); + } + writer.WriteEndArray(); + } + writer.WriteEndObject(); + writer.WriteEndObject(); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoClusterPatch.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoClusterPatch.cs new file mode 100644 index 0000000000000..21236b3d576cd --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoClusterPatch.cs @@ -0,0 +1,46 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Represents a mongo cluster resource for updates. + public partial class MongoClusterPatch + { + /// Initializes a new instance of MongoClusterPatch. + public MongoClusterPatch() + { + Tags = new ChangeTrackingDictionary(); + NodeGroupSpecs = new ChangeTrackingList(); + } + + /// Application-specific metadata in the form of key-value pairs. + public IDictionary Tags { get; } + /// The mode to create a mongo cluster. + public CosmosDBAccountCreateMode? CreateMode { get; set; } + /// Parameters used for restore operations. + public MongoClusterRestoreParameters RestoreParameters { get; set; } + /// The administrator's login for the mongo cluster. + public string AdministratorLogin { get; set; } + /// The password of the administrator login. + public string AdministratorLoginPassword { get; set; } + /// The Mongo DB server version. Defaults to the latest available version if not specified. + public string ServerVersion { get; set; } + /// The default mongo connection string for the cluster. + public string ConnectionString { get; } + /// Earliest restore timestamp in UTC ISO8601 format. + public string EarliestRestoreTime { get; } + /// A provisioning state of the mongo cluster. + public CosmosDBProvisioningState? ProvisioningState { get; } + /// A status of the mongo cluster. + public MongoClusterStatus? ClusterStatus { get; } + /// The list of node group specs in the cluster. + public IList NodeGroupSpecs { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoClusterRestoreParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoClusterRestoreParameters.Serialization.cs new file mode 100644 index 0000000000000..85564f5637c6f --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoClusterRestoreParameters.Serialization.cs @@ -0,0 +1,60 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class MongoClusterRestoreParameters : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(PointInTimeUTC)) + { + writer.WritePropertyName("pointInTimeUTC"u8); + writer.WriteStringValue(PointInTimeUTC.Value, "O"); + } + if (Optional.IsDefined(SourceResourceId)) + { + writer.WritePropertyName("sourceResourceId"u8); + writer.WriteStringValue(SourceResourceId); + } + writer.WriteEndObject(); + } + + internal static MongoClusterRestoreParameters DeserializeMongoClusterRestoreParameters(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional pointInTimeUTC = default; + Optional sourceResourceId = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("pointInTimeUTC"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + pointInTimeUTC = property.Value.GetDateTimeOffset("O"); + continue; + } + if (property.NameEquals("sourceResourceId"u8)) + { + sourceResourceId = property.Value.GetString(); + continue; + } + } + return new MongoClusterRestoreParameters(Optional.ToNullable(pointInTimeUTC), sourceResourceId.Value); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoClusterRestoreParameters.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoClusterRestoreParameters.cs new file mode 100644 index 0000000000000..41e420746fbc1 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoClusterRestoreParameters.cs @@ -0,0 +1,34 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Parameters used for restore operations. + public partial class MongoClusterRestoreParameters + { + /// Initializes a new instance of MongoClusterRestoreParameters. + public MongoClusterRestoreParameters() + { + } + + /// Initializes a new instance of MongoClusterRestoreParameters. + /// UTC point in time to restore a mongo cluster. + /// Resource ID to locate the source cluster to restore. + internal MongoClusterRestoreParameters(DateTimeOffset? pointInTimeUTC, string sourceResourceId) + { + PointInTimeUTC = pointInTimeUTC; + SourceResourceId = sourceResourceId; + } + + /// UTC point in time to restore a mongo cluster. + public DateTimeOffset? PointInTimeUTC { get; set; } + /// Resource ID to locate the source cluster to restore. + public string SourceResourceId { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoClusterStatus.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoClusterStatus.cs new file mode 100644 index 0000000000000..39f1894ff9dc8 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoClusterStatus.cs @@ -0,0 +1,66 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The status of the resource at the time the operation was called. + public readonly partial struct MongoClusterStatus : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public MongoClusterStatus(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ReadyValue = "Ready"; + private const string ProvisioningValue = "Provisioning"; + private const string UpdatingValue = "Updating"; + private const string StartingValue = "Starting"; + private const string StoppingValue = "Stopping"; + private const string StoppedValue = "Stopped"; + private const string DroppingValue = "Dropping"; + + /// Ready. + public static MongoClusterStatus Ready { get; } = new MongoClusterStatus(ReadyValue); + /// Provisioning. + public static MongoClusterStatus Provisioning { get; } = new MongoClusterStatus(ProvisioningValue); + /// Updating. + public static MongoClusterStatus Updating { get; } = new MongoClusterStatus(UpdatingValue); + /// Starting. + public static MongoClusterStatus Starting { get; } = new MongoClusterStatus(StartingValue); + /// Stopping. + public static MongoClusterStatus Stopping { get; } = new MongoClusterStatus(StoppingValue); + /// Stopped. + public static MongoClusterStatus Stopped { get; } = new MongoClusterStatus(StoppedValue); + /// Dropping. + public static MongoClusterStatus Dropping { get; } = new MongoClusterStatus(DroppingValue); + /// Determines if two values are the same. + public static bool operator ==(MongoClusterStatus left, MongoClusterStatus right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(MongoClusterStatus left, MongoClusterStatus right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator MongoClusterStatus(string value) => new MongoClusterStatus(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is MongoClusterStatus other && Equals(other); + /// + public bool Equals(MongoClusterStatus other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NodeGroupProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NodeGroupProperties.Serialization.cs new file mode 100644 index 0000000000000..16901805fb91c --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NodeGroupProperties.Serialization.cs @@ -0,0 +1,74 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class NodeGroupProperties : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"u8); + writer.WriteStringValue(Sku); + } + if (Optional.IsDefined(DiskSizeInGB)) + { + writer.WritePropertyName("diskSizeGB"u8); + writer.WriteNumberValue(DiskSizeInGB.Value); + } + if (Optional.IsDefined(EnableHa)) + { + writer.WritePropertyName("enableHa"u8); + writer.WriteBooleanValue(EnableHa.Value); + } + writer.WriteEndObject(); + } + + internal static NodeGroupProperties DeserializeNodeGroupProperties(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional sku = default; + Optional diskSizeGB = default; + Optional enableHa = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("sku"u8)) + { + sku = property.Value.GetString(); + continue; + } + if (property.NameEquals("diskSizeGB"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskSizeGB = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("enableHa"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableHa = property.Value.GetBoolean(); + continue; + } + } + return new NodeGroupProperties(sku.Value, Optional.ToNullable(diskSizeGB), Optional.ToNullable(enableHa)); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NodeGroupProperties.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NodeGroupProperties.cs new file mode 100644 index 0000000000000..5b4633a30c60b --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NodeGroupProperties.cs @@ -0,0 +1,36 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The properties of the node group on a cluster. + public partial class NodeGroupProperties + { + /// Initializes a new instance of NodeGroupProperties. + public NodeGroupProperties() + { + } + + /// Initializes a new instance of NodeGroupProperties. + /// The resource sku for the node group. This defines the size of CPU and memory that is provisioned for each node. Example values: 'M30', 'M40'. + /// The disk storage size for the node group in GB. Example values: 128, 256, 512, 1024. + /// Whether high availability is enabled on the node group. + internal NodeGroupProperties(string sku, long? diskSizeInGB, bool? enableHa) + { + Sku = sku; + DiskSizeInGB = diskSizeInGB; + EnableHa = enableHa; + } + + /// The resource sku for the node group. This defines the size of CPU and memory that is provisioned for each node. Example values: 'M30', 'M40'. + public string Sku { get; set; } + /// The disk storage size for the node group in GB. Example values: 128, 256, 512, 1024. + public long? DiskSizeInGB { get; set; } + /// Whether high availability is enabled on the node group. + public bool? EnableHa { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NodeGroupSpec.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NodeGroupSpec.Serialization.cs new file mode 100644 index 0000000000000..71eb657281d24 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NodeGroupSpec.Serialization.cs @@ -0,0 +1,104 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Text.Json; +using Azure.Core; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + public partial class NodeGroupSpec : IUtf8JsonSerializable + { + void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) + { + writer.WriteStartObject(); + if (Optional.IsDefined(Kind)) + { + writer.WritePropertyName("kind"u8); + writer.WriteStringValue(Kind.Value.ToString()); + } + if (Optional.IsDefined(NodeCount)) + { + writer.WritePropertyName("nodeCount"u8); + writer.WriteNumberValue(NodeCount.Value); + } + if (Optional.IsDefined(Sku)) + { + writer.WritePropertyName("sku"u8); + writer.WriteStringValue(Sku); + } + if (Optional.IsDefined(DiskSizeInGB)) + { + writer.WritePropertyName("diskSizeGB"u8); + writer.WriteNumberValue(DiskSizeInGB.Value); + } + if (Optional.IsDefined(EnableHa)) + { + writer.WritePropertyName("enableHa"u8); + writer.WriteBooleanValue(EnableHa.Value); + } + writer.WriteEndObject(); + } + + internal static NodeGroupSpec DeserializeNodeGroupSpec(JsonElement element) + { + if (element.ValueKind == JsonValueKind.Null) + { + return null; + } + Optional kind = default; + Optional nodeCount = default; + Optional sku = default; + Optional diskSizeGB = default; + Optional enableHa = default; + foreach (var property in element.EnumerateObject()) + { + if (property.NameEquals("kind"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + kind = new NodeKind(property.Value.GetString()); + continue; + } + if (property.NameEquals("nodeCount"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + nodeCount = property.Value.GetInt32(); + continue; + } + if (property.NameEquals("sku"u8)) + { + sku = property.Value.GetString(); + continue; + } + if (property.NameEquals("diskSizeGB"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + diskSizeGB = property.Value.GetInt64(); + continue; + } + if (property.NameEquals("enableHa"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + enableHa = property.Value.GetBoolean(); + continue; + } + } + return new NodeGroupSpec(sku.Value, Optional.ToNullable(diskSizeGB), Optional.ToNullable(enableHa), Optional.ToNullable(kind), Optional.ToNullable(nodeCount)); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NodeGroupSpec.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NodeGroupSpec.cs new file mode 100644 index 0000000000000..fbbeb83af774e --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NodeGroupSpec.cs @@ -0,0 +1,35 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// Specification for a node group. + public partial class NodeGroupSpec : NodeGroupProperties + { + /// Initializes a new instance of NodeGroupSpec. + public NodeGroupSpec() + { + } + + /// Initializes a new instance of NodeGroupSpec. + /// The resource sku for the node group. This defines the size of CPU and memory that is provisioned for each node. Example values: 'M30', 'M40'. + /// The disk storage size for the node group in GB. Example values: 128, 256, 512, 1024. + /// Whether high availability is enabled on the node group. + /// The node type deployed in the node group. + /// The number of nodes in the node group. + internal NodeGroupSpec(string sku, long? diskSizeInGB, bool? enableHa, NodeKind? kind, int? nodeCount) : base(sku, diskSizeInGB, enableHa) + { + Kind = kind; + NodeCount = nodeCount; + } + + /// The node type deployed in the node group. + public NodeKind? Kind { get; set; } + /// The number of nodes in the node group. + public int? NodeCount { get; set; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NodeKind.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NodeKind.cs new file mode 100644 index 0000000000000..cfeab4b3a4c2b --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NodeKind.cs @@ -0,0 +1,48 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.ComponentModel; + +namespace Azure.ResourceManager.CosmosDB.Models +{ + /// The kind of a node in the mongo cluster. + public readonly partial struct NodeKind : IEquatable + { + private readonly string _value; + + /// Initializes a new instance of . + /// is null. + public NodeKind(string value) + { + _value = value ?? throw new ArgumentNullException(nameof(value)); + } + + private const string ShardValue = "Shard"; + + /// Shard. + public static NodeKind Shard { get; } = new NodeKind(ShardValue); + /// Determines if two values are the same. + public static bool operator ==(NodeKind left, NodeKind right) => left.Equals(right); + /// Determines if two values are not the same. + public static bool operator !=(NodeKind left, NodeKind right) => !left.Equals(right); + /// Converts a string to a . + public static implicit operator NodeKind(string value) => new NodeKind(value); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override bool Equals(object obj) => obj is NodeKind other && Equals(other); + /// + public bool Equals(NodeKind other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + + /// + [EditorBrowsable(EditorBrowsableState.Never)] + public override int GetHashCode() => _value?.GetHashCode() ?? 0; + /// + public override string ToString() => _value; + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.Serialization.cs index bf0dba0bf37f1..57004819798e3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.Serialization.cs @@ -63,6 +63,11 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) writer.WritePropertyName("createMode"u8); writer.WriteStringValue(CreateMode.Value.ToString()); } + if (Optional.IsDefined(MaterializedViewDefinition)) + { + writer.WritePropertyName("materializedViewDefinition"u8); + writer.WriteObjectValue(MaterializedViewDefinition); + } writer.WriteEndObject(); } @@ -86,6 +91,7 @@ internal static RestorableSqlContainerPropertiesResourceContainer DeserializeRes Optional analyticalStorageTtl = default; Optional restoreParameters = default; Optional createMode = default; + Optional materializedViewDefinition = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("_self"u8)) @@ -202,8 +208,17 @@ internal static RestorableSqlContainerPropertiesResourceContainer DeserializeRes createMode = new CosmosDBAccountCreateMode(property.Value.GetString()); continue; } + if (property.NameEquals("materializedViewDefinition"u8)) + { + if (property.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + materializedViewDefinition = MaterializedViewDefinition.DeserializeMaterializedViewDefinition(property.Value); + continue; + } } - return new RestorableSqlContainerPropertiesResourceContainer(id, indexingPolicy.Value, partitionKey.Value, Optional.ToNullable(defaultTtl), uniqueKeyPolicy.Value, conflictResolutionPolicy.Value, clientEncryptionPolicy.Value, Optional.ToNullable(analyticalStorageTtl), restoreParameters.Value, Optional.ToNullable(createMode), self.Value, rid.Value, Optional.ToNullable(ts), Optional.ToNullable(etag)); + return new RestorableSqlContainerPropertiesResourceContainer(id, indexingPolicy.Value, partitionKey.Value, Optional.ToNullable(defaultTtl), uniqueKeyPolicy.Value, conflictResolutionPolicy.Value, clientEncryptionPolicy.Value, Optional.ToNullable(analyticalStorageTtl), restoreParameters.Value, Optional.ToNullable(createMode), materializedViewDefinition.Value, self.Value, rid.Value, Optional.ToNullable(ts), Optional.ToNullable(etag)); } } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs index be1f19bd0b451..cb23511a682c3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainerPropertiesResourceContainer.cs @@ -33,11 +33,12 @@ public RestorableSqlContainerPropertiesResourceContainer(string containerName) : /// Analytical TTL. /// Parameters to indicate the information about the restore. /// Enum to indicate the mode of resource creation. + /// The configuration for defining Materialized Views. This must be specified only for creating a Materialized View container. /// A system generated property that specifies the addressable path of the container resource. /// 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. - internal RestorableSqlContainerPropertiesResourceContainer(string containerName, CosmosDBIndexingPolicy indexingPolicy, CosmosDBContainerPartitionKey partitionKey, int? defaultTtl, CosmosDBUniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, CosmosDBClientEncryptionPolicy clientEncryptionPolicy, long? analyticalStorageTtl, ResourceRestoreParameters restoreParameters, CosmosDBAccountCreateMode? createMode, string self, string rid, float? timestamp, ETag? etag) : base(containerName, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy, clientEncryptionPolicy, analyticalStorageTtl, restoreParameters, createMode) + internal RestorableSqlContainerPropertiesResourceContainer(string containerName, CosmosDBIndexingPolicy indexingPolicy, CosmosDBContainerPartitionKey partitionKey, int? defaultTtl, CosmosDBUniqueKeyPolicy uniqueKeyPolicy, ConflictResolutionPolicy conflictResolutionPolicy, CosmosDBClientEncryptionPolicy clientEncryptionPolicy, long? analyticalStorageTtl, ResourceRestoreParameters restoreParameters, CosmosDBAccountCreateMode? createMode, MaterializedViewDefinition materializedViewDefinition, string self, string rid, float? timestamp, ETag? etag) : base(containerName, indexingPolicy, partitionKey, defaultTtl, uniqueKeyPolicy, conflictResolutionPolicy, clientEncryptionPolicy, analyticalStorageTtl, restoreParameters, createMode, materializedViewDefinition) { Self = self; Rid = rid; diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoClusterCollection.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoClusterCollection.cs new file mode 100644 index 0000000000000..57870d8917be4 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoClusterCollection.cs @@ -0,0 +1,341 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A class representing a collection of and their operations. + /// Each in the collection will belong to the same instance of . + /// To get a instance call the GetMongoClusters method from an instance of . + /// + public partial class MongoClusterCollection : ArmCollection, IEnumerable, IAsyncEnumerable + { + private readonly ClientDiagnostics _mongoClusterClientDiagnostics; + private readonly MongoClustersRestOperations _mongoClusterRestClient; + + /// Initializes a new instance of the class for mocking. + protected MongoClusterCollection() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the parent resource that is the target of operations. + internal MongoClusterCollection(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _mongoClusterClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", MongoClusterResource.ResourceType.Namespace, Diagnostics); + TryGetApiVersion(MongoClusterResource.ResourceType, out string mongoClusterApiVersion); + _mongoClusterRestClient = new MongoClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, mongoClusterApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceGroupResource.ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceGroupResource.ResourceType), nameof(id)); + } + + /// + /// Create or update a mongo cluster. Update overwrites all properties for the resource. To only modify some of the properties, use PATCH. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName} + /// + /// + /// Operation Id + /// MongoClusters_CreateOrUpdate + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the mongo cluster. + /// The required parameters for creating or updating a mongo cluster. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual async Task> CreateOrUpdateAsync(WaitUntil waitUntil, string mongoClusterName, MongoClusterData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _mongoClusterClientDiagnostics.CreateScope("MongoClusterCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = await _mongoClusterRestClient.CreateOrUpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, mongoClusterName, data, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(new MongoClusterOperationSource(Client), _mongoClusterClientDiagnostics, Pipeline, _mongoClusterRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, mongoClusterName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Create or update a mongo cluster. Update overwrites all properties for the resource. To only modify some of the properties, use PATCH. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName} + /// + /// + /// Operation Id + /// MongoClusters_CreateOrUpdate + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The name of the mongo cluster. + /// The required parameters for creating or updating a mongo cluster. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// or is null. + public virtual ArmOperation CreateOrUpdate(WaitUntil waitUntil, string mongoClusterName, MongoClusterData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + Argument.AssertNotNull(data, nameof(data)); + + using var scope = _mongoClusterClientDiagnostics.CreateScope("MongoClusterCollection.CreateOrUpdate"); + scope.Start(); + try + { + var response = _mongoClusterRestClient.CreateOrUpdate(Id.SubscriptionId, Id.ResourceGroupName, mongoClusterName, data, cancellationToken); + var operation = new CosmosDBArmOperation(new MongoClusterOperationSource(Client), _mongoClusterClientDiagnostics, Pipeline, _mongoClusterRestClient.CreateCreateOrUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, mongoClusterName, data).Request, response, OperationFinalStateVia.AzureAsyncOperation); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets information about a mongo cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName} + /// + /// + /// Operation Id + /// MongoClusters_Get + /// + /// + /// + /// The name of the mongo cluster. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> GetAsync(string mongoClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + + using var scope = _mongoClusterClientDiagnostics.CreateScope("MongoClusterCollection.Get"); + scope.Start(); + try + { + var response = await _mongoClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, mongoClusterName, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MongoClusterResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets information about a mongo cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName} + /// + /// + /// Operation Id + /// MongoClusters_Get + /// + /// + /// + /// The name of the mongo cluster. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Get(string mongoClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + + using var scope = _mongoClusterClientDiagnostics.CreateScope("MongoClusterCollection.Get"); + scope.Start(); + try + { + var response = _mongoClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, mongoClusterName, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MongoClusterResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List all the mongo clusters in a given resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters + /// + /// + /// Operation Id + /// MongoClusters_ListByResourceGroup + /// + /// + /// + /// The cancellation token to use. + /// An async collection of that may take multiple service requests to iterate over. + public virtual AsyncPageable GetAllAsync(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _mongoClusterRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _mongoClusterRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return PageableHelpers.CreateAsyncPageable(FirstPageRequest, NextPageRequest, e => new MongoClusterResource(Client, MongoClusterData.DeserializeMongoClusterData(e)), _mongoClusterClientDiagnostics, Pipeline, "MongoClusterCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// List all the mongo clusters in a given resource group. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters + /// + /// + /// Operation Id + /// MongoClusters_ListByResourceGroup + /// + /// + /// + /// The cancellation token to use. + /// A collection of that may take multiple service requests to iterate over. + public virtual Pageable GetAll(CancellationToken cancellationToken = default) + { + HttpMessage FirstPageRequest(int? pageSizeHint) => _mongoClusterRestClient.CreateListByResourceGroupRequest(Id.SubscriptionId, Id.ResourceGroupName); + HttpMessage NextPageRequest(int? pageSizeHint, string nextLink) => _mongoClusterRestClient.CreateListByResourceGroupNextPageRequest(nextLink, Id.SubscriptionId, Id.ResourceGroupName); + return PageableHelpers.CreatePageable(FirstPageRequest, NextPageRequest, e => new MongoClusterResource(Client, MongoClusterData.DeserializeMongoClusterData(e)), _mongoClusterClientDiagnostics, Pipeline, "MongoClusterCollection.GetAll", "value", "nextLink", cancellationToken); + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName} + /// + /// + /// Operation Id + /// MongoClusters_Get + /// + /// + /// + /// The name of the mongo cluster. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual async Task> ExistsAsync(string mongoClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + + using var scope = _mongoClusterClientDiagnostics.CreateScope("MongoClusterCollection.Exists"); + scope.Start(); + try + { + var response = await _mongoClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, mongoClusterName, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Checks to see if the resource exists in azure. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName} + /// + /// + /// Operation Id + /// MongoClusters_Get + /// + /// + /// + /// The name of the mongo cluster. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + public virtual Response Exists(string mongoClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + + using var scope = _mongoClusterClientDiagnostics.CreateScope("MongoClusterCollection.Exists"); + scope.Start(); + try + { + var response = _mongoClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, mongoClusterName, cancellationToken: cancellationToken); + return Response.FromValue(response.Value != null, response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return GetAll().GetEnumerator(); + } + + IAsyncEnumerator IAsyncEnumerable.GetAsyncEnumerator(CancellationToken cancellationToken) + { + return GetAllAsync(cancellationToken: cancellationToken).GetAsyncEnumerator(cancellationToken); + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoClusterData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoClusterData.cs new file mode 100644 index 0000000000000..8b0042a4d7377 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoClusterData.cs @@ -0,0 +1,80 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System.Collections.Generic; +using Azure.Core; +using Azure.ResourceManager.CosmosDB.Models; +using Azure.ResourceManager.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A class representing the MongoCluster data model. + /// Represents a mongo cluster resource. + /// + public partial class MongoClusterData : TrackedResourceData + { + /// Initializes a new instance of MongoClusterData. + /// The location. + public MongoClusterData(AzureLocation location) : base(location) + { + NodeGroupSpecs = new ChangeTrackingList(); + } + + /// Initializes a new instance of MongoClusterData. + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The tags. + /// The location. + /// The mode to create a mongo cluster. + /// Parameters used for restore operations. + /// The administrator's login for the mongo cluster. + /// The password of the administrator login. + /// The Mongo DB server version. Defaults to the latest available version if not specified. + /// The default mongo connection string for the cluster. + /// Earliest restore timestamp in UTC ISO8601 format. + /// A provisioning state of the mongo cluster. + /// A status of the mongo cluster. + /// The list of node group specs in the cluster. + internal MongoClusterData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, CosmosDBAccountCreateMode? createMode, MongoClusterRestoreParameters restoreParameters, string administratorLogin, string administratorLoginPassword, string serverVersion, string connectionString, string earliestRestoreTime, CosmosDBProvisioningState? provisioningState, MongoClusterStatus? clusterStatus, IList nodeGroupSpecs) : base(id, name, resourceType, systemData, tags, location) + { + CreateMode = createMode; + RestoreParameters = restoreParameters; + AdministratorLogin = administratorLogin; + AdministratorLoginPassword = administratorLoginPassword; + ServerVersion = serverVersion; + ConnectionString = connectionString; + EarliestRestoreTime = earliestRestoreTime; + ProvisioningState = provisioningState; + ClusterStatus = clusterStatus; + NodeGroupSpecs = nodeGroupSpecs; + } + + /// The mode to create a mongo cluster. + public CosmosDBAccountCreateMode? CreateMode { get; set; } + /// Parameters used for restore operations. + public MongoClusterRestoreParameters RestoreParameters { get; set; } + /// The administrator's login for the mongo cluster. + public string AdministratorLogin { get; set; } + /// The password of the administrator login. + public string AdministratorLoginPassword { get; set; } + /// The Mongo DB server version. Defaults to the latest available version if not specified. + public string ServerVersion { get; set; } + /// The default mongo connection string for the cluster. + public string ConnectionString { get; } + /// Earliest restore timestamp in UTC ISO8601 format. + public string EarliestRestoreTime { get; } + /// A provisioning state of the mongo cluster. + public CosmosDBProvisioningState? ProvisioningState { get; } + /// A status of the mongo cluster. + public MongoClusterStatus? ClusterStatus { get; } + /// The list of node group specs in the cluster. + public IList NodeGroupSpecs { get; } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoClusterResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoClusterResource.cs new file mode 100644 index 0000000000000..7bf5d3b850b64 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoClusterResource.cs @@ -0,0 +1,723 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Collections.Generic; +using System.Globalization; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager; +using Azure.ResourceManager.CosmosDB.Models; +using Azure.ResourceManager.Resources; + +namespace Azure.ResourceManager.CosmosDB +{ + /// + /// A Class representing a MongoCluster along with the instance operations that can be performed on it. + /// If you have a you can construct a + /// from an instance of using the GetMongoClusterResource method. + /// Otherwise you can get one from its parent resource using the GetMongoCluster method. + /// + public partial class MongoClusterResource : ArmResource + { + /// Generate the resource identifier of a instance. + public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId, string resourceGroupName, string mongoClusterName) + { + var resourceId = $"/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}"; + return new ResourceIdentifier(resourceId); + } + + private readonly ClientDiagnostics _mongoClusterClientDiagnostics; + private readonly MongoClustersRestOperations _mongoClusterRestClient; + private readonly MongoClusterData _data; + + /// Initializes a new instance of the class for mocking. + protected MongoClusterResource() + { + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The resource that is the target of operations. + internal MongoClusterResource(ArmClient client, MongoClusterData data) : this(client, data.Id) + { + HasData = true; + _data = data; + } + + /// Initializes a new instance of the class. + /// The client parameters to use in these operations. + /// The identifier of the resource that is the target of operations. + internal MongoClusterResource(ArmClient client, ResourceIdentifier id) : base(client, id) + { + _mongoClusterClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.CosmosDB", ResourceType.Namespace, Diagnostics); + TryGetApiVersion(ResourceType, out string mongoClusterApiVersion); + _mongoClusterRestClient = new MongoClustersRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint, mongoClusterApiVersion); +#if DEBUG + ValidateResourceId(Id); +#endif + } + + /// Gets the resource type for the operations. + public static readonly ResourceType ResourceType = "Microsoft.DocumentDB/mongoClusters"; + + /// Gets whether or not the current instance has data. + public virtual bool HasData { get; } + + /// Gets the data representing this Feature. + /// Throws if there is no data loaded in the current instance. + public virtual MongoClusterData Data + { + get + { + if (!HasData) + throw new InvalidOperationException("The current instance does not have data, you must call Get first."); + return _data; + } + } + + internal static void ValidateResourceId(ResourceIdentifier id) + { + if (id.ResourceType != ResourceType) + throw new ArgumentException(string.Format(CultureInfo.CurrentCulture, "Invalid resource type {0} expected {1}", id.ResourceType, ResourceType), nameof(id)); + } + + /// Gets a collection of CosmosDBFirewallRuleResources in the MongoCluster. + /// An object representing collection of CosmosDBFirewallRuleResources and their operations over a CosmosDBFirewallRuleResource. + public virtual CosmosDBFirewallRuleCollection GetCosmosDBFirewallRules() + { + return GetCachedClient(Client => new CosmosDBFirewallRuleCollection(Client, Id)); + } + + /// + /// Gets information about a mongo cluster firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// MongoClusters_GetFirewallRule + /// + /// + /// + /// The name of the mongo cluster firewall rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual async Task> GetCosmosDBFirewallRuleAsync(string firewallRuleName, CancellationToken cancellationToken = default) + { + return await GetCosmosDBFirewallRules().GetAsync(firewallRuleName, cancellationToken).ConfigureAwait(false); + } + + /// + /// Gets information about a mongo cluster firewall rule. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/firewallRules/{firewallRuleName} + /// + /// + /// Operation Id + /// MongoClusters_GetFirewallRule + /// + /// + /// + /// The name of the mongo cluster firewall rule. + /// The cancellation token to use. + /// is an empty string, and was expected to be non-empty. + /// is null. + [ForwardsClientCalls] + public virtual Response GetCosmosDBFirewallRule(string firewallRuleName, CancellationToken cancellationToken = default) + { + return GetCosmosDBFirewallRules().Get(firewallRuleName, cancellationToken); + } + + /// + /// Gets information about a mongo cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName} + /// + /// + /// Operation Id + /// MongoClusters_Get + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetAsync(CancellationToken cancellationToken = default) + { + using var scope = _mongoClusterClientDiagnostics.CreateScope("MongoClusterResource.Get"); + scope.Start(); + try + { + var response = await _mongoClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MongoClusterResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Gets information about a mongo cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName} + /// + /// + /// Operation Id + /// MongoClusters_Get + /// + /// + /// + /// The cancellation token to use. + public virtual Response Get(CancellationToken cancellationToken = default) + { + using var scope = _mongoClusterClientDiagnostics.CreateScope("MongoClusterResource.Get"); + scope.Start(); + try + { + var response = _mongoClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + if (response.Value == null) + throw new RequestFailedException(response.GetRawResponse()); + return Response.FromValue(new MongoClusterResource(Client, response.Value), response.GetRawResponse()); + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a mongo cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName} + /// + /// + /// Operation Id + /// MongoClusters_Delete + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual async Task DeleteAsync(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _mongoClusterClientDiagnostics.CreateScope("MongoClusterResource.Delete"); + scope.Start(); + try + { + var response = await _mongoClusterRestClient.DeleteAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(_mongoClusterClientDiagnostics, Pipeline, _mongoClusterRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Deletes a mongo cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName} + /// + /// + /// Operation Id + /// MongoClusters_Delete + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The cancellation token to use. + public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) + { + using var scope = _mongoClusterClientDiagnostics.CreateScope("MongoClusterResource.Delete"); + scope.Start(); + try + { + var response = _mongoClusterRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + var operation = new CosmosDBArmOperation(_mongoClusterClientDiagnostics, Pipeline, _mongoClusterRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletionResponse(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates an existing mongo cluster. The request body can contain one to many of the properties present in the normal mongo cluster definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName} + /// + /// + /// Operation Id + /// MongoClusters_Update + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters for updating a mongo cluster. + /// The cancellation token to use. + /// is null. + public virtual async Task> UpdateAsync(WaitUntil waitUntil, MongoClusterPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _mongoClusterClientDiagnostics.CreateScope("MongoClusterResource.Update"); + scope.Start(); + try + { + var response = await _mongoClusterRestClient.UpdateAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(new MongoClusterOperationSource(Client), _mongoClusterClientDiagnostics, Pipeline, _mongoClusterRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Updates an existing mongo cluster. The request body can contain one to many of the properties present in the normal mongo cluster definition. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName} + /// + /// + /// Operation Id + /// MongoClusters_Update + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters for updating a mongo cluster. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation Update(WaitUntil waitUntil, MongoClusterPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(patch, nameof(patch)); + + using var scope = _mongoClusterClientDiagnostics.CreateScope("MongoClusterResource.Update"); + scope.Start(); + try + { + var response = _mongoClusterRestClient.Update(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch, cancellationToken); + var operation = new CosmosDBArmOperation(new MongoClusterOperationSource(Client), _mongoClusterClientDiagnostics, Pipeline, _mongoClusterRestClient.CreateUpdateRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, patch).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List mongo cluster connection strings. This includes the default connection string using SCRAM-SHA-256, as well as other connection strings supported by the cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/listConnectionStrings + /// + /// + /// Operation Id + /// MongoClusters_ListConnectionStrings + /// + /// + /// + /// The cancellation token to use. + public virtual async Task> GetConnectionStringsAsync(CancellationToken cancellationToken = default) + { + using var scope = _mongoClusterClientDiagnostics.CreateScope("MongoClusterResource.GetConnectionStrings"); + scope.Start(); + try + { + var response = await _mongoClusterRestClient.ListConnectionStringsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// List mongo cluster connection strings. This includes the default connection string using SCRAM-SHA-256, as well as other connection strings supported by the cluster. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName}/listConnectionStrings + /// + /// + /// Operation Id + /// MongoClusters_ListConnectionStrings + /// + /// + /// + /// The cancellation token to use. + public virtual Response GetConnectionStrings(CancellationToken cancellationToken = default) + { + using var scope = _mongoClusterClientDiagnostics.CreateScope("MongoClusterResource.GetConnectionStrings"); + scope.Start(); + try + { + var response = _mongoClusterRestClient.ListConnectionStrings(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return response; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName} + /// + /// + /// Operation Id + /// MongoClusters_Get + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual async Task> AddTagAsync(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _mongoClusterClientDiagnostics.CreateScope("MongoClusterResource.AddTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues[key] = value; + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _mongoClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new MongoClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new MongoClusterPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Add a tag to the current resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName} + /// + /// + /// Operation Id + /// MongoClusters_Get + /// + /// + /// + /// The key for the tag. + /// The value for the tag. + /// The cancellation token to use. + /// or is null. + public virtual Response AddTag(string key, string value, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + Argument.AssertNotNull(value, nameof(value)); + + using var scope = _mongoClusterClientDiagnostics.CreateScope("MongoClusterResource.AddTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues[key] = value; + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _mongoClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new MongoClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new MongoClusterPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags[key] = value; + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName} + /// + /// + /// Operation Id + /// MongoClusters_Get + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual async Task> SetTagsAsync(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _mongoClusterClientDiagnostics.CreateScope("MongoClusterResource.SetTags"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + await GetTagResource().DeleteAsync(WaitUntil.Completed, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _mongoClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new MongoClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new MongoClusterPatch(); + patch.Tags.ReplaceWith(tags); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Replace the tags on the resource with the given set. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName} + /// + /// + /// Operation Id + /// MongoClusters_Get + /// + /// + /// + /// The set of tags to use as replacement. + /// The cancellation token to use. + /// is null. + public virtual Response SetTags(IDictionary tags, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(tags, nameof(tags)); + + using var scope = _mongoClusterClientDiagnostics.CreateScope("MongoClusterResource.SetTags"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + GetTagResource().Delete(WaitUntil.Completed, cancellationToken: cancellationToken); + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.ReplaceWith(tags); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _mongoClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new MongoClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new MongoClusterPatch(); + patch.Tags.ReplaceWith(tags); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName} + /// + /// + /// Operation Id + /// MongoClusters_Get + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual async Task> RemoveTagAsync(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _mongoClusterClientDiagnostics.CreateScope("MongoClusterResource.RemoveTag"); + scope.Start(); + try + { + if (await CanUseTagResourceAsync(cancellationToken: cancellationToken).ConfigureAwait(false)) + { + var originalTags = await GetTagResource().GetAsync(cancellationToken).ConfigureAwait(false); + originalTags.Value.Data.TagValues.Remove(key); + await GetTagResource().CreateOrUpdateAsync(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken).ConfigureAwait(false); + var originalResponse = await _mongoClusterRestClient.GetAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken).ConfigureAwait(false); + return Response.FromValue(new MongoClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = (await GetAsync(cancellationToken: cancellationToken).ConfigureAwait(false)).Value.Data; + var patch = new MongoClusterPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = await UpdateAsync(WaitUntil.Completed, patch, cancellationToken: cancellationToken).ConfigureAwait(false); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Removes a tag by key from the resource. + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/mongoClusters/{mongoClusterName} + /// + /// + /// Operation Id + /// MongoClusters_Get + /// + /// + /// + /// The key for the tag. + /// The cancellation token to use. + /// is null. + public virtual Response RemoveTag(string key, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(key, nameof(key)); + + using var scope = _mongoClusterClientDiagnostics.CreateScope("MongoClusterResource.RemoveTag"); + scope.Start(); + try + { + if (CanUseTagResource(cancellationToken: cancellationToken)) + { + var originalTags = GetTagResource().Get(cancellationToken); + originalTags.Value.Data.TagValues.Remove(key); + GetTagResource().CreateOrUpdate(WaitUntil.Completed, originalTags.Value.Data, cancellationToken: cancellationToken); + var originalResponse = _mongoClusterRestClient.Get(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); + return Response.FromValue(new MongoClusterResource(Client, originalResponse.Value), originalResponse.GetRawResponse()); + } + else + { + var current = Get(cancellationToken: cancellationToken).Value.Data; + var patch = new MongoClusterPatch(); + foreach (var tag in current.Tags) + { + patch.Tags.Add(tag); + } + patch.Tags.Remove(key); + var result = Update(WaitUntil.Completed, patch, cancellationToken: cancellationToken); + return Response.FromValue(result.Value, result.GetRawResponse()); + } + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseResource.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseResource.cs index 825bce3374700..adefa62d6d684 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseResource.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseResource.cs @@ -356,6 +356,82 @@ public virtual ArmOperation Update(WaitUntil waitUntil, } } + /// + /// Merges the partitions of a MongoDB database + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/partitionMerge + /// + /// + /// Operation Id + /// MongoDBResources_MongoDBDatabasePartitionMerge + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters for the merge operation. + /// The cancellation token to use. + /// is null. + public virtual async Task> MongoDBDatabasePartitionMergeAsync(WaitUntil waitUntil, MergeParameters mergeParameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); + + using var scope = _mongoDBDatabaseMongoDBResourcesClientDiagnostics.CreateScope("MongoDBDatabaseResource.MongoDBDatabasePartitionMerge"); + scope.Start(); + try + { + var response = await _mongoDBDatabaseMongoDBResourcesRestClient.MongoDBDatabasePartitionMergeAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters, cancellationToken).ConfigureAwait(false); + var operation = new CosmosDBArmOperation(new PhysicalPartitionStorageInfoCollectionOperationSource(), _mongoDBDatabaseMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBDatabaseMongoDBResourcesRestClient.CreateMongoDBDatabasePartitionMergeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + + /// + /// Merges the partitions of a MongoDB database + /// + /// + /// Request Path + /// /subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/mongodbDatabases/{databaseName}/partitionMerge + /// + /// + /// Operation Id + /// MongoDBResources_MongoDBDatabasePartitionMerge + /// + /// + /// + /// if the method should wait to return until the long-running operation has completed on the service; if it should return after starting the operation. For more information on long-running operations, please see Azure.Core Long-Running Operation samples. + /// The parameters for the merge operation. + /// The cancellation token to use. + /// is null. + public virtual ArmOperation MongoDBDatabasePartitionMerge(WaitUntil waitUntil, MergeParameters mergeParameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); + + using var scope = _mongoDBDatabaseMongoDBResourcesClientDiagnostics.CreateScope("MongoDBDatabaseResource.MongoDBDatabasePartitionMerge"); + scope.Start(); + try + { + var response = _mongoDBDatabaseMongoDBResourcesRestClient.MongoDBDatabasePartitionMerge(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters, cancellationToken); + var operation = new CosmosDBArmOperation(new PhysicalPartitionStorageInfoCollectionOperationSource(), _mongoDBDatabaseMongoDBResourcesClientDiagnostics, Pipeline, _mongoDBDatabaseMongoDBResourcesRestClient.CreateMongoDBDatabasePartitionMergeRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, mergeParameters).Request, response, OperationFinalStateVia.Location); + if (waitUntil == WaitUntil.Completed) + operation.WaitForCompletion(cancellationToken); + return operation; + } + catch (Exception e) + { + scope.Failed(e); + throw; + } + } + /// /// Add a tag to the current resource. /// diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraClustersRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraClustersRestOperations.cs index 19be5968e84ba..05e8566a997a4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraClustersRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraClustersRestOperations.cs @@ -33,7 +33,7 @@ public CassandraClustersRestOperations(HttpPipeline pipeline, string application { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraDataCentersRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraDataCentersRestOperations.cs index 4ec2ba02f6e1f..0b8a82792cd9b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraDataCentersRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraDataCentersRestOperations.cs @@ -33,7 +33,7 @@ public CassandraDataCentersRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraResourcesRestOperations.cs index 9522dc619fb81..c492127ad13d0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CassandraResourcesRestOperations.cs @@ -33,7 +33,7 @@ public CassandraResourcesRestOperations(HttpPipeline pipeline, string applicatio { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRegionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRegionRestOperations.cs index c6c09c7d4b8ea..44c1e724b120f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRegionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRegionRestOperations.cs @@ -33,7 +33,7 @@ public CollectionPartitionRegionRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRestOperations.cs index 95c8e9f9c9b59..c086be9ed93a8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionPartitionRestOperations.cs @@ -33,7 +33,7 @@ public CollectionPartitionRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRegionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRegionRestOperations.cs index ca28543a0064a..dd41cc236c309 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRegionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRegionRestOperations.cs @@ -33,7 +33,7 @@ public CollectionRegionRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRestOperations.cs index 144e5ba9d97c6..e63342ab46c2b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/CollectionRestOperations.cs @@ -33,7 +33,7 @@ public CollectionRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DataTransferJobsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DataTransferJobsRestOperations.cs index de45e72d56ec6..e27575c882d1b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DataTransferJobsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DataTransferJobsRestOperations.cs @@ -33,7 +33,7 @@ public DataTransferJobsRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountRegionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountRegionRestOperations.cs index 24b53c42969ca..ea7fb426d81c5 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountRegionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountRegionRestOperations.cs @@ -33,7 +33,7 @@ public DatabaseAccountRegionRestOperations(HttpPipeline pipeline, string applica { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountsRestOperations.cs index 6f1ab4bf718db..7d304c5f67ad7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseAccountsRestOperations.cs @@ -33,7 +33,7 @@ public DatabaseAccountsRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseRestOperations.cs index a25f6ce06b3c4..6b92f7b7d6a1b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/DatabaseRestOperations.cs @@ -33,7 +33,7 @@ public DatabaseRestOperations(HttpPipeline pipeline, string applicationId, Uri e { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GraphResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GraphResourcesRestOperations.cs index 39ce69e4fe4f4..f4a6ef9134467 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GraphResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GraphResourcesRestOperations.cs @@ -33,7 +33,7 @@ public GraphResourcesRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GremlinResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GremlinResourcesRestOperations.cs index 835118a735f19..aaca2a15404f7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GremlinResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/GremlinResourcesRestOperations.cs @@ -33,7 +33,7 @@ public GremlinResourcesRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/LocationsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/LocationsRestOperations.cs index 8c49e0aa7b10e..69ddc872c0a58 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/LocationsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/LocationsRestOperations.cs @@ -33,7 +33,7 @@ public LocationsRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/MongoClustersRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/MongoClustersRestOperations.cs new file mode 100644 index 0000000000000..345a7a3340aaf --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/MongoClustersRestOperations.cs @@ -0,0 +1,1189 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. + +// + +#nullable disable + +using System; +using System.Text.Json; +using System.Threading; +using System.Threading.Tasks; +using Azure; +using Azure.Core; +using Azure.Core.Pipeline; +using Azure.ResourceManager.CosmosDB.Models; + +namespace Azure.ResourceManager.CosmosDB +{ + internal partial class MongoClustersRestOperations + { + private readonly TelemetryDetails _userAgent; + private readonly HttpPipeline _pipeline; + private readonly Uri _endpoint; + private readonly string _apiVersion; + + /// Initializes a new instance of MongoClustersRestOperations. + /// The HTTP pipeline for sending and receiving REST requests and responses. + /// The application id to use for user agent. + /// server parameter. + /// Api Version. + /// or is null. + public MongoClustersRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default) + { + _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); + _endpoint = endpoint ?? new Uri("https://management.azure.com"); + _apiVersion = apiVersion ?? "2023-03-15-preview"; + _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); + } + + internal HttpMessage CreateListRequest(string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/mongoClusters", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List all the mongo clusters in a given subscription. + /// The ID of the target subscription. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListAsync(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListRequest(subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MongoClusterListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MongoClusterListResult.DeserializeMongoClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all the mongo clusters in a given subscription. + /// The ID of the target subscription. + /// The cancellation token to use. + /// is null. + /// is an empty string, and was expected to be non-empty. + public Response List(string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListRequest(subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MongoClusterListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MongoClusterListResult.DeserializeMongoClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByResourceGroupRequest(string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/mongoClusters", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List all the mongo clusters in a given resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupAsync(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MongoClusterListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MongoClusterListResult.DeserializeMongoClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all the mongo clusters in a given resource group. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroup(string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupRequest(subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MongoClusterListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MongoClusterListResult.DeserializeMongoClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateRequest(string subscriptionId, string resourceGroupName, string mongoClusterName, MongoClusterData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/mongoClusters/", false); + uri.AppendPath(mongoClusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Create or update a mongo cluster. Update overwrites all properties for the resource. To only modify some of the properties, use PATCH. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the mongo cluster. + /// The required parameters for creating or updating a mongo cluster. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateAsync(string subscriptionId, string resourceGroupName, string mongoClusterName, MongoClusterData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, mongoClusterName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Create or update a mongo cluster. Update overwrites all properties for the resource. To only modify some of the properties, use PATCH. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the mongo cluster. + /// The required parameters for creating or updating a mongo cluster. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdate(string subscriptionId, string resourceGroupName, string mongoClusterName, MongoClusterData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateRequest(subscriptionId, resourceGroupName, mongoClusterName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetRequest(string subscriptionId, string resourceGroupName, string mongoClusterName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/mongoClusters/", false); + uri.AppendPath(mongoClusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets information about a mongo cluster. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the mongo cluster. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> GetAsync(string subscriptionId, string resourceGroupName, string mongoClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, mongoClusterName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MongoClusterData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MongoClusterData.DeserializeMongoClusterData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MongoClusterData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets information about a mongo cluster. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the mongo cluster. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Get(string subscriptionId, string resourceGroupName, string mongoClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + + using var message = CreateGetRequest(subscriptionId, resourceGroupName, mongoClusterName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MongoClusterData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MongoClusterData.DeserializeMongoClusterData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((MongoClusterData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteRequest(string subscriptionId, string resourceGroupName, string mongoClusterName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/mongoClusters/", false); + uri.AppendPath(mongoClusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a mongo cluster. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the mongo cluster. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task DeleteAsync(string subscriptionId, string resourceGroupName, string mongoClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, mongoClusterName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a mongo cluster. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the mongo cluster. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Delete(string subscriptionId, string resourceGroupName, string mongoClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + + using var message = CreateDeleteRequest(subscriptionId, resourceGroupName, mongoClusterName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateUpdateRequest(string subscriptionId, string resourceGroupName, string mongoClusterName, MongoClusterPatch patch) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Patch; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/mongoClusters/", false); + uri.AppendPath(mongoClusterName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(patch); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Updates an existing mongo cluster. The request body can contain one to many of the properties present in the normal mongo cluster definition. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the mongo cluster. + /// The parameters for updating a mongo cluster. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task UpdateAsync(string subscriptionId, string resourceGroupName, string mongoClusterName, MongoClusterPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, mongoClusterName, patch); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Updates an existing mongo cluster. The request body can contain one to many of the properties present in the normal mongo cluster definition. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the mongo cluster. + /// The parameters for updating a mongo cluster. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response Update(string subscriptionId, string resourceGroupName, string mongoClusterName, MongoClusterPatch patch, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + Argument.AssertNotNull(patch, nameof(patch)); + + using var message = CreateUpdateRequest(subscriptionId, resourceGroupName, mongoClusterName, patch); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCreateOrUpdateFirewallRuleRequest(string subscriptionId, string resourceGroupName, string mongoClusterName, string firewallRuleName, CosmosDBFirewallRuleData data) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Put; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/mongoClusters/", false); + uri.AppendPath(mongoClusterName, true); + uri.AppendPath("/firewallRules/", false); + uri.AppendPath(firewallRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(data); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Creates a new firewall rule or updates an existing firewall rule on a mongo cluster. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the mongo cluster. + /// The name of the mongo cluster firewall rule. + /// The required parameters for creating or updating a firewall rule. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task CreateOrUpdateFirewallRuleAsync(string subscriptionId, string resourceGroupName, string mongoClusterName, string firewallRuleName, CosmosDBFirewallRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateFirewallRuleRequest(subscriptionId, resourceGroupName, mongoClusterName, firewallRuleName, data); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Creates a new firewall rule or updates an existing firewall rule on a mongo cluster. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the mongo cluster. + /// The name of the mongo cluster firewall rule. + /// The required parameters for creating or updating a firewall rule. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response CreateOrUpdateFirewallRule(string subscriptionId, string resourceGroupName, string mongoClusterName, string firewallRuleName, CosmosDBFirewallRuleData data, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + Argument.AssertNotNull(data, nameof(data)); + + using var message = CreateCreateOrUpdateFirewallRuleRequest(subscriptionId, resourceGroupName, mongoClusterName, firewallRuleName, data); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 201: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateDeleteFirewallRuleRequest(string subscriptionId, string resourceGroupName, string mongoClusterName, string firewallRuleName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Delete; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/mongoClusters/", false); + uri.AppendPath(mongoClusterName, true); + uri.AppendPath("/firewallRules/", false); + uri.AppendPath(firewallRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Deletes a mongo cluster firewall rule. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the mongo cluster. + /// The name of the mongo cluster firewall rule. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task DeleteFirewallRuleAsync(string subscriptionId, string resourceGroupName, string mongoClusterName, string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var message = CreateDeleteFirewallRuleRequest(subscriptionId, resourceGroupName, mongoClusterName, firewallRuleName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Deletes a mongo cluster firewall rule. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the mongo cluster. + /// The name of the mongo cluster firewall rule. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response DeleteFirewallRule(string subscriptionId, string resourceGroupName, string mongoClusterName, string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var message = CreateDeleteFirewallRuleRequest(subscriptionId, resourceGroupName, mongoClusterName, firewallRuleName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 202: + case 204: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateGetFirewallRuleRequest(string subscriptionId, string resourceGroupName, string mongoClusterName, string firewallRuleName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/mongoClusters/", false); + uri.AppendPath(mongoClusterName, true); + uri.AppendPath("/firewallRules/", false); + uri.AppendPath(firewallRuleName, true); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// Gets information about a mongo cluster firewall rule. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the mongo cluster. + /// The name of the mongo cluster firewall rule. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task> GetFirewallRuleAsync(string subscriptionId, string resourceGroupName, string mongoClusterName, string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var message = CreateGetFirewallRuleRequest(subscriptionId, resourceGroupName, mongoClusterName, firewallRuleName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CosmosDBFirewallRuleData value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CosmosDBFirewallRuleData.DeserializeCosmosDBFirewallRuleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((CosmosDBFirewallRuleData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + /// Gets information about a mongo cluster firewall rule. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the mongo cluster. + /// The name of the mongo cluster firewall rule. + /// The cancellation token to use. + /// , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response GetFirewallRule(string subscriptionId, string resourceGroupName, string mongoClusterName, string firewallRuleName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + Argument.AssertNotNullOrEmpty(firewallRuleName, nameof(firewallRuleName)); + + using var message = CreateGetFirewallRuleRequest(subscriptionId, resourceGroupName, mongoClusterName, firewallRuleName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CosmosDBFirewallRuleData value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CosmosDBFirewallRuleData.DeserializeCosmosDBFirewallRuleData(document.RootElement); + return Response.FromValue(value, message.Response); + } + case 404: + return Response.FromValue((CosmosDBFirewallRuleData)null, message.Response); + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListFirewallRulesRequest(string subscriptionId, string resourceGroupName, string mongoClusterName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/mongoClusters/", false); + uri.AppendPath(mongoClusterName, true); + uri.AppendPath("/firewallRules", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List all the firewall rules in a given mongo cluster. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the mongo cluster. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListFirewallRulesAsync(string subscriptionId, string resourceGroupName, string mongoClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + + using var message = CreateListFirewallRulesRequest(subscriptionId, resourceGroupName, mongoClusterName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FirewallRuleListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FirewallRuleListResult.DeserializeFirewallRuleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all the firewall rules in a given mongo cluster. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the mongo cluster. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListFirewallRules(string subscriptionId, string resourceGroupName, string mongoClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + + using var message = CreateListFirewallRulesRequest(subscriptionId, resourceGroupName, mongoClusterName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FirewallRuleListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FirewallRuleListResult.DeserializeFirewallRuleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateCheckNameAvailabilityRequest(string subscriptionId, AzureLocation location, CheckCosmosDBNameAvailabilityContent content) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/locations/", false); + uri.AppendPath(location, true); + uri.AppendPath("/checkMongoClusterNameAvailability", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content0 = new Utf8JsonRequestContent(); + content0.JsonWriter.WriteObjectValue(content); + request.Content = content0; + _userAgent.Apply(message); + return message; + } + + /// Check the availability of name for resource. + /// The ID of the target subscription. + /// The name of the Azure region. + /// The required parameters for checking if resource name is available. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> CheckNameAvailabilityAsync(string subscriptionId, AzureLocation location, CheckCosmosDBNameAvailabilityContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateCheckNameAvailabilityRequest(subscriptionId, location, content); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + CheckCosmosDBNameAvailabilityResponse value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = CheckCosmosDBNameAvailabilityResponse.DeserializeCheckCosmosDBNameAvailabilityResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// Check the availability of name for resource. + /// The ID of the target subscription. + /// The name of the Azure region. + /// The required parameters for checking if resource name is available. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response CheckNameAvailability(string subscriptionId, AzureLocation location, CheckCosmosDBNameAvailabilityContent content, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNull(content, nameof(content)); + + using var message = CreateCheckNameAvailabilityRequest(subscriptionId, location, content); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + CheckCosmosDBNameAvailabilityResponse value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = CheckCosmosDBNameAvailabilityResponse.DeserializeCheckCosmosDBNameAvailabilityResponse(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListConnectionStringsRequest(string subscriptionId, string resourceGroupName, string mongoClusterName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/mongoClusters/", false); + uri.AppendPath(mongoClusterName, true); + uri.AppendPath("/listConnectionStrings", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List mongo cluster connection strings. This includes the default connection string using SCRAM-SHA-256, as well as other connection strings supported by the cluster. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the mongo cluster. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListConnectionStringsAsync(string subscriptionId, string resourceGroupName, string mongoClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + + using var message = CreateListConnectionStringsRequest(subscriptionId, resourceGroupName, mongoClusterName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + ListConnectionStringsResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = ListConnectionStringsResult.DeserializeListConnectionStringsResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List mongo cluster connection strings. This includes the default connection string using SCRAM-SHA-256, as well as other connection strings supported by the cluster. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the mongo cluster. + /// The cancellation token to use. + /// , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListConnectionStrings(string subscriptionId, string resourceGroupName, string mongoClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + + using var message = CreateListConnectionStringsRequest(subscriptionId, resourceGroupName, mongoClusterName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + ListConnectionStringsResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = ListConnectionStringsResult.DeserializeListConnectionStringsResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListNextPageRequest(string nextLink, string subscriptionId) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List all the mongo clusters in a given subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public async Task> ListNextPageAsync(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MongoClusterListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MongoClusterListResult.DeserializeMongoClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all the mongo clusters in a given subscription. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The cancellation token to use. + /// or is null. + /// is an empty string, and was expected to be non-empty. + public Response ListNextPage(string nextLink, string subscriptionId, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + + using var message = CreateListNextPageRequest(nextLink, subscriptionId); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MongoClusterListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MongoClusterListResult.DeserializeMongoClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListByResourceGroupNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List all the mongo clusters in a given resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public async Task> ListByResourceGroupNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + MongoClusterListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = MongoClusterListResult.DeserializeMongoClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all the mongo clusters in a given resource group. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The cancellation token to use. + /// , or is null. + /// or is an empty string, and was expected to be non-empty. + public Response ListByResourceGroupNextPage(string nextLink, string subscriptionId, string resourceGroupName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + + using var message = CreateListByResourceGroupNextPageRequest(nextLink, subscriptionId, resourceGroupName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + MongoClusterListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = MongoClusterListResult.DeserializeMongoClusterListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + internal HttpMessage CreateListFirewallRulesNextPageRequest(string nextLink, string subscriptionId, string resourceGroupName, string mongoClusterName) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Get; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendRawNextLink(nextLink, false); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + _userAgent.Apply(message); + return message; + } + + /// List all the firewall rules in a given mongo cluster. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the mongo cluster. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public async Task> ListFirewallRulesNextPageAsync(string nextLink, string subscriptionId, string resourceGroupName, string mongoClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + + using var message = CreateListFirewallRulesNextPageRequest(nextLink, subscriptionId, resourceGroupName, mongoClusterName); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + { + FirewallRuleListResult value = default; + using var document = await JsonDocument.ParseAsync(message.Response.ContentStream, default, cancellationToken).ConfigureAwait(false); + value = FirewallRuleListResult.DeserializeFirewallRuleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + + /// List all the firewall rules in a given mongo cluster. + /// The URL to the next page of results. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// The name of the mongo cluster. + /// The cancellation token to use. + /// , , or is null. + /// , or is an empty string, and was expected to be non-empty. + public Response ListFirewallRulesNextPage(string nextLink, string subscriptionId, string resourceGroupName, string mongoClusterName, CancellationToken cancellationToken = default) + { + Argument.AssertNotNull(nextLink, nameof(nextLink)); + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(mongoClusterName, nameof(mongoClusterName)); + + using var message = CreateListFirewallRulesNextPageRequest(nextLink, subscriptionId, resourceGroupName, mongoClusterName); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + { + FirewallRuleListResult value = default; + using var document = JsonDocument.Parse(message.Response.ContentStream); + value = FirewallRuleListResult.DeserializeFirewallRuleListResult(document.RootElement); + return Response.FromValue(value, message.Response); + } + default: + throw new RequestFailedException(message.Response); + } + } + } +} diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/MongoDBResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/MongoDBResourcesRestOperations.cs index 7e80ec97eed2d..69a75d483635d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/MongoDBResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/MongoDBResourcesRestOperations.cs @@ -33,7 +33,7 @@ public MongoDBResourcesRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -1393,6 +1393,91 @@ public Response DeleteMongoDBCollection(string subscriptionId, string resourceGr } } + internal HttpMessage CreateMongoDBDatabasePartitionMergeRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, MergeParameters mergeParameters) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/mongodbDatabases/", false); + uri.AppendPath(databaseName, true); + uri.AppendPath("/partitionMerge", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(mergeParameters); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Merges the partitions of a MongoDB database. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// Cosmos DB database name. + /// The parameters for the merge operation. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task MongoDBDatabasePartitionMergeAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, MergeParameters mergeParameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); + + using var message = CreateMongoDBDatabasePartitionMergeRequest(subscriptionId, resourceGroupName, accountName, databaseName, mergeParameters); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Merges the partitions of a MongoDB database. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// Cosmos DB database name. + /// The parameters for the merge operation. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response MongoDBDatabasePartitionMerge(string subscriptionId, string resourceGroupName, string accountName, string databaseName, MergeParameters mergeParameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); + + using var message = CreateMongoDBDatabasePartitionMergeRequest(subscriptionId, resourceGroupName, accountName, databaseName, mergeParameters); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal HttpMessage CreateListMongoDBCollectionPartitionMergeRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string collectionName, MergeParameters mergeParameters) { var message = _pipeline.CreateMessage(); diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRegionRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRegionRestOperations.cs index b0f5892204180..1607261b398fe 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRegionRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRegionRestOperations.cs @@ -33,7 +33,7 @@ public PartitionKeyRangeIdRegionRestOperations(HttpPipeline pipeline, string app { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRestOperations.cs index 1e2213e8816a0..177d359f1c60b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PartitionKeyRangeIdRestOperations.cs @@ -33,7 +33,7 @@ public PartitionKeyRangeIdRestOperations(HttpPipeline pipeline, string applicati { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileRestOperations.cs index ef4c20030e566..fe8c0295e1a53 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileRestOperations.cs @@ -33,7 +33,7 @@ public PercentileRestOperations(HttpPipeline pipeline, string applicationId, Uri { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileSourceTargetRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileSourceTargetRestOperations.cs index 489380d3c4d3d..5d02a7093ad55 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileSourceTargetRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileSourceTargetRestOperations.cs @@ -33,7 +33,7 @@ public PercentileSourceTargetRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileTargetRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileTargetRestOperations.cs index 8d7bddbfeaf1e..029de11d05542 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileTargetRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PercentileTargetRestOperations.cs @@ -33,7 +33,7 @@ public PercentileTargetRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs index e3cc5a5a56b7b..c8a01377f74fb 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateEndpointConnectionsRestOperations.cs @@ -33,7 +33,7 @@ public PrivateEndpointConnectionsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs index 5a51cf2d501a8..24bbecd7632e6 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/PrivateLinkResourcesRestOperations.cs @@ -33,7 +33,7 @@ public PrivateLinkResourcesRestOperations(HttpPipeline pipeline, string applicat { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableDatabaseAccountsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableDatabaseAccountsRestOperations.cs index 94ab83913e516..293020c2d546e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableDatabaseAccountsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableDatabaseAccountsRestOperations.cs @@ -33,7 +33,7 @@ public RestorableDatabaseAccountsRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinDatabasesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinDatabasesRestOperations.cs index 5957150bc364e..b166e21aaf661 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinDatabasesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinDatabasesRestOperations.cs @@ -33,7 +33,7 @@ public RestorableGremlinDatabasesRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinGraphsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinGraphsRestOperations.cs index 30a7709d5bf39..b7261e1edf3f3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinGraphsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinGraphsRestOperations.cs @@ -33,7 +33,7 @@ public RestorableGremlinGraphsRestOperations(HttpPipeline pipeline, string appli { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinResourcesRestOperations.cs index f5477df3119ab..491e0a52c006d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableGremlinResourcesRestOperations.cs @@ -33,7 +33,7 @@ public RestorableGremlinResourcesRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbCollectionsRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbCollectionsRestOperations.cs index 0d269b148b528..5c3591f4fd5d2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbCollectionsRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbCollectionsRestOperations.cs @@ -33,7 +33,7 @@ public RestorableMongodbCollectionsRestOperations(HttpPipeline pipeline, string { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbDatabasesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbDatabasesRestOperations.cs index 4edc279baf855..d95a8e3e45bb0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbDatabasesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbDatabasesRestOperations.cs @@ -33,7 +33,7 @@ public RestorableMongodbDatabasesRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbResourcesRestOperations.cs index 4c3d60ab4a01c..a928d5461714d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableMongodbResourcesRestOperations.cs @@ -33,7 +33,7 @@ public RestorableMongodbResourcesRestOperations(HttpPipeline pipeline, string ap { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlContainersRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlContainersRestOperations.cs index 8407093516af3..efc9633c797f5 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlContainersRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlContainersRestOperations.cs @@ -33,7 +33,7 @@ public RestorableSqlContainersRestOperations(HttpPipeline pipeline, string appli { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlDatabasesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlDatabasesRestOperations.cs index 6d25b16e1bbf8..789a9361823a5 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlDatabasesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlDatabasesRestOperations.cs @@ -33,7 +33,7 @@ public RestorableSqlDatabasesRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlResourcesRestOperations.cs index 32591c101458d..3ff217dd2a69e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableSqlResourcesRestOperations.cs @@ -33,7 +33,7 @@ public RestorableSqlResourcesRestOperations(HttpPipeline pipeline, string applic { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTableResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTableResourcesRestOperations.cs index ffde6bbca0e3e..b53887e11b4ef 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTableResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTableResourcesRestOperations.cs @@ -33,7 +33,7 @@ public RestorableTableResourcesRestOperations(HttpPipeline pipeline, string appl { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTablesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTablesRestOperations.cs index 5b22c8a2bfc9b..e925ee574e565 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTablesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/RestorableTablesRestOperations.cs @@ -33,7 +33,7 @@ public RestorableTablesRestOperations(HttpPipeline pipeline, string applicationI { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ServiceRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ServiceRestOperations.cs index 0b8419aeaa4bf..80ed56e4796ce 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ServiceRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/ServiceRestOperations.cs @@ -33,7 +33,7 @@ public ServiceRestOperations(HttpPipeline pipeline, string applicationId, Uri en { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/SqlResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/SqlResourcesRestOperations.cs index 57cc9178230b7..f8bea3d172d40 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/SqlResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/SqlResourcesRestOperations.cs @@ -33,7 +33,7 @@ public SqlResourcesRestOperations(HttpPipeline pipeline, string applicationId, U { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } @@ -1310,6 +1310,91 @@ public Response DeleteSqlContainer(string subscriptionId, string resourceGroupNa } } + internal HttpMessage CreateSqlDatabasePartitionMergeRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, MergeParameters mergeParameters) + { + var message = _pipeline.CreateMessage(); + var request = message.Request; + request.Method = RequestMethod.Post; + var uri = new RawRequestUriBuilder(); + uri.Reset(_endpoint); + uri.AppendPath("/subscriptions/", false); + uri.AppendPath(subscriptionId, true); + uri.AppendPath("/resourceGroups/", false); + uri.AppendPath(resourceGroupName, true); + uri.AppendPath("/providers/Microsoft.DocumentDB/databaseAccounts/", false); + uri.AppendPath(accountName, true); + uri.AppendPath("/sqlDatabases/", false); + uri.AppendPath(databaseName, true); + uri.AppendPath("/partitionMerge", false); + uri.AppendQuery("api-version", _apiVersion, true); + request.Uri = uri; + request.Headers.Add("Accept", "application/json"); + request.Headers.Add("Content-Type", "application/json"); + var content = new Utf8JsonRequestContent(); + content.JsonWriter.WriteObjectValue(mergeParameters); + request.Content = content; + _userAgent.Apply(message); + return message; + } + + /// Merges the partitions of a SQL database. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// Cosmos DB database name. + /// The parameters for the merge operation. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public async Task SqlDatabasePartitionMergeAsync(string subscriptionId, string resourceGroupName, string accountName, string databaseName, MergeParameters mergeParameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); + + using var message = CreateSqlDatabasePartitionMergeRequest(subscriptionId, resourceGroupName, accountName, databaseName, mergeParameters); + await _pipeline.SendAsync(message, cancellationToken).ConfigureAwait(false); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + + /// Merges the partitions of a SQL database. + /// The ID of the target subscription. + /// The name of the resource group. The name is case insensitive. + /// Cosmos DB database account name. + /// Cosmos DB database name. + /// The parameters for the merge operation. + /// The cancellation token to use. + /// , , , or is null. + /// , , or is an empty string, and was expected to be non-empty. + public Response SqlDatabasePartitionMerge(string subscriptionId, string resourceGroupName, string accountName, string databaseName, MergeParameters mergeParameters, CancellationToken cancellationToken = default) + { + Argument.AssertNotNullOrEmpty(subscriptionId, nameof(subscriptionId)); + Argument.AssertNotNullOrEmpty(resourceGroupName, nameof(resourceGroupName)); + Argument.AssertNotNullOrEmpty(accountName, nameof(accountName)); + Argument.AssertNotNullOrEmpty(databaseName, nameof(databaseName)); + Argument.AssertNotNull(mergeParameters, nameof(mergeParameters)); + + using var message = CreateSqlDatabasePartitionMergeRequest(subscriptionId, resourceGroupName, accountName, databaseName, mergeParameters); + _pipeline.Send(message, cancellationToken); + switch (message.Response.Status) + { + case 200: + case 202: + return message.Response; + default: + throw new RequestFailedException(message.Response); + } + } + internal HttpMessage CreateListSqlContainerPartitionMergeRequest(string subscriptionId, string resourceGroupName, string accountName, string databaseName, string containerName, MergeParameters mergeParameters) { var message = _pipeline.CreateMessage(); diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/TableResourcesRestOperations.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/TableResourcesRestOperations.cs index 1bb9482137ddb..0ace58f3fc9ec 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/TableResourcesRestOperations.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestOperations/TableResourcesRestOperations.cs @@ -33,7 +33,7 @@ public TableResourcesRestOperations(HttpPipeline pipeline, string applicationId, { _pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline)); _endpoint = endpoint ?? new Uri("https://management.azure.com"); - _apiVersion = apiVersion ?? "2022-11-15-preview"; + _apiVersion = apiVersion ?? "2023-03-15-preview"; _userAgent = new TelemetryDetails(GetType().Assembly, applicationId); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md index 7e457e0fa9283..c9c63b4187db8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md @@ -9,14 +9,13 @@ azure-arm: true csharp: true library-name: CosmosDB namespace: Azure.ResourceManager.CosmosDB -require: https://github.com/Azure/azure-rest-api-specs/blob/c1bf995dbab472761ba4da53ed33c7b621ff8bd9/specification/cosmos-db/resource-manager/readme.md -tag: package-preview-2022-11 +require: https://github.com/Azure/azure-rest-api-specs/blob/44e83346defd3d4ca99efade8b1ee90c67d9f249/specification/cosmos-db/resource-manager/readme.md output-folder: $(this-folder)/Generated clear-output-folder: true skip-csproj: true modelerfour: flatten-payloads: false - + lenient-model-deduplication: true # mgmt-debug: # show-serialized-names: true @@ -120,6 +119,7 @@ override-operation-name: RestorableMongodbCollections_List: GetRestorableMongoDBCollections RestorableMongodbResources_List: GetAllRestorableMongoDBResourceData RestorableSqlResources_List: GetAllRestorableSqlResourceData + MongoClusters_CheckNameAvailability: CheckMongoClusterNameAailability rename-mapping: MongoRoleDefinitionGetResults: MongoDBRoleDefinition @@ -301,6 +301,11 @@ rename-mapping: PrivilegeResource.db: DBName MinimalTlsVersion: CosmosDBMinimalTlsVersion BackupResource: CassandraClusterBackupResource + CheckNameAvailabilityRequest: CheckCosmosDBNameAvailabilityContent + CheckNameAvailabilityResponse: CheckCosmosDBNameAvailabilityResponse + CheckNameAvailabilityReason: CosmosDBNameUnavailableReason + NodeGroupProperties.diskSizeGB: DiskSizeInGB + prepend-rp-prefix: - UniqueKey @@ -335,6 +340,11 @@ prepend-rp-prefix: - PublicNetworkAccess - SpatialType - ContainerPartitionKey +- FirewallRule +- Status +- ProvisioningState +- Type +- ConnectionString models-to-treat-empty-string-as-null: - CosmosDBAccountData @@ -377,6 +387,7 @@ directive: $.MetricDefinition.properties.resourceUri['x-ms-client-name'] = 'ResourceId'; $.MetricDefinition.properties.resourceUri['x-ms-format'] = 'arm-id'; $.VirtualNetworkRule.properties.id['x-ms-format'] = 'arm-id'; + $.DatabaseAccountConnectionString.properties.type['x-ms-client-name'] = 'KeyType'; # add a missing response code for long running operation. an issue was filed on swagger: https://github.com/Azure/azure-rest-api-specs/issues/16508 - from: swagger-document where: $.paths['/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.DocumentDB/databaseAccounts/{accountName}/notebookWorkspaces/{notebookWorkspaceName}'].put diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/tests/CosmosDBManagementClientBase.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/tests/CosmosDBManagementClientBase.cs index 7d71e00c7f48f..addb356fe81ca 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/tests/CosmosDBManagementClientBase.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/tests/CosmosDBManagementClientBase.cs @@ -59,7 +59,7 @@ protected async Task CreateDatabaseAccount(string name, return await CreateDatabaseAccount(name, kind, null, enableContinuousModeBackup); } - protected async Task CreateDatabaseAccount(string name, CosmosDBAccountKind kind, List capabilities, bool enableContinuousModeBackup = false) + protected async Task CreateDatabaseAccount(string name, CosmosDBAccountKind kind, List capabilities, bool enableContinuousModeBackup = false, bool enablePartitionMerge = false) { var locations = new List() { @@ -93,7 +93,7 @@ protected async Task CreateDatabaseAccount(string name, { capabilities.ForEach(x => createParameters.Capabilities.Add(x)); } - + createParameters.EnablePartitionMerge = enablePartitionMerge; createParameters.Tags.Add("key1", "value1"); createParameters.Tags.Add("key2", "value2"); _databaseAccountName = name; diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/tests/ScenarioTests/DatabaseAccountTests.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/tests/ScenarioTests/DatabaseAccountTests.cs index c2b7890538574..9eff3f9ab3b40 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/tests/ScenarioTests/DatabaseAccountTests.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/tests/ScenarioTests/DatabaseAccountTests.cs @@ -149,6 +149,12 @@ public async Task DatabaseAccountListConnectionStringsTest() var connectionStrings = await account.GetConnectionStringsAsync().ToEnumerableAsync(); Assert.That(connectionStrings, Has.Count.EqualTo(4)); + + foreach (var item in connectionStrings) + { + Assert.IsNotNull(item.KeyKind); + Assert.IsNotNull(item.KeyType); + } } [Test] diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/tests/ScenarioTests/SqlPartitionMergeTests.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/tests/ScenarioTests/SqlPartitionMergeTests.cs new file mode 100644 index 0000000000000..be66996c303d6 --- /dev/null +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/tests/ScenarioTests/SqlPartitionMergeTests.cs @@ -0,0 +1,111 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Linq; +using System.Threading; +using System.Threading.Tasks; +using Azure.Core; +using Azure.Core.TestFramework; +using Azure.ResourceManager.CosmosDB.Models; +using Azure.ResourceManager.Models; +using NUnit.Framework; + +namespace Azure.ResourceManager.CosmosDB.Tests +{ + internal class SqlPartitionMergeTests : CosmosDBManagementClientBase + { + private ResourceIdentifier _databaseAccountIdentifier; + private CosmosDBAccountResource _databaseAccount; + + private string _databaseName; + + public SqlPartitionMergeTests(bool isAsync) : base(isAsync) + { + } + + protected CosmosDBSqlDatabaseCollection SqlDatabaseContainer => _databaseAccount.GetCosmosDBSqlDatabases(); + + [OneTimeSetUp] + public async Task GlobalSetup() + { + _resourceGroup = await GlobalClient.GetResourceGroupResource(_resourceGroupIdentifier).GetAsync(); + //BackupPolicy = new ContinuousModeBackupPolicy() + _databaseAccountIdentifier = (await CreateDatabaseAccount(SessionRecording.GenerateAssetName("dbaccount-"), CosmosDBAccountKind.GlobalDocumentDB, null, enablePartitionMerge:true)).Id; + await StopSessionRecordingAsync(); + } + + [OneTimeTearDown] + public async Task GlobalTeardown() + { + if (_databaseAccountIdentifier != null) + { + await ArmClient.GetCosmosDBAccountResource(_databaseAccountIdentifier).DeleteAsync(WaitUntil.Completed); + } + } + + [SetUp] + public async Task SetUp() + { + _databaseAccount = await ArmClient.GetCosmosDBAccountResource(_databaseAccountIdentifier).GetAsync(); + } + + [TearDown] + public async Task TearDown() + { + if (await SqlDatabaseContainer.ExistsAsync(_databaseName)) + { + var id = SqlDatabaseContainer.Id; + id = CosmosDBSqlDatabaseResource.CreateResourceIdentifier(id.SubscriptionId, id.ResourceGroupName, id.Name, _databaseName); + CosmosDBSqlDatabaseResource database = this.ArmClient.GetCosmosDBSqlDatabaseResource(id); + await database.DeleteAsync(WaitUntil.Completed); + } + } + + [Test] + //[RecordedTest] + public async Task SqlDatabasePartitionMerge() + { + var database = await CreateSqlDatabase(new AutoscaleSettings() + { + MaxThroughput = 12000, + }); + + //update throughput to lower value. + CosmosDBSqlDatabaseThroughputSettingResource throughput = await database.GetCosmosDBSqlDatabaseThroughputSetting().GetAsync(); + ThroughputSettingData throughputData = (await throughput.MigrateSqlDatabaseToManualThroughputAsync(WaitUntil.Completed)).Value.Data; + throughput = await database.GetCosmosDBSqlDatabaseThroughputSetting().GetAsync(); + CosmosDBSqlDatabaseThroughputSettingResource throughput2 = (await throughput.CreateOrUpdateAsync(WaitUntil.Completed, new ThroughputSettingsUpdateData(AzureLocation.WestUS, + new ThroughputSettingsResourceInfo(1000, null, null, null)))).Value; + + MergeParameters mergeParameters = new MergeParameters() { IsDryRun = true }; + try + { + PhysicalPartitionStorageInfoCollection physicalPartitionCollection = (await database.SqlDatabasePartitionMergeAsync(WaitUntil.Completed, mergeParameters)).Value; + Assert.IsTrue(physicalPartitionCollection.PhysicalPartitionStorageInfoCollectionValue.Count > 1); + } + catch (Exception e) + { + Assert.IsTrue(e.Message.Contains("Merge operation feature is not available/enabled")); + } + } + + internal async Task CreateSqlDatabase(AutoscaleSettings autoscale) + { + _databaseName = Recording.GenerateAssetName("sql-db-"); + return await CreateSqlDatabase(_databaseName, autoscale, _databaseAccount.GetCosmosDBSqlDatabases()); + } + + internal static async Task CreateSqlDatabase(string name, AutoscaleSettings autoscale, CosmosDBSqlDatabaseCollection collection) + { + var sqlDatabaseCreateUpdateOptions = new CosmosDBSqlDatabaseCreateOrUpdateContent(AzureLocation.WestUS, + new Models.CosmosDBSqlDatabaseResourceInfo(name)) + { + Options = BuildDatabaseCreateUpdateOptions(TestThroughput1, autoscale), + }; + var databaseLro = await collection.CreateOrUpdateAsync(WaitUntil.Completed, name, sqlDatabaseCreateUpdateOptions); + return databaseLro.Value; + } + } +}