From 4de7cf67e2eb90e5f55d947e43b0ba9bff4df293 Mon Sep 17 00:00:00 2001 From: SDKAuto Date: Sat, 20 May 2023 13:14:17 +0000 Subject: [PATCH] CodeGen from PR 23327 in Azure/azure-rest-api-specs Merge bc21c3f463ef1cbaf7c79f20b97bfd0d38f2d5b9 into d0d161eb19d5efd1c3d23d47a5491a53f41cbd7c --- ...Azure.ResourceManager.CosmosDB.netstandard2.0.cs | 6 +++--- ...DefinitionCreateOrUpdateContent.Serialization.cs | 2 +- .../MongoDBRoleDefinitionData.Serialization.cs | 2 +- .../MongoDBRoleDefinitionType.Serialization.cs | 13 +++---------- .../Generated/Models/MongoDBRoleDefinitionType.cs | 10 +++++----- .../Azure.ResourceManager.CosmosDB/src/autorest.md | 2 +- 6 files changed, 14 insertions(+), 21 deletions(-) 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 ec9bc13c550bf..30023c16dc8ca 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 @@ -3469,10 +3469,10 @@ public MongoDBRoleDefinitionCreateOrUpdateContent() { } public string RoleName { get { throw null; } set { } } public System.Collections.Generic.IList Roles { get { throw null; } } } - public enum MongoDBRoleDefinitionType + public enum MongoDBRoleDefinitionType : long { - BuiltInRole = 0, - CustomRole = 1, + BuiltInRole = (long)0, + CustomRole = (long)1, } public partial class MongoDBUserDefinitionCreateOrUpdateContent { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBRoleDefinitionCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBRoleDefinitionCreateOrUpdateContent.Serialization.cs index cd13f8b6300cb..5b5308d0ecf25 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBRoleDefinitionCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBRoleDefinitionCreateOrUpdateContent.Serialization.cs @@ -25,7 +25,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) if (Optional.IsDefined(DefinitionType)) { writer.WritePropertyName("type"u8); - writer.WriteStringValue(DefinitionType.Value.ToSerialString()); + writer.WriteNumberValue((long)DefinitionType.Value); } if (Optional.IsDefined(DatabaseName)) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBRoleDefinitionData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBRoleDefinitionData.Serialization.cs index f8c948e448d96..d2bcdeb017442 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBRoleDefinitionData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBRoleDefinitionData.Serialization.cs @@ -28,7 +28,7 @@ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) if (Optional.IsDefined(RoleDefinitionType)) { writer.WritePropertyName("type"u8); - writer.WriteStringValue(RoleDefinitionType.Value.ToSerialString()); + writer.WriteNumberValue((long)RoleDefinitionType.Value); } if (Optional.IsDefined(DatabaseName)) { diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBRoleDefinitionType.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBRoleDefinitionType.Serialization.cs index bd6035af3b1e7..127f7043b6100 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBRoleDefinitionType.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBRoleDefinitionType.Serialization.cs @@ -11,17 +11,10 @@ namespace Azure.ResourceManager.CosmosDB.Models { internal static partial class MongoDBRoleDefinitionTypeExtensions { - public static string ToSerialString(this MongoDBRoleDefinitionType value) => value switch + public static MongoDBRoleDefinitionType ToMongoDBRoleDefinitionType(this long value) { - MongoDBRoleDefinitionType.BuiltInRole => "BuiltInRole", - MongoDBRoleDefinitionType.CustomRole => "CustomRole", - _ => throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown MongoDBRoleDefinitionType value.") - }; - - public static MongoDBRoleDefinitionType ToMongoDBRoleDefinitionType(this string value) - { - if (StringComparer.OrdinalIgnoreCase.Equals(value, "BuiltInRole")) return MongoDBRoleDefinitionType.BuiltInRole; - if (StringComparer.OrdinalIgnoreCase.Equals(value, "CustomRole")) return MongoDBRoleDefinitionType.CustomRole; + if (value == 0L) return MongoDBRoleDefinitionType.BuiltInRole; + if (value == 1L) return MongoDBRoleDefinitionType.CustomRole; throw new ArgumentOutOfRangeException(nameof(value), value, "Unknown MongoDBRoleDefinitionType value."); } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBRoleDefinitionType.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBRoleDefinitionType.cs index ef5da899fde95..3dc6781eab02b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBRoleDefinitionType.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBRoleDefinitionType.cs @@ -8,11 +8,11 @@ namespace Azure.ResourceManager.CosmosDB.Models { /// Indicates whether the Role Definition was built-in or user created. - public enum MongoDBRoleDefinitionType + public enum MongoDBRoleDefinitionType : long { - /// BuiltInRole. - BuiltInRole, - /// CustomRole. - CustomRole + /// The BuiltInRole. + BuiltInRole = 0L, + /// The CustomRole. + CustomRole = 1L } } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md index 503ecc32be886..2c023a23bd142 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md @@ -10,7 +10,7 @@ generate-model-factory: false 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 +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/cosmos-db/resource-manager/readme.md tag: package-preview-2022-11 output-folder: $(this-folder)/Generated clear-output-folder: true