From ed610543cfe7ab9865080337494b651d9c69deb5 Mon Sep 17 00:00:00 2001 From: Himanshu Sunil Dhawale Date: Mon, 24 Jul 2023 15:59:07 -0700 Subject: [PATCH] resolving comments --- .../src/ApiCompatBaseline.txt | 1 - .../src/Generated/ArmCosmosDBModelFactory.cs | 8 +-- .../src/Generated/FirewallRuleData.cs | 4 +- ...DBAccountConnectionString.Serialization.cs | 4 +- .../Models/CosmosDBAccountConnectionString.cs | 4 +- ...osmosDBLocationProperties.Serialization.cs | 4 +- .../Models/CosmosDBLocationProperties.cs | 4 +- .../Models/CosmosDBProvisioningState.cs | 63 +++++++++++++++++++ .../src/Generated/Models/CosmosDBStatus.cs | 60 ++++++++++++++++++ .../Models/{Type.cs => CosmosDBType.cs} | 40 ++++++------ .../Models/FirewallRuleData.Serialization.cs | 4 +- .../Models/MongoClusterData.Serialization.cs | 4 +- .../src/Generated/Models/MongoClusterPatch.cs | 2 +- .../src/Generated/Models/ProvisioningState.cs | 63 ------------------- .../src/Generated/Models/Status.cs | 60 ------------------ .../src/Generated/MongoClusterData.cs | 4 +- .../src/autorest.md | 5 ++ .../ScenarioTests/SqlPartitionMergeTests.cs | 2 +- .../AzSdk.RP.props | 2 +- .../src/Generated/CosmosDBManagementClient.cs | 2 +- 20 files changed, 172 insertions(+), 168 deletions(-) delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/ApiCompatBaseline.txt create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBProvisioningState.cs create mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBStatus.cs rename sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/{Type.cs => CosmosDBType.cs} (50%) delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningState.cs delete mode 100644 sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Status.cs diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/ApiCompatBaseline.txt b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/ApiCompatBaseline.txt deleted file mode 100644 index fcc74cf8643c5..0000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/ApiCompatBaseline.txt +++ /dev/null @@ -1 +0,0 @@ -Total Issues: 0 diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ArmCosmosDBModelFactory.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ArmCosmosDBModelFactory.cs index 9b555d8220e50..f21a1e90f4c3e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ArmCosmosDBModelFactory.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ArmCosmosDBModelFactory.cs @@ -235,7 +235,7 @@ public static CosmosDBAccountReadOnlyKeyList CosmosDBAccountReadOnlyKeyList(stri /// 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, CosmosDBKind? keyKind = null, Type? keyType = null) + public static CosmosDBAccountConnectionString CosmosDBAccountConnectionString(string connectionString = null, string description = null, CosmosDBKind? keyKind = null, CosmosDBType? keyType = null) { return new CosmosDBAccountConnectionString(connectionString, description, keyKind, keyType); } @@ -1248,7 +1248,7 @@ public static CosmosDBLocationData CosmosDBLocationData(ResourceIdentifier id = /// 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(bool? doesSupportAvailabilityZone = null, bool? isResidencyRestricted = null, IEnumerable backupStorageRedundancies = null, bool? isSubscriptionRegionAccessAllowedForRegular = null, bool? isSubscriptionRegionAccessAllowedForAz = null, Status? status = 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(); @@ -1579,7 +1579,7 @@ public static CassandraClusterDataCenterNodeItem CassandraClusterDataCenterNodeI /// 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, ProvisioningState? provisioningState = null, MongoClusterStatus? clusterStatus = null, IEnumerable nodeGroupSpecs = null) + 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(); @@ -1596,7 +1596,7 @@ public static MongoClusterData MongoClusterData(ResourceIdentifier id = null, st /// 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 FirewallRuleData FirewallRuleData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, ProvisioningState? provisioningState = null, string startIPAddress = null, string endIPAddress = null) + public static FirewallRuleData FirewallRuleData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, CosmosDBProvisioningState? provisioningState = null, string startIPAddress = null, string endIPAddress = null) { return new FirewallRuleData(id, name, resourceType, systemData, provisioningState, startIPAddress, endIPAddress); } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FirewallRuleData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FirewallRuleData.cs index 56cf18243fc37..3f61cf85b2409 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FirewallRuleData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/FirewallRuleData.cs @@ -39,7 +39,7 @@ public FirewallRuleData(string startIPAddress, string endIPAddress) /// 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 FirewallRuleData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, ProvisioningState? provisioningState, string startIPAddress, string endIPAddress) : base(id, name, resourceType, systemData) + internal FirewallRuleData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, CosmosDBProvisioningState? provisioningState, string startIPAddress, string endIPAddress) : base(id, name, resourceType, systemData) { ProvisioningState = provisioningState; StartIPAddress = startIPAddress; @@ -47,7 +47,7 @@ internal FirewallRuleData(ResourceIdentifier id, string name, ResourceType resou } /// The provisioning state of the firewall rule. - public ProvisioningState? ProvisioningState { get; } + 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. 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 cee5796086a7e..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 @@ -21,7 +21,7 @@ internal static CosmosDBAccountConnectionString DeserializeCosmosDBAccountConnec Optional connectionString = default; Optional description = default; Optional keyKind = default; - Optional type = default; + Optional type = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("connectionString"u8)) @@ -49,7 +49,7 @@ internal static CosmosDBAccountConnectionString DeserializeCosmosDBAccountConnec { continue; } - type = new Type(property.Value.GetString()); + type = new CosmosDBType(property.Value.GetString()); continue; } } 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 10c8afeacc8cb..8b2136134f3f8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountConnectionString.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountConnectionString.cs @@ -20,7 +20,7 @@ internal CosmosDBAccountConnectionString() /// Description of the connection string. /// Kind of the connection string key. /// Type of the connection string. - internal CosmosDBAccountConnectionString(string connectionString, string description, CosmosDBKind? keyKind, Type? keyType) + internal CosmosDBAccountConnectionString(string connectionString, string description, CosmosDBKind? keyKind, CosmosDBType? keyType) { ConnectionString = connectionString; Description = description; @@ -35,6 +35,6 @@ internal CosmosDBAccountConnectionString(string connectionString, string descrip /// Kind of the connection string key. public CosmosDBKind? KeyKind { get; } /// Type of the connection string. - public Type? KeyType { get; } + public CosmosDBType? KeyType { get; } } } 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 89558654cc31a..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 @@ -30,7 +30,7 @@ internal static CosmosDBLocationProperties DeserializeCosmosDBLocationProperties Optional> backupStorageRedundancies = default; Optional isSubscriptionRegionAccessAllowedForRegular = default; Optional isSubscriptionRegionAccessAllowedForAz = default; - Optional status = default; + Optional status = default; foreach (var property in element.EnumerateObject()) { if (property.NameEquals("supportsAvailabilityZone"u8)) @@ -89,7 +89,7 @@ internal static CosmosDBLocationProperties DeserializeCosmosDBLocationProperties { continue; } - status = new Status(property.Value.GetString()); + status = new CosmosDBStatus(property.Value.GetString()); continue; } } 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 4fa7cd5593091..7620d40f55eeb 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBLocationProperties.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBLocationProperties.cs @@ -26,7 +26,7 @@ public CosmosDBLocationProperties() /// 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, Status? status) + internal CosmosDBLocationProperties(bool? doesSupportAvailabilityZone, bool? isResidencyRestricted, IReadOnlyList backupStorageRedundancies, bool? isSubscriptionRegionAccessAllowedForRegular, bool? isSubscriptionRegionAccessAllowedForAz, CosmosDBStatus? status) { DoesSupportAvailabilityZone = doesSupportAvailabilityZone; IsResidencyRestricted = isResidencyRestricted; @@ -47,6 +47,6 @@ internal CosmosDBLocationProperties(bool? doesSupportAvailabilityZone, bool? isR /// 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 Status? Status { get; } + public CosmosDBStatus? Status { get; } } } 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/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/Type.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBType.cs similarity index 50% rename from sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Type.cs rename to sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBType.cs index ff50b08829a8c..373e5b95128d9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Type.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBType.cs @@ -11,13 +11,13 @@ namespace Azure.ResourceManager.CosmosDB.Models { /// Type of the connection string. - public readonly partial struct Type : IEquatable + public readonly partial struct CosmosDBType : IEquatable { private readonly string _value; - /// Initializes a new instance of . + /// Initializes a new instance of . /// is null. - public Type(string value) + public CosmosDBType(string value) { _value = value ?? throw new ArgumentNullException(nameof(value)); } @@ -33,35 +33,35 @@ public Type(string value) private const string UndefinedValue = "Undefined"; /// Sql. - public static Type Sql { get; } = new Type(SqlValue); + public static CosmosDBType Sql { get; } = new CosmosDBType(SqlValue); /// Table. - public static Type Table { get; } = new Type(TableValue); + public static CosmosDBType Table { get; } = new CosmosDBType(TableValue); /// MongoDB. - public static Type MongoDB { get; } = new Type(MongoDBValue); + public static CosmosDBType MongoDB { get; } = new CosmosDBType(MongoDBValue); /// Cassandra. - public static Type Cassandra { get; } = new Type(CassandraValue); + public static CosmosDBType Cassandra { get; } = new CosmosDBType(CassandraValue); /// CassandraConnectorMetadata. - public static Type CassandraConnectorMetadata { get; } = new Type(CassandraConnectorMetadataValue); + public static CosmosDBType CassandraConnectorMetadata { get; } = new CosmosDBType(CassandraConnectorMetadataValue); /// Gremlin. - public static Type Gremlin { get; } = new Type(GremlinValue); + public static CosmosDBType Gremlin { get; } = new CosmosDBType(GremlinValue); /// SqlDedicatedGateway. - public static Type SqlDedicatedGateway { get; } = new Type(SqlDedicatedGatewayValue); + public static CosmosDBType SqlDedicatedGateway { get; } = new CosmosDBType(SqlDedicatedGatewayValue); /// GremlinV2. - public static Type GremlinV2 { get; } = new Type(GremlinV2Value); + public static CosmosDBType GremlinV2 { get; } = new CosmosDBType(GremlinV2Value); /// Undefined. - public static Type Undefined { get; } = new Type(UndefinedValue); - /// Determines if two values are the same. - public static bool operator ==(Type left, Type right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(Type left, Type right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator Type(string value) => new Type(value); + 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 Type other && Equals(other); + public override bool Equals(object obj) => obj is CosmosDBType other && Equals(other); /// - public bool Equals(Type other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); + public bool Equals(CosmosDBType other) => string.Equals(_value, other._value, StringComparison.InvariantCultureIgnoreCase); /// [EditorBrowsable(EditorBrowsableState.Never)] diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FirewallRuleData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FirewallRuleData.Serialization.cs index 0b0a0e330c93a..d5e3f17e88bdc 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FirewallRuleData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/FirewallRuleData.Serialization.cs @@ -37,7 +37,7 @@ internal static FirewallRuleData DeserializeFirewallRuleData(JsonElement element string name = default; ResourceType type = default; Optional systemData = default; - Optional provisioningState = default; + Optional provisioningState = default; string startIPAddress = default; string endIPAddress = default; foreach (var property in element.EnumerateObject()) @@ -81,7 +81,7 @@ internal static FirewallRuleData DeserializeFirewallRuleData(JsonElement element { continue; } - provisioningState = new ProvisioningState(property0.Value.GetString()); + provisioningState = new CosmosDBProvisioningState(property0.Value.GetString()); continue; } if (property0.NameEquals("startIpAddress"u8)) 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 index 92309de64efb6..ea554cbcd68fb 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoClusterData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoClusterData.Serialization.cs @@ -91,7 +91,7 @@ internal static MongoClusterData DeserializeMongoClusterData(JsonElement element Optional serverVersion = default; Optional connectionString = default; Optional earliestRestoreTime = default; - Optional provisioningState = default; + Optional provisioningState = default; Optional clusterStatus = default; Optional> nodeGroupSpecs = default; foreach (var property in element.EnumerateObject()) @@ -197,7 +197,7 @@ internal static MongoClusterData DeserializeMongoClusterData(JsonElement element { continue; } - provisioningState = new ProvisioningState(property0.Value.GetString()); + provisioningState = new CosmosDBProvisioningState(property0.Value.GetString()); continue; } if (property0.NameEquals("clusterStatus"u8)) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoClusterPatch.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoClusterPatch.cs index b06652d38bcdb..21236b3d576cd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoClusterPatch.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoClusterPatch.cs @@ -37,7 +37,7 @@ public MongoClusterPatch() /// Earliest restore timestamp in UTC ISO8601 format. public string EarliestRestoreTime { get; } /// A provisioning state of the mongo cluster. - public ProvisioningState? ProvisioningState { get; } + public CosmosDBProvisioningState? ProvisioningState { get; } /// A status of the mongo cluster. public MongoClusterStatus? ClusterStatus { get; } /// The list of node group specs in the cluster. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningState.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningState.cs deleted file mode 100644 index 3850a10258235..0000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningState.cs +++ /dev/null @@ -1,63 +0,0 @@ -// 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 ProvisioningState : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public ProvisioningState(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 ProvisioningState Succeeded { get; } = new ProvisioningState(SucceededValue); - /// Failed. - public static ProvisioningState Failed { get; } = new ProvisioningState(FailedValue); - /// Canceled. - public static ProvisioningState Canceled { get; } = new ProvisioningState(CanceledValue); - /// InProgress. - public static ProvisioningState InProgress { get; } = new ProvisioningState(InProgressValue); - /// Updating. - public static ProvisioningState Updating { get; } = new ProvisioningState(UpdatingValue); - /// Dropping. - public static ProvisioningState Dropping { get; } = new ProvisioningState(DroppingValue); - /// Determines if two values are the same. - public static bool operator ==(ProvisioningState left, ProvisioningState right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(ProvisioningState left, ProvisioningState right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator ProvisioningState(string value) => new ProvisioningState(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is ProvisioningState other && Equals(other); - /// - public bool Equals(ProvisioningState 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/Status.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Status.cs deleted file mode 100644 index 61d89813f9e9a..0000000000000 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/Status.cs +++ /dev/null @@ -1,60 +0,0 @@ -// 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 Status : IEquatable - { - private readonly string _value; - - /// Initializes a new instance of . - /// is null. - public Status(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 Status Uninitialized { get; } = new Status(UninitializedValue); - /// Initializing. - public static Status Initializing { get; } = new Status(InitializingValue); - /// InternallyReady. - public static Status InternallyReady { get; } = new Status(InternallyReadyValue); - /// Online. - public static Status Online { get; } = new Status(OnlineValue); - /// Deleting. - public static Status Deleting { get; } = new Status(DeletingValue); - /// Determines if two values are the same. - public static bool operator ==(Status left, Status right) => left.Equals(right); - /// Determines if two values are not the same. - public static bool operator !=(Status left, Status right) => !left.Equals(right); - /// Converts a string to a . - public static implicit operator Status(string value) => new Status(value); - - /// - [EditorBrowsable(EditorBrowsableState.Never)] - public override bool Equals(object obj) => obj is Status other && Equals(other); - /// - public bool Equals(Status 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/MongoClusterData.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoClusterData.cs index f0b4e9066678b..8b0042a4d7377 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoClusterData.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoClusterData.cs @@ -42,7 +42,7 @@ public MongoClusterData(AzureLocation location) : base(location) /// 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, ProvisioningState? provisioningState, MongoClusterStatus? clusterStatus, IList nodeGroupSpecs) : base(id, name, resourceType, systemData, tags, location) + 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; @@ -71,7 +71,7 @@ internal MongoClusterData(ResourceIdentifier id, string name, ResourceType resou /// Earliest restore timestamp in UTC ISO8601 format. public string EarliestRestoreTime { get; } /// A provisioning state of the mongo cluster. - public ProvisioningState? ProvisioningState { get; } + public CosmosDBProvisioningState? ProvisioningState { get; } /// A status of the mongo cluster. public MongoClusterStatus? ClusterStatus { get; } /// The list of node group specs in the cluster. diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md index ea054e48af312..d919f2e971193 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md @@ -335,6 +335,11 @@ prepend-rp-prefix: - PublicNetworkAccess - SpatialType - ContainerPartitionKey +- FirewallRuleCollection +- Status +- ProvisioningState +- Type +- CheckNameAvailabilityContent models-to-treat-empty-string-as-null: - CosmosDBAccountData diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/tests/ScenarioTests/SqlPartitionMergeTests.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/tests/ScenarioTests/SqlPartitionMergeTests.cs index 38dcd8c4c2302..be66996c303d6 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/tests/ScenarioTests/SqlPartitionMergeTests.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/tests/ScenarioTests/SqlPartitionMergeTests.cs @@ -64,7 +64,7 @@ public async Task TearDown() } [Test] - [RecordedTest] + //[RecordedTest] public async Task SqlDatabasePartitionMerge() { var database = await CreateSqlDatabase(new AutoscaleSettings() diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/AzSdk.RP.props b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/AzSdk.RP.props index 6718ab4e3fa1c..40bf0ab93dcf9 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/AzSdk.RP.props +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/AzSdk.RP.props @@ -1,7 +1,7 @@  - CosmosDB_2023-03-15-preview + CosmosDB_2022-08-15-preview $(PackageTags);$(CommonTags);$(AzureApiTag); \ No newline at end of file diff --git a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CosmosDBManagementClient.cs b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CosmosDBManagementClient.cs index 1e41a63334ac6..e5dd8271a435b 100644 --- a/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CosmosDBManagementClient.cs +++ b/sdk/cosmosdb/Microsoft.Azure.Management.CosmosDB/src/Generated/CosmosDBManagementClient.cs @@ -547,7 +547,7 @@ private void Initialize() RestorableTableResources = new RestorableTableResourcesOperations(this); Service = new ServiceOperations(this); BaseUri = new System.Uri("https://management.azure.com"); - ApiVersion = "2023-03-15-preview"; + ApiVersion = "2022-08-15-preview"; AcceptLanguage = "en-US"; LongRunningOperationRetryTimeout = 30; GenerateClientRequestId = true;