diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/CHANGELOG.md b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/CHANGELOG.md index 45e21244fa2e4..7c8fb276ec274 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/CHANGELOG.md +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/CHANGELOG.md @@ -4,6 +4,8 @@ ### Features Added +- Exposed `JsonModelWriteCore` for model serialization procedure. + ### Breaking Changes ### Bugs Fixed 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 c262fc79dc271..2fe760ea46b1b 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 @@ -22,6 +22,7 @@ public partial class CassandraClusterData : Azure.ResourceManager.Models.Tracked public CassandraClusterData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CassandraClusterProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CassandraClusterData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CassandraClusterData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -97,6 +98,7 @@ public partial class CassandraDataCenterData : Azure.ResourceManager.Models.Reso { public CassandraDataCenterData() { } public Azure.ResourceManager.CosmosDB.Models.CassandraDataCenterProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CassandraDataCenterData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CassandraDataCenterData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -145,6 +147,7 @@ public CassandraKeyspaceData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CassandraKeyspacePropertiesConfig Options { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.ExtendedCassandraKeyspaceResourceInfo Resource { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CassandraKeyspaceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CassandraKeyspaceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -233,6 +236,7 @@ public CassandraTableData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CassandraTablePropertiesConfig Options { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.ExtendedCassandraTableResourceInfo Resource { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CassandraTableData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CassandraTableData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -315,6 +319,7 @@ public CassandraViewGetResultData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CassandraViewGetPropertiesOptions Options { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CassandraViewGetPropertiesResource Resource { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CassandraViewGetResultData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CassandraViewGetResultData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -442,6 +447,7 @@ public CosmosDBAccountData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountRestoreParameters RestoreParameters { get { throw null; } set { } } public System.Collections.Generic.IList VirtualNetworkRules { get { throw null; } } public System.Collections.Generic.IReadOnlyList WriteLocations { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBAccountData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBAccountData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -655,6 +661,7 @@ public partial class CosmosDBLocationData : Azure.ResourceManager.Models.Resourc { public CosmosDBLocationData() { } public Azure.ResourceManager.CosmosDB.Models.CosmosDBLocationProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBLocationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBLocationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -703,6 +710,7 @@ public CosmosDBPrivateEndpointConnectionData() { } public string GroupId { get { throw null; } set { } } public Azure.Core.ResourceIdentifier PrivateEndpointId { get { throw null; } set { } } public string ProvisioningState { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBPrivateEndpointConnectionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBPrivateEndpointConnectionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -764,6 +772,7 @@ public CosmosDBPrivateLinkResourceData() { } public string GroupId { get { throw null; } } public System.Collections.Generic.IReadOnlyList RequiredMembers { get { throw null; } } public System.Collections.Generic.IReadOnlyList RequiredZoneNames { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBPrivateLinkResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBPrivateLinkResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -791,6 +800,7 @@ public partial class CosmosDBServiceData : Azure.ResourceManager.Models.Resource { public CosmosDBServiceData() { } public Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBServiceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBServiceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -837,6 +847,7 @@ public partial class CosmosDBSqlClientEncryptionKeyData : Azure.ResourceManager. { public CosmosDBSqlClientEncryptionKeyData() { } public Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlClientEncryptionKeyProperties Resource { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBSqlClientEncryptionKeyData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBSqlClientEncryptionKeyData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -883,6 +894,7 @@ public CosmosDBSqlContainerData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlContainerPropertiesConfig Options { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.ExtendedCosmosDBSqlContainerResourceInfo Resource { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBSqlContainerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBSqlContainerData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -982,6 +994,7 @@ public CosmosDBSqlDatabaseData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlDatabasePropertiesConfig Options { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.ExtendedCosmosDBSqlDatabaseResourceInfo Resource { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBSqlDatabaseData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBSqlDatabaseData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1076,6 +1089,7 @@ public CosmosDBSqlRoleAssignmentData() { } public System.Guid? PrincipalId { get { throw null; } set { } } public Azure.Core.ResourceIdentifier RoleDefinitionId { get { throw null; } set { } } public string Scope { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBSqlRoleAssignmentData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBSqlRoleAssignmentData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1125,6 +1139,7 @@ public CosmosDBSqlRoleDefinitionData() { } public System.Collections.Generic.IList Permissions { get { throw null; } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlRoleDefinitionType? RoleDefinitionType { get { throw null; } set { } } public string RoleName { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBSqlRoleDefinitionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBSqlRoleDefinitionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1172,6 +1187,7 @@ public partial class CosmosDBSqlStoredProcedureData : Azure.ResourceManager.Mode public CosmosDBSqlStoredProcedureData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.ExtendedCosmosDBSqlStoredProcedureResourceInfo Resource { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBSqlStoredProcedureData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBSqlStoredProcedureData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1225,6 +1241,7 @@ public partial class CosmosDBSqlTriggerData : Azure.ResourceManager.Models.Track public CosmosDBSqlTriggerData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.ExtendedCosmosDBSqlTriggerResourceInfo Resource { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBSqlTriggerData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBSqlTriggerData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1278,6 +1295,7 @@ public partial class CosmosDBSqlUserDefinedFunctionData : Azure.ResourceManager. public CosmosDBSqlUserDefinedFunctionData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.ExtendedCosmosDBSqlUserDefinedFunctionResourceInfo Resource { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBSqlUserDefinedFunctionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBSqlUserDefinedFunctionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1332,6 +1350,7 @@ public CosmosDBTableData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBTablePropertiesOptions Options { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBTablePropertiesResource Resource { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBTableData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBTableData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1390,6 +1409,7 @@ public CosmosDBThroughputPoolAccountData() { } public Azure.Core.AzureLocation? AccountLocation { get { throw null; } set { } } public Azure.Core.ResourceIdentifier AccountResourceIdentifier { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus? ProvisioningState { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBThroughputPoolAccountData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBThroughputPoolAccountData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1437,6 +1457,7 @@ public partial class CosmosDBThroughputPoolData : Azure.ResourceManager.Models.T public CosmosDBThroughputPoolData(Azure.Core.AzureLocation location) { } public int? MaxThroughput { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus? ProvisioningState { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBThroughputPoolData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.CosmosDBThroughputPoolData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1523,6 +1544,7 @@ public DataTransferJobGetResultData() { } public string Status { get { throw null; } } public long? TotalCount { get { throw null; } } public int? WorkerCount { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.DataTransferJobGetResultData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.DataTransferJobGetResultData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1577,6 +1599,7 @@ public GraphResourceGetResultData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.GraphResourceGetPropertiesOptions Options { get { throw null; } set { } } public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.GraphResourceGetResultData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.GraphResourceGetResultData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1631,6 +1654,7 @@ public GremlinDatabaseData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.GremlinDatabasePropertiesConfig Options { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.ExtendedGremlinDatabaseResourceInfo Resource { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.GremlinDatabaseData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.GremlinDatabaseData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1716,6 +1740,7 @@ public GremlinGraphData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.GremlinGraphPropertiesConfig Options { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.ExtendedGremlinGraphResourceInfo Resource { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.GremlinGraphData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.GremlinGraphData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1800,6 +1825,7 @@ public MongoDBCollectionData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.MongoDBCollectionPropertiesConfig Options { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.ExtendedMongoDBCollectionResourceInfo Resource { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.MongoDBCollectionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.MongoDBCollectionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1890,6 +1916,7 @@ public MongoDBDatabaseData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.MongoDBDatabasePropertiesConfig Options { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.ExtendedMongoDBDatabaseResourceInfo Resource { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.MongoDBDatabaseData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.MongoDBDatabaseData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -1983,6 +2010,7 @@ public MongoDBRoleDefinitionData() { } public Azure.ResourceManager.CosmosDB.Models.MongoDBRoleDefinitionType? RoleDefinitionType { get { throw null; } set { } } public string RoleName { get { throw null; } set { } } public System.Collections.Generic.IList Roles { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.MongoDBRoleDefinitionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.MongoDBRoleDefinitionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2034,6 +2062,7 @@ public MongoDBUserDefinitionData() { } public string Password { get { throw null; } set { } } public System.Collections.Generic.IList Roles { get { throw null; } } public string UserName { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.MongoDBUserDefinitionData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.MongoDBUserDefinitionData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2078,6 +2107,7 @@ public partial class NetworkSecurityPerimeterConfigurationData : Azure.ResourceM { public NetworkSecurityPerimeterConfigurationData() { } public Azure.ResourceManager.CosmosDB.Models.NetworkSecurityPerimeterConfigurationProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.NetworkSecurityPerimeterConfigurationData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.NetworkSecurityPerimeterConfigurationData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2126,6 +2156,7 @@ internal RestorableCosmosDBAccountData() { } public Azure.Core.AzureLocation? Location { get { throw null; } } public System.DateTimeOffset? OldestRestorableOn { get { throw null; } } public System.Collections.Generic.IReadOnlyList RestorableLocations { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.RestorableCosmosDBAccountData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.RestorableCosmosDBAccountData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2188,6 +2219,7 @@ public partial class ThroughputSettingData : Azure.ResourceManager.Models.Tracke public ThroughputSettingData(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.ExtendedThroughputSettingsResourceInfo Resource { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.ThroughputSettingData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.ThroughputSettingData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2284,6 +2316,7 @@ public partial class AccessRule : System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.AccessRule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2318,6 +2351,7 @@ public AccessRuleProperties() { } public System.Collections.Generic.IList NetworkSecurityPerimeters { get { throw null; } } public System.Collections.Generic.IList PhoneNumbers { get { throw null; } } public System.Collections.Generic.IList Subscriptions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.AccessRuleProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.AccessRuleProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2497,6 +2531,7 @@ public AuthenticationMethodLdapProperties() { } public int? ServerPort { get { throw null; } set { } } public string ServiceUserDistinguishedName { get { throw null; } set { } } public string ServiceUserPassword { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.AuthenticationMethodLdapProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.AuthenticationMethodLdapProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2509,6 +2544,7 @@ public AutoscaleSettingsResourceInfo(int maxThroughput) { } public Azure.ResourceManager.CosmosDB.Models.ThroughputPolicyResourceInfo AutoUpgradeThroughputPolicy { get { throw null; } set { } } public int MaxThroughput { get { throw null; } set { } } public int? TargetMaxThroughput { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.AutoscaleSettingsResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.AutoscaleSettingsResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2520,6 +2556,7 @@ public partial class AzureBlobDataTransferDataSourceSink : Azure.ResourceManager public AzureBlobDataTransferDataSourceSink(string containerName) { } public string ContainerName { get { throw null; } set { } } public System.Uri EndpointUri { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.AzureBlobDataTransferDataSourceSink System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.AzureBlobDataTransferDataSourceSink System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2532,6 +2569,7 @@ public BackupPolicyMigrationState() { } public System.DateTimeOffset? StartOn { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.BackupPolicyMigrationStatus? Status { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.BackupPolicyType? TargetType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.BackupPolicyMigrationState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.BackupPolicyMigrationState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2580,6 +2618,7 @@ public partial class BaseCosmosDataTransferDataSourceSink : Azure.ResourceManage { public BaseCosmosDataTransferDataSourceSink() { } public string RemoteAccountName { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.BaseCosmosDataTransferDataSourceSink System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.BaseCosmosDataTransferDataSourceSink System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2614,6 +2653,7 @@ public CapacityModeChangeTransitionState() { } public Azure.ResourceManager.CosmosDB.Models.CapacityModeTransitionStatus? CapacityModeTransitionStatus { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CapacityMode? CurrentCapacityMode { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CapacityMode? PreviousCapacityMode { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CapacityModeChangeTransitionState System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CapacityModeChangeTransitionState System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2683,6 +2723,7 @@ public partial class CassandraCertificate : System.ClientModel.Primitives.IJsonM { public CassandraCertificate() { } public string Pem { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraCertificate System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraCertificate System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2697,6 +2738,7 @@ internal CassandraClusterBackupResourceInfo() { } public System.DateTimeOffset? BackupStartTimestamp { get { throw null; } } public Azure.ResourceManager.CosmosDB.Models.CassandraClusterBackupState? BackupState { get { throw null; } } public System.DateTimeOffset? BackupStopTimestamp { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraClusterBackupResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraClusterBackupResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2709,6 +2751,7 @@ public CassandraClusterBackupSchedule() { } public string CronExpression { get { throw null; } set { } } public int? RetentionInHours { get { throw null; } set { } } public string ScheduleName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraClusterBackupSchedule System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraClusterBackupSchedule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2748,6 +2791,7 @@ internal CassandraClusterCommand() { } public string Result { get { throw null; } } public bool? ShouldStopCassandraBeforeStart { get { throw null; } } public Azure.ResourceManager.CosmosDB.Models.CassandraClusterCommandStatus? Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraClusterCommand System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraClusterCommand System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2797,6 +2841,7 @@ internal CassandraClusterDataCenterNodeItem() { } public string Status { get { throw null; } } public string Timestamp { get { throw null; } } public System.Collections.Generic.IReadOnlyList Tokens { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraClusterDataCenterNodeItem System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraClusterDataCenterNodeItem System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2808,6 +2853,7 @@ public partial class CassandraClusterKey : System.ClientModel.Primitives.IJsonMo public CassandraClusterKey() { } public string Name { get { throw null; } set { } } public string OrderBy { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraClusterKey System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraClusterKey System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2843,6 +2889,7 @@ public CassandraClusterProperties() { } public string RestoreFromBackupId { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.ScheduledEventStrategy? ScheduledEventStrategy { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList SeedNodes { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraClusterProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraClusterProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2857,6 +2904,7 @@ internal CassandraClusterPublicStatus() { } 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; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraClusterPublicStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraClusterPublicStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2869,6 +2917,7 @@ internal CassandraClusterPublicStatusDataCentersItem() { } public string Name { get { throw null; } } public System.Collections.Generic.IReadOnlyList Nodes { get { throw null; } } public System.Collections.Generic.IReadOnlyList SeedNodes { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraClusterPublicStatusDataCentersItem System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraClusterPublicStatusDataCentersItem System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2898,6 +2947,7 @@ public partial class CassandraColumn : System.ClientModel.Primitives.IJsonModel< public CassandraColumn() { } public string CassandraColumnType { get { throw null; } set { } } public string Name { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraColumn System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraColumn System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2908,6 +2958,7 @@ public partial class CassandraCommandOutput : System.ClientModel.Primitives.IJso { internal CassandraCommandOutput() { } public string CommandOutput { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraCommandOutput System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraCommandOutput System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2922,6 +2973,7 @@ public CassandraCommandPostBody(string command, string host) { } public bool? CassandraStopStart { get { throw null; } set { } } public string Command { get { throw null; } } public string Host { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraCommandPostBody System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraCommandPostBody System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2936,6 +2988,7 @@ internal CassandraConnectionError() { } public string IPFrom { get { throw null; } } public string IPTo { get { throw null; } } public int? Port { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraConnectionError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraConnectionError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2983,6 +3036,7 @@ public CassandraDataCenterProperties() { } 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 { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraDataCenterProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraDataCenterProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -2993,6 +3047,7 @@ public partial class CassandraDataCenterSeedNode : System.ClientModel.Primitives { public CassandraDataCenterSeedNode() { } public string IPAddress { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraDataCenterSeedNode System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraDataCenterSeedNode System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3006,6 +3061,7 @@ public CassandraError() { } public string Code { get { throw null; } set { } } public string Message { get { throw null; } set { } } public string Target { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraError System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraError System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3018,6 +3074,7 @@ public CassandraKeyspaceCreateOrUpdateContent(Azure.Core.AzureLocation location, public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig Options { get { throw null; } set { } } public string ResourceKeyspaceName { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraKeyspaceCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraKeyspaceCreateOrUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3027,6 +3084,7 @@ public CassandraKeyspaceCreateOrUpdateContent(Azure.Core.AzureLocation location, public partial class CassandraKeyspacePropertiesConfig : Azure.ResourceManager.CosmosDB.Models.CosmosDBBaseConfig, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public CassandraKeyspacePropertiesConfig() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraKeyspacePropertiesConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraKeyspacePropertiesConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3037,6 +3095,7 @@ public partial class CassandraKeyspaceResourceInfo : System.ClientModel.Primitiv { public CassandraKeyspaceResourceInfo(string keyspaceName) { } public string KeyspaceName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraKeyspaceResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraKeyspaceResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3068,6 +3127,7 @@ public partial class CassandraPartitionKey : System.ClientModel.Primitives.IJson { public CassandraPartitionKey() { } public string Name { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraPartitionKey System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraPartitionKey System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3102,6 +3162,7 @@ internal CassandraReaperStatus() { } public bool? IsHealthy { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary RepairRunIds { get { throw null; } } public System.Collections.Generic.IReadOnlyDictionary RepairSchedules { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraReaperStatus System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraReaperStatus System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3114,6 +3175,7 @@ public CassandraSchema() { } public System.Collections.Generic.IList ClusterKeys { get { throw null; } } public System.Collections.Generic.IList Columns { get { throw null; } } public System.Collections.Generic.IList PartitionKeys { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraSchema System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraSchema System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3126,6 +3188,7 @@ public CassandraTableCreateOrUpdateContent(Azure.Core.AzureLocation location, Az public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig Options { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CassandraTableResourceInfo Resource { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraTableCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraTableCreateOrUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3135,6 +3198,7 @@ public CassandraTableCreateOrUpdateContent(Azure.Core.AzureLocation location, Az public partial class CassandraTablePropertiesConfig : Azure.ResourceManager.CosmosDB.Models.CosmosDBBaseConfig, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public CassandraTablePropertiesConfig() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraTablePropertiesConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraTablePropertiesConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3148,6 +3212,7 @@ public CassandraTableResourceInfo(string tableName) { } public int? DefaultTtl { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CassandraSchema Schema { get { throw null; } set { } } public string TableName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraTableResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraTableResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3157,6 +3222,7 @@ public CassandraTableResourceInfo(string tableName) { } public partial class CassandraViewGetPropertiesOptions : Azure.ResourceManager.CosmosDB.Models.CosmosDBBaseConfig, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public CassandraViewGetPropertiesOptions() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraViewGetPropertiesOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraViewGetPropertiesOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3169,6 +3235,7 @@ public partial class CassandraViewGetPropertiesResource : Azure.ResourceManager. public Azure.ETag? ETag { get { throw null; } } public string Rid { get { throw null; } } public float? Timestamp { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraViewGetPropertiesResource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraViewGetPropertiesResource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3181,6 +3248,7 @@ public CassandraViewGetResultCreateOrUpdateContent(Azure.Core.AzureLocation loca public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig Options { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CassandraViewResource Resource { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraViewGetResultCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraViewGetResultCreateOrUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3192,6 +3260,7 @@ public partial class CassandraViewResource : System.ClientModel.Primitives.IJson public CassandraViewResource(string id, string viewDefinition) { } public string Id { get { throw null; } set { } } public string ViewDefinition { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraViewResource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CassandraViewResource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3221,6 +3290,7 @@ public partial class ComputedProperty : System.ClientModel.Primitives.IJsonModel public ComputedProperty() { } public string Name { get { throw null; } set { } } public string Query { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ComputedProperty System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ComputedProperty System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3251,6 +3321,7 @@ public ConflictResolutionPolicy() { } public string ConflictResolutionPath { get { throw null; } set { } } public string ConflictResolutionProcedure { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.ConflictResolutionMode? Mode { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ConflictResolutionPolicy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ConflictResolutionPolicy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3280,6 +3351,7 @@ public ConsistencyPolicy(Azure.ResourceManager.CosmosDB.Models.DefaultConsistenc public Azure.ResourceManager.CosmosDB.Models.DefaultConsistencyLevel DefaultConsistencyLevel { get { throw null; } set { } } public int? MaxIntervalInSeconds { get { throw null; } set { } } public long? MaxStalenessPrefix { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ConsistencyPolicy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ConsistencyPolicy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3290,6 +3362,7 @@ public partial class ContinuousBackupRestoreLocation : System.ClientModel.Primit { public ContinuousBackupRestoreLocation() { } public Azure.Core.AzureLocation? Location { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ContinuousBackupRestoreLocation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ContinuousBackupRestoreLocation System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3300,6 +3373,7 @@ public partial class ContinuousModeBackupPolicy : Azure.ResourceManager.CosmosDB { public ContinuousModeBackupPolicy() { } public Azure.ResourceManager.CosmosDB.Models.ContinuousTier? ContinuousModeTier { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ContinuousModeBackupPolicy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ContinuousModeBackupPolicy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3329,6 +3403,7 @@ public partial class CosmosCassandraDataTransferDataSourceSink : Azure.ResourceM public CosmosCassandraDataTransferDataSourceSink(string keyspaceName, string tableName) { } public string KeyspaceName { get { throw null; } set { } } public string TableName { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosCassandraDataTransferDataSourceSink System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosCassandraDataTransferDataSourceSink System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3339,6 +3414,7 @@ public abstract partial class CosmosDBAccountBackupPolicy : System.ClientModel.P { protected CosmosDBAccountBackupPolicy() { } public Azure.ResourceManager.CosmosDB.Models.BackupPolicyMigrationState MigrationState { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountBackupPolicy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountBackupPolicy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3349,6 +3425,7 @@ public partial class CosmosDBAccountCapability : System.ClientModel.Primitives.I { public CosmosDBAccountCapability() { } public string Name { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCapability System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCapability System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3362,6 +3439,7 @@ internal CosmosDBAccountConnectionString() { } 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; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountConnectionString System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountConnectionString System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3376,6 +3454,7 @@ public CosmosDBAccountCorsPolicy(string allowedOrigins) { } public string AllowedOrigins { get { throw null; } set { } } public string ExposedHeaders { get { throw null; } set { } } public long? MaxAgeInSeconds { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCorsPolicy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCorsPolicy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3443,6 +3522,7 @@ public CosmosDBAccountCreateOrUpdateContent(Azure.Core.AzureLocation location, S public Azure.ResourceManager.CosmosDB.Models.CosmosDBPublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountRestoreParameters RestoreParameters { get { throw null; } set { } } public System.Collections.Generic.IList VirtualNetworkRules { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateOrUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3474,6 +3554,7 @@ public partial class CosmosDBAccountKeyList : Azure.ResourceManager.CosmosDB.Mod internal CosmosDBAccountKeyList() { } public string PrimaryMasterKey { get { throw null; } } public string SecondaryMasterKey { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountKeyList System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountKeyList System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3508,6 +3589,7 @@ public CosmosDBAccountLocation() { } public bool? IsZoneRedundant { get { throw null; } set { } } public Azure.Core.AzureLocation? LocationName { get { throw null; } set { } } public string ProvisioningState { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountLocation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountLocation System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3572,6 +3654,7 @@ public CosmosDBAccountPatch() { } public Azure.ResourceManager.CosmosDB.Models.CosmosDBPublicNetworkAccess? PublicNetworkAccess { get { throw null; } set { } } public System.Collections.Generic.IDictionary Tags { get { throw null; } } public System.Collections.Generic.IList VirtualNetworkRules { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3583,6 +3666,7 @@ public partial class CosmosDBAccountReadOnlyKeyList : System.ClientModel.Primiti internal CosmosDBAccountReadOnlyKeyList() { } public string PrimaryReadonlyMasterKey { get { throw null; } } public string SecondaryReadonlyMasterKey { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountReadOnlyKeyList System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountReadOnlyKeyList System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3593,6 +3677,7 @@ public partial class CosmosDBAccountRegenerateKeyContent : System.ClientModel.Pr { public CosmosDBAccountRegenerateKeyContent(Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountKeyKind keyKind) { } public Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountKeyKind KeyKind { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountRegenerateKeyContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountRegenerateKeyContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3624,6 +3709,7 @@ public CosmosDBAccountRestoreParameters() { } public Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountRestoreMode? RestoreMode { get { throw null; } set { } } public string SourceBackupLocation { get { throw null; } set { } } public System.Collections.Generic.IList TablesToRestore { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountRestoreParameters System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountRestoreParameters System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3656,6 +3742,7 @@ public partial class CosmosDBBackupInformation : System.ClientModel.Primitives.I { internal CosmosDBBackupInformation() { } public System.DateTimeOffset? ContinuousBackupInformationLatestRestorableTimestamp { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBBackupInformation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBBackupInformation System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3686,6 +3773,7 @@ public partial class CosmosDBBaseConfig : System.ClientModel.Primitives.IJsonMod public CosmosDBBaseConfig() { } public int? AutoscaleMaxThroughput { get { throw null; } set { } } public int? Throughput { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBBaseConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBBaseConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3701,6 +3789,7 @@ internal CosmosDBBaseMetric() { } public System.DateTimeOffset? StartOn { get { throw null; } } public string TimeGrain { get { throw null; } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricUnitType? Unit { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBBaseMetric System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBBaseMetric System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3715,6 +3804,7 @@ internal CosmosDBBaseUsage() { } public Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricName Name { get { throw null; } } public string QuotaPeriod { get { throw null; } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricUnitType? Unit { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBBaseUsage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBBaseUsage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3728,6 +3818,7 @@ public CosmosDBClientEncryptionIncludedPath(string path, string clientEncryption public string EncryptionAlgorithm { get { throw null; } set { } } public string EncryptionType { get { throw null; } set { } } public string Path { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBClientEncryptionIncludedPath System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBClientEncryptionIncludedPath System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3739,6 +3830,7 @@ public partial class CosmosDBClientEncryptionPolicy : System.ClientModel.Primiti public CosmosDBClientEncryptionPolicy(System.Collections.Generic.IEnumerable includedPaths, int policyFormatVersion) { } public System.Collections.Generic.IList IncludedPaths { get { throw null; } } public int PolicyFormatVersion { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBClientEncryptionPolicy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBClientEncryptionPolicy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3750,6 +3842,7 @@ public partial class CosmosDBCompositePath : System.ClientModel.Primitives.IJson public CosmosDBCompositePath() { } public Azure.ResourceManager.CosmosDB.Models.CompositePathSortOrder? Order { get { throw null; } set { } } public string Path { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBCompositePath System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBCompositePath System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3763,6 +3856,7 @@ public CosmosDBContainerPartitionKey() { } public Azure.ResourceManager.CosmosDB.Models.CosmosDBPartitionKind? Kind { get { throw null; } set { } } public System.Collections.Generic.IList Paths { get { throw null; } } public int? Version { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBContainerPartitionKey System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBContainerPartitionKey System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3774,6 +3868,7 @@ public partial class CosmosDBCreateUpdateConfig : System.ClientModel.Primitives. public CosmosDBCreateUpdateConfig() { } public int? AutoscaleMaxThroughput { get { throw null; } set { } } public int? Throughput { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3807,6 +3902,7 @@ public partial class CosmosDBErrorResult : System.ClientModel.Primitives.IJsonMo internal CosmosDBErrorResult() { } public string Code { get { throw null; } } public string Message { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBErrorResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBErrorResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3817,6 +3913,7 @@ public partial class CosmosDBExcludedPath : System.ClientModel.Primitives.IJsonM { public CosmosDBExcludedPath() { } public string Path { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBExcludedPath System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBExcludedPath System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3827,6 +3924,7 @@ public partial class CosmosDBFailoverPolicies : System.ClientModel.Primitives.IJ { public CosmosDBFailoverPolicies(System.Collections.Generic.IEnumerable failoverPolicies) { } public System.Collections.Generic.IList FailoverPolicies { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBFailoverPolicies System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBFailoverPolicies System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3839,6 +3937,7 @@ public CosmosDBFailoverPolicy() { } public int? FailoverPriority { get { throw null; } set { } } public string Id { get { throw null; } } public Azure.Core.AzureLocation? LocationName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBFailoverPolicy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBFailoverPolicy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3850,6 +3949,7 @@ public partial class CosmosDBIncludedPath : System.ClientModel.Primitives.IJsonM public CosmosDBIncludedPath() { } public System.Collections.Generic.IList Indexes { get { throw null; } } public string Path { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBIncludedPath System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBIncludedPath System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3884,6 +3984,7 @@ public CosmosDBIndexingPolicy() { } public Azure.ResourceManager.CosmosDB.Models.CosmosDBIndexingMode? IndexingMode { get { throw null; } set { } } public bool? IsAutomatic { get { throw null; } set { } } public System.Collections.Generic.IList SpatialIndexes { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBIndexingPolicy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBIndexingPolicy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3913,6 +4014,7 @@ public partial class CosmosDBIPAddressOrRange : System.ClientModel.Primitives.IJ { public CosmosDBIPAddressOrRange() { } public string IPAddressOrRange { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBIPAddressOrRange System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBIPAddressOrRange System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3926,6 +4028,7 @@ public CosmosDBKeyWrapMetadata() { } public string CosmosDBKeyWrapMetadataType { get { throw null; } set { } } public string Name { get { throw null; } set { } } public string Value { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBKeyWrapMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBKeyWrapMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3961,6 +4064,7 @@ public CosmosDBLocationProperties() { } public bool? IsSubscriptionRegionAccessAllowedForAz { get { throw null; } } public bool? IsSubscriptionRegionAccessAllowedForRegular { get { throw null; } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus? Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBLocationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBLocationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3972,6 +4076,7 @@ public partial class CosmosDBMetricAvailability : System.ClientModel.Primitives. internal CosmosDBMetricAvailability() { } public string Retention { get { throw null; } } public string TimeGrain { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricAvailability System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricAvailability System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3986,6 +4091,7 @@ internal CosmosDBMetricDefinition() { } public Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricPrimaryAggregationType? PrimaryAggregationType { get { throw null; } } public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricUnitType? Unit { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricDefinition System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricDefinition System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -3997,6 +4103,7 @@ public partial class CosmosDBMetricName : System.ClientModel.Primitives.IJsonMod internal CosmosDBMetricName() { } public string LocalizedValue { get { throw null; } } public string Value { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricName System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricName System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4057,6 +4164,7 @@ internal CosmosDBMetricValue() { } public double? Minimum { get { throw null; } } public System.DateTimeOffset? Timestamp { get { throw null; } } public double? Total { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricValue System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricValue System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4128,6 +4236,7 @@ public CosmosDBPathIndexes() { } public Azure.ResourceManager.CosmosDB.Models.CosmosDBDataType? DataType { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBIndexKind? Kind { get { throw null; } set { } } public int? Precision { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBPathIndexes System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBPathIndexes System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4143,6 +4252,7 @@ internal CosmosDBPercentileMetric() { } public System.DateTimeOffset? StartOn { get { throw null; } } public string TimeGrain { get { throw null; } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBMetricUnitType? Unit { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBPercentileMetric System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBPercentileMetric System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4155,6 +4265,7 @@ public CosmosDBPrivateLinkServiceConnectionStateProperty() { } public string ActionsRequired { get { throw null; } } public string Description { get { throw null; } set { } } public string Status { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBPrivateLinkServiceConnectionStateProperty System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBPrivateLinkServiceConnectionStateProperty System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4186,6 +4297,7 @@ internal CosmosDBRegionalService() { } public Azure.Core.AzureLocation? Location { get { throw null; } } public string Name { get { throw null; } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceStatus? Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBRegionalService System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBRegionalService System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4221,6 +4333,7 @@ public CosmosDBServiceCreateOrUpdateContent() { } public Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceSize? InstanceSize { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.ServiceResourceCreateUpdateProperties Properties { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceType? ServiceType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceCreateOrUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4235,6 +4348,7 @@ public CosmosDBServiceProperties() { } public int? InstanceCount { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceSize? InstanceSize { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceStatus? Status { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4326,6 +4440,7 @@ public partial class CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent : Syste { public CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent(Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlClientEncryptionKeyResourceInfo resource) { } public Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlClientEncryptionKeyResourceInfo Resource { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4338,6 +4453,7 @@ public CosmosDBSqlClientEncryptionKeyProperties() { } public Azure.ETag? ETag { get { throw null; } } public string Rid { get { throw null; } } public float? Timestamp { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlClientEncryptionKeyProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlClientEncryptionKeyProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4351,6 +4467,7 @@ public CosmosDBSqlClientEncryptionKeyResourceInfo() { } public string Id { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBKeyWrapMetadata KeyWrapMetadata { get { throw null; } set { } } public byte[] WrappedDataEncryptionKey { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlClientEncryptionKeyResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlClientEncryptionKeyResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4363,6 +4480,7 @@ public CosmosDBSqlContainerCreateOrUpdateContent(Azure.Core.AzureLocation locati public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig Options { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlContainerResourceInfo Resource { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlContainerCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlContainerCreateOrUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4372,6 +4490,7 @@ public CosmosDBSqlContainerCreateOrUpdateContent(Azure.Core.AzureLocation locati public partial class CosmosDBSqlContainerPropertiesConfig : Azure.ResourceManager.CosmosDB.Models.CosmosDBBaseConfig, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public CosmosDBSqlContainerPropertiesConfig() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlContainerPropertiesConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlContainerPropertiesConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4393,6 +4512,7 @@ public CosmosDBSqlContainerResourceInfo(string containerName) { } 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; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlContainerResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlContainerResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4406,6 +4526,7 @@ public CosmosDBSqlDatabaseCreateOrUpdateContent(Azure.Core.AzureLocation locatio public Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig Options { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlDatabaseResourceInfo Resource { get { throw null; } set { } } public string ResourceDatabaseName { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlDatabaseCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlDatabaseCreateOrUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4415,6 +4536,7 @@ public CosmosDBSqlDatabaseCreateOrUpdateContent(Azure.Core.AzureLocation locatio public partial class CosmosDBSqlDatabasePropertiesConfig : Azure.ResourceManager.CosmosDB.Models.CosmosDBBaseConfig, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public CosmosDBSqlDatabasePropertiesConfig() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlDatabasePropertiesConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlDatabasePropertiesConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4427,6 +4549,7 @@ public CosmosDBSqlDatabaseResourceInfo(string databaseName) { } public Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? CreateMode { get { throw null; } set { } } public string DatabaseName { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.ResourceRestoreParameters RestoreParameters { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlDatabaseResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlDatabaseResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4439,6 +4562,7 @@ public CosmosDBSqlRoleAssignmentCreateOrUpdateContent() { } public System.Guid? PrincipalId { get { throw null; } set { } } public Azure.Core.ResourceIdentifier RoleDefinitionId { get { throw null; } set { } } public string Scope { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlRoleAssignmentCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlRoleAssignmentCreateOrUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4452,6 +4576,7 @@ public CosmosDBSqlRoleDefinitionCreateOrUpdateContent() { } public System.Collections.Generic.IList Permissions { get { throw null; } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlRoleDefinitionType? RoleDefinitionType { get { throw null; } set { } } public string RoleName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlRoleDefinitionCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlRoleDefinitionCreateOrUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4468,6 +4593,7 @@ public partial class CosmosDBSqlRolePermission : System.ClientModel.Primitives.I public CosmosDBSqlRolePermission() { } public System.Collections.Generic.IList DataActions { get { throw null; } } public System.Collections.Generic.IList NotDataActions { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlRolePermission System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlRolePermission System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4480,6 +4606,7 @@ public CosmosDBSqlStoredProcedureCreateOrUpdateContent(Azure.Core.AzureLocation public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig Options { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlStoredProcedureResourceInfo Resource { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlStoredProcedureCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlStoredProcedureCreateOrUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4491,6 +4618,7 @@ public partial class CosmosDBSqlStoredProcedureResourceInfo : System.ClientModel public CosmosDBSqlStoredProcedureResourceInfo(string storedProcedureName) { } public string Body { get { throw null; } set { } } public string StoredProcedureName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlStoredProcedureResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlStoredProcedureResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4503,6 +4631,7 @@ public CosmosDBSqlTriggerCreateOrUpdateContent(Azure.Core.AzureLocation location public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig Options { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlTriggerResourceInfo Resource { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlTriggerCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlTriggerCreateOrUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4537,6 +4666,7 @@ public CosmosDBSqlTriggerResourceInfo(string triggerName) { } public string TriggerName { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlTriggerOperation? TriggerOperation { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlTriggerType? TriggerType { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlTriggerResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlTriggerResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4567,6 +4697,7 @@ public CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent(Azure.Core.AzureLocat public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig Options { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlUserDefinedFunctionResourceInfo Resource { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4578,6 +4709,7 @@ public partial class CosmosDBSqlUserDefinedFunctionResourceInfo : System.ClientM public CosmosDBSqlUserDefinedFunctionResourceInfo(string functionName) { } public string Body { get { throw null; } set { } } public string FunctionName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlUserDefinedFunctionResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBSqlUserDefinedFunctionResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4616,6 +4748,7 @@ public CosmosDBTableCreateOrUpdateContent(Azure.Core.AzureLocation location, Azu public Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig Options { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBTableResourceInfo Resource { get { throw null; } set { } } public string ResourceTableName { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBTableCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBTableCreateOrUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4625,6 +4758,7 @@ public CosmosDBTableCreateOrUpdateContent(Azure.Core.AzureLocation location, Azu public partial class CosmosDBTablePropertiesOptions : Azure.ResourceManager.CosmosDB.Models.CosmosDBBaseConfig, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public CosmosDBTablePropertiesOptions() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBTablePropertiesOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBTablePropertiesOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4637,6 +4771,7 @@ public CosmosDBTablePropertiesResource(string tableName) : base (default(string) public Azure.ETag? ETag { get { throw null; } } public string Rid { get { throw null; } } public float? Timestamp { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBTablePropertiesResource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBTablePropertiesResource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4649,6 +4784,7 @@ public CosmosDBTableResourceInfo(string tableName) { } public Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? CreateMode { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.ResourceRestoreParameters RestoreParameters { get { throw null; } set { } } public string TableName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBTableResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBTableResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4660,6 +4796,7 @@ public partial class CosmosDBThroughputPoolPatch : System.ClientModel.Primitives public CosmosDBThroughputPoolPatch() { } public int? MaxThroughput { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBStatus? ProvisioningState { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBThroughputPoolPatch System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBThroughputPoolPatch System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4695,6 +4832,7 @@ public partial class CosmosDBUniqueKey : System.ClientModel.Primitives.IJsonMode { public CosmosDBUniqueKey() { } public System.Collections.Generic.IList Paths { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBUniqueKey System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBUniqueKey System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4706,6 +4844,7 @@ public partial class CosmosDBVirtualNetworkRule : System.ClientModel.Primitives. public CosmosDBVirtualNetworkRule() { } public Azure.Core.ResourceIdentifier Id { get { throw null; } set { } } public bool? IgnoreMissingVnetServiceEndpoint { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBVirtualNetworkRule System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosDBVirtualNetworkRule System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4717,6 +4856,7 @@ public partial class CosmosMongoDataTransferDataSourceSink : Azure.ResourceManag public CosmosMongoDataTransferDataSourceSink(string databaseName, string collectionName) { } public string CollectionName { get { throw null; } set { } } public string DatabaseName { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosMongoDataTransferDataSourceSink System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosMongoDataTransferDataSourceSink System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4728,6 +4868,7 @@ public partial class CosmosSqlDataTransferDataSourceSink : Azure.ResourceManager public CosmosSqlDataTransferDataSourceSink(string databaseName, string containerName) { } public string ContainerName { get { throw null; } set { } } public string DatabaseName { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosSqlDataTransferDataSourceSink System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.CosmosSqlDataTransferDataSourceSink System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4741,6 +4882,7 @@ internal DatabaseAccountKeysMetadata() { } public System.DateTimeOffset? PrimaryReadonlyMasterKeyGeneratedOn { get { throw null; } } public System.DateTimeOffset? SecondaryMasterKeyGeneratedOn { get { throw null; } } public System.DateTimeOffset? SecondaryReadonlyMasterKeyGeneratedOn { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.DatabaseAccountKeysMetadata System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.DatabaseAccountKeysMetadata System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4752,6 +4894,7 @@ public partial class DatabaseRestoreResourceInfo : System.ClientModel.Primitives public DatabaseRestoreResourceInfo() { } public System.Collections.Generic.IList CollectionNames { get { throw null; } } public string DatabaseName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.DatabaseRestoreResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.DatabaseRestoreResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4761,6 +4904,7 @@ public DatabaseRestoreResourceInfo() { } public abstract partial class DataTransferDataSourceSink : System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { protected DataTransferDataSourceSink() { } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.DataTransferDataSourceSink System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.DataTransferDataSourceSink System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4771,6 +4915,7 @@ public partial class DataTransferJobGetResultCreateOrUpdateContent : Azure.Resou { public DataTransferJobGetResultCreateOrUpdateContent(Azure.ResourceManager.CosmosDB.Models.DataTransferJobProperties properties) { } public Azure.ResourceManager.CosmosDB.Models.DataTransferJobProperties Properties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.DataTransferJobGetResultCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.DataTransferJobGetResultCreateOrUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4809,6 +4954,7 @@ public DataTransferJobProperties(Azure.ResourceManager.CosmosDB.Models.DataTrans public string Status { get { throw null; } } public long? TotalCount { get { throw null; } } public int? WorkerCount { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.DataTransferJobProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.DataTransferJobProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4818,6 +4964,7 @@ public DataTransferJobProperties(Azure.ResourceManager.CosmosDB.Models.DataTrans public partial class DataTransferRegionalService : Azure.ResourceManager.CosmosDB.Models.CosmosDBRegionalService, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal DataTransferRegionalService() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.DataTransferRegionalService System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.DataTransferRegionalService System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4828,6 +4975,7 @@ public partial class DataTransferServiceProperties : Azure.ResourceManager.Cosmo { public DataTransferServiceProperties() { } public System.Collections.Generic.IReadOnlyList Locations { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.DataTransferServiceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.DataTransferServiceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4837,6 +4985,7 @@ public DataTransferServiceProperties() { } public partial class DataTransferServiceResourceCreateUpdateProperties : Azure.ResourceManager.CosmosDB.Models.ServiceResourceCreateUpdateProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public DataTransferServiceResourceCreateUpdateProperties() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.DataTransferServiceResourceCreateUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.DataTransferServiceResourceCreateUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4899,6 +5048,7 @@ public ExtendedCassandraKeyspaceResourceInfo(string keyspaceName) : base (defaul public Azure.ETag? ETag { get { throw null; } } public string Rid { get { throw null; } } public float? Timestamp { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedCassandraKeyspaceResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedCassandraKeyspaceResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4911,6 +5061,7 @@ public ExtendedCassandraTableResourceInfo(string tableName) : base (default(stri public Azure.ETag? ETag { get { throw null; } } public string Rid { get { throw null; } } public float? Timestamp { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedCassandraTableResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedCassandraTableResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4923,6 +5074,7 @@ public ExtendedCosmosDBSqlContainerResourceInfo(string containerName) : base (de public Azure.ETag? ETag { get { throw null; } } public string Rid { get { throw null; } } public float? Timestamp { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedCosmosDBSqlContainerResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedCosmosDBSqlContainerResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4937,6 +5089,7 @@ public ExtendedCosmosDBSqlDatabaseResourceInfo(string databaseName) : base (defa public string Rid { get { throw null; } } public float? Timestamp { get { throw null; } } public string Users { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedCosmosDBSqlDatabaseResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedCosmosDBSqlDatabaseResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4949,6 +5102,7 @@ public ExtendedCosmosDBSqlStoredProcedureResourceInfo(string storedProcedureName public Azure.ETag? ETag { get { throw null; } } public string Rid { get { throw null; } } public float? Timestamp { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedCosmosDBSqlStoredProcedureResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedCosmosDBSqlStoredProcedureResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4961,6 +5115,7 @@ public ExtendedCosmosDBSqlTriggerResourceInfo(string triggerName) : base (defaul public Azure.ETag? ETag { get { throw null; } } public string Rid { get { throw null; } } public float? Timestamp { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedCosmosDBSqlTriggerResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedCosmosDBSqlTriggerResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4973,6 +5128,7 @@ public ExtendedCosmosDBSqlUserDefinedFunctionResourceInfo(string functionName) : public Azure.ETag? ETag { get { throw null; } } public string Rid { get { throw null; } } public float? Timestamp { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedCosmosDBSqlUserDefinedFunctionResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedCosmosDBSqlUserDefinedFunctionResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4985,6 +5141,7 @@ public ExtendedGremlinDatabaseResourceInfo(string databaseName) : base (default( public Azure.ETag? ETag { get { throw null; } } public string Rid { get { throw null; } } public float? Timestamp { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedGremlinDatabaseResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedGremlinDatabaseResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -4997,6 +5154,7 @@ public ExtendedGremlinGraphResourceInfo(string graphName) : base (default(string public Azure.ETag? ETag { get { throw null; } } public string Rid { get { throw null; } } public float? Timestamp { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedGremlinGraphResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedGremlinGraphResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5009,6 +5167,7 @@ public ExtendedMongoDBCollectionResourceInfo(string collectionName) : base (defa public Azure.ETag? ETag { get { throw null; } } public string Rid { get { throw null; } } public float? Timestamp { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedMongoDBCollectionResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedMongoDBCollectionResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5021,6 +5180,7 @@ public ExtendedMongoDBDatabaseResourceInfo(string databaseName) : base (default( public Azure.ETag? ETag { get { throw null; } } public string Rid { get { throw null; } } public float? Timestamp { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedMongoDBDatabaseResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedMongoDBDatabaseResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5037,6 +5197,7 @@ internal ExtendedRestorableGremlinDatabaseResourceInfo() { } public string EventTimestamp { get { throw null; } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBOperationType? OperationType { get { throw null; } } public string Rid { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableGremlinDatabaseResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableGremlinDatabaseResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5053,6 +5214,7 @@ internal ExtendedRestorableGremlinGraphResourceInfo() { } public string GraphName { get { throw null; } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBOperationType? OperationType { get { throw null; } } public string Rid { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableGremlinGraphResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableGremlinGraphResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5069,6 +5231,7 @@ internal ExtendedRestorableMongoDBCollectionResourceInfo() { } public string EventTimestamp { get { throw null; } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBOperationType? OperationType { get { throw null; } } public string Rid { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableMongoDBCollectionResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableMongoDBCollectionResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5085,6 +5248,7 @@ internal ExtendedRestorableMongoDBDatabaseResourceInfo() { } public string EventTimestamp { get { throw null; } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBOperationType? OperationType { get { throw null; } } public string Rid { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableMongoDBDatabaseResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableMongoDBDatabaseResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5102,6 +5266,7 @@ internal ExtendedRestorableSqlContainerResourceInfo() { } public string EventTimestamp { get { throw null; } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBOperationType? OperationType { get { throw null; } } public string Rid { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableSqlContainerResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableSqlContainerResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5119,6 +5284,7 @@ internal ExtendedRestorableSqlDatabaseResourceInfo() { } public string EventTimestamp { get { throw null; } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBOperationType? OperationType { get { throw null; } } public string Rid { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableSqlDatabaseResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableSqlDatabaseResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5135,6 +5301,7 @@ internal ExtendedRestorableTableResourceInfo() { } public string Rid { get { throw null; } } public string TableId { get { throw null; } } public string TableName { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableTableResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableTableResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5147,6 +5314,7 @@ public ExtendedThroughputSettingsResourceInfo() { } public Azure.ETag? ETag { get { throw null; } } public string Rid { get { throw null; } } public float? Timestamp { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedThroughputSettingsResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ExtendedThroughputSettingsResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5157,6 +5325,7 @@ public partial class GraphApiComputeRegionalService : Azure.ResourceManager.Cosm { internal GraphApiComputeRegionalService() { } public string GraphApiComputeEndpoint { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.GraphApiComputeRegionalService System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.GraphApiComputeRegionalService System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5168,6 +5337,7 @@ public partial class GraphApiComputeServiceProperties : Azure.ResourceManager.Co public GraphApiComputeServiceProperties() { } public string GraphApiComputeEndpoint { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList Locations { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.GraphApiComputeServiceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.GraphApiComputeServiceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5177,6 +5347,7 @@ public GraphApiComputeServiceProperties() { } public partial class GraphApiComputeServiceResourceCreateUpdateProperties : Azure.ResourceManager.CosmosDB.Models.ServiceResourceCreateUpdateProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public GraphApiComputeServiceResourceCreateUpdateProperties() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.GraphApiComputeServiceResourceCreateUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.GraphApiComputeServiceResourceCreateUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5186,6 +5357,7 @@ public GraphApiComputeServiceResourceCreateUpdateProperties() { } public partial class GraphResourceGetPropertiesOptions : Azure.ResourceManager.CosmosDB.Models.CosmosDBBaseConfig, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public GraphResourceGetPropertiesOptions() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.GraphResourceGetPropertiesOptions System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.GraphResourceGetPropertiesOptions System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5198,6 +5370,7 @@ public GraphResourceGetResultCreateOrUpdateContent(Azure.Core.AzureLocation loca public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig Options { get { throw null; } set { } } public Azure.Core.ResourceIdentifier ResourceId { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.GraphResourceGetResultCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.GraphResourceGetResultCreateOrUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5211,6 +5384,7 @@ public GremlinDatabaseCreateOrUpdateContent(Azure.Core.AzureLocation location, A public Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig Options { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.GremlinDatabaseResourceInfo Resource { get { throw null; } set { } } public string ResourceDatabaseName { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.GremlinDatabaseCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.GremlinDatabaseCreateOrUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5220,6 +5394,7 @@ public GremlinDatabaseCreateOrUpdateContent(Azure.Core.AzureLocation location, A public partial class GremlinDatabasePropertiesConfig : Azure.ResourceManager.CosmosDB.Models.CosmosDBBaseConfig, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public GremlinDatabasePropertiesConfig() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.GremlinDatabasePropertiesConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.GremlinDatabasePropertiesConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5232,6 +5407,7 @@ public GremlinDatabaseResourceInfo(string databaseName) { } public Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? CreateMode { get { throw null; } set { } } public string DatabaseName { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.ResourceRestoreParameters RestoreParameters { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.GremlinDatabaseResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.GremlinDatabaseResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5243,6 +5419,7 @@ public partial class GremlinDatabaseRestoreResourceInfo : System.ClientModel.Pri public GremlinDatabaseRestoreResourceInfo() { } public string DatabaseName { get { throw null; } set { } } public System.Collections.Generic.IList GraphNames { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.GremlinDatabaseRestoreResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.GremlinDatabaseRestoreResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5255,6 +5432,7 @@ public GremlinGraphCreateOrUpdateContent(Azure.Core.AzureLocation location, Azur public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig Options { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.GremlinGraphResourceInfo Resource { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.GremlinGraphCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.GremlinGraphCreateOrUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5264,6 +5442,7 @@ public GremlinGraphCreateOrUpdateContent(Azure.Core.AzureLocation location, Azur public partial class GremlinGraphPropertiesConfig : Azure.ResourceManager.CosmosDB.Models.CosmosDBBaseConfig, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public GremlinGraphPropertiesConfig() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.GremlinGraphPropertiesConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.GremlinGraphPropertiesConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5282,6 +5461,7 @@ public GremlinGraphResourceInfo(string graphName) { } 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; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.GremlinGraphResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.GremlinGraphResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5314,6 +5494,7 @@ 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; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MaterializedViewDefinition System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MaterializedViewDefinition System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5323,6 +5504,7 @@ public MaterializedViewDefinition(string sourceCollectionId, string definition) public partial class MaterializedViewsBuilderRegionalService : Azure.ResourceManager.CosmosDB.Models.CosmosDBRegionalService, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal MaterializedViewsBuilderRegionalService() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MaterializedViewsBuilderRegionalService System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MaterializedViewsBuilderRegionalService System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5333,6 +5515,7 @@ public partial class MaterializedViewsBuilderServiceProperties : Azure.ResourceM { public MaterializedViewsBuilderServiceProperties() { } public System.Collections.Generic.IReadOnlyList Locations { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MaterializedViewsBuilderServiceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MaterializedViewsBuilderServiceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5342,6 +5525,7 @@ public MaterializedViewsBuilderServiceProperties() { } public partial class MaterializedViewsBuilderServiceResourceCreateUpdateProperties : Azure.ResourceManager.CosmosDB.Models.ServiceResourceCreateUpdateProperties, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MaterializedViewsBuilderServiceResourceCreateUpdateProperties() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MaterializedViewsBuilderServiceResourceCreateUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MaterializedViewsBuilderServiceResourceCreateUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5352,6 +5536,7 @@ public partial class MergeParameters : System.ClientModel.Primitives.IJsonModel< { public MergeParameters() { } public bool? IsDryRun { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MergeParameters System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MergeParameters System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5364,6 +5549,7 @@ public MongoDBCollectionCreateOrUpdateContent(Azure.Core.AzureLocation location, public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig Options { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.MongoDBCollectionResourceInfo Resource { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MongoDBCollectionCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MongoDBCollectionCreateOrUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5373,6 +5559,7 @@ public MongoDBCollectionCreateOrUpdateContent(Azure.Core.AzureLocation location, public partial class MongoDBCollectionPropertiesConfig : Azure.ResourceManager.CosmosDB.Models.CosmosDBBaseConfig, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MongoDBCollectionPropertiesConfig() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MongoDBCollectionPropertiesConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MongoDBCollectionPropertiesConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5388,6 +5575,7 @@ public MongoDBCollectionResourceInfo(string collectionName) { } public System.Collections.Generic.IList Indexes { get { throw null; } } public Azure.ResourceManager.CosmosDB.Models.ResourceRestoreParameters RestoreParameters { get { throw null; } set { } } public System.Collections.Generic.IDictionary ShardKey { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MongoDBCollectionResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MongoDBCollectionResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5401,6 +5589,7 @@ public MongoDBDatabaseCreateOrUpdateContent(Azure.Core.AzureLocation location, A public Azure.ResourceManager.CosmosDB.Models.CosmosDBCreateUpdateConfig Options { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.MongoDBDatabaseResourceInfo Resource { get { throw null; } set { } } public string ResourceDatabaseName { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MongoDBDatabaseCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MongoDBDatabaseCreateOrUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5410,6 +5599,7 @@ public MongoDBDatabaseCreateOrUpdateContent(Azure.Core.AzureLocation location, A public partial class MongoDBDatabasePropertiesConfig : Azure.ResourceManager.CosmosDB.Models.CosmosDBBaseConfig, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public MongoDBDatabasePropertiesConfig() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MongoDBDatabasePropertiesConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MongoDBDatabasePropertiesConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5422,6 +5612,7 @@ public MongoDBDatabaseResourceInfo(string databaseName) { } public Azure.ResourceManager.CosmosDB.Models.CosmosDBAccountCreateMode? CreateMode { get { throw null; } set { } } public string DatabaseName { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.ResourceRestoreParameters RestoreParameters { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MongoDBDatabaseResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MongoDBDatabaseResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5433,6 +5624,7 @@ public partial class MongoDBIndex : System.ClientModel.Primitives.IJsonModel Keys { get { throw null; } } public Azure.ResourceManager.CosmosDB.Models.MongoDBIndexConfig Options { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MongoDBIndex System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MongoDBIndex System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5444,6 +5636,7 @@ public partial class MongoDBIndexConfig : System.ClientModel.Primitives.IJsonMod public MongoDBIndexConfig() { } public int? ExpireAfterSeconds { get { throw null; } set { } } public bool? IsUnique { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MongoDBIndexConfig System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MongoDBIndexConfig System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5455,6 +5648,7 @@ public partial class MongoDBPrivilege : System.ClientModel.Primitives.IJsonModel public MongoDBPrivilege() { } public System.Collections.Generic.IList Actions { get { throw null; } } public Azure.ResourceManager.CosmosDB.Models.MongoDBPrivilegeResourceInfo Resource { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MongoDBPrivilege System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MongoDBPrivilege System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5466,6 +5660,7 @@ public partial class MongoDBPrivilegeResourceInfo : System.ClientModel.Primitive public MongoDBPrivilegeResourceInfo() { } public string Collection { get { throw null; } set { } } public string DBName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MongoDBPrivilegeResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MongoDBPrivilegeResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5477,6 +5672,7 @@ public partial class MongoDBRole : System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MongoDBRole System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5491,6 +5687,7 @@ public MongoDBRoleDefinitionCreateOrUpdateContent() { } public System.Collections.Generic.IList Privileges { get { throw null; } } public string RoleName { get { throw null; } set { } } public System.Collections.Generic.IList Roles { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MongoDBRoleDefinitionCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MongoDBRoleDefinitionCreateOrUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5511,6 +5708,7 @@ public MongoDBUserDefinitionCreateOrUpdateContent() { } public string Password { get { throw null; } set { } } public System.Collections.Generic.IList Roles { get { throw null; } } public string UserName { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MongoDBUserDefinitionCreateOrUpdateContent System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.MongoDBUserDefinitionCreateOrUpdateContent System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5528,6 +5726,7 @@ public NetworkSecurityPerimeter() { } public Azure.Core.ResourceIdentifier Id { get { throw null; } set { } } public Azure.Core.AzureLocation? Location { get { throw null; } set { } } public System.Guid? PerimeterGuid { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.NetworkSecurityPerimeter System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.NetworkSecurityPerimeter System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5542,6 +5741,7 @@ public NetworkSecurityPerimeterConfigurationProperties() { } public System.Collections.Generic.IReadOnlyList ProvisioningIssues { get { throw null; } } public Azure.ResourceManager.CosmosDB.Models.NetworkSecurityPerimeterConfigurationProvisioningState? ProvisioningState { get { throw null; } } public Azure.ResourceManager.CosmosDB.Models.ResourceAssociation ResourceAssociation { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.NetworkSecurityPerimeterConfigurationProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.NetworkSecurityPerimeterConfigurationProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5579,6 +5779,7 @@ public NetworkSecurityProfile() { } public int? DiagnosticSettingsVersion { get { throw null; } set { } } public System.Collections.Generic.IList EnabledLogCategories { get { throw null; } } public string Name { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.NetworkSecurityProfile System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.NetworkSecurityProfile System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5590,6 +5791,7 @@ public partial class PartitionMetric : Azure.ResourceManager.CosmosDB.Models.Cos internal PartitionMetric() { } public System.Guid? PartitionId { get { throw null; } } public string PartitionKeyRangeId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.PartitionMetric System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.PartitionMetric System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5601,6 +5803,7 @@ public partial class PartitionUsage : Azure.ResourceManager.CosmosDB.Models.Cosm internal PartitionUsage() { } public System.Guid? PartitionId { get { throw null; } } public string PartitionKeyRangeId { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.PartitionUsage System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.PartitionUsage System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5617,6 +5820,7 @@ internal PercentileMetricValue() { } public double? P90 { get { throw null; } } public double? P95 { get { throw null; } } public double? P99 { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.PercentileMetricValue System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.PercentileMetricValue System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5627,6 +5831,7 @@ public partial class PeriodicModeBackupPolicy : Azure.ResourceManager.CosmosDB.M { public PeriodicModeBackupPolicy() { } public Azure.ResourceManager.CosmosDB.Models.PeriodicModeProperties PeriodicModeProperties { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.PeriodicModeBackupPolicy System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.PeriodicModeBackupPolicy System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5639,6 +5844,7 @@ public PeriodicModeProperties() { } public int? BackupIntervalInMinutes { get { throw null; } set { } } public int? BackupRetentionIntervalInHours { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBBackupStorageRedundancy? BackupStorageRedundancy { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.PeriodicModeProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.PeriodicModeProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5650,6 +5856,7 @@ public partial class PhysicalPartitionStorageInfo : System.ClientModel.Primitive internal PhysicalPartitionStorageInfo() { } public string Id { get { throw null; } } public double? StorageInKB { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.PhysicalPartitionStorageInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.PhysicalPartitionStorageInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5660,6 +5867,7 @@ public partial class PhysicalPartitionStorageInfoCollection : System.ClientModel { internal PhysicalPartitionStorageInfoCollection() { } public System.Collections.Generic.IReadOnlyList PhysicalPartitionStorageInfoCollectionValue { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.PhysicalPartitionStorageInfoCollection System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.PhysicalPartitionStorageInfoCollection System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5671,6 +5879,7 @@ public partial class PhysicalPartitionThroughputInfoResource : System.ClientMode public PhysicalPartitionThroughputInfoResource(string id) { } public string Id { get { throw null; } set { } } public double? Throughput { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.PhysicalPartitionThroughputInfoResource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.PhysicalPartitionThroughputInfoResource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5682,6 +5891,7 @@ public partial class PhysicalPartitionThroughputInfoResult : Azure.ResourceManag public PhysicalPartitionThroughputInfoResult(Azure.Core.AzureLocation location) { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public System.Collections.Generic.IList ResourcePhysicalPartitionThroughputInfo { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.PhysicalPartitionThroughputInfoResult System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.PhysicalPartitionThroughputInfoResult System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5693,6 +5903,7 @@ public partial class ProvisioningIssue : System.ClientModel.Primitives.IJsonMode internal ProvisioningIssue() { } public string Name { get { throw null; } } public Azure.ResourceManager.CosmosDB.Models.ProvisioningIssueProperties Properties { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ProvisioningIssue System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ProvisioningIssue System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5707,6 +5918,7 @@ internal ProvisioningIssueProperties() { } public Azure.ResourceManager.CosmosDB.Models.Severity? Severity { get { throw null; } } public System.Collections.Generic.IReadOnlyList SuggestedAccessRules { get { throw null; } } public System.Collections.Generic.IReadOnlyList SuggestedResourceIds { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ProvisioningIssueProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ProvisioningIssueProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5718,6 +5930,7 @@ public partial class RedistributeThroughputParameters : Azure.ResourceManager.Mo public RedistributeThroughputParameters(Azure.Core.AzureLocation location, Azure.ResourceManager.CosmosDB.Models.RedistributeThroughputPropertiesResource resource) { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.RedistributeThroughputPropertiesResource Resource { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RedistributeThroughputParameters System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RedistributeThroughputParameters System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5730,6 +5943,7 @@ public RedistributeThroughputPropertiesResource(Azure.ResourceManager.CosmosDB.M public System.Collections.Generic.IList SourcePhysicalPartitionThroughputInfo { get { throw null; } } public System.Collections.Generic.IList TargetPhysicalPartitionThroughputInfo { get { throw null; } } public Azure.ResourceManager.CosmosDB.Models.ThroughputPolicyType ThroughputPolicy { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RedistributeThroughputPropertiesResource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RedistributeThroughputPropertiesResource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5740,6 +5954,7 @@ public partial class RegionForOnlineOffline : System.ClientModel.Primitives.IJso { public RegionForOnlineOffline(string region) { } public string Region { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RegionForOnlineOffline System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RegionForOnlineOffline System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5751,6 +5966,7 @@ public partial class ResourceAssociation : System.ClientModel.Primitives.IJsonMo public ResourceAssociation() { } public Azure.ResourceManager.CosmosDB.Models.ResourceAssociationAccessMode? AccessMode { get { throw null; } set { } } public string Name { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ResourceAssociation System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ResourceAssociation System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5779,6 +5995,7 @@ public ResourceAssociation() { } public partial class ResourceRestoreParameters : Azure.ResourceManager.CosmosDB.Models.RestoreParametersBase, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { public ResourceRestoreParameters() { } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ResourceRestoreParameters System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ResourceRestoreParameters System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5789,6 +6006,7 @@ public partial class RestorableGremlinDatabase : Azure.ResourceManager.Models.Re { internal RestorableGremlinDatabase() { } public Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableGremlinDatabaseResourceInfo Resource { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RestorableGremlinDatabase System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RestorableGremlinDatabase System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5799,6 +6017,7 @@ public partial class RestorableGremlinGraph : Azure.ResourceManager.Models.Resou { internal RestorableGremlinGraph() { } public Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableGremlinGraphResourceInfo Resource { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RestorableGremlinGraph System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RestorableGremlinGraph System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5810,6 +6029,7 @@ public partial class RestorableGremlinResourceData : Azure.ResourceManager.Model internal RestorableGremlinResourceData() { } public string DatabaseName { get { throw null; } } public System.Collections.Generic.IReadOnlyList GraphNames { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RestorableGremlinResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RestorableGremlinResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5823,6 +6043,7 @@ internal RestorableLocationResourceInfo() { } public System.DateTimeOffset? DeletedOn { get { throw null; } } public Azure.Core.AzureLocation? LocationName { get { throw null; } } public string RegionalDatabaseAccountInstanceId { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RestorableLocationResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RestorableLocationResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5833,6 +6054,7 @@ public partial class RestorableMongoDBCollection : Azure.ResourceManager.Models. { internal RestorableMongoDBCollection() { } public Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableMongoDBCollectionResourceInfo Resource { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RestorableMongoDBCollection System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RestorableMongoDBCollection System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5843,6 +6065,7 @@ public partial class RestorableMongoDBDatabase : Azure.ResourceManager.Models.Re { internal RestorableMongoDBDatabase() { } public Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableMongoDBDatabaseResourceInfo Resource { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RestorableMongoDBDatabase System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RestorableMongoDBDatabase System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5854,6 +6077,7 @@ public partial class RestorableMongoDBResourceData : Azure.ResourceManager.Model internal RestorableMongoDBResourceData() { } public System.Collections.Generic.IReadOnlyList CollectionNames { get { throw null; } } public string DatabaseName { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RestorableMongoDBResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RestorableMongoDBResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5864,6 +6088,7 @@ public partial class RestorableSqlContainer : Azure.ResourceManager.Models.Resou { internal RestorableSqlContainer() { } public Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableSqlContainerResourceInfo Resource { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RestorableSqlContainer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RestorableSqlContainer System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5877,6 +6102,7 @@ public RestorableSqlContainerPropertiesResourceContainer(string containerName) : public string Rid { get { throw null; } } public string Self { get { throw null; } } public float? Timestamp { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RestorableSqlContainerPropertiesResourceContainer System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RestorableSqlContainerPropertiesResourceContainer System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5887,6 +6113,7 @@ public partial class RestorableSqlDatabase : Azure.ResourceManager.Models.Resour { internal RestorableSqlDatabase() { } public Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableSqlDatabaseResourceInfo Resource { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RestorableSqlDatabase System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RestorableSqlDatabase System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5902,6 +6129,7 @@ public RestorableSqlDatabasePropertiesResourceDatabase(string databaseName) : ba public string Self { get { throw null; } } public float? Timestamp { get { throw null; } } public string Users { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RestorableSqlDatabasePropertiesResourceDatabase System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RestorableSqlDatabasePropertiesResourceDatabase System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5913,6 +6141,7 @@ public partial class RestorableSqlResourceData : Azure.ResourceManager.Models.Re internal RestorableSqlResourceData() { } public System.Collections.Generic.IReadOnlyList CollectionNames { get { throw null; } } public string DatabaseName { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RestorableSqlResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RestorableSqlResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5923,6 +6152,7 @@ public partial class RestorableTable : Azure.ResourceManager.Models.ResourceData { internal RestorableTable() { } public Azure.ResourceManager.CosmosDB.Models.ExtendedRestorableTableResourceInfo Resource { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RestorableTable System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RestorableTable System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5935,6 +6165,7 @@ internal RestorableTableResourceData() { } public string Id { get { throw null; } } public string Name { get { throw null; } } public string ResourceType { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RestorableTableResourceData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RestorableTableResourceData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5947,6 +6178,7 @@ public RestoreParametersBase() { } public bool? IsRestoreWithTtlDisabled { get { throw null; } set { } } public string RestoreSource { get { throw null; } set { } } public System.DateTimeOffset? RestoreTimestampInUtc { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RestoreParametersBase System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RestoreParametersBase System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5958,6 +6190,7 @@ public partial class RetrieveThroughputParameters : Azure.ResourceManager.Models public RetrieveThroughputParameters(Azure.Core.AzureLocation location, Azure.ResourceManager.CosmosDB.Models.RetrieveThroughputPropertiesResource resource) { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public System.Collections.Generic.IList ResourcePhysicalPartitionIds { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RetrieveThroughputParameters System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RetrieveThroughputParameters System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -5968,6 +6201,7 @@ public partial class RetrieveThroughputPropertiesResource : System.ClientModel.P { public RetrieveThroughputPropertiesResource(System.Collections.Generic.IEnumerable physicalPartitionIds) { } public System.Collections.Generic.IList PhysicalPartitionIds { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RetrieveThroughputPropertiesResource System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.RetrieveThroughputPropertiesResource System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -6016,6 +6250,7 @@ public abstract partial class ServiceResourceCreateUpdateProperties : System.Cli protected ServiceResourceCreateUpdateProperties() { } public int? InstanceCount { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.CosmosDBServiceSize? InstanceSize { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ServiceResourceCreateUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ServiceResourceCreateUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -6045,6 +6280,7 @@ public partial class SpatialSpec : System.ClientModel.Primitives.IJsonModel Types { get { throw null; } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.SpatialSpec System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.SpatialSpec System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -6055,6 +6291,7 @@ public partial class SqlDedicatedGatewayRegionalService : Azure.ResourceManager. { internal SqlDedicatedGatewayRegionalService() { } public string SqlDedicatedGatewayEndpoint { get { throw null; } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.SqlDedicatedGatewayRegionalService System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.SqlDedicatedGatewayRegionalService System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -6067,6 +6304,7 @@ public SqlDedicatedGatewayServiceProperties() { } public Azure.ResourceManager.CosmosDB.Models.DedicatedGatewayType? DedicatedGatewayType { get { throw null; } set { } } public System.Collections.Generic.IReadOnlyList Locations { get { throw null; } } public string SqlDedicatedGatewayEndpoint { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.SqlDedicatedGatewayServiceProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.SqlDedicatedGatewayServiceProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -6077,6 +6315,7 @@ public partial class SqlDedicatedGatewayServiceResourceCreateUpdateProperties : { public SqlDedicatedGatewayServiceResourceCreateUpdateProperties() { } public Azure.ResourceManager.CosmosDB.Models.DedicatedGatewayType? DedicatedGatewayType { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.SqlDedicatedGatewayServiceResourceCreateUpdateProperties System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.SqlDedicatedGatewayServiceResourceCreateUpdateProperties System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -6088,6 +6327,7 @@ public partial class ThroughputPolicyResourceInfo : System.ClientModel.Primitive public ThroughputPolicyResourceInfo() { } public int? IncrementPercent { get { throw null; } set { } } public bool? IsEnabled { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ThroughputPolicyResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ThroughputPolicyResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -6122,6 +6362,7 @@ public ThroughputSettingsResourceInfo() { } public string OfferReplacePending { get { throw null; } } public string SoftAllowedMaximumThroughput { get { throw null; } } public int? Throughput { get { throw null; } set { } } + protected virtual void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ThroughputSettingsResourceInfo System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ThroughputSettingsResourceInfo System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } @@ -6133,6 +6374,7 @@ public partial class ThroughputSettingsUpdateData : Azure.ResourceManager.Models public ThroughputSettingsUpdateData(Azure.Core.AzureLocation location, Azure.ResourceManager.CosmosDB.Models.ThroughputSettingsResourceInfo resource) { } public Azure.ResourceManager.Models.ManagedServiceIdentity Identity { get { throw null; } set { } } public Azure.ResourceManager.CosmosDB.Models.ThroughputSettingsResourceInfo Resource { get { throw null; } set { } } + protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ThroughputSettingsUpdateData System.ClientModel.Primitives.IJsonModel.Create(ref System.Text.Json.Utf8JsonReader reader, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } void System.ClientModel.Primitives.IJsonModel.Write(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.CosmosDB.Models.ThroughputSettingsUpdateData System.ClientModel.Primitives.IPersistableModel.Create(System.BinaryData data, System.ClientModel.Primitives.ModelReaderWriterOptions options) { throw null; } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/assets.json b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/assets.json index d36929614e017..60caa289ca17e 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_4896b8af3d" + "Tag": "net/cosmosdb/Azure.ResourceManager.CosmosDB_91f3220bd8" } diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterData.Serialization.cs index 00df94ee51e3d..fbc9c1469a363 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraClusterData.Serialization.cs @@ -22,6 +22,15 @@ public partial class CassandraClusterData : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,7 +38,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(CassandraClusterData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); @@ -40,55 +49,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr writer.WritePropertyName("identity"u8); JsonSerializer.Serialize(writer, Identity); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CassandraClusterData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterData.Serialization.cs index 7b91e1e7d6795..682bea2228a6f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraDataCenterData.Serialization.cs @@ -21,6 +21,15 @@ public partial class CassandraDataCenterData : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,48 +37,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(CassandraDataCenterData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CassandraDataCenterData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceData.Serialization.cs index 074a6a239663f..055f7a03a3a87 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraKeyspaceData.Serialization.cs @@ -22,6 +22,15 @@ public partial class CassandraKeyspaceData : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,46 +38,13 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(CassandraKeyspaceData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -82,22 +58,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW writer.WriteObjectValue(Options, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CassandraKeyspaceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableData.Serialization.cs index 98274578431d7..7e971bbf6ef6d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraTableData.Serialization.cs @@ -22,6 +22,15 @@ public partial class CassandraTableData : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,46 +38,13 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(CassandraTableData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -82,22 +58,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit writer.WriteObjectValue(Options, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CassandraTableData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultData.Serialization.cs index dda3d0de1eb72..5bfe68e8d4522 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CassandraViewGetResultData.Serialization.cs @@ -22,6 +22,15 @@ public partial class CassandraViewGetResultData : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,46 +38,13 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(CassandraViewGetResultData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -82,22 +58,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WriteObjectValue(Options, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CassandraViewGetResultData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.Serialization.cs index 0a489937adece..62f789c6f8c1f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBAccountData.Serialization.cs @@ -22,6 +22,15 @@ public partial class CosmosDBAccountData : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,7 +38,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(CosmosDBAccountData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Kind)) { writer.WritePropertyName("kind"u8); @@ -41,39 +50,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) @@ -362,22 +338,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri writer.WriteBooleanValue(EnablePerRegionPerPartitionAutoscale.Value); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CosmosDBAccountData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationData.Serialization.cs index 9f613c9a0617c..09431f46e43a2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBLocationData.Serialization.cs @@ -21,6 +21,15 @@ public partial class CosmosDBLocationData : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,48 +37,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(CosmosDBLocationData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CosmosDBLocationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionData.Serialization.cs index c9c48df8b08f8..ea7553ad3da67 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateEndpointConnectionData.Serialization.cs @@ -21,6 +21,15 @@ public partial class CosmosDBPrivateEndpointConnectionData : IUtf8JsonSerializab void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,27 +37,7 @@ void IJsonModel.Write(Utf8JsonWriter writ throw new FormatException($"The model {nameof(CosmosDBPrivateEndpointConnectionData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(PrivateEndpoint)) @@ -72,22 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WriteStringValue(ProvisioningState); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CosmosDBPrivateEndpointConnectionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResourceData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResourceData.Serialization.cs index e9aeeaf9c0b94..cd3375a5c1b79 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResourceData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBPrivateLinkResourceData.Serialization.cs @@ -21,6 +21,15 @@ public partial class CosmosDBPrivateLinkResourceData : IUtf8JsonSerializable, IJ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,27 +37,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo throw new FormatException($"The model {nameof(CosmosDBPrivateLinkResourceData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(GroupId)) @@ -77,22 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo writer.WriteEndArray(); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CosmosDBPrivateLinkResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceData.Serialization.cs index a8209784bcff6..c654cde9bf783 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBServiceData.Serialization.cs @@ -21,6 +21,15 @@ public partial class CosmosDBServiceData : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,48 +37,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(CosmosDBServiceData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CosmosDBServiceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyData.Serialization.cs index a5b6f4b70b71b..97324b0a9b940 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlClientEncryptionKeyData.Serialization.cs @@ -21,6 +21,15 @@ public partial class CosmosDBSqlClientEncryptionKeyData : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,27 +37,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(CosmosDBSqlClientEncryptionKeyData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -57,22 +46,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteObjectValue(Resource, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CosmosDBSqlClientEncryptionKeyData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerData.Serialization.cs index 9b42f5b0caed5..005a2be0d1250 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlContainerData.Serialization.cs @@ -22,6 +22,15 @@ public partial class CosmosDBSqlContainerData : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,46 +38,13 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(CosmosDBSqlContainerData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -82,22 +58,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead writer.WriteObjectValue(Options, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CosmosDBSqlContainerData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseData.Serialization.cs index db802a7149d86..390dd4463fc0f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlDatabaseData.Serialization.cs @@ -22,6 +22,15 @@ public partial class CosmosDBSqlDatabaseData : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,46 +38,13 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(CosmosDBSqlDatabaseData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -82,22 +58,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade writer.WriteObjectValue(Options, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CosmosDBSqlDatabaseData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentData.Serialization.cs index 9a5d23bc0aa56..1f4c945b4f6ff 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleAssignmentData.Serialization.cs @@ -20,6 +20,15 @@ public partial class CosmosDBSqlRoleAssignmentData : IUtf8JsonSerializable, IJso void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,27 +36,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(CosmosDBSqlRoleAssignmentData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(RoleDefinitionId)) @@ -66,22 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WriteStringValue(PrincipalId.Value); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CosmosDBSqlRoleAssignmentData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionData.Serialization.cs index 9290af21d81aa..01ea8f076d57f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlRoleDefinitionData.Serialization.cs @@ -22,6 +22,15 @@ public partial class CosmosDBSqlRoleDefinitionData : IUtf8JsonSerializable, IJso void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,27 +38,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(CosmosDBSqlRoleDefinitionData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(RoleName)) @@ -83,22 +72,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WriteEndArray(); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CosmosDBSqlRoleDefinitionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureData.Serialization.cs index d7b1c42b674bf..2370f9e1be87c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlStoredProcedureData.Serialization.cs @@ -22,6 +22,15 @@ public partial class CosmosDBSqlStoredProcedureData : IUtf8JsonSerializable, IJs void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,46 +38,13 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(CosmosDBSqlStoredProcedureData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -77,22 +53,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod writer.WriteObjectValue(Resource, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CosmosDBSqlStoredProcedureData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerData.Serialization.cs index f7ac7a840113e..5a1797357e81b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlTriggerData.Serialization.cs @@ -22,6 +22,15 @@ public partial class CosmosDBSqlTriggerData : IUtf8JsonSerializable, IJsonModel< void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,46 +38,13 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(CosmosDBSqlTriggerData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -77,22 +53,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader writer.WriteObjectValue(Resource, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CosmosDBSqlTriggerData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionData.Serialization.cs index 089a5bc8ef35f..c774f7620b962 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBSqlUserDefinedFunctionData.Serialization.cs @@ -22,6 +22,15 @@ public partial class CosmosDBSqlUserDefinedFunctionData : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,46 +38,13 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(CosmosDBSqlUserDefinedFunctionData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -77,22 +53,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteObjectValue(Resource, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CosmosDBSqlUserDefinedFunctionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableData.Serialization.cs index b4b14ebd0d887..725b45b0b7cdd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBTableData.Serialization.cs @@ -22,6 +22,15 @@ public partial class CosmosDBTableData : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,46 +38,13 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite throw new FormatException($"The model {nameof(CosmosDBTableData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -82,22 +58,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite writer.WriteObjectValue(Options, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CosmosDBTableData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountData.Serialization.cs index 52478831ea404..c7981782b0191 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolAccountData.Serialization.cs @@ -21,6 +21,15 @@ public partial class CosmosDBThroughputPoolAccountData : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,27 +37,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(CosmosDBThroughputPoolAccountData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(ProvisioningState)) @@ -72,22 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteStringValue(AccountInstanceId); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CosmosDBThroughputPoolAccountData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolData.Serialization.cs index 25017af2cfb99..8efb9d1add789 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/CosmosDBThroughputPoolData.Serialization.cs @@ -22,6 +22,15 @@ public partial class CosmosDBThroughputPoolData : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,40 +38,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(CosmosDBThroughputPoolData)} does not support writing '{format}' format."); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(ProvisioningState)) @@ -76,22 +52,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WriteNumberValue(MaxThroughput.Value); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CosmosDBThroughputPoolData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultData.Serialization.cs index 1cfeffb569176..a698d8d2dd8e8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/DataTransferJobGetResultData.Serialization.cs @@ -21,6 +21,15 @@ public partial class DataTransferJobGetResultData : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,27 +37,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(DataTransferJobGetResultData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(JobName)) @@ -107,22 +96,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model writer.WriteStringValue(Mode.Value.ToString()); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } DataTransferJobGetResultData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultData.Serialization.cs index 7a2d7010da264..8515677a31913 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GraphResourceGetResultData.Serialization.cs @@ -23,6 +23,15 @@ public partial class GraphResourceGetResultData : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -30,46 +39,13 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(GraphResourceGetResultData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -83,22 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe writer.WriteObjectValue(Options, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } GraphResourceGetResultData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseData.Serialization.cs index 14949bb6f7b64..004ed6405666a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinDatabaseData.Serialization.cs @@ -22,6 +22,15 @@ public partial class GremlinDatabaseData : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,46 +38,13 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(GremlinDatabaseData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -82,22 +58,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri writer.WriteObjectValue(Options, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } GremlinDatabaseData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphData.Serialization.cs index 21dac0e3f4ae9..a7c49307ed245 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/GremlinGraphData.Serialization.cs @@ -22,6 +22,15 @@ public partial class GremlinGraphData : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,46 +38,13 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(GremlinGraphData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -82,22 +58,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter writer.WriteObjectValue(Options, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } GremlinGraphData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRule.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRule.Serialization.cs index c92851b175a9b..0cc1c9822adda 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRule.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRule.Serialization.cs @@ -19,6 +19,15 @@ public partial class AccessRule : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption throw new FormatException($"The model {nameof(AccessRule)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOption #endif } } - writer.WriteEndObject(); } AccessRule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleProperties.Serialization.cs index cd897a3892f07..e7c72c0579249 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleProperties.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccessRuleProperties.Serialization.cs @@ -21,6 +21,15 @@ public partial class AccessRuleProperties : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,7 +37,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(AccessRuleProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Direction)) { writer.WritePropertyName("direction"u8); @@ -109,7 +117,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } AccessRuleProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccountKeyMetadata.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccountKeyMetadata.Serialization.cs index e778ac3f9c078..cd8c9469e4d70 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccountKeyMetadata.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AccountKeyMetadata.Serialization.cs @@ -19,6 +19,15 @@ internal partial class AccountKeyMetadata : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(AccountKeyMetadata)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(GeneratedOn)) { writer.WritePropertyName("generationTime"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit #endif } } - writer.WriteEndObject(); } AccountKeyMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AnalyticalStorageConfiguration.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AnalyticalStorageConfiguration.Serialization.cs index 97f4ada05f0ee..233a7f33871b9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AnalyticalStorageConfiguration.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AnalyticalStorageConfiguration.Serialization.cs @@ -19,6 +19,15 @@ internal partial class AnalyticalStorageConfiguration : IUtf8JsonSerializable, I void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(AnalyticalStorageConfiguration)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(SchemaType)) { writer.WritePropertyName("schemaType"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod #endif } } - writer.WriteEndObject(); } AnalyticalStorageConfiguration IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ApiProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ApiProperties.Serialization.cs index 21b01a80fb73a..dd6d20cef0c34 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ApiProperties.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ApiProperties.Serialization.cs @@ -19,6 +19,15 @@ internal partial class ApiProperties : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpt throw new FormatException($"The model {nameof(ApiProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ServerVersion)) { writer.WritePropertyName("serverVersion"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpt #endif } } - writer.WriteEndObject(); } ApiProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) 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 fff48ef148ac4..09c01bf291b9b 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 @@ -20,6 +20,15 @@ public partial class AuthenticationMethodLdapProperties : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(AuthenticationMethodLdapProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ServerHostname)) { writer.WritePropertyName("serverHostname"u8); @@ -88,7 +96,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, #endif } } - writer.WriteEndObject(); } AuthenticationMethodLdapProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AutoUpgradePolicyResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AutoUpgradePolicyResourceInfo.Serialization.cs index 73b90e7dc0501..7a5c0bb71fdb8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AutoUpgradePolicyResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AutoUpgradePolicyResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ internal partial class AutoUpgradePolicyResourceInfo : IUtf8JsonSerializable, IJ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(AutoUpgradePolicyResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ThroughputPolicy)) { writer.WritePropertyName("throughputPolicy"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode #endif } } - writer.WriteEndObject(); } AutoUpgradePolicyResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AutoscaleSettings.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AutoscaleSettings.Serialization.cs index 953d1327b62d7..4ef18110a237e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AutoscaleSettings.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AutoscaleSettings.Serialization.cs @@ -19,6 +19,15 @@ internal partial class AutoscaleSettings : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite throw new FormatException($"The model {nameof(AutoscaleSettings)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(MaxThroughput)) { writer.WritePropertyName("maxThroughput"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite #endif } } - writer.WriteEndObject(); } AutoscaleSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AutoscaleSettingsResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AutoscaleSettingsResourceInfo.Serialization.cs index 6de45420c7cec..b8a1df73577fe 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AutoscaleSettingsResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AutoscaleSettingsResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class AutoscaleSettingsResourceInfo : IUtf8JsonSerializable, IJso void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(AutoscaleSettingsResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("maxThroughput"u8); writer.WriteNumberValue(MaxThroughput); if (Optional.IsDefined(AutoUpgradePolicy)) @@ -54,7 +62,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode #endif } } - writer.WriteEndObject(); } AutoscaleSettingsResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobDataTransferDataSourceSink.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobDataTransferDataSourceSink.Serialization.cs index a7dfdd43049e8..1c55b637ec676 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobDataTransferDataSourceSink.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/AzureBlobDataTransferDataSourceSink.Serialization.cs @@ -19,6 +19,15 @@ public partial class AzureBlobDataTransferDataSourceSink : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter writer throw new FormatException($"The model {nameof(AzureBlobDataTransferDataSourceSink)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("containerName"u8); writer.WriteStringValue(ContainerName); if (Optional.IsDefined(EndpointUri)) @@ -34,24 +43,6 @@ void IJsonModel.Write(Utf8JsonWriter writer writer.WritePropertyName("endpointUrl"u8); writer.WriteStringValue(EndpointUri.AbsoluteUri); } - writer.WritePropertyName("component"u8); - writer.WriteStringValue(Component.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } AzureBlobDataTransferDataSourceSink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupPolicyMigrationState.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupPolicyMigrationState.Serialization.cs index 6a8c812c76f5c..1550d0c250eb6 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupPolicyMigrationState.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BackupPolicyMigrationState.Serialization.cs @@ -19,6 +19,15 @@ public partial class BackupPolicyMigrationState : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(BackupPolicyMigrationState)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Status)) { writer.WritePropertyName("status"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } BackupPolicyMigrationState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCosmosDataTransferDataSourceSink.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCosmosDataTransferDataSourceSink.Serialization.cs index 45fe531a8667e..d4f74b855192d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCosmosDataTransferDataSourceSink.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/BaseCosmosDataTransferDataSourceSink.Serialization.cs @@ -19,6 +19,15 @@ public partial class BaseCosmosDataTransferDataSourceSink : IUtf8JsonSerializabl void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,30 +35,12 @@ void IJsonModel.Write(Utf8JsonWriter write throw new FormatException($"The model {nameof(BaseCosmosDataTransferDataSourceSink)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(RemoteAccountName)) { writer.WritePropertyName("remoteAccountName"u8); writer.WriteStringValue(RemoteAccountName); } - writer.WritePropertyName("component"u8); - writer.WriteStringValue(Component.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } BaseCosmosDataTransferDataSourceSink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeChangeTransitionState.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeChangeTransitionState.Serialization.cs index db4ddb6061226..612a2fd889e1b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeChangeTransitionState.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CapacityModeChangeTransitionState.Serialization.cs @@ -19,6 +19,15 @@ public partial class CapacityModeChangeTransitionState : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(CapacityModeChangeTransitionState)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(CapacityModeTransitionStatus)) { writer.WritePropertyName("capacityModeTransitionStatus"u8); @@ -72,7 +80,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, #endif } } - writer.WriteEndObject(); } CapacityModeChangeTransitionState IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCertificate.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCertificate.Serialization.cs index 19a8e81d72339..13495324e5cac 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCertificate.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCertificate.Serialization.cs @@ -19,6 +19,15 @@ public partial class CassandraCertificate : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(CassandraCertificate)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Pem)) { writer.WritePropertyName("pem"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } CassandraCertificate IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupResourceInfo.Serialization.cs index fa718e7abcd9e..34f1433d5c5f7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class CassandraClusterBackupResourceInfo : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(CassandraClusterBackupResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(BackupId)) { writer.WritePropertyName("backupId"u8); @@ -67,7 +75,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, #endif } } - writer.WriteEndObject(); } CassandraClusterBackupResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupSchedule.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupSchedule.Serialization.cs index 5312824b96161..000d5f5dd78ca 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupSchedule.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterBackupSchedule.Serialization.cs @@ -19,6 +19,15 @@ public partial class CassandraClusterBackupSchedule : IUtf8JsonSerializable, IJs void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(CassandraClusterBackupSchedule)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ScheduleName)) { writer.WritePropertyName("scheduleName"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod #endif } } - writer.WriteEndObject(); } CassandraClusterBackupSchedule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommand.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommand.Serialization.cs index f1401c33c3edc..8964be1de3a92 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommand.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterCommand.Serialization.cs @@ -19,6 +19,15 @@ public partial class CassandraClusterCommand : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(CassandraClusterCommand)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Command)) { writer.WritePropertyName("command"u8); @@ -99,7 +107,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade #endif } } - writer.WriteEndObject(); } CassandraClusterCommand IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) 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 41539485aace7..3960a57cad6f2 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 @@ -20,6 +20,15 @@ public partial class CassandraClusterDataCenterNodeItem : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(CassandraClusterDataCenterNodeItem)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Address)) { writer.WritePropertyName("address"u8); @@ -138,7 +146,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, #endif } } - writer.WriteEndObject(); } CassandraClusterDataCenterNodeItem IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterKey.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterKey.Serialization.cs index 0a90c280f48c8..fa2f4cdba1f10 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterKey.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterKey.Serialization.cs @@ -19,6 +19,15 @@ public partial class CassandraClusterKey : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(CassandraClusterKey)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri #endif } } - writer.WriteEndObject(); } CassandraClusterKey IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterListResult.Serialization.cs index 7aed35e4be3ae..78d3705633d12 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class CassandraClusterListResult : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(CassandraClusterListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } CassandraClusterListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) 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 477cf23bd8237..f3a749d257b14 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 @@ -20,6 +20,15 @@ public partial class CassandraClusterProperties : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(CassandraClusterProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); @@ -213,7 +221,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } CassandraClusterProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) 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 4ea42e176a787..dea56815aaa3d 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 @@ -20,6 +20,15 @@ public partial class CassandraClusterPublicStatus : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(CassandraClusterPublicStatus)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ETag)) { writer.WritePropertyName("eTag"u8); @@ -83,7 +91,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model #endif } } - writer.WriteEndObject(); } CassandraClusterPublicStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterPublicStatusDataCentersItem.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterPublicStatusDataCentersItem.Serialization.cs index f6f8e6f6f5670..fbef6c03ac2a4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterPublicStatusDataCentersItem.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraClusterPublicStatusDataCentersItem.Serialization.cs @@ -20,6 +20,15 @@ public partial class CassandraClusterPublicStatusDataCentersItem : IUtf8JsonSeri void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWrite throw new FormatException($"The model {nameof(CassandraClusterPublicStatusDataCentersItem)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -68,7 +76,6 @@ void IJsonModel.Write(Utf8JsonWrite #endif } } - writer.WriteEndObject(); } CassandraClusterPublicStatusDataCentersItem IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraColumn.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraColumn.Serialization.cs index f6040e5642756..f1d345f5154ef 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraColumn.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraColumn.Serialization.cs @@ -19,6 +19,15 @@ public partial class CassandraColumn : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO throw new FormatException($"The model {nameof(CassandraColumn)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO #endif } } - writer.WriteEndObject(); } CassandraColumn IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandOutput.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandOutput.Serialization.cs index c9597607a6d36..674158f36a255 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandOutput.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandOutput.Serialization.cs @@ -19,6 +19,15 @@ public partial class CassandraCommandOutput : IUtf8JsonSerializable, IJsonModel< void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(CassandraCommandOutput)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(CommandOutput)) { writer.WritePropertyName("commandOutput"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } CassandraCommandOutput IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandPostBody.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandPostBody.Serialization.cs index 58ba02e0e5a94..472d70f5090cd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandPostBody.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraCommandPostBody.Serialization.cs @@ -18,6 +18,15 @@ public partial class CassandraCommandPostBody : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(CassandraCommandPostBody)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("command"u8); writer.WriteStringValue(Command); if (Optional.IsCollectionDefined(Arguments)) @@ -66,7 +74,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } CassandraCommandPostBody IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraConnectionError.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraConnectionError.Serialization.cs index 2ac78aca35fb3..142aaf95155a0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraConnectionError.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraConnectionError.Serialization.cs @@ -19,6 +19,15 @@ public partial class CassandraConnectionError : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(CassandraConnectionError)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ConnectionState)) { writer.WritePropertyName("connectionState"u8); @@ -67,7 +75,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } CassandraConnectionError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraDataCenterListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraDataCenterListResult.Serialization.cs index f1b9efbc9a764..7086ec8d62780 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraDataCenterListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraDataCenterListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class CassandraDataCenterListResult : IUtf8JsonSerializable, IJ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(CassandraDataCenterListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode #endif } } - writer.WriteEndObject(); } CassandraDataCenterListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) 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 6eadbe6ec1654..86973ff0858ae 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 @@ -20,6 +20,15 @@ public partial class CassandraDataCenterProperties : IUtf8JsonSerializable, IJso void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(CassandraDataCenterProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); @@ -128,7 +136,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode #endif } } - writer.WriteEndObject(); } CassandraDataCenterProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraDataCenterSeedNode.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraDataCenterSeedNode.Serialization.cs index 64ed4585e3538..557f982416e4b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraDataCenterSeedNode.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraDataCenterSeedNode.Serialization.cs @@ -19,6 +19,15 @@ public partial class CassandraDataCenterSeedNode : IUtf8JsonSerializable, IJsonM void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(CassandraDataCenterSeedNode)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(IPAddress)) { writer.WritePropertyName("ipAddress"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR #endif } } - writer.WriteEndObject(); } CassandraDataCenterSeedNode IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) 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 index 2be5198a47978..ef1ffd706ac83 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraError.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraError.Serialization.cs @@ -19,6 +19,15 @@ public partial class CassandraError : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp throw new FormatException($"The model {nameof(CassandraError)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Code)) { writer.WritePropertyName("code"u8); @@ -62,7 +70,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp #endif } } - writer.WriteEndObject(); } CassandraError IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateOrUpdateContent.Serialization.cs index 6e1f2937fc845..73e8526ea2ba8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceCreateOrUpdateContent.Serialization.cs @@ -21,6 +21,15 @@ public partial class CassandraKeyspaceCreateOrUpdateContent : IUtf8JsonSerializa void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,46 +37,13 @@ void IJsonModel.Write(Utf8JsonWriter wri throw new FormatException($"The model {nameof(CassandraKeyspaceCreateOrUpdateContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); @@ -78,22 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter wri writer.WriteObjectValue(Options, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CassandraKeyspaceCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceListResult.Serialization.cs index 3ac82f12c82c4..a5b66884c1a14 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class CassandraKeyspaceListResult : IUtf8JsonSerializable, IJso void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(CassandraKeyspaceListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR #endif } } - writer.WriteEndObject(); } CassandraKeyspaceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspacePropertiesConfig.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspacePropertiesConfig.Serialization.cs index 65377cd7a16b6..ade9530fb4d17 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspacePropertiesConfig.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspacePropertiesConfig.Serialization.cs @@ -19,6 +19,15 @@ public partial class CassandraKeyspacePropertiesConfig : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,33 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(CassandraKeyspacePropertiesConfig)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (Optional.IsDefined(Throughput)) - { - writer.WritePropertyName("throughput"u8); - writer.WriteNumberValue(Throughput.Value); - } - if (Optional.IsDefined(AutoscaleSettings)) - { - writer.WritePropertyName("autoscaleSettings"u8); - writer.WriteObjectValue(AutoscaleSettings, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } CassandraKeyspacePropertiesConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceResourceInfo.Serialization.cs index 64a1da95c0f86..4959798fac1ff 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraKeyspaceResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class CassandraKeyspaceResourceInfo : IUtf8JsonSerializable, IJso void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(CassandraKeyspaceResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("id"u8); writer.WriteStringValue(KeyspaceName); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -44,7 +52,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode #endif } } - writer.WriteEndObject(); } CassandraKeyspaceResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraPartitionKey.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraPartitionKey.Serialization.cs index 4f3d8507c9917..26cf931194709 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraPartitionKey.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraPartitionKey.Serialization.cs @@ -19,6 +19,15 @@ public partial class CassandraPartitionKey : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(CassandraPartitionKey)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW #endif } } - writer.WriteEndObject(); } CassandraPartitionKey IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraReaperStatus.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraReaperStatus.Serialization.cs index f884afb8ebd51..6baf759918b38 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraReaperStatus.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraReaperStatus.Serialization.cs @@ -20,6 +20,15 @@ public partial class CassandraReaperStatus : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(CassandraReaperStatus)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(IsHealthy)) { writer.WritePropertyName("healthy"u8); @@ -70,7 +78,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW #endif } } - writer.WriteEndObject(); } CassandraReaperStatus IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraSchema.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraSchema.Serialization.cs index 4c4e54730a7e9..2ec62449f2715 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraSchema.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraSchema.Serialization.cs @@ -20,6 +20,15 @@ public partial class CassandraSchema : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO throw new FormatException($"The model {nameof(CassandraSchema)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Columns)) { writer.WritePropertyName("columns"u8); @@ -73,7 +81,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO #endif } } - writer.WriteEndObject(); } CassandraSchema IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateOrUpdateContent.Serialization.cs index 1ae0e1ea253ac..f43158ba1e478 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableCreateOrUpdateContent.Serialization.cs @@ -21,6 +21,15 @@ public partial class CassandraTableCreateOrUpdateContent : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,46 +37,13 @@ void IJsonModel.Write(Utf8JsonWriter writer throw new FormatException($"The model {nameof(CassandraTableCreateOrUpdateContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); @@ -78,22 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter writer writer.WriteObjectValue(Options, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CassandraTableCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableListResult.Serialization.cs index c18ead2dea09a..485294f91f28e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class CassandraTableListResult : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(CassandraTableListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } CassandraTableListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTablePropertiesConfig.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTablePropertiesConfig.Serialization.cs index 50379824a7996..3f9d7ab29e666 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTablePropertiesConfig.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTablePropertiesConfig.Serialization.cs @@ -19,6 +19,15 @@ public partial class CassandraTablePropertiesConfig : IUtf8JsonSerializable, IJs void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,33 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(CassandraTablePropertiesConfig)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (Optional.IsDefined(Throughput)) - { - writer.WritePropertyName("throughput"u8); - writer.WriteNumberValue(Throughput.Value); - } - if (Optional.IsDefined(AutoscaleSettings)) - { - writer.WritePropertyName("autoscaleSettings"u8); - writer.WriteObjectValue(AutoscaleSettings, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } CassandraTablePropertiesConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableResourceInfo.Serialization.cs index 5e471aab20ddb..84ef8c9c25e19 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraTableResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class CassandraTableResourceInfo : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(CassandraTableResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("id"u8); writer.WriteStringValue(TableName); if (Optional.IsDefined(DefaultTtl)) @@ -59,7 +67,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } CassandraTableResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesOptions.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesOptions.Serialization.cs index f8540c1483810..ff38532d3c319 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesOptions.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesOptions.Serialization.cs @@ -19,6 +19,15 @@ public partial class CassandraViewGetPropertiesOptions : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,33 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(CassandraViewGetPropertiesOptions)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (Optional.IsDefined(Throughput)) - { - writer.WritePropertyName("throughput"u8); - writer.WriteNumberValue(Throughput.Value); - } - if (Optional.IsDefined(AutoscaleSettings)) - { - writer.WritePropertyName("autoscaleSettings"u8); - writer.WriteObjectValue(AutoscaleSettings, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } CassandraViewGetPropertiesOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesResource.Serialization.cs index 66002ffbc000a..2a0290b15fda7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesResource.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetPropertiesResource.Serialization.cs @@ -19,6 +19,15 @@ public partial class CassandraViewGetPropertiesResource : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(CassandraViewGetPropertiesResource)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (options.Format != "W" && Optional.IsDefined(Rid)) { writer.WritePropertyName("_rid"u8); @@ -42,26 +51,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WritePropertyName("_etag"u8); writer.WriteStringValue(ETag.Value.ToString()); } - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - writer.WritePropertyName("viewDefinition"u8); - writer.WriteStringValue(ViewDefinition); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CassandraViewGetPropertiesResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetResultCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetResultCreateOrUpdateContent.Serialization.cs index a7faa3184ab9b..5d69dedeafce6 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetResultCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewGetResultCreateOrUpdateContent.Serialization.cs @@ -21,6 +21,15 @@ public partial class CassandraViewGetResultCreateOrUpdateContent : IUtf8JsonSeri void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,46 +37,13 @@ void IJsonModel.Write(Utf8JsonWrite throw new FormatException($"The model {nameof(CassandraViewGetResultCreateOrUpdateContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); @@ -78,22 +54,6 @@ void IJsonModel.Write(Utf8JsonWrite writer.WriteObjectValue(Options, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CassandraViewGetResultCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewListResult.Serialization.cs index f6147d64a37b7..1641028a48f84 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class CassandraViewListResult : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(CassandraViewListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade #endif } } - writer.WriteEndObject(); } CassandraViewListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewResource.Serialization.cs index dce1d590180d5..2e475f84b1836 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewResource.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CassandraViewResource.Serialization.cs @@ -19,6 +19,15 @@ public partial class CassandraViewResource : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(CassandraViewResource)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("id"u8); writer.WriteStringValue(Id); writer.WritePropertyName("viewDefinition"u8); @@ -46,7 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW #endif } } - writer.WriteEndObject(); } CassandraViewResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ClientEncryptionKeysListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ClientEncryptionKeysListResult.Serialization.cs index 972da124150c0..0b8f42ed90d1a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ClientEncryptionKeysListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ClientEncryptionKeysListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class ClientEncryptionKeysListResult : IUtf8JsonSerializable, I void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(ClientEncryptionKeysListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod #endif } } - writer.WriteEndObject(); } ClientEncryptionKeysListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ComputedProperty.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ComputedProperty.Serialization.cs index 40f5f5d6d9b36..93969769e691c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ComputedProperty.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ComputedProperty.Serialization.cs @@ -19,6 +19,15 @@ public partial class ComputedProperty : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(ComputedProperty)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter #endif } } - writer.WriteEndObject(); } ComputedProperty IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ConflictResolutionPolicy.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ConflictResolutionPolicy.Serialization.cs index ef438c79c00cb..223a4c64b7c9f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ConflictResolutionPolicy.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ConflictResolutionPolicy.Serialization.cs @@ -19,6 +19,15 @@ public partial class ConflictResolutionPolicy : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(ConflictResolutionPolicy)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Mode)) { writer.WritePropertyName("mode"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } ConflictResolutionPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ConsistencyPolicy.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ConsistencyPolicy.Serialization.cs index c64ed420823ed..4d2f5d29a5011 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ConsistencyPolicy.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ConsistencyPolicy.Serialization.cs @@ -19,6 +19,15 @@ public partial class ConsistencyPolicy : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite throw new FormatException($"The model {nameof(ConsistencyPolicy)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("defaultConsistencyLevel"u8); writer.WriteStringValue(DefaultConsistencyLevel.ToSerialString()); if (Optional.IsDefined(MaxStalenessPrefix)) @@ -54,7 +62,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite #endif } } - writer.WriteEndObject(); } ConsistencyPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousBackupInformation.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousBackupInformation.Serialization.cs index ea04c1a0f7248..d517616fe765a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousBackupInformation.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousBackupInformation.Serialization.cs @@ -19,6 +19,15 @@ internal partial class ContinuousBackupInformation : IUtf8JsonSerializable, IJso void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(ContinuousBackupInformation)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(LatestRestorableTimestamp)) { writer.WritePropertyName("latestRestorableTimestamp"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR #endif } } - writer.WriteEndObject(); } ContinuousBackupInformation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousBackupRestoreLocation.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousBackupRestoreLocation.Serialization.cs index 72553090f0264..69c51d6f836c0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousBackupRestoreLocation.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousBackupRestoreLocation.Serialization.cs @@ -18,6 +18,15 @@ public partial class ContinuousBackupRestoreLocation : IUtf8JsonSerializable, IJ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo throw new FormatException($"The model {nameof(ContinuousBackupRestoreLocation)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Location)) { writer.WritePropertyName("location"u8); @@ -46,7 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo #endif } } - writer.WriteEndObject(); } ContinuousBackupRestoreLocation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeBackupPolicy.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeBackupPolicy.Serialization.cs index 21f35e39d08fb..c7bb38e761962 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeBackupPolicy.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeBackupPolicy.Serialization.cs @@ -19,6 +19,15 @@ public partial class ContinuousModeBackupPolicy : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,35 +35,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(ContinuousModeBackupPolicy)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(ContinuousModeProperties)) { writer.WritePropertyName("continuousModeProperties"u8); writer.WriteObjectValue(ContinuousModeProperties, options); } - writer.WritePropertyName("type"u8); - writer.WriteStringValue(BackupPolicyType.ToString()); - if (Optional.IsDefined(MigrationState)) - { - writer.WritePropertyName("migrationState"u8); - writer.WriteObjectValue(MigrationState, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } ContinuousModeBackupPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeProperties.Serialization.cs index 615fad5160fd4..dece046ae081e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeProperties.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ContinuousModeProperties.Serialization.cs @@ -19,6 +19,15 @@ internal partial class ContinuousModeProperties : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(ContinuousModeProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Tier)) { writer.WritePropertyName("tier"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } ContinuousModeProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosCassandraDataTransferDataSourceSink.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosCassandraDataTransferDataSourceSink.Serialization.cs index 8a8a6a3ad0910..b778484ea44c8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosCassandraDataTransferDataSourceSink.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosCassandraDataTransferDataSourceSink.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosCassandraDataTransferDataSourceSink : IUtf8JsonSerial void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,34 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter throw new FormatException($"The model {nameof(CosmosCassandraDataTransferDataSourceSink)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("keyspaceName"u8); writer.WriteStringValue(KeyspaceName); writer.WritePropertyName("tableName"u8); writer.WriteStringValue(TableName); - if (Optional.IsDefined(RemoteAccountName)) - { - writer.WritePropertyName("remoteAccountName"u8); - writer.WriteStringValue(RemoteAccountName); - } - writer.WritePropertyName("component"u8); - writer.WriteStringValue(Component.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CosmosCassandraDataTransferDataSourceSink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountBackupPolicy.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountBackupPolicy.Serialization.cs index 0efd4410921f3..398414b8c4d1a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountBackupPolicy.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountBackupPolicy.Serialization.cs @@ -20,6 +20,15 @@ public partial class CosmosDBAccountBackupPolicy : IUtf8JsonSerializable, IJsonM void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(CosmosDBAccountBackupPolicy)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("type"u8); writer.WriteStringValue(BackupPolicyType.ToString()); if (Optional.IsDefined(MigrationState)) @@ -50,7 +58,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR #endif } } - writer.WriteEndObject(); } CosmosDBAccountBackupPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCapability.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCapability.Serialization.cs index 335d543fc8639..8b3f94c9c8793 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCapability.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCapability.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBAccountCapability : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(CosmosDBAccountCapability)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } CosmosDBAccountCapability IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCapacity.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCapacity.Serialization.cs index d2ea1a3c81c79..52fc7f6ad5344 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCapacity.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCapacity.Serialization.cs @@ -19,6 +19,15 @@ internal partial class CosmosDBAccountCapacity : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(CosmosDBAccountCapacity)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(TotalThroughputLimit)) { writer.WritePropertyName("totalThroughputLimit"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade #endif } } - writer.WriteEndObject(); } CosmosDBAccountCapacity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) 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 ce14bfc307d44..8ece2d9d674c5 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 @@ -19,6 +19,15 @@ public partial class CosmosDBAccountConnectionString : IUtf8JsonSerializable, IJ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo throw new FormatException($"The model {nameof(CosmosDBAccountConnectionString)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(ConnectionString)) { writer.WritePropertyName("connectionString"u8); @@ -62,7 +70,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo #endif } } - writer.WriteEndObject(); } CosmosDBAccountConnectionString IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCorsPolicy.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCorsPolicy.Serialization.cs index d3f13e29cd881..dd48f0974a39b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCorsPolicy.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCorsPolicy.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBAccountCorsPolicy : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(CosmosDBAccountCorsPolicy)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("allowedOrigins"u8); writer.WriteStringValue(AllowedOrigins); if (Optional.IsDefined(AllowedMethods)) @@ -64,7 +72,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } CosmosDBAccountCorsPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.Serialization.cs index e46744332f7c1..ac5a450466773 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountCreateOrUpdateContent.Serialization.cs @@ -21,6 +21,15 @@ public partial class CosmosDBAccountCreateOrUpdateContent : IUtf8JsonSerializabl void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,7 +37,7 @@ void IJsonModel.Write(Utf8JsonWriter write throw new FormatException($"The model {nameof(CosmosDBAccountCreateOrUpdateContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Kind)) { writer.WritePropertyName("kind"u8); @@ -40,39 +49,6 @@ void IJsonModel.Write(Utf8JsonWriter write var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(ConsistencyPolicy)) @@ -295,22 +271,6 @@ void IJsonModel.Write(Utf8JsonWriter write writer.WriteBooleanValue(EnablePerRegionPerPartitionAutoscale.Value); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CosmosDBAccountCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountKeyList.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountKeyList.Serialization.cs index dd75819b8277f..5e3bba2b1ca9b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountKeyList.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountKeyList.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBAccountKeyList : IUtf8JsonSerializable, IJsonModel< void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(CosmosDBAccountKeyList)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (options.Format != "W" && Optional.IsDefined(PrimaryMasterKey)) { writer.WritePropertyName("primaryMasterKey"u8); @@ -37,32 +46,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader writer.WritePropertyName("secondaryMasterKey"u8); writer.WriteStringValue(SecondaryMasterKey); } - if (options.Format != "W" && Optional.IsDefined(PrimaryReadonlyMasterKey)) - { - writer.WritePropertyName("primaryReadonlyMasterKey"u8); - writer.WriteStringValue(PrimaryReadonlyMasterKey); - } - if (options.Format != "W" && Optional.IsDefined(SecondaryReadonlyMasterKey)) - { - writer.WritePropertyName("secondaryReadonlyMasterKey"u8); - writer.WriteStringValue(SecondaryReadonlyMasterKey); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CosmosDBAccountKeyList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountLocation.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountLocation.Serialization.cs index 1436467692327..933db923aa3b2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountLocation.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountLocation.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBAccountLocation : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(CosmosDBAccountLocation)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -72,7 +80,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade #endif } } - writer.WriteEndObject(); } CosmosDBAccountLocation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.Serialization.cs index 8112c3ba607c0..8ee3d06654c18 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountPatch.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBAccountPatch : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(CosmosDBAccountPatch)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Tags)) { writer.WritePropertyName("tags"u8); @@ -277,7 +285,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } CosmosDBAccountPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountReadOnlyKeyList.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountReadOnlyKeyList.Serialization.cs index 22ed9fc8a2b0d..28e7ee9b61537 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountReadOnlyKeyList.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountReadOnlyKeyList.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBAccountReadOnlyKeyList : IUtf8JsonSerializable, IJs void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(CosmosDBAccountReadOnlyKeyList)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(PrimaryReadonlyMasterKey)) { writer.WritePropertyName("primaryReadonlyMasterKey"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod #endif } } - writer.WriteEndObject(); } CosmosDBAccountReadOnlyKeyList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRegenerateKeyContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRegenerateKeyContent.Serialization.cs index b5c32d4f64728..36b28a45d8cc4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRegenerateKeyContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRegenerateKeyContent.Serialization.cs @@ -18,6 +18,15 @@ public partial class CosmosDBAccountRegenerateKeyContent : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer throw new FormatException($"The model {nameof(CosmosDBAccountRegenerateKeyContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("keyKind"u8); writer.WriteStringValue(KeyKind.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -43,7 +51,6 @@ void IJsonModel.Write(Utf8JsonWriter writer #endif } } - writer.WriteEndObject(); } CosmosDBAccountRegenerateKeyContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRestoreParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRestoreParameters.Serialization.cs index 7385cc676e8bd..8767bfca33e73 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRestoreParameters.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBAccountRestoreParameters.Serialization.cs @@ -20,6 +20,15 @@ public partial class CosmosDBAccountRestoreParameters : IUtf8JsonSerializable, I void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, M throw new FormatException($"The model {nameof(CosmosDBAccountRestoreParameters)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(RestoreMode)) { writer.WritePropertyName("restoreMode"u8); @@ -68,37 +77,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M writer.WritePropertyName("sourceBackupLocation"u8); writer.WriteStringValue(SourceBackupLocation); } - if (Optional.IsDefined(RestoreSource)) - { - writer.WritePropertyName("restoreSource"u8); - writer.WriteStringValue(RestoreSource); - } - if (Optional.IsDefined(RestoreTimestampInUtc)) - { - writer.WritePropertyName("restoreTimestampInUtc"u8); - writer.WriteStringValue(RestoreTimestampInUtc.Value, "O"); - } - if (Optional.IsDefined(IsRestoreWithTtlDisabled)) - { - writer.WritePropertyName("restoreWithTtlDisabled"u8); - writer.WriteBooleanValue(IsRestoreWithTtlDisabled.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CosmosDBAccountRestoreParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBBackupInformation.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBBackupInformation.Serialization.cs index 1b634124c7141..fc243acd6cce5 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBBackupInformation.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBBackupInformation.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBBackupInformation : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(CosmosDBBackupInformation)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(ContinuousBackupInformation)) { writer.WritePropertyName("continuousBackupInformation"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } CosmosDBBackupInformation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBBaseConfig.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBBaseConfig.Serialization.cs index ccb931bd19eff..eba63e36fed2a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBBaseConfig.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBBaseConfig.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBBaseConfig : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(CosmosDBBaseConfig)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Throughput)) { writer.WritePropertyName("throughput"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit #endif } } - writer.WriteEndObject(); } CosmosDBBaseConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBBaseMetric.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBBaseMetric.Serialization.cs index a95609a02d8f7..8662a5d22606c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBBaseMetric.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBBaseMetric.Serialization.cs @@ -20,6 +20,15 @@ public partial class CosmosDBBaseMetric : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(CosmosDBBaseMetric)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(StartOn)) { writer.WritePropertyName("startTime"u8); @@ -78,7 +86,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit #endif } } - writer.WriteEndObject(); } CosmosDBBaseMetric IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBBaseUsage.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBBaseUsage.Serialization.cs index f6a880342df2b..8e027dae2893d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBBaseUsage.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBBaseUsage.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBBaseUsage : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite throw new FormatException($"The model {nameof(CosmosDBBaseUsage)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Unit)) { writer.WritePropertyName("unit"u8); @@ -67,7 +75,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite #endif } } - writer.WriteEndObject(); } CosmosDBBaseUsage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBClientEncryptionIncludedPath.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBClientEncryptionIncludedPath.Serialization.cs index 8717e1a330a8b..af05cd0c722c5 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBClientEncryptionIncludedPath.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBClientEncryptionIncludedPath.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBClientEncryptionIncludedPath : IUtf8JsonSerializabl void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter write throw new FormatException($"The model {nameof(CosmosDBClientEncryptionIncludedPath)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("path"u8); writer.WriteStringValue(Path); writer.WritePropertyName("clientEncryptionKeyId"u8); @@ -50,7 +58,6 @@ void IJsonModel.Write(Utf8JsonWriter write #endif } } - writer.WriteEndObject(); } CosmosDBClientEncryptionIncludedPath IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBClientEncryptionPolicy.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBClientEncryptionPolicy.Serialization.cs index 3aa6a1353f75d..804cf00287116 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBClientEncryptionPolicy.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBClientEncryptionPolicy.Serialization.cs @@ -20,6 +20,15 @@ public partial class CosmosDBClientEncryptionPolicy : IUtf8JsonSerializable, IJs void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(CosmosDBClientEncryptionPolicy)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("includedPaths"u8); writer.WriteStartArray(); foreach (var item in IncludedPaths) @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod #endif } } - writer.WriteEndObject(); } CosmosDBClientEncryptionPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBCompositePath.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBCompositePath.Serialization.cs index 9262aaf997bc7..58e3a3b4d6ab0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBCompositePath.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBCompositePath.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBCompositePath : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(CosmosDBCompositePath)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Path)) { writer.WritePropertyName("path"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW #endif } } - writer.WriteEndObject(); } CosmosDBCompositePath IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBContainerPartitionKey.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBContainerPartitionKey.Serialization.cs index 49fc78eaae994..c39d5d2f4dcff 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBContainerPartitionKey.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBContainerPartitionKey.Serialization.cs @@ -20,6 +20,15 @@ public partial class CosmosDBContainerPartitionKey : IUtf8JsonSerializable, IJso void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(CosmosDBContainerPartitionKey)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Paths)) { writer.WritePropertyName("paths"u8); @@ -68,7 +76,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode #endif } } - writer.WriteEndObject(); } CosmosDBContainerPartitionKey IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBCreateUpdateConfig.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBCreateUpdateConfig.Serialization.cs index 1344f7fae2d93..52ad20fe7c1ac 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBCreateUpdateConfig.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBCreateUpdateConfig.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBCreateUpdateConfig : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(CosmosDBCreateUpdateConfig)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Throughput)) { writer.WritePropertyName("throughput"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } CosmosDBCreateUpdateConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBErrorResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBErrorResult.Serialization.cs index df618d0989e87..377ddf33e6e09 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBErrorResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBErrorResult.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBErrorResult : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(CosmosDBErrorResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Code)) { writer.WritePropertyName("code"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri #endif } } - writer.WriteEndObject(); } CosmosDBErrorResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBExcludedPath.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBExcludedPath.Serialization.cs index ef3599ff4c0ca..3b772ba354b6d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBExcludedPath.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBExcludedPath.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBExcludedPath : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(CosmosDBExcludedPath)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Path)) { writer.WritePropertyName("path"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } CosmosDBExcludedPath IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBFailoverPolicies.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBFailoverPolicies.Serialization.cs index ef976e0e580c8..dff425fabf068 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBFailoverPolicies.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBFailoverPolicies.Serialization.cs @@ -18,6 +18,15 @@ public partial class CosmosDBFailoverPolicies : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(CosmosDBFailoverPolicies)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("failoverPolicies"u8); writer.WriteStartArray(); foreach (var item in FailoverPolicies) @@ -48,7 +56,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } CosmosDBFailoverPolicies IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBFailoverPolicy.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBFailoverPolicy.Serialization.cs index afb06cae5699e..2ebee1ec6411e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBFailoverPolicy.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBFailoverPolicy.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBFailoverPolicy : IUtf8JsonSerializable, IJsonModel< void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(CosmosDBFailoverPolicy)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } CosmosDBFailoverPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBIPAddressOrRange.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBIPAddressOrRange.Serialization.cs index 6180ffcc344a6..54d52bf3e66a0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBIPAddressOrRange.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBIPAddressOrRange.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBIPAddressOrRange : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(CosmosDBIPAddressOrRange)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(IPAddressOrRange)) { writer.WritePropertyName("ipAddressOrRange"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } CosmosDBIPAddressOrRange IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBIncludedPath.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBIncludedPath.Serialization.cs index e30f35902eba9..3e1f85033e4d4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBIncludedPath.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBIncludedPath.Serialization.cs @@ -20,6 +20,15 @@ public partial class CosmosDBIncludedPath : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(CosmosDBIncludedPath)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Path)) { writer.WritePropertyName("path"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } CosmosDBIncludedPath IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBIndexingPolicy.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBIndexingPolicy.Serialization.cs index a23ce682b340f..2c62b2396b35b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBIndexingPolicy.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBIndexingPolicy.Serialization.cs @@ -20,6 +20,15 @@ public partial class CosmosDBIndexingPolicy : IUtf8JsonSerializable, IJsonModel< void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(CosmosDBIndexingPolicy)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(IsAutomatic)) { writer.WritePropertyName("automatic"u8); @@ -103,7 +111,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } CosmosDBIndexingPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBKeyWrapMetadata.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBKeyWrapMetadata.Serialization.cs index 28f0ad6e8e09f..a20af498d9d9b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBKeyWrapMetadata.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBKeyWrapMetadata.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBKeyWrapMetadata : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(CosmosDBKeyWrapMetadata)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -62,7 +70,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade #endif } } - writer.WriteEndObject(); } CosmosDBKeyWrapMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBLocationListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBLocationListResult.Serialization.cs index 9ff07a3af94f0..de5c5b3c17c09 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBLocationListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBLocationListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class CosmosDBLocationListResult : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(CosmosDBLocationListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } CosmosDBLocationListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) 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 6fb1f7b55e0c4..60602b75dc44b 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 @@ -20,6 +20,15 @@ public partial class CosmosDBLocationProperties : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(CosmosDBLocationProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(DoesSupportAvailabilityZone)) { writer.WritePropertyName("supportsAvailabilityZone"u8); @@ -78,7 +86,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } CosmosDBLocationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMetricAvailability.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMetricAvailability.Serialization.cs index b1a93749b4250..04850eb6a4ec8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMetricAvailability.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMetricAvailability.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBMetricAvailability : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(CosmosDBMetricAvailability)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(TimeGrain)) { writer.WritePropertyName("timeGrain"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } CosmosDBMetricAvailability IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMetricDefinition.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMetricDefinition.Serialization.cs index 9f573f84b9632..40752047a202a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMetricDefinition.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMetricDefinition.Serialization.cs @@ -20,6 +20,15 @@ public partial class CosmosDBMetricDefinition : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(CosmosDBMetricDefinition)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(MetricAvailabilities)) { writer.WritePropertyName("metricAvailabilities"u8); @@ -73,7 +81,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } CosmosDBMetricDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMetricDefinitionsListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMetricDefinitionsListResult.Serialization.cs index 667133c4688e5..dc0ac6042d3d6 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMetricDefinitionsListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMetricDefinitionsListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class CosmosDBMetricDefinitionsListResult : IUtf8JsonSerializab void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer throw new FormatException($"The model {nameof(CosmosDBMetricDefinitionsListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer #endif } } - writer.WriteEndObject(); } CosmosDBMetricDefinitionsListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMetricListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMetricListResult.Serialization.cs index 988bc56e3e09f..c80aa9f7b2677 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMetricListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMetricListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class CosmosDBMetricListResult : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(CosmosDBMetricListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } CosmosDBMetricListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMetricName.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMetricName.Serialization.cs index 02c5afd769796..514e8dbabf67e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMetricName.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMetricName.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBMetricName : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(CosmosDBMetricName)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Value)) { writer.WritePropertyName("value"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit #endif } } - writer.WriteEndObject(); } CosmosDBMetricName IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMetricValue.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMetricValue.Serialization.cs index 660fe1419617c..ed3cb20be45c9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMetricValue.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBMetricValue.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBMetricValue : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(CosmosDBMetricValue)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Count)) { writer.WritePropertyName("_count"u8); @@ -72,7 +80,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri #endif } } - writer.WriteEndObject(); } CosmosDBMetricValue IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBPathIndexes.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBPathIndexes.Serialization.cs index c22175f46d5f7..62216a882c371 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBPathIndexes.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBPathIndexes.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBPathIndexes : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(CosmosDBPathIndexes)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(DataType)) { writer.WritePropertyName("dataType"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri #endif } } - writer.WriteEndObject(); } CosmosDBPathIndexes IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBPercentileMetric.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBPercentileMetric.Serialization.cs index f4312e8a2fa49..9c2e911f02ffd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBPercentileMetric.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBPercentileMetric.Serialization.cs @@ -20,6 +20,15 @@ public partial class CosmosDBPercentileMetric : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(CosmosDBPercentileMetric)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(StartOn)) { writer.WritePropertyName("startTime"u8); @@ -78,7 +86,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } CosmosDBPercentileMetric IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBPrivateEndpointConnectionListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBPrivateEndpointConnectionListResult.Serialization.cs index 62b027daa3f4c..33bf3e7896f8b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBPrivateEndpointConnectionListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBPrivateEndpointConnectionListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class CosmosDBPrivateEndpointConnectionListResult : IUtf8JsonSe void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWrite throw new FormatException($"The model {nameof(CosmosDBPrivateEndpointConnectionListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWrite #endif } } - writer.WriteEndObject(); } CosmosDBPrivateEndpointConnectionListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBPrivateLinkResourceListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBPrivateLinkResourceListResult.Serialization.cs index cc9e4c122ada1..b1af4d6d7eb30 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBPrivateLinkResourceListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBPrivateLinkResourceListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class CosmosDBPrivateLinkResourceListResult : IUtf8JsonSerializ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writ throw new FormatException($"The model {nameof(CosmosDBPrivateLinkResourceListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writ #endif } } - writer.WriteEndObject(); } CosmosDBPrivateLinkResourceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBPrivateLinkServiceConnectionStateProperty.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBPrivateLinkServiceConnectionStateProperty.Serialization.cs index c663bf3cf2bf8..9c0c4de03eef3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBPrivateLinkServiceConnectionStateProperty.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBPrivateLinkServiceConnectionStateProperty.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBPrivateLinkServiceConnectionStateProperty : IUtf8Js void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8Jso throw new FormatException($"The model {nameof(CosmosDBPrivateLinkServiceConnectionStateProperty)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Status)) { writer.WritePropertyName("status"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8Jso #endif } } - writer.WriteEndObject(); } CosmosDBPrivateLinkServiceConnectionStateProperty IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBRegionalService.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBRegionalService.Serialization.cs index f5ca1803053f9..34f042bb0a23c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBRegionalService.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBRegionalService.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBRegionalService : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(CosmosDBRegionalService)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade #endif } } - writer.WriteEndObject(); } CosmosDBRegionalService IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBServiceCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBServiceCreateOrUpdateContent.Serialization.cs index 64452ff95b9e4..c68631e8627b9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBServiceCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBServiceCreateOrUpdateContent.Serialization.cs @@ -18,6 +18,15 @@ public partial class CosmosDBServiceCreateOrUpdateContent : IUtf8JsonSerializabl void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter write throw new FormatException($"The model {nameof(CosmosDBServiceCreateOrUpdateContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); @@ -46,7 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter write #endif } } - writer.WriteEndObject(); } CosmosDBServiceCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBServiceListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBServiceListResult.Serialization.cs index 0a83705721843..2dede352c8fb8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBServiceListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBServiceListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class CosmosDBServiceListResult : IUtf8JsonSerializable, IJsonM void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(CosmosDBServiceListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } CosmosDBServiceListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBServiceProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBServiceProperties.Serialization.cs index 38c2b909a84a5..678995e6f256e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBServiceProperties.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBServiceProperties.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBServiceProperties : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(CosmosDBServiceProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(CreatedOn)) { writer.WritePropertyName("creationTime"u8); @@ -61,7 +69,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea } #endif } - writer.WriteEndObject(); } CosmosDBServiceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent.Serialization.cs index 41a6f3eb31a34..c090732cc3c66 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent.Serialization.cs @@ -18,6 +18,15 @@ public partial class CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent : IUtf8 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8J throw new FormatException($"The model {nameof(CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); @@ -46,7 +54,6 @@ void IJsonModel.Write(Utf8J #endif } } - writer.WriteEndObject(); } CosmosDBSqlClientEncryptionKeyCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlClientEncryptionKeyProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlClientEncryptionKeyProperties.Serialization.cs index 8cfb52ebb28ca..f3977f797f1b8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlClientEncryptionKeyProperties.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlClientEncryptionKeyProperties.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBSqlClientEncryptionKeyProperties : IUtf8JsonSeriali void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter w throw new FormatException($"The model {nameof(CosmosDBSqlClientEncryptionKeyProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (options.Format != "W" && Optional.IsDefined(Rid)) { writer.WritePropertyName("_rid"u8); @@ -42,42 +51,6 @@ void IJsonModel.Write(Utf8JsonWriter w writer.WritePropertyName("_etag"u8); writer.WriteStringValue(ETag.Value.ToString()); } - if (Optional.IsDefined(Id)) - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (Optional.IsDefined(EncryptionAlgorithm)) - { - writer.WritePropertyName("encryptionAlgorithm"u8); - writer.WriteStringValue(EncryptionAlgorithm); - } - if (Optional.IsDefined(WrappedDataEncryptionKey)) - { - writer.WritePropertyName("wrappedDataEncryptionKey"u8); - writer.WriteBase64StringValue(WrappedDataEncryptionKey, "D"); - } - if (Optional.IsDefined(KeyWrapMetadata)) - { - writer.WritePropertyName("keyWrapMetadata"u8); - writer.WriteObjectValue(KeyWrapMetadata, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CosmosDBSqlClientEncryptionKeyProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlClientEncryptionKeyResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlClientEncryptionKeyResourceInfo.Serialization.cs index 37bdb109b0ba7..8a41c1007dacc 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlClientEncryptionKeyResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlClientEncryptionKeyResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBSqlClientEncryptionKeyResourceInfo : IUtf8JsonSeria void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter throw new FormatException($"The model {nameof(CosmosDBSqlClientEncryptionKeyResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -62,7 +70,6 @@ void IJsonModel.Write(Utf8JsonWriter #endif } } - writer.WriteEndObject(); } CosmosDBSqlClientEncryptionKeyResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerCreateOrUpdateContent.Serialization.cs index 3dea4a88918d8..c1d55f43b8ecd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerCreateOrUpdateContent.Serialization.cs @@ -21,6 +21,15 @@ public partial class CosmosDBSqlContainerCreateOrUpdateContent : IUtf8JsonSerial void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,46 +37,13 @@ void IJsonModel.Write(Utf8JsonWriter throw new FormatException($"The model {nameof(CosmosDBSqlContainerCreateOrUpdateContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); @@ -78,22 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter writer.WriteObjectValue(Options, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CosmosDBSqlContainerCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerListResult.Serialization.cs index adfc1327760b5..8777ae8b0529e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class CosmosDBSqlContainerListResult : IUtf8JsonSerializable, I void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(CosmosDBSqlContainerListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod #endif } } - writer.WriteEndObject(); } CosmosDBSqlContainerListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerPropertiesConfig.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerPropertiesConfig.Serialization.cs index 9174f36070dfa..f092ae9694e13 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerPropertiesConfig.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlContainerPropertiesConfig.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBSqlContainerPropertiesConfig : IUtf8JsonSerializabl void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,33 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter write throw new FormatException($"The model {nameof(CosmosDBSqlContainerPropertiesConfig)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (Optional.IsDefined(Throughput)) - { - writer.WritePropertyName("throughput"u8); - writer.WriteNumberValue(Throughput.Value); - } - if (Optional.IsDefined(AutoscaleSettings)) - { - writer.WritePropertyName("autoscaleSettings"u8); - writer.WriteObjectValue(AutoscaleSettings, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } CosmosDBSqlContainerPropertiesConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) 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 320d288e18054..4f7aa7d91ddb3 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 @@ -20,6 +20,15 @@ public partial class CosmosDBSqlContainerResourceInfo : IUtf8JsonSerializable, I void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M throw new FormatException($"The model {nameof(CosmosDBSqlContainerResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("id"u8); writer.WriteStringValue(ContainerName); if (Optional.IsDefined(IndexingPolicy)) @@ -105,7 +113,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M #endif } } - writer.WriteEndObject(); } CosmosDBSqlContainerResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseCreateOrUpdateContent.Serialization.cs index cb33383f6dd14..c9c7f75a0256d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseCreateOrUpdateContent.Serialization.cs @@ -21,6 +21,15 @@ public partial class CosmosDBSqlDatabaseCreateOrUpdateContent : IUtf8JsonSeriali void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,46 +37,13 @@ void IJsonModel.Write(Utf8JsonWriter w throw new FormatException($"The model {nameof(CosmosDBSqlDatabaseCreateOrUpdateContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); @@ -78,22 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter w writer.WriteObjectValue(Options, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CosmosDBSqlDatabaseCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseListResult.Serialization.cs index 30c6c2dfac121..54d8d8bb19066 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class CosmosDBSqlDatabaseListResult : IUtf8JsonSerializable, IJ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(CosmosDBSqlDatabaseListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode #endif } } - writer.WriteEndObject(); } CosmosDBSqlDatabaseListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabasePropertiesConfig.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabasePropertiesConfig.Serialization.cs index 5f03d95c79181..87733d47161df 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabasePropertiesConfig.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabasePropertiesConfig.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBSqlDatabasePropertiesConfig : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,33 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter writer throw new FormatException($"The model {nameof(CosmosDBSqlDatabasePropertiesConfig)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (Optional.IsDefined(Throughput)) - { - writer.WritePropertyName("throughput"u8); - writer.WriteNumberValue(Throughput.Value); - } - if (Optional.IsDefined(AutoscaleSettings)) - { - writer.WritePropertyName("autoscaleSettings"u8); - writer.WriteObjectValue(AutoscaleSettings, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } CosmosDBSqlDatabasePropertiesConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseResourceInfo.Serialization.cs index 429d4b9105939..5038042fa29d7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlDatabaseResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBSqlDatabaseResourceInfo : IUtf8JsonSerializable, IJ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo throw new FormatException($"The model {nameof(CosmosDBSqlDatabaseResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("id"u8); writer.WriteStringValue(DatabaseName); if (Optional.IsDefined(RestoreParameters)) @@ -54,7 +62,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo #endif } } - writer.WriteEndObject(); } CosmosDBSqlDatabaseResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlRoleAssignmentCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlRoleAssignmentCreateOrUpdateContent.Serialization.cs index 75357c84b6e44..289f1fc06eef8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlRoleAssignmentCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlRoleAssignmentCreateOrUpdateContent.Serialization.cs @@ -18,6 +18,15 @@ public partial class CosmosDBSqlRoleAssignmentCreateOrUpdateContent : IUtf8JsonS void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWr throw new FormatException($"The model {nameof(CosmosDBSqlRoleAssignmentCreateOrUpdateContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(RoleDefinitionId)) @@ -59,7 +67,6 @@ void IJsonModel.Write(Utf8JsonWr #endif } } - writer.WriteEndObject(); } CosmosDBSqlRoleAssignmentCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlRoleAssignmentList.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlRoleAssignmentList.Serialization.cs index 68d544bc27257..107074252d662 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlRoleAssignmentList.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlRoleAssignmentList.Serialization.cs @@ -20,6 +20,15 @@ internal partial class CosmosDBSqlRoleAssignmentList : IUtf8JsonSerializable, IJ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(CosmosDBSqlRoleAssignmentList)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode #endif } } - writer.WriteEndObject(); } CosmosDBSqlRoleAssignmentList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlRoleDefinitionCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlRoleDefinitionCreateOrUpdateContent.Serialization.cs index 08ab66c3e8174..6da92bf3ca3de 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlRoleDefinitionCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlRoleDefinitionCreateOrUpdateContent.Serialization.cs @@ -18,6 +18,15 @@ public partial class CosmosDBSqlRoleDefinitionCreateOrUpdateContent : IUtf8JsonS void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWr throw new FormatException($"The model {nameof(CosmosDBSqlRoleDefinitionCreateOrUpdateContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(RoleName)) @@ -74,7 +82,6 @@ void IJsonModel.Write(Utf8JsonWr #endif } } - writer.WriteEndObject(); } CosmosDBSqlRoleDefinitionCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlRoleDefinitionList.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlRoleDefinitionList.Serialization.cs index 02f98845a4a01..0eb193e2e2818 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlRoleDefinitionList.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlRoleDefinitionList.Serialization.cs @@ -20,6 +20,15 @@ internal partial class CosmosDBSqlRoleDefinitionList : IUtf8JsonSerializable, IJ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(CosmosDBSqlRoleDefinitionList)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode #endif } } - writer.WriteEndObject(); } CosmosDBSqlRoleDefinitionList IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlRolePermission.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlRolePermission.Serialization.cs index 0dce32a4fe174..e3c937cafaae2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlRolePermission.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlRolePermission.Serialization.cs @@ -20,6 +20,15 @@ public partial class CosmosDBSqlRolePermission : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(CosmosDBSqlRolePermission)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(DataActions)) { writer.WritePropertyName("dataActions"u8); @@ -63,7 +71,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } CosmosDBSqlRolePermission IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureCreateOrUpdateContent.Serialization.cs index 4733d4d938ad2..010ff04e75ce9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureCreateOrUpdateContent.Serialization.cs @@ -21,6 +21,15 @@ public partial class CosmosDBSqlStoredProcedureCreateOrUpdateContent : IUtf8Json void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,46 +37,13 @@ void IJsonModel.Write(Utf8JsonW throw new FormatException($"The model {nameof(CosmosDBSqlStoredProcedureCreateOrUpdateContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); @@ -78,22 +54,6 @@ void IJsonModel.Write(Utf8JsonW writer.WriteObjectValue(Options, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CosmosDBSqlStoredProcedureCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureListResult.Serialization.cs index 23e7c8e25d760..f23b48829b0c4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class CosmosDBSqlStoredProcedureListResult : IUtf8JsonSerializa void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter write throw new FormatException($"The model {nameof(CosmosDBSqlStoredProcedureListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter write #endif } } - writer.WriteEndObject(); } CosmosDBSqlStoredProcedureListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureResourceInfo.Serialization.cs index e90af617f5c44..e8c9d36b7e161 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlStoredProcedureResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBSqlStoredProcedureResourceInfo : IUtf8JsonSerializa void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter wri throw new FormatException($"The model {nameof(CosmosDBSqlStoredProcedureResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("id"u8); writer.WriteStringValue(StoredProcedureName); if (Optional.IsDefined(Body)) @@ -49,7 +57,6 @@ void IJsonModel.Write(Utf8JsonWriter wri #endif } } - writer.WriteEndObject(); } CosmosDBSqlStoredProcedureResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerCreateOrUpdateContent.Serialization.cs index 043b0e925b5b5..0889346fce9f8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerCreateOrUpdateContent.Serialization.cs @@ -21,6 +21,15 @@ public partial class CosmosDBSqlTriggerCreateOrUpdateContent : IUtf8JsonSerializ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,46 +37,13 @@ void IJsonModel.Write(Utf8JsonWriter wr throw new FormatException($"The model {nameof(CosmosDBSqlTriggerCreateOrUpdateContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); @@ -78,22 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter wr writer.WriteObjectValue(Options, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CosmosDBSqlTriggerCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerListResult.Serialization.cs index 0e66179a92447..b70ae921f084f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class CosmosDBSqlTriggerListResult : IUtf8JsonSerializable, IJs void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(CosmosDBSqlTriggerListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model #endif } } - writer.WriteEndObject(); } CosmosDBSqlTriggerListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerResourceInfo.Serialization.cs index ea9ca1ba12162..64be96caf298f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlTriggerResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBSqlTriggerResourceInfo : IUtf8JsonSerializable, IJs void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(CosmosDBSqlTriggerResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("id"u8); writer.WriteStringValue(TriggerName); if (Optional.IsDefined(Body)) @@ -59,7 +67,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod #endif } } - writer.WriteEndObject(); } CosmosDBSqlTriggerResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent.Serialization.cs index 95ede0aab61a0..1277f2d17212c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent.Serialization.cs @@ -21,6 +21,15 @@ public partial class CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent : IUtf8 void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,46 +37,13 @@ void IJsonModel.Write(Utf8J throw new FormatException($"The model {nameof(CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); @@ -78,22 +54,6 @@ void IJsonModel.Write(Utf8J writer.WriteObjectValue(Options, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CosmosDBSqlUserDefinedFunctionCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionListResult.Serialization.cs index 786d4be35f33f..0efdd1f53f1fd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class CosmosDBSqlUserDefinedFunctionListResult : IUtf8JsonSeria void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter w throw new FormatException($"The model {nameof(CosmosDBSqlUserDefinedFunctionListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter w #endif } } - writer.WriteEndObject(); } CosmosDBSqlUserDefinedFunctionListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionResourceInfo.Serialization.cs index 21d5c76756f7d..fa9e01c77fbcf 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBSqlUserDefinedFunctionResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBSqlUserDefinedFunctionResourceInfo : IUtf8JsonSeria void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter throw new FormatException($"The model {nameof(CosmosDBSqlUserDefinedFunctionResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("id"u8); writer.WriteStringValue(FunctionName); if (Optional.IsDefined(Body)) @@ -49,7 +57,6 @@ void IJsonModel.Write(Utf8JsonWriter #endif } } - writer.WriteEndObject(); } CosmosDBSqlUserDefinedFunctionResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableCreateOrUpdateContent.Serialization.cs index 87c96d666096f..e7c14dbdad358 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableCreateOrUpdateContent.Serialization.cs @@ -21,6 +21,15 @@ public partial class CosmosDBTableCreateOrUpdateContent : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,46 +37,13 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(CosmosDBTableCreateOrUpdateContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); @@ -78,22 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteObjectValue(Options, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CosmosDBTableCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableListResult.Serialization.cs index 56676a837544c..cf2467ee1080a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class CosmosDBTableListResult : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(CosmosDBTableListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade #endif } } - writer.WriteEndObject(); } CosmosDBTableListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTablePropertiesOptions.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTablePropertiesOptions.Serialization.cs index 5e7c376a3186d..8ae1dc698f46c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTablePropertiesOptions.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTablePropertiesOptions.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBTablePropertiesOptions : IUtf8JsonSerializable, IJs void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,33 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(CosmosDBTablePropertiesOptions)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (Optional.IsDefined(Throughput)) - { - writer.WritePropertyName("throughput"u8); - writer.WriteNumberValue(Throughput.Value); - } - if (Optional.IsDefined(AutoscaleSettings)) - { - writer.WritePropertyName("autoscaleSettings"u8); - writer.WriteObjectValue(AutoscaleSettings, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } CosmosDBTablePropertiesOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTablePropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTablePropertiesResource.Serialization.cs index 5c7b877450254..392b334de9b86 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTablePropertiesResource.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTablePropertiesResource.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBTablePropertiesResource : IUtf8JsonSerializable, IJ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo throw new FormatException($"The model {nameof(CosmosDBTablePropertiesResource)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (options.Format != "W" && Optional.IsDefined(Rid)) { writer.WritePropertyName("_rid"u8); @@ -42,34 +51,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo writer.WritePropertyName("_etag"u8); writer.WriteStringValue(ETag.Value.ToString()); } - writer.WritePropertyName("id"u8); - writer.WriteStringValue(TableName); - if (Optional.IsDefined(RestoreParameters)) - { - writer.WritePropertyName("restoreParameters"u8); - writer.WriteObjectValue(RestoreParameters, options); - } - if (Optional.IsDefined(CreateMode)) - { - writer.WritePropertyName("createMode"u8); - writer.WriteStringValue(CreateMode.Value.ToString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CosmosDBTablePropertiesResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableResourceInfo.Serialization.cs index 24c295dedef71..ebcc840546e37 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBTableResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBTableResourceInfo : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(CosmosDBTableResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("id"u8); writer.WriteStringValue(TableName); if (Optional.IsDefined(RestoreParameters)) @@ -54,7 +62,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } CosmosDBTableResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputPoolPatch.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputPoolPatch.Serialization.cs index 5a27e018de6ac..d497a35295af2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputPoolPatch.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBThroughputPoolPatch.Serialization.cs @@ -18,6 +18,15 @@ public partial class CosmosDBThroughputPoolPatch : IUtf8JsonSerializable, IJsonM void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(CosmosDBThroughputPoolPatch)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(ProvisioningState)) @@ -54,7 +62,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR #endif } } - writer.WriteEndObject(); } CosmosDBThroughputPoolPatch IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBUniqueKey.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBUniqueKey.Serialization.cs index bd87989ba4c08..45349c1ff5c28 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBUniqueKey.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBUniqueKey.Serialization.cs @@ -20,6 +20,15 @@ public partial class CosmosDBUniqueKey : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite throw new FormatException($"The model {nameof(CosmosDBUniqueKey)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Paths)) { writer.WritePropertyName("paths"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite #endif } } - writer.WriteEndObject(); } CosmosDBUniqueKey IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBUniqueKeyPolicy.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBUniqueKeyPolicy.Serialization.cs index b2f73def4cfb1..d015cc9c851d8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBUniqueKeyPolicy.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBUniqueKeyPolicy.Serialization.cs @@ -20,6 +20,15 @@ internal partial class CosmosDBUniqueKeyPolicy : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(CosmosDBUniqueKeyPolicy)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(UniqueKeys)) { writer.WritePropertyName("uniqueKeys"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade #endif } } - writer.WriteEndObject(); } CosmosDBUniqueKeyPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBUsagesResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBUsagesResult.Serialization.cs index d693b67e5b09e..66ed665d19052 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBUsagesResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBUsagesResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class CosmosDBUsagesResult : IUtf8JsonSerializable, IJsonModel< void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr throw new FormatException($"The model {nameof(CosmosDBUsagesResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWr #endif } } - writer.WriteEndObject(); } CosmosDBUsagesResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBVirtualNetworkRule.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBVirtualNetworkRule.Serialization.cs index fa1c57c8c0d00..3672eec897265 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBVirtualNetworkRule.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosDBVirtualNetworkRule.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosDBVirtualNetworkRule : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(CosmosDBVirtualNetworkRule)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } CosmosDBVirtualNetworkRule IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) 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 index c853f46f4ba68..e4b057c968d60 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoDataTransferDataSourceSink.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosMongoDataTransferDataSourceSink.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosMongoDataTransferDataSourceSink : IUtf8JsonSerializab void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,34 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writ throw new FormatException($"The model {nameof(CosmosMongoDataTransferDataSourceSink)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("databaseName"u8); writer.WriteStringValue(DatabaseName); writer.WritePropertyName("collectionName"u8); writer.WriteStringValue(CollectionName); - if (Optional.IsDefined(RemoteAccountName)) - { - writer.WritePropertyName("remoteAccountName"u8); - writer.WriteStringValue(RemoteAccountName); - } - writer.WritePropertyName("component"u8); - writer.WriteStringValue(Component.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CosmosMongoDataTransferDataSourceSink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosSqlDataTransferDataSourceSink.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosSqlDataTransferDataSourceSink.Serialization.cs index 5d192f6f9b5b8..936d745186384 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosSqlDataTransferDataSourceSink.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/CosmosSqlDataTransferDataSourceSink.Serialization.cs @@ -19,6 +19,15 @@ public partial class CosmosSqlDataTransferDataSourceSink : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,34 +35,11 @@ void IJsonModel.Write(Utf8JsonWriter writer throw new FormatException($"The model {nameof(CosmosSqlDataTransferDataSourceSink)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("databaseName"u8); writer.WriteStringValue(DatabaseName); writer.WritePropertyName("containerName"u8); writer.WriteStringValue(ContainerName); - if (Optional.IsDefined(RemoteAccountName)) - { - writer.WritePropertyName("remoteAccountName"u8); - writer.WriteStringValue(RemoteAccountName); - } - writer.WritePropertyName("component"u8); - writer.WriteStringValue(Component.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } CosmosSqlDataTransferDataSourceSink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) 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 c703b56f5c56f..4295991895aeb 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 @@ -20,6 +20,15 @@ public partial class DataTransferDataSourceSink : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(DataTransferDataSourceSink)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("component"u8); writer.WriteStringValue(Component.ToString()); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -45,7 +53,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } DataTransferDataSourceSink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobFeedResults.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobFeedResults.Serialization.cs index 2bde9271b81a5..1e5df3f842d47 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobFeedResults.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobFeedResults.Serialization.cs @@ -20,6 +20,15 @@ internal partial class DataTransferJobFeedResults : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(DataTransferJobFeedResults)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } DataTransferJobFeedResults IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobGetResultCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobGetResultCreateOrUpdateContent.Serialization.cs index e58c1dcf7a0b5..0312847163d9e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobGetResultCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobGetResultCreateOrUpdateContent.Serialization.cs @@ -20,6 +20,15 @@ public partial class DataTransferJobGetResultCreateOrUpdateContent : IUtf8JsonSe void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,45 +36,9 @@ void IJsonModel.Write(Utf8JsonWri throw new FormatException($"The model {nameof(DataTransferJobGetResultCreateOrUpdateContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } DataTransferJobGetResultCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobProperties.Serialization.cs index c037da8e0c4a3..d6aca8c77df2e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobProperties.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferJobProperties.Serialization.cs @@ -19,6 +19,15 @@ public partial class DataTransferJobProperties : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(DataTransferJobProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(JobName)) { writer.WritePropertyName("jobName"u8); @@ -91,7 +99,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } DataTransferJobProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferRegionalService.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferRegionalService.Serialization.cs index 555678c55ade2..84f871acfd446 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferRegionalService.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferRegionalService.Serialization.cs @@ -19,6 +19,15 @@ public partial class DataTransferRegionalService : IUtf8JsonSerializable, IJsonM void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,38 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(DataTransferRegionalService)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W" && Optional.IsDefined(Location)) - { - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location.Value); - } - if (options.Format != "W" && Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.Value.ToString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } DataTransferRegionalService IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferServiceProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferServiceProperties.Serialization.cs index 320f0ad46e1f6..01e313fce040e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferServiceProperties.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferServiceProperties.Serialization.cs @@ -20,6 +20,15 @@ public partial class DataTransferServiceProperties : IUtf8JsonSerializable, IJso void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(DataTransferServiceProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (options.Format != "W" && Optional.IsCollectionDefined(Locations)) { writer.WritePropertyName("locations"u8); @@ -38,28 +47,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode } writer.WriteEndArray(); } - if (options.Format != "W" && Optional.IsDefined(CreatedOn)) - { - writer.WritePropertyName("creationTime"u8); - writer.WriteStringValue(CreatedOn.Value, "O"); - } - if (Optional.IsDefined(InstanceSize)) - { - writer.WritePropertyName("instanceSize"u8); - writer.WriteStringValue(InstanceSize.Value.ToString()); - } - if (Optional.IsDefined(InstanceCount)) - { - writer.WritePropertyName("instanceCount"u8); - writer.WriteNumberValue(InstanceCount.Value); - } - writer.WritePropertyName("serviceType"u8); - writer.WriteStringValue(ServiceType.ToString()); - if (options.Format != "W" && Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.Value.ToString()); - } foreach (var item in AdditionalProperties) { writer.WritePropertyName(item.Key); @@ -72,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode } #endif } - writer.WriteEndObject(); } DataTransferServiceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferServiceResourceCreateUpdateProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferServiceResourceCreateUpdateProperties.Serialization.cs index 96f35c847fab0..34b1d6eac376e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferServiceResourceCreateUpdateProperties.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DataTransferServiceResourceCreateUpdateProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class DataTransferServiceResourceCreateUpdateProperties : IUtf8Js void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,35 +34,7 @@ void IJsonModel.Write(Utf8Jso throw new FormatException($"The model {nameof(DataTransferServiceResourceCreateUpdateProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (Optional.IsDefined(InstanceSize)) - { - writer.WritePropertyName("instanceSize"u8); - writer.WriteStringValue(InstanceSize.Value.ToString()); - } - if (Optional.IsDefined(InstanceCount)) - { - writer.WritePropertyName("instanceCount"u8); - writer.WriteNumberValue(InstanceCount.Value); - } - writer.WritePropertyName("serviceType"u8); - writer.WriteStringValue(ServiceType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } DataTransferServiceResourceCreateUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountKeysMetadata.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountKeysMetadata.Serialization.cs index e185107d4ed00..f9eb77fb92d96 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountKeysMetadata.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountKeysMetadata.Serialization.cs @@ -19,6 +19,15 @@ public partial class DatabaseAccountKeysMetadata : IUtf8JsonSerializable, IJsonM void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(DatabaseAccountKeysMetadata)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(PrimaryMasterKey)) { writer.WritePropertyName("primaryMasterKey"u8); @@ -62,7 +70,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR #endif } } - writer.WriteEndObject(); } DatabaseAccountKeysMetadata IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountListConnectionStringsResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountListConnectionStringsResult.Serialization.cs index 9c1fef41bdad9..9bb2e5520b617 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountListConnectionStringsResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountListConnectionStringsResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class DatabaseAccountListConnectionStringsResult : IUtf8JsonSer void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter throw new FormatException($"The model {nameof(DatabaseAccountListConnectionStringsResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(ConnectionStrings)) { writer.WritePropertyName("connectionStrings"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter #endif } } - writer.WriteEndObject(); } DatabaseAccountListConnectionStringsResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountsListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountsListResult.Serialization.cs index 0e3430cea6d0a..752c237268868 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountsListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseAccountsListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class DatabaseAccountsListResult : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(DatabaseAccountsListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } DatabaseAccountsListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseRestoreResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseRestoreResourceInfo.Serialization.cs index f368ec515c079..aa8c779824859 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseRestoreResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DatabaseRestoreResourceInfo.Serialization.cs @@ -20,6 +20,15 @@ public partial class DatabaseRestoreResourceInfo : IUtf8JsonSerializable, IJsonM void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(DatabaseRestoreResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(DatabaseName)) { writer.WritePropertyName("databaseName"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR #endif } } - writer.WriteEndObject(); } DatabaseRestoreResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DiagnosticLogSettings.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DiagnosticLogSettings.Serialization.cs index 10229b3ded13a..e68a0886038e4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DiagnosticLogSettings.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/DiagnosticLogSettings.Serialization.cs @@ -19,6 +19,15 @@ internal partial class DiagnosticLogSettings : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(DiagnosticLogSettings)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(EnableFullTextQuery)) { writer.WritePropertyName("enableFullTextQuery"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW #endif } } - writer.WriteEndObject(); } DiagnosticLogSettings IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCassandraKeyspaceResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCassandraKeyspaceResourceInfo.Serialization.cs index a8f6c6253a30e..62a4dcaedd247 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCassandraKeyspaceResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCassandraKeyspaceResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class ExtendedCassandraKeyspaceResourceInfo : IUtf8JsonSerializab void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter writ throw new FormatException($"The model {nameof(ExtendedCassandraKeyspaceResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (options.Format != "W" && Optional.IsDefined(Rid)) { writer.WritePropertyName("_rid"u8); @@ -42,24 +51,6 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WritePropertyName("_etag"u8); writer.WriteStringValue(ETag.Value.ToString()); } - writer.WritePropertyName("id"u8); - writer.WriteStringValue(KeyspaceName); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } ExtendedCassandraKeyspaceResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCassandraTableResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCassandraTableResourceInfo.Serialization.cs index 93e830607d90e..12f4228b2e5a7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCassandraTableResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCassandraTableResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class ExtendedCassandraTableResourceInfo : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(ExtendedCassandraTableResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (options.Format != "W" && Optional.IsDefined(Rid)) { writer.WritePropertyName("_rid"u8); @@ -42,39 +51,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WritePropertyName("_etag"u8); writer.WriteStringValue(ETag.Value.ToString()); } - writer.WritePropertyName("id"u8); - writer.WriteStringValue(TableName); - if (Optional.IsDefined(DefaultTtl)) - { - writer.WritePropertyName("defaultTtl"u8); - writer.WriteNumberValue(DefaultTtl.Value); - } - if (Optional.IsDefined(Schema)) - { - writer.WritePropertyName("schema"u8); - writer.WriteObjectValue(Schema, options); - } - if (Optional.IsDefined(AnalyticalStorageTtl)) - { - writer.WritePropertyName("analyticalStorageTtl"u8); - writer.WriteNumberValue(AnalyticalStorageTtl.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } ExtendedCassandraTableResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) 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 38c9cc44a336f..0f9778faa9757 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 @@ -20,6 +20,15 @@ public partial class ExtendedCosmosDBSqlContainerResourceInfo : IUtf8JsonSeriali void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,7 @@ void IJsonModel.Write(Utf8JsonWriter w throw new FormatException($"The model {nameof(ExtendedCosmosDBSqlContainerResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (options.Format != "W" && Optional.IsDefined(Rid)) { writer.WritePropertyName("_rid"u8); @@ -43,84 +52,6 @@ void IJsonModel.Write(Utf8JsonWriter w writer.WritePropertyName("_etag"u8); writer.WriteStringValue(ETag.Value.ToString()); } - writer.WritePropertyName("id"u8); - writer.WriteStringValue(ContainerName); - if (Optional.IsDefined(IndexingPolicy)) - { - writer.WritePropertyName("indexingPolicy"u8); - writer.WriteObjectValue(IndexingPolicy, options); - } - if (Optional.IsDefined(PartitionKey)) - { - writer.WritePropertyName("partitionKey"u8); - writer.WriteObjectValue(PartitionKey, options); - } - if (Optional.IsDefined(DefaultTtl)) - { - writer.WritePropertyName("defaultTtl"u8); - writer.WriteNumberValue(DefaultTtl.Value); - } - if (Optional.IsDefined(UniqueKeyPolicy)) - { - writer.WritePropertyName("uniqueKeyPolicy"u8); - writer.WriteObjectValue(UniqueKeyPolicy, options); - } - if (Optional.IsDefined(ConflictResolutionPolicy)) - { - writer.WritePropertyName("conflictResolutionPolicy"u8); - writer.WriteObjectValue(ConflictResolutionPolicy, options); - } - if (Optional.IsDefined(ClientEncryptionPolicy)) - { - writer.WritePropertyName("clientEncryptionPolicy"u8); - writer.WriteObjectValue(ClientEncryptionPolicy, options); - } - if (Optional.IsDefined(AnalyticalStorageTtl)) - { - writer.WritePropertyName("analyticalStorageTtl"u8); - writer.WriteNumberValue(AnalyticalStorageTtl.Value); - } - if (Optional.IsDefined(RestoreParameters)) - { - writer.WritePropertyName("restoreParameters"u8); - writer.WriteObjectValue(RestoreParameters, options); - } - if (Optional.IsDefined(CreateMode)) - { - writer.WritePropertyName("createMode"u8); - writer.WriteStringValue(CreateMode.Value.ToString()); - } - if (Optional.IsDefined(MaterializedViewDefinition)) - { - writer.WritePropertyName("materializedViewDefinition"u8); - writer.WriteObjectValue(MaterializedViewDefinition, options); - } - if (Optional.IsCollectionDefined(ComputedProperties)) - { - writer.WritePropertyName("computedProperties"u8); - writer.WriteStartArray(); - foreach (var item in ComputedProperties) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } ExtendedCosmosDBSqlContainerResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlDatabaseResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlDatabaseResourceInfo.Serialization.cs index 7b27df82b29d9..b1cce37a60629 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlDatabaseResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlDatabaseResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class ExtendedCosmosDBSqlDatabaseResourceInfo : IUtf8JsonSerializ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter wr throw new FormatException($"The model {nameof(ExtendedCosmosDBSqlDatabaseResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Colls)) { writer.WritePropertyName("_colls"u8); @@ -52,34 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter wr writer.WritePropertyName("_etag"u8); writer.WriteStringValue(ETag.Value.ToString()); } - writer.WritePropertyName("id"u8); - writer.WriteStringValue(DatabaseName); - if (Optional.IsDefined(RestoreParameters)) - { - writer.WritePropertyName("restoreParameters"u8); - writer.WriteObjectValue(RestoreParameters, options); - } - if (Optional.IsDefined(CreateMode)) - { - writer.WritePropertyName("createMode"u8); - writer.WriteStringValue(CreateMode.Value.ToString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } ExtendedCosmosDBSqlDatabaseResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlStoredProcedureResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlStoredProcedureResourceInfo.Serialization.cs index 41471aadb20ff..a97395c11e458 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlStoredProcedureResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlStoredProcedureResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class ExtendedCosmosDBSqlStoredProcedureResourceInfo : IUtf8JsonS void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,7 @@ void IJsonModel.Write(Utf8JsonWr throw new FormatException($"The model {nameof(ExtendedCosmosDBSqlStoredProcedureResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (options.Format != "W" && Optional.IsDefined(Rid)) { writer.WritePropertyName("_rid"u8); @@ -42,29 +51,6 @@ void IJsonModel.Write(Utf8JsonWr writer.WritePropertyName("_etag"u8); writer.WriteStringValue(ETag.Value.ToString()); } - writer.WritePropertyName("id"u8); - writer.WriteStringValue(StoredProcedureName); - if (Optional.IsDefined(Body)) - { - writer.WritePropertyName("body"u8); - writer.WriteStringValue(Body); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } ExtendedCosmosDBSqlStoredProcedureResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlTriggerResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlTriggerResourceInfo.Serialization.cs index 9ddb3aec44e86..d5c2e0c2ec59c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlTriggerResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlTriggerResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class ExtendedCosmosDBSqlTriggerResourceInfo : IUtf8JsonSerializa void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter wri throw new FormatException($"The model {nameof(ExtendedCosmosDBSqlTriggerResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (options.Format != "W" && Optional.IsDefined(Rid)) { writer.WritePropertyName("_rid"u8); @@ -42,39 +51,6 @@ void IJsonModel.Write(Utf8JsonWriter wri writer.WritePropertyName("_etag"u8); writer.WriteStringValue(ETag.Value.ToString()); } - writer.WritePropertyName("id"u8); - writer.WriteStringValue(TriggerName); - if (Optional.IsDefined(Body)) - { - writer.WritePropertyName("body"u8); - writer.WriteStringValue(Body); - } - if (Optional.IsDefined(TriggerType)) - { - writer.WritePropertyName("triggerType"u8); - writer.WriteStringValue(TriggerType.Value.ToString()); - } - if (Optional.IsDefined(TriggerOperation)) - { - writer.WritePropertyName("triggerOperation"u8); - writer.WriteStringValue(TriggerOperation.Value.ToString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } ExtendedCosmosDBSqlTriggerResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlUserDefinedFunctionResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlUserDefinedFunctionResourceInfo.Serialization.cs index aeff88c51ec82..fb078c7b860cc 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlUserDefinedFunctionResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedCosmosDBSqlUserDefinedFunctionResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class ExtendedCosmosDBSqlUserDefinedFunctionResourceInfo : IUtf8J void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,7 @@ void IJsonModel.Write(Utf8Js throw new FormatException($"The model {nameof(ExtendedCosmosDBSqlUserDefinedFunctionResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (options.Format != "W" && Optional.IsDefined(Rid)) { writer.WritePropertyName("_rid"u8); @@ -42,29 +51,6 @@ void IJsonModel.Write(Utf8Js writer.WritePropertyName("_etag"u8); writer.WriteStringValue(ETag.Value.ToString()); } - writer.WritePropertyName("id"u8); - writer.WriteStringValue(FunctionName); - if (Optional.IsDefined(Body)) - { - writer.WritePropertyName("body"u8); - writer.WriteStringValue(Body); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } ExtendedCosmosDBSqlUserDefinedFunctionResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedGremlinDatabaseResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedGremlinDatabaseResourceInfo.Serialization.cs index f40c97f16f6f7..b9e1c9e265efa 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedGremlinDatabaseResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedGremlinDatabaseResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class ExtendedGremlinDatabaseResourceInfo : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter writer throw new FormatException($"The model {nameof(ExtendedGremlinDatabaseResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (options.Format != "W" && Optional.IsDefined(Rid)) { writer.WritePropertyName("_rid"u8); @@ -42,34 +51,6 @@ void IJsonModel.Write(Utf8JsonWriter writer writer.WritePropertyName("_etag"u8); writer.WriteStringValue(ETag.Value.ToString()); } - writer.WritePropertyName("id"u8); - writer.WriteStringValue(DatabaseName); - if (Optional.IsDefined(RestoreParameters)) - { - writer.WritePropertyName("restoreParameters"u8); - writer.WriteObjectValue(RestoreParameters, options); - } - if (Optional.IsDefined(CreateMode)) - { - writer.WritePropertyName("createMode"u8); - writer.WriteStringValue(CreateMode.Value.ToString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } ExtendedGremlinDatabaseResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedGremlinGraphResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedGremlinGraphResourceInfo.Serialization.cs index 826a15d6ed918..94da76c891e46 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedGremlinGraphResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedGremlinGraphResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class ExtendedGremlinGraphResourceInfo : IUtf8JsonSerializable, I void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, M throw new FormatException($"The model {nameof(ExtendedGremlinGraphResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (options.Format != "W" && Optional.IsDefined(Rid)) { writer.WritePropertyName("_rid"u8); @@ -42,64 +51,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M writer.WritePropertyName("_etag"u8); writer.WriteStringValue(ETag.Value.ToString()); } - writer.WritePropertyName("id"u8); - writer.WriteStringValue(GraphName); - if (Optional.IsDefined(IndexingPolicy)) - { - writer.WritePropertyName("indexingPolicy"u8); - writer.WriteObjectValue(IndexingPolicy, options); - } - if (Optional.IsDefined(PartitionKey)) - { - writer.WritePropertyName("partitionKey"u8); - writer.WriteObjectValue(PartitionKey, options); - } - if (Optional.IsDefined(DefaultTtl)) - { - writer.WritePropertyName("defaultTtl"u8); - writer.WriteNumberValue(DefaultTtl.Value); - } - if (Optional.IsDefined(UniqueKeyPolicy)) - { - writer.WritePropertyName("uniqueKeyPolicy"u8); - writer.WriteObjectValue(UniqueKeyPolicy, options); - } - if (Optional.IsDefined(ConflictResolutionPolicy)) - { - writer.WritePropertyName("conflictResolutionPolicy"u8); - writer.WriteObjectValue(ConflictResolutionPolicy, options); - } - if (Optional.IsDefined(AnalyticalStorageTtl)) - { - writer.WritePropertyName("analyticalStorageTtl"u8); - writer.WriteNumberValue(AnalyticalStorageTtl.Value); - } - if (Optional.IsDefined(RestoreParameters)) - { - writer.WritePropertyName("restoreParameters"u8); - writer.WriteObjectValue(RestoreParameters, options); - } - if (Optional.IsDefined(CreateMode)) - { - writer.WritePropertyName("createMode"u8); - writer.WriteStringValue(CreateMode.Value.ToString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } ExtendedGremlinGraphResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedMongoDBCollectionResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedMongoDBCollectionResourceInfo.Serialization.cs index 0cf07353ddac6..5fff64e46ced0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedMongoDBCollectionResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedMongoDBCollectionResourceInfo.Serialization.cs @@ -20,6 +20,15 @@ public partial class ExtendedMongoDBCollectionResourceInfo : IUtf8JsonSerializab void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,7 @@ void IJsonModel.Write(Utf8JsonWriter writ throw new FormatException($"The model {nameof(ExtendedMongoDBCollectionResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (options.Format != "W" && Optional.IsDefined(Rid)) { writer.WritePropertyName("_rid"u8); @@ -43,60 +52,6 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WritePropertyName("_etag"u8); writer.WriteStringValue(ETag.Value.ToString()); } - writer.WritePropertyName("id"u8); - writer.WriteStringValue(CollectionName); - if (Optional.IsCollectionDefined(ShardKey)) - { - writer.WritePropertyName("shardKey"u8); - writer.WriteStartObject(); - foreach (var item in ShardKey) - { - writer.WritePropertyName(item.Key); - writer.WriteStringValue(item.Value); - } - writer.WriteEndObject(); - } - if (Optional.IsCollectionDefined(Indexes)) - { - writer.WritePropertyName("indexes"u8); - writer.WriteStartArray(); - foreach (var item in Indexes) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (Optional.IsDefined(AnalyticalStorageTtl)) - { - writer.WritePropertyName("analyticalStorageTtl"u8); - writer.WriteNumberValue(AnalyticalStorageTtl.Value); - } - if (Optional.IsDefined(RestoreParameters)) - { - writer.WritePropertyName("restoreParameters"u8); - writer.WriteObjectValue(RestoreParameters, options); - } - if (Optional.IsDefined(CreateMode)) - { - writer.WritePropertyName("createMode"u8); - writer.WriteStringValue(CreateMode.Value.ToString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } ExtendedMongoDBCollectionResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedMongoDBDatabaseResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedMongoDBDatabaseResourceInfo.Serialization.cs index c2b1bae3719fa..aea3139f15c3d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedMongoDBDatabaseResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedMongoDBDatabaseResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class ExtendedMongoDBDatabaseResourceInfo : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter writer throw new FormatException($"The model {nameof(ExtendedMongoDBDatabaseResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (options.Format != "W" && Optional.IsDefined(Rid)) { writer.WritePropertyName("_rid"u8); @@ -42,34 +51,6 @@ void IJsonModel.Write(Utf8JsonWriter writer writer.WritePropertyName("_etag"u8); writer.WriteStringValue(ETag.Value.ToString()); } - writer.WritePropertyName("id"u8); - writer.WriteStringValue(DatabaseName); - if (Optional.IsDefined(RestoreParameters)) - { - writer.WritePropertyName("restoreParameters"u8); - writer.WriteObjectValue(RestoreParameters, options); - } - if (Optional.IsDefined(CreateMode)) - { - writer.WritePropertyName("createMode"u8); - writer.WriteStringValue(CreateMode.Value.ToString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } ExtendedMongoDBDatabaseResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedRestorableGremlinDatabaseResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedRestorableGremlinDatabaseResourceInfo.Serialization.cs index 45a8454980c9d..a8c425ed235fb 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedRestorableGremlinDatabaseResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedRestorableGremlinDatabaseResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class ExtendedRestorableGremlinDatabaseResourceInfo : IUtf8JsonSe void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWri throw new FormatException($"The model {nameof(ExtendedRestorableGremlinDatabaseResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Rid)) { writer.WritePropertyName("_rid"u8); @@ -77,7 +85,6 @@ void IJsonModel.Write(Utf8JsonWri #endif } } - writer.WriteEndObject(); } ExtendedRestorableGremlinDatabaseResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedRestorableGremlinGraphResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedRestorableGremlinGraphResourceInfo.Serialization.cs index 606e37ecd953b..296907795a65c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedRestorableGremlinGraphResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedRestorableGremlinGraphResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class ExtendedRestorableGremlinGraphResourceInfo : IUtf8JsonSeria void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter throw new FormatException($"The model {nameof(ExtendedRestorableGremlinGraphResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Rid)) { writer.WritePropertyName("_rid"u8); @@ -77,7 +85,6 @@ void IJsonModel.Write(Utf8JsonWriter #endif } } - writer.WriteEndObject(); } ExtendedRestorableGremlinGraphResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedRestorableMongoDBCollectionResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedRestorableMongoDBCollectionResourceInfo.Serialization.cs index 62d11b7857a34..1d55cbee467a0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedRestorableMongoDBCollectionResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedRestorableMongoDBCollectionResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class ExtendedRestorableMongoDBCollectionResourceInfo : IUtf8Json void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonW throw new FormatException($"The model {nameof(ExtendedRestorableMongoDBCollectionResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Rid)) { writer.WritePropertyName("_rid"u8); @@ -77,7 +85,6 @@ void IJsonModel.Write(Utf8JsonW #endif } } - writer.WriteEndObject(); } ExtendedRestorableMongoDBCollectionResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedRestorableMongoDBDatabaseResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedRestorableMongoDBDatabaseResourceInfo.Serialization.cs index fb349862ec026..0104df851a53e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedRestorableMongoDBDatabaseResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedRestorableMongoDBDatabaseResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class ExtendedRestorableMongoDBDatabaseResourceInfo : IUtf8JsonSe void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWri throw new FormatException($"The model {nameof(ExtendedRestorableMongoDBDatabaseResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Rid)) { writer.WritePropertyName("_rid"u8); @@ -77,7 +85,6 @@ void IJsonModel.Write(Utf8JsonWri #endif } } - writer.WriteEndObject(); } ExtendedRestorableMongoDBDatabaseResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedRestorableSqlContainerResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedRestorableSqlContainerResourceInfo.Serialization.cs index c6214b71bc862..29b1d50a3bb32 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedRestorableSqlContainerResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedRestorableSqlContainerResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class ExtendedRestorableSqlContainerResourceInfo : IUtf8JsonSeria void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter throw new FormatException($"The model {nameof(ExtendedRestorableSqlContainerResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Rid)) { writer.WritePropertyName("_rid"u8); @@ -82,7 +90,6 @@ void IJsonModel.Write(Utf8JsonWriter #endif } } - writer.WriteEndObject(); } ExtendedRestorableSqlContainerResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedRestorableSqlDatabaseResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedRestorableSqlDatabaseResourceInfo.Serialization.cs index 86bb5a3be42b0..3c587608f8c6e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedRestorableSqlDatabaseResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedRestorableSqlDatabaseResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class ExtendedRestorableSqlDatabaseResourceInfo : IUtf8JsonSerial void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter throw new FormatException($"The model {nameof(ExtendedRestorableSqlDatabaseResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Rid)) { writer.WritePropertyName("_rid"u8); @@ -82,7 +90,6 @@ void IJsonModel.Write(Utf8JsonWriter #endif } } - writer.WriteEndObject(); } ExtendedRestorableSqlDatabaseResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedRestorableTableResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedRestorableTableResourceInfo.Serialization.cs index ddc677c8e1446..c73d33152a88a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedRestorableTableResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedRestorableTableResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class ExtendedRestorableTableResourceInfo : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer throw new FormatException($"The model {nameof(ExtendedRestorableTableResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Rid)) { writer.WritePropertyName("_rid"u8); @@ -77,7 +85,6 @@ void IJsonModel.Write(Utf8JsonWriter writer #endif } } - writer.WriteEndObject(); } ExtendedRestorableTableResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedThroughputSettingsResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedThroughputSettingsResourceInfo.Serialization.cs index 8bf010ecc831a..0289016c61af8 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedThroughputSettingsResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ExtendedThroughputSettingsResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class ExtendedThroughputSettingsResourceInfo : IUtf8JsonSerializa void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter wri throw new FormatException($"The model {nameof(ExtendedThroughputSettingsResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (options.Format != "W" && Optional.IsDefined(Rid)) { writer.WritePropertyName("_rid"u8); @@ -42,52 +51,6 @@ void IJsonModel.Write(Utf8JsonWriter wri writer.WritePropertyName("_etag"u8); writer.WriteStringValue(ETag.Value.ToString()); } - if (Optional.IsDefined(Throughput)) - { - writer.WritePropertyName("throughput"u8); - writer.WriteNumberValue(Throughput.Value); - } - if (Optional.IsDefined(AutoscaleSettings)) - { - writer.WritePropertyName("autoscaleSettings"u8); - writer.WriteObjectValue(AutoscaleSettings, options); - } - if (options.Format != "W" && Optional.IsDefined(MinimumThroughput)) - { - writer.WritePropertyName("minimumThroughput"u8); - writer.WriteStringValue(MinimumThroughput); - } - if (options.Format != "W" && Optional.IsDefined(OfferReplacePending)) - { - writer.WritePropertyName("offerReplacePending"u8); - writer.WriteStringValue(OfferReplacePending); - } - if (options.Format != "W" && Optional.IsDefined(InstantMaximumThroughput)) - { - writer.WritePropertyName("instantMaximumThroughput"u8); - writer.WriteStringValue(InstantMaximumThroughput); - } - if (options.Format != "W" && Optional.IsDefined(SoftAllowedMaximumThroughput)) - { - writer.WritePropertyName("softAllowedMaximumThroughput"u8); - writer.WriteStringValue(SoftAllowedMaximumThroughput); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } ExtendedThroughputSettingsResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphApiComputeRegionalService.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphApiComputeRegionalService.Serialization.cs index 1ca2651bbce90..7b1e023a8ea5c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphApiComputeRegionalService.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphApiComputeRegionalService.Serialization.cs @@ -19,6 +19,15 @@ public partial class GraphApiComputeRegionalService : IUtf8JsonSerializable, IJs void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,43 +35,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(GraphApiComputeRegionalService)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (options.Format != "W" && Optional.IsDefined(GraphApiComputeEndpoint)) { writer.WritePropertyName("graphApiComputeEndpoint"u8); writer.WriteStringValue(GraphApiComputeEndpoint); } - if (options.Format != "W" && Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W" && Optional.IsDefined(Location)) - { - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location.Value); - } - if (options.Format != "W" && Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.Value.ToString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } GraphApiComputeRegionalService IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphApiComputeServiceProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphApiComputeServiceProperties.Serialization.cs index 73a9635f5d2b9..675899374a831 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphApiComputeServiceProperties.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphApiComputeServiceProperties.Serialization.cs @@ -20,6 +20,15 @@ public partial class GraphApiComputeServiceProperties : IUtf8JsonSerializable, I void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, M throw new FormatException($"The model {nameof(GraphApiComputeServiceProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(GraphApiComputeEndpoint)) { writer.WritePropertyName("graphApiComputeEndpoint"u8); @@ -43,28 +52,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M } writer.WriteEndArray(); } - if (options.Format != "W" && Optional.IsDefined(CreatedOn)) - { - writer.WritePropertyName("creationTime"u8); - writer.WriteStringValue(CreatedOn.Value, "O"); - } - if (Optional.IsDefined(InstanceSize)) - { - writer.WritePropertyName("instanceSize"u8); - writer.WriteStringValue(InstanceSize.Value.ToString()); - } - if (Optional.IsDefined(InstanceCount)) - { - writer.WritePropertyName("instanceCount"u8); - writer.WriteNumberValue(InstanceCount.Value); - } - writer.WritePropertyName("serviceType"u8); - writer.WriteStringValue(ServiceType.ToString()); - if (options.Format != "W" && Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.Value.ToString()); - } foreach (var item in AdditionalProperties) { writer.WritePropertyName(item.Key); @@ -77,7 +64,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M } #endif } - writer.WriteEndObject(); } GraphApiComputeServiceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphApiComputeServiceResourceCreateUpdateProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphApiComputeServiceResourceCreateUpdateProperties.Serialization.cs index 1489375d86f54..0cff6befe01ef 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphApiComputeServiceResourceCreateUpdateProperties.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphApiComputeServiceResourceCreateUpdateProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class GraphApiComputeServiceResourceCreateUpdateProperties : IUtf void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,35 +34,7 @@ void IJsonModel.Write(Utf8 throw new FormatException($"The model {nameof(GraphApiComputeServiceResourceCreateUpdateProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (Optional.IsDefined(InstanceSize)) - { - writer.WritePropertyName("instanceSize"u8); - writer.WriteStringValue(InstanceSize.Value.ToString()); - } - if (Optional.IsDefined(InstanceCount)) - { - writer.WritePropertyName("instanceCount"u8); - writer.WriteNumberValue(InstanceCount.Value); - } - writer.WritePropertyName("serviceType"u8); - writer.WriteStringValue(ServiceType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } GraphApiComputeServiceResourceCreateUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetPropertiesOptions.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetPropertiesOptions.Serialization.cs index b596b434dbd6b..e0554e3456827 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetPropertiesOptions.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetPropertiesOptions.Serialization.cs @@ -19,6 +19,15 @@ public partial class GraphResourceGetPropertiesOptions : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,33 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(GraphResourceGetPropertiesOptions)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (Optional.IsDefined(Throughput)) - { - writer.WritePropertyName("throughput"u8); - writer.WriteNumberValue(Throughput.Value); - } - if (Optional.IsDefined(AutoscaleSettings)) - { - writer.WritePropertyName("autoscaleSettings"u8); - writer.WriteObjectValue(AutoscaleSettings, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } GraphResourceGetPropertiesOptions IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetResultCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetResultCreateOrUpdateContent.Serialization.cs index 672c9ad5d5cb9..5df884e44ffe4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetResultCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourceGetResultCreateOrUpdateContent.Serialization.cs @@ -22,6 +22,15 @@ public partial class GraphResourceGetResultCreateOrUpdateContent : IUtf8JsonSeri void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,46 +38,13 @@ void IJsonModel.Write(Utf8JsonWrite throw new FormatException($"The model {nameof(GraphResourceGetResultCreateOrUpdateContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); @@ -79,22 +55,6 @@ void IJsonModel.Write(Utf8JsonWrite writer.WriteObjectValue(Options, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } GraphResourceGetResultCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourcesListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourcesListResult.Serialization.cs index f00a5061ab48f..6b51f9f2fdc91 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourcesListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GraphResourcesListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class GraphResourcesListResult : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(GraphResourcesListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } GraphResourcesListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateOrUpdateContent.Serialization.cs index ff46c6e2103bb..2e5a328b4e784 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseCreateOrUpdateContent.Serialization.cs @@ -21,6 +21,15 @@ public partial class GremlinDatabaseCreateOrUpdateContent : IUtf8JsonSerializabl void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,46 +37,13 @@ void IJsonModel.Write(Utf8JsonWriter write throw new FormatException($"The model {nameof(GremlinDatabaseCreateOrUpdateContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); @@ -78,22 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter write writer.WriteObjectValue(Options, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } GremlinDatabaseCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseListResult.Serialization.cs index 7b2bb97896b8b..d50333353c628 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class GremlinDatabaseListResult : IUtf8JsonSerializable, IJsonM void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(GremlinDatabaseListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } GremlinDatabaseListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabasePropertiesConfig.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabasePropertiesConfig.Serialization.cs index 178fd6a131f55..bb20680acae74 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabasePropertiesConfig.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabasePropertiesConfig.Serialization.cs @@ -19,6 +19,15 @@ public partial class GremlinDatabasePropertiesConfig : IUtf8JsonSerializable, IJ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,33 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo throw new FormatException($"The model {nameof(GremlinDatabasePropertiesConfig)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (Optional.IsDefined(Throughput)) - { - writer.WritePropertyName("throughput"u8); - writer.WriteNumberValue(Throughput.Value); - } - if (Optional.IsDefined(AutoscaleSettings)) - { - writer.WritePropertyName("autoscaleSettings"u8); - writer.WriteObjectValue(AutoscaleSettings, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } GremlinDatabasePropertiesConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseResourceInfo.Serialization.cs index 1585b3ca4a2ae..d3b8a59a3ce24 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class GremlinDatabaseResourceInfo : IUtf8JsonSerializable, IJsonM void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(GremlinDatabaseResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("id"u8); writer.WriteStringValue(DatabaseName); if (Optional.IsDefined(RestoreParameters)) @@ -54,7 +62,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR #endif } } - writer.WriteEndObject(); } GremlinDatabaseResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseRestoreResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseRestoreResourceInfo.Serialization.cs index 8d54bce19275a..91ce3e88ab68a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseRestoreResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinDatabaseRestoreResourceInfo.Serialization.cs @@ -20,6 +20,15 @@ public partial class GremlinDatabaseRestoreResourceInfo : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(GremlinDatabaseRestoreResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(DatabaseName)) { writer.WritePropertyName("databaseName"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, #endif } } - writer.WriteEndObject(); } GremlinDatabaseRestoreResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateOrUpdateContent.Serialization.cs index e3680fed59876..a0463bcb3150e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphCreateOrUpdateContent.Serialization.cs @@ -21,6 +21,15 @@ public partial class GremlinGraphCreateOrUpdateContent : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,46 +37,13 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(GremlinGraphCreateOrUpdateContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); @@ -78,22 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, writer.WriteObjectValue(Options, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } GremlinGraphCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphListResult.Serialization.cs index c69967f259ecc..e7b1d901de545 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class GremlinGraphListResult : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(GremlinGraphListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } GremlinGraphListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphPropertiesConfig.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphPropertiesConfig.Serialization.cs index 7f5e2dc36b2f6..2ce66298d35aa 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphPropertiesConfig.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphPropertiesConfig.Serialization.cs @@ -19,6 +19,15 @@ public partial class GremlinGraphPropertiesConfig : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,33 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(GremlinGraphPropertiesConfig)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (Optional.IsDefined(Throughput)) - { - writer.WritePropertyName("throughput"u8); - writer.WriteNumberValue(Throughput.Value); - } - if (Optional.IsDefined(AutoscaleSettings)) - { - writer.WritePropertyName("autoscaleSettings"u8); - writer.WriteObjectValue(AutoscaleSettings, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } GremlinGraphPropertiesConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphResourceInfo.Serialization.cs index 030fb82b91311..ed573b14b664e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/GremlinGraphResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class GremlinGraphResourceInfo : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(GremlinGraphResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("id"u8); writer.WriteStringValue(GraphName); if (Optional.IsDefined(IndexingPolicy)) @@ -84,7 +92,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } GremlinGraphResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListBackups.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListBackups.Serialization.cs index 242a9a8c2c490..cb17f48f0c1c9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListBackups.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListBackups.Serialization.cs @@ -20,6 +20,15 @@ internal partial class ListBackups : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptio throw new FormatException($"The model {nameof(ListBackups)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptio #endif } } - writer.WriteEndObject(); } ListBackups IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListCommands.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListCommands.Serialization.cs index d16c6979ea3f3..fefeb5ec9e88a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListCommands.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ListCommands.Serialization.cs @@ -20,6 +20,15 @@ internal partial class ListCommands : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpti throw new FormatException($"The model {nameof(ListCommands)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpti #endif } } - writer.WriteEndObject(); } ListCommands IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) 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 index 4856a1ed72c12..148961a3057c0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewDefinition.Serialization.cs @@ -19,6 +19,15 @@ public partial class MaterializedViewDefinition : IUtf8JsonSerializable, IJsonMo void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(MaterializedViewDefinition)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(SourceCollectionRid)) { writer.WritePropertyName("sourceCollectionRid"u8); @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } MaterializedViewDefinition IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewsBuilderRegionalService.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewsBuilderRegionalService.Serialization.cs index f20d8c53bccfa..4391ae637ba46 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewsBuilderRegionalService.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewsBuilderRegionalService.Serialization.cs @@ -19,6 +19,15 @@ public partial class MaterializedViewsBuilderRegionalService : IUtf8JsonSerializ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,38 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter wr throw new FormatException($"The model {nameof(MaterializedViewsBuilderRegionalService)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W" && Optional.IsDefined(Location)) - { - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location.Value); - } - if (options.Format != "W" && Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.Value.ToString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } MaterializedViewsBuilderRegionalService IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewsBuilderServiceProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewsBuilderServiceProperties.Serialization.cs index fb716a375efb5..bfcb4cbf0a924 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewsBuilderServiceProperties.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewsBuilderServiceProperties.Serialization.cs @@ -20,6 +20,15 @@ public partial class MaterializedViewsBuilderServiceProperties : IUtf8JsonSerial void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,7 @@ void IJsonModel.Write(Utf8JsonWriter throw new FormatException($"The model {nameof(MaterializedViewsBuilderServiceProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (options.Format != "W" && Optional.IsCollectionDefined(Locations)) { writer.WritePropertyName("locations"u8); @@ -38,28 +47,6 @@ void IJsonModel.Write(Utf8JsonWriter } writer.WriteEndArray(); } - if (options.Format != "W" && Optional.IsDefined(CreatedOn)) - { - writer.WritePropertyName("creationTime"u8); - writer.WriteStringValue(CreatedOn.Value, "O"); - } - if (Optional.IsDefined(InstanceSize)) - { - writer.WritePropertyName("instanceSize"u8); - writer.WriteStringValue(InstanceSize.Value.ToString()); - } - if (Optional.IsDefined(InstanceCount)) - { - writer.WritePropertyName("instanceCount"u8); - writer.WriteNumberValue(InstanceCount.Value); - } - writer.WritePropertyName("serviceType"u8); - writer.WriteStringValue(ServiceType.ToString()); - if (options.Format != "W" && Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.Value.ToString()); - } foreach (var item in AdditionalProperties) { writer.WritePropertyName(item.Key); @@ -72,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter } #endif } - writer.WriteEndObject(); } MaterializedViewsBuilderServiceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewsBuilderServiceResourceCreateUpdateProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewsBuilderServiceResourceCreateUpdateProperties.Serialization.cs index 4ad07019cfb39..4a3c079fbc684 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewsBuilderServiceResourceCreateUpdateProperties.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MaterializedViewsBuilderServiceResourceCreateUpdateProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class MaterializedViewsBuilderServiceResourceCreateUpdateProperti void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,35 +34,7 @@ void IJsonModel.W throw new FormatException($"The model {nameof(MaterializedViewsBuilderServiceResourceCreateUpdateProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (Optional.IsDefined(InstanceSize)) - { - writer.WritePropertyName("instanceSize"u8); - writer.WriteStringValue(InstanceSize.Value.ToString()); - } - if (Optional.IsDefined(InstanceCount)) - { - writer.WritePropertyName("instanceCount"u8); - writer.WriteNumberValue(InstanceCount.Value); - } - writer.WritePropertyName("serviceType"u8); - writer.WriteStringValue(ServiceType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } MaterializedViewsBuilderServiceResourceCreateUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MergeParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MergeParameters.Serialization.cs index 1fcc123a55300..7fa43a5cb6305 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MergeParameters.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MergeParameters.Serialization.cs @@ -18,6 +18,15 @@ public partial class MergeParameters : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO throw new FormatException($"The model {nameof(MergeParameters)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(IsDryRun)) { writer.WritePropertyName("isDryRun"u8); @@ -46,7 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO #endif } } - writer.WriteEndObject(); } MergeParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateOrUpdateContent.Serialization.cs index 66a97aabb73ce..1e351718f51f0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionCreateOrUpdateContent.Serialization.cs @@ -21,6 +21,15 @@ public partial class MongoDBCollectionCreateOrUpdateContent : IUtf8JsonSerializa void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,46 +37,13 @@ void IJsonModel.Write(Utf8JsonWriter wri throw new FormatException($"The model {nameof(MongoDBCollectionCreateOrUpdateContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); @@ -78,22 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter wri writer.WriteObjectValue(Options, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } MongoDBCollectionCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionListResult.Serialization.cs index 2afc73da615a7..0ac8c78d165d4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class MongoDBCollectionListResult : IUtf8JsonSerializable, IJso void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(MongoDBCollectionListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR #endif } } - writer.WriteEndObject(); } MongoDBCollectionListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionPropertiesConfig.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionPropertiesConfig.Serialization.cs index 94f7285a7f4f6..efa1cb8622495 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionPropertiesConfig.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionPropertiesConfig.Serialization.cs @@ -19,6 +19,15 @@ public partial class MongoDBCollectionPropertiesConfig : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,33 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(MongoDBCollectionPropertiesConfig)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (Optional.IsDefined(Throughput)) - { - writer.WritePropertyName("throughput"u8); - writer.WriteNumberValue(Throughput.Value); - } - if (Optional.IsDefined(AutoscaleSettings)) - { - writer.WritePropertyName("autoscaleSettings"u8); - writer.WriteObjectValue(AutoscaleSettings, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } MongoDBCollectionPropertiesConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionResourceInfo.Serialization.cs index 109ca22b7b832..d82546cbab6bf 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBCollectionResourceInfo.Serialization.cs @@ -20,6 +20,15 @@ public partial class MongoDBCollectionResourceInfo : IUtf8JsonSerializable, IJso void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(MongoDBCollectionResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("id"u8); writer.WriteStringValue(CollectionName); if (Optional.IsCollectionDefined(ShardKey)) @@ -81,7 +89,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode #endif } } - writer.WriteEndObject(); } MongoDBCollectionResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateOrUpdateContent.Serialization.cs index d7cb06e66414f..8162fefb68320 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseCreateOrUpdateContent.Serialization.cs @@ -21,6 +21,15 @@ public partial class MongoDBDatabaseCreateOrUpdateContent : IUtf8JsonSerializabl void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,46 +37,13 @@ void IJsonModel.Write(Utf8JsonWriter write throw new FormatException($"The model {nameof(MongoDBDatabaseCreateOrUpdateContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); @@ -78,22 +54,6 @@ void IJsonModel.Write(Utf8JsonWriter write writer.WriteObjectValue(Options, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } MongoDBDatabaseCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseListResult.Serialization.cs index d54848f9bb99c..f31007b5cc9ff 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class MongoDBDatabaseListResult : IUtf8JsonSerializable, IJsonM void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(MongoDBDatabaseListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } MongoDBDatabaseListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabasePropertiesConfig.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabasePropertiesConfig.Serialization.cs index 670e3aacce891..999049ebb8a47 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabasePropertiesConfig.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabasePropertiesConfig.Serialization.cs @@ -19,6 +19,15 @@ public partial class MongoDBDatabasePropertiesConfig : IUtf8JsonSerializable, IJ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,33 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo throw new FormatException($"The model {nameof(MongoDBDatabasePropertiesConfig)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (Optional.IsDefined(Throughput)) - { - writer.WritePropertyName("throughput"u8); - writer.WriteNumberValue(Throughput.Value); - } - if (Optional.IsDefined(AutoscaleSettings)) - { - writer.WritePropertyName("autoscaleSettings"u8); - writer.WriteObjectValue(AutoscaleSettings, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } MongoDBDatabasePropertiesConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseResourceInfo.Serialization.cs index e6ab0fabae3a8..a0ab5283a7bd9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBDatabaseResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class MongoDBDatabaseResourceInfo : IUtf8JsonSerializable, IJsonM void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(MongoDBDatabaseResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("id"u8); writer.WriteStringValue(DatabaseName); if (Optional.IsDefined(RestoreParameters)) @@ -54,7 +62,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR #endif } } - writer.WriteEndObject(); } MongoDBDatabaseResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBIndex.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBIndex.Serialization.cs index 460c3d09bf087..bdc0db9910e04 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBIndex.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBIndex.Serialization.cs @@ -19,6 +19,15 @@ public partial class MongoDBIndex : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpti throw new FormatException($"The model {nameof(MongoDBIndex)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Key)) { writer.WritePropertyName("key"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOpti #endif } } - writer.WriteEndObject(); } MongoDBIndex IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBIndexConfig.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBIndexConfig.Serialization.cs index 8f5b1aad1c8d2..d5ea5f1e7448c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBIndexConfig.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBIndexConfig.Serialization.cs @@ -19,6 +19,15 @@ public partial class MongoDBIndexConfig : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit throw new FormatException($"The model {nameof(MongoDBIndexConfig)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(ExpireAfterSeconds)) { writer.WritePropertyName("expireAfterSeconds"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrit #endif } } - writer.WriteEndObject(); } MongoDBIndexConfig IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBPrivilege.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBPrivilege.Serialization.cs index 0af7cac9e27f1..903afa4f131f7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBPrivilege.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBPrivilege.Serialization.cs @@ -20,6 +20,15 @@ public partial class MongoDBPrivilege : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter throw new FormatException($"The model {nameof(MongoDBPrivilege)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Resource)) { writer.WritePropertyName("resource"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriter #endif } } - writer.WriteEndObject(); } MongoDBPrivilege IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBPrivilegeResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBPrivilegeResourceInfo.Serialization.cs index 3f6272853f51d..71a3a0115bbde 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBPrivilegeResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBPrivilegeResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class MongoDBPrivilegeResourceInfo : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(MongoDBPrivilegeResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(DBName)) { writer.WritePropertyName("db"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model #endif } } - writer.WriteEndObject(); } MongoDBPrivilegeResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBRole.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBRole.Serialization.cs index 97eaad7bbce29..5f8a50f6a8bd4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBRole.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBRole.Serialization.cs @@ -19,6 +19,15 @@ public partial class MongoDBRole : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptio throw new FormatException($"The model {nameof(MongoDBRole)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(DBName)) { writer.WritePropertyName("db"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptio #endif } } - writer.WriteEndObject(); } MongoDBRole IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) 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 c0d1571dda291..95a5577672538 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 @@ -18,6 +18,15 @@ public partial class MongoDBRoleDefinitionCreateOrUpdateContent : IUtf8JsonSeria void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter throw new FormatException($"The model {nameof(MongoDBRoleDefinitionCreateOrUpdateContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(RoleName)) @@ -79,7 +87,6 @@ void IJsonModel.Write(Utf8JsonWriter #endif } } - writer.WriteEndObject(); } MongoDBRoleDefinitionCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBRoleDefinitionListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBRoleDefinitionListResult.Serialization.cs index 851624673c5d0..4a6fc515909f4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBRoleDefinitionListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBRoleDefinitionListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class MongoDBRoleDefinitionListResult : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo throw new FormatException($"The model {nameof(MongoDBRoleDefinitionListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo #endif } } - writer.WriteEndObject(); } MongoDBRoleDefinitionListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBUserDefinitionCreateOrUpdateContent.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBUserDefinitionCreateOrUpdateContent.Serialization.cs index 28866eac45628..ccad2c721fe21 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBUserDefinitionCreateOrUpdateContent.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBUserDefinitionCreateOrUpdateContent.Serialization.cs @@ -18,6 +18,15 @@ public partial class MongoDBUserDefinitionCreateOrUpdateContent : IUtf8JsonSeria void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter throw new FormatException($"The model {nameof(MongoDBUserDefinitionCreateOrUpdateContent)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(UserName)) @@ -79,7 +87,6 @@ void IJsonModel.Write(Utf8JsonWriter #endif } } - writer.WriteEndObject(); } MongoDBUserDefinitionCreateOrUpdateContent IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBUserDefinitionListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBUserDefinitionListResult.Serialization.cs index 9c44049168645..9b68a2188c4a2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBUserDefinitionListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoDBUserDefinitionListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class MongoDBUserDefinitionListResult : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo throw new FormatException($"The model {nameof(MongoDBUserDefinitionListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mo #endif } } - writer.WriteEndObject(); } MongoDBUserDefinitionListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoIndexKeys.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoIndexKeys.Serialization.cs index 547efe17afa73..82cdaf86a0df5 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoIndexKeys.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/MongoIndexKeys.Serialization.cs @@ -20,6 +20,15 @@ internal partial class MongoIndexKeys : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp throw new FormatException($"The model {nameof(MongoIndexKeys)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Keys)) { writer.WritePropertyName("keys"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp #endif } } - writer.WriteEndObject(); } MongoIndexKeys IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs index 0f1a348e6a32f..2201730376fe6 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeter.Serialization.cs @@ -19,6 +19,15 @@ public partial class NetworkSecurityPerimeter : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(NetworkSecurityPerimeter)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead #endif } } - writer.WriteEndObject(); } NetworkSecurityPerimeter IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.Serialization.cs index 941563248e65b..acb5696a8a4f0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class NetworkSecurityPerimeterConfigurationListResult : IUtf8Js void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonW throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonW #endif } } - writer.WriteEndObject(); } NetworkSecurityPerimeterConfigurationListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.Serialization.cs index 52e5510825bbe..b1496c4bc2fa2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityPerimeterConfigurationProperties.Serialization.cs @@ -20,6 +20,15 @@ public partial class NetworkSecurityPerimeterConfigurationProperties : IUtf8Json void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonW throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(ProvisioningState)) { writer.WritePropertyName("provisioningState"u8); @@ -73,7 +81,6 @@ void IJsonModel.Write(Utf8JsonW #endif } } - writer.WriteEndObject(); } NetworkSecurityPerimeterConfigurationProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityProfile.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityProfile.Serialization.cs index 154b9b9f4e369..20f069e4e7267 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityProfile.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/NetworkSecurityProfile.Serialization.cs @@ -20,6 +20,15 @@ public partial class NetworkSecurityProfile : IUtf8JsonSerializable, IJsonModel< void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(NetworkSecurityProfile)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -78,7 +86,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } NetworkSecurityProfile IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PartitionMetric.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PartitionMetric.Serialization.cs index 360e3135fbbfb..c8acd4b8f6446 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PartitionMetric.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PartitionMetric.Serialization.cs @@ -20,6 +20,15 @@ public partial class PartitionMetric : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO throw new FormatException($"The model {nameof(PartitionMetric)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (options.Format != "W" && Optional.IsDefined(PartitionId)) { writer.WritePropertyName("partitionId"u8); @@ -38,57 +47,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO writer.WritePropertyName("partitionKeyRangeId"u8); writer.WriteStringValue(PartitionKeyRangeId); } - if (options.Format != "W" && Optional.IsDefined(StartOn)) - { - writer.WritePropertyName("startTime"u8); - writer.WriteStringValue(StartOn.Value, "O"); - } - if (options.Format != "W" && Optional.IsDefined(EndOn)) - { - writer.WritePropertyName("endTime"u8); - writer.WriteStringValue(EndOn.Value, "O"); - } - if (options.Format != "W" && Optional.IsDefined(TimeGrain)) - { - writer.WritePropertyName("timeGrain"u8); - writer.WriteStringValue(TimeGrain); - } - if (options.Format != "W" && Optional.IsDefined(Unit)) - { - writer.WritePropertyName("unit"u8); - writer.WriteStringValue(Unit.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteObjectValue(Name, options); - } - if (options.Format != "W" && Optional.IsCollectionDefined(MetricValues)) - { - writer.WritePropertyName("metricValues"u8); - writer.WriteStartArray(); - foreach (var item in MetricValues) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } PartitionMetric IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PartitionMetricListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PartitionMetricListResult.Serialization.cs index 2d9002d9347fd..72cbba71ae4f1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PartitionMetricListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PartitionMetricListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class PartitionMetricListResult : IUtf8JsonSerializable, IJsonM void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(PartitionMetricListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } PartitionMetricListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PartitionUsage.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PartitionUsage.Serialization.cs index ee7d85d4da9f7..6adfe62b759d5 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PartitionUsage.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PartitionUsage.Serialization.cs @@ -19,6 +19,15 @@ public partial class PartitionUsage : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp throw new FormatException($"The model {nameof(PartitionUsage)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (options.Format != "W" && Optional.IsDefined(PartitionId)) { writer.WritePropertyName("partitionId"u8); @@ -37,47 +46,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOp writer.WritePropertyName("partitionKeyRangeId"u8); writer.WriteStringValue(PartitionKeyRangeId); } - if (options.Format != "W" && Optional.IsDefined(Unit)) - { - writer.WritePropertyName("unit"u8); - writer.WriteStringValue(Unit.Value.ToString()); - } - if (options.Format != "W" && Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteObjectValue(Name, options); - } - if (options.Format != "W" && Optional.IsDefined(QuotaPeriod)) - { - writer.WritePropertyName("quotaPeriod"u8); - writer.WriteStringValue(QuotaPeriod); - } - if (options.Format != "W" && Optional.IsDefined(Limit)) - { - writer.WritePropertyName("limit"u8); - writer.WriteNumberValue(Limit.Value); - } - if (options.Format != "W" && Optional.IsDefined(CurrentValue)) - { - writer.WritePropertyName("currentValue"u8); - writer.WriteNumberValue(CurrentValue.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } PartitionUsage IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PartitionUsagesResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PartitionUsagesResult.Serialization.cs index daddf31dad32c..a6dfd22a8e69d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PartitionUsagesResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PartitionUsagesResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class PartitionUsagesResult : IUtf8JsonSerializable, IJsonModel void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(PartitionUsagesResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW #endif } } - writer.WriteEndObject(); } PartitionUsagesResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PercentileMetricListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PercentileMetricListResult.Serialization.cs index c24685e0db749..66a20fc9f1ee6 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PercentileMetricListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PercentileMetricListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class PercentileMetricListResult : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(PercentileMetricListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } PercentileMetricListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PercentileMetricValue.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PercentileMetricValue.Serialization.cs index 94566185a9a99..1d54fa18f765c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PercentileMetricValue.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PercentileMetricValue.Serialization.cs @@ -19,6 +19,15 @@ public partial class PercentileMetricValue : IUtf8JsonSerializable, IJsonModel

((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(PercentileMetricValue)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (options.Format != "W" && Optional.IsDefined(P10)) { writer.WritePropertyName("P10"u8); @@ -62,52 +71,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW writer.WritePropertyName("P99"u8); writer.WriteNumberValue(P99.Value); } - if (options.Format != "W" && Optional.IsDefined(Count)) - { - writer.WritePropertyName("_count"u8); - writer.WriteNumberValue(Count.Value); - } - if (options.Format != "W" && Optional.IsDefined(Average)) - { - writer.WritePropertyName("average"u8); - writer.WriteNumberValue(Average.Value); - } - if (options.Format != "W" && Optional.IsDefined(Maximum)) - { - writer.WritePropertyName("maximum"u8); - writer.WriteNumberValue(Maximum.Value); - } - if (options.Format != "W" && Optional.IsDefined(Minimum)) - { - writer.WritePropertyName("minimum"u8); - writer.WriteNumberValue(Minimum.Value); - } - if (options.Format != "W" && Optional.IsDefined(Timestamp)) - { - writer.WritePropertyName("timestamp"u8); - writer.WriteStringValue(Timestamp.Value, "O"); - } - if (options.Format != "W" && Optional.IsDefined(Total)) - { - writer.WritePropertyName("total"u8); - writer.WriteNumberValue(Total.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } PercentileMetricValue IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PeriodicModeBackupPolicy.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PeriodicModeBackupPolicy.Serialization.cs index e543fb39594d9..2c4f775815726 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PeriodicModeBackupPolicy.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PeriodicModeBackupPolicy.Serialization.cs @@ -19,6 +19,15 @@ public partial class PeriodicModeBackupPolicy : IUtf8JsonSerializable, IJsonMode void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,35 +35,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRead throw new FormatException($"The model {nameof(PeriodicModeBackupPolicy)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(PeriodicModeProperties)) { writer.WritePropertyName("periodicModeProperties"u8); writer.WriteObjectValue(PeriodicModeProperties, options); } - writer.WritePropertyName("type"u8); - writer.WriteStringValue(BackupPolicyType.ToString()); - if (Optional.IsDefined(MigrationState)) - { - writer.WritePropertyName("migrationState"u8); - writer.WriteObjectValue(MigrationState, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } PeriodicModeBackupPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PeriodicModeProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PeriodicModeProperties.Serialization.cs index 0713551592a6a..605f7159a3570 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PeriodicModeProperties.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PeriodicModeProperties.Serialization.cs @@ -19,6 +19,15 @@ public partial class PeriodicModeProperties : IUtf8JsonSerializable, IJsonModel< void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(PeriodicModeProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(BackupIntervalInMinutes)) { writer.WritePropertyName("backupIntervalInMinutes"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } PeriodicModeProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfo.Serialization.cs index a572464131fc8..52dbfc4bbbd5c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class PhysicalPartitionStorageInfo : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(PhysicalPartitionStorageInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model #endif } } - writer.WriteEndObject(); } PhysicalPartitionStorageInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfoCollection.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfoCollection.Serialization.cs index ed2bb4b364310..1b0f7165cb74f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfoCollection.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionStorageInfoCollection.Serialization.cs @@ -20,6 +20,15 @@ public partial class PhysicalPartitionStorageInfoCollection : IUtf8JsonSerializa void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter wri throw new FormatException($"The model {nameof(PhysicalPartitionStorageInfoCollection)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(PhysicalPartitionStorageInfoCollectionValue)) { writer.WritePropertyName("physicalPartitionStorageInfoCollection"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter wri #endif } } - writer.WriteEndObject(); } PhysicalPartitionStorageInfoCollection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoProperties.Serialization.cs index 6bc181c170b01..7617b7fe0d1f4 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoProperties.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoProperties.Serialization.cs @@ -20,6 +20,15 @@ internal partial class PhysicalPartitionThroughputInfoProperties : IUtf8JsonSeri void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsCollectionDefined(PhysicalPartitionThroughputInfo)) { writer.WritePropertyName("physicalPartitionThroughputInfo"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter #endif } } - writer.WriteEndObject(); } PhysicalPartitionThroughputInfoProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.Serialization.cs index f3f7e055ab138..553f257c5f4d6 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResource.Serialization.cs @@ -19,6 +19,15 @@ public partial class PhysicalPartitionThroughputInfoResource : IUtf8JsonSerializ void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter wr throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResource)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("id"u8); writer.WriteStringValue(Id); if (Optional.IsDefined(Throughput)) @@ -49,7 +57,6 @@ void IJsonModel.Write(Utf8JsonWriter wr #endif } } - writer.WriteEndObject(); } PhysicalPartitionThroughputInfoResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResult.Serialization.cs index fb2383870ae52..7b9e1a2647c0d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResult.Serialization.cs @@ -21,6 +21,15 @@ public partial class PhysicalPartitionThroughputInfoResult : IUtf8JsonSerializab void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,46 +37,13 @@ void IJsonModel.Write(Utf8JsonWriter writ throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -76,22 +52,6 @@ void IJsonModel.Write(Utf8JsonWriter writ writer.WriteObjectValue(Resource, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } PhysicalPartitionThroughputInfoResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResultPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResultPropertiesResource.Serialization.cs index 1cdc443d18f8f..a0e69f10f0cf7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResultPropertiesResource.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PhysicalPartitionThroughputInfoResultPropertiesResource.Serialization.cs @@ -20,6 +20,15 @@ internal partial class PhysicalPartitionThroughputInfoResultPropertiesResource : void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,33 +36,7 @@ void IJsonModel.Write(U throw new FormatException($"The model {nameof(PhysicalPartitionThroughputInfoResultPropertiesResource)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (Optional.IsCollectionDefined(PhysicalPartitionThroughputInfo)) - { - writer.WritePropertyName("physicalPartitionThroughputInfo"u8); - writer.WriteStartArray(); - foreach (var item in PhysicalPartitionThroughputInfo) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } PhysicalPartitionThroughputInfoResultPropertiesResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateEndpointProperty.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateEndpointProperty.Serialization.cs index c0534ddb76847..90ca326831bf6 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateEndpointProperty.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/PrivateEndpointProperty.Serialization.cs @@ -19,6 +19,15 @@ internal partial class PrivateEndpointProperty : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade throw new FormatException($"The model {nameof(PrivateEndpointProperty)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -47,7 +55,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReade #endif } } - writer.WriteEndObject(); } PrivateEndpointProperty IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssue.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssue.Serialization.cs index 3ad4d9f142b2a..aa914b1111ff6 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssue.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssue.Serialization.cs @@ -19,6 +19,15 @@ public partial class ProvisioningIssue : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite throw new FormatException($"The model {nameof(ProvisioningIssue)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWrite #endif } } - writer.WriteEndObject(); } ProvisioningIssue IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssueProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssueProperties.Serialization.cs index 5cfce516a6f97..735be1d4d6311 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssueProperties.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ProvisioningIssueProperties.Serialization.cs @@ -20,6 +20,15 @@ public partial class ProvisioningIssueProperties : IUtf8JsonSerializable, IJsonM void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(ProvisioningIssueProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(IssueType)) { writer.WritePropertyName("issueType"u8); @@ -83,7 +91,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR #endif } } - writer.WriteEndObject(); } ProvisioningIssueProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputParameters.Serialization.cs index 1163bc2370478..a4a4c684ba24e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputParameters.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputParameters.Serialization.cs @@ -21,6 +21,15 @@ public partial class RedistributeThroughputParameters : IUtf8JsonSerializable, I void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,67 +37,18 @@ void IJsonModel.Write(Utf8JsonWriter writer, M throw new FormatException($"The model {nameof(RedistributeThroughputParameters)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); writer.WriteObjectValue(Resource, options); writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } RedistributeThroughputParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputPropertiesResource.Serialization.cs index 7ef27772ab3ff..17861718e3323 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputPropertiesResource.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RedistributeThroughputPropertiesResource.Serialization.cs @@ -20,6 +20,15 @@ public partial class RedistributeThroughputPropertiesResource : IUtf8JsonSeriali void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter w throw new FormatException($"The model {nameof(RedistributeThroughputPropertiesResource)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("throughputPolicy"u8); writer.WriteStringValue(ThroughputPolicy.ToString()); writer.WritePropertyName("targetPhysicalPartitionThroughputInfo"u8); @@ -59,7 +67,6 @@ void IJsonModel.Write(Utf8JsonWriter w #endif } } - writer.WriteEndObject(); } RedistributeThroughputPropertiesResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RegionForOnlineOffline.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RegionForOnlineOffline.Serialization.cs index 5e5120953311b..a916746278b74 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RegionForOnlineOffline.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RegionForOnlineOffline.Serialization.cs @@ -18,6 +18,15 @@ public partial class RegionForOnlineOffline : IUtf8JsonSerializable, IJsonModel< void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(RegionForOnlineOffline)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("region"u8); writer.WriteStringValue(Region); if (options.Format != "W" && _serializedAdditionalRawData != null) @@ -43,7 +51,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader #endif } } - writer.WriteEndObject(); } RegionForOnlineOffline IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociation.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociation.Serialization.cs index a61d7bd799443..7820540e1995b 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociation.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceAssociation.Serialization.cs @@ -19,6 +19,15 @@ public partial class ResourceAssociation : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(ResourceAssociation)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Name)) { writer.WritePropertyName("name"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri #endif } } - writer.WriteEndObject(); } ResourceAssociation IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceRestoreParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceRestoreParameters.Serialization.cs index 204d89a8981b5..e2d8754823dda 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceRestoreParameters.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ResourceRestoreParameters.Serialization.cs @@ -19,6 +19,15 @@ public partial class ResourceRestoreParameters : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,38 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(ResourceRestoreParameters)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (Optional.IsDefined(RestoreSource)) - { - writer.WritePropertyName("restoreSource"u8); - writer.WriteStringValue(RestoreSource); - } - if (Optional.IsDefined(RestoreTimestampInUtc)) - { - writer.WritePropertyName("restoreTimestampInUtc"u8); - writer.WriteStringValue(RestoreTimestampInUtc.Value, "O"); - } - if (Optional.IsDefined(IsRestoreWithTtlDisabled)) - { - writer.WritePropertyName("restoreWithTtlDisabled"u8); - writer.WriteBooleanValue(IsRestoreWithTtlDisabled.Value); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } ResourceRestoreParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableDatabaseAccountsListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableDatabaseAccountsListResult.Serialization.cs index 88d28c8fed606..7391d90075ddb 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableDatabaseAccountsListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableDatabaseAccountsListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class RestorableDatabaseAccountsListResult : IUtf8JsonSerializa void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter write throw new FormatException($"The model {nameof(RestorableDatabaseAccountsListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter write #endif } } - writer.WriteEndObject(); } RestorableDatabaseAccountsListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableGremlinDatabase.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableGremlinDatabase.Serialization.cs index 0bdd260d4b4a5..edf4576a67308 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableGremlinDatabase.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableGremlinDatabase.Serialization.cs @@ -20,6 +20,15 @@ public partial class RestorableGremlinDatabase : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,27 +36,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(RestorableGremlinDatabase)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -56,22 +45,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteObjectValue(Resource, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } RestorableGremlinDatabase IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableGremlinDatabasesListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableGremlinDatabasesListResult.Serialization.cs index d2f2f98a41c30..5910271e8fd06 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableGremlinDatabasesListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableGremlinDatabasesListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class RestorableGremlinDatabasesListResult : IUtf8JsonSerializa void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter write throw new FormatException($"The model {nameof(RestorableGremlinDatabasesListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter write #endif } } - writer.WriteEndObject(); } RestorableGremlinDatabasesListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableGremlinGraph.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableGremlinGraph.Serialization.cs index 0e35bde27f38c..47c71e42ba6fd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableGremlinGraph.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableGremlinGraph.Serialization.cs @@ -20,6 +20,15 @@ public partial class RestorableGremlinGraph : IUtf8JsonSerializable, IJsonModel< void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,27 +36,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(RestorableGremlinGraph)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -56,22 +45,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader writer.WriteObjectValue(Resource, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } RestorableGremlinGraph IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableGremlinGraphsListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableGremlinGraphsListResult.Serialization.cs index cd1afdca26a3b..e643ca5083da9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableGremlinGraphsListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableGremlinGraphsListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class RestorableGremlinGraphsListResult : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(RestorableGremlinGraphsListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, #endif } } - writer.WriteEndObject(); } RestorableGremlinGraphsListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableGremlinResourceData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableGremlinResourceData.Serialization.cs index 10c0a05fa1a7a..89a378d1275ec 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableGremlinResourceData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableGremlinResourceData.Serialization.cs @@ -21,6 +21,15 @@ public partial class RestorableGremlinResourceData : IUtf8JsonSerializable, IJso void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,7 +37,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(RestorableGremlinResourceData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(DatabaseName)) { writer.WritePropertyName("databaseName"u8); @@ -44,42 +53,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode } writer.WriteEndArray(); } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } RestorableGremlinResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableGremlinResourcesListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableGremlinResourcesListResult.Serialization.cs index 5ef9255b17b78..78f902e4e5518 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableGremlinResourcesListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableGremlinResourcesListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class RestorableGremlinResourcesListResult : IUtf8JsonSerializa void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter write throw new FormatException($"The model {nameof(RestorableGremlinResourcesListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter write #endif } } - writer.WriteEndObject(); } RestorableGremlinResourcesListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableLocationResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableLocationResourceInfo.Serialization.cs index b6ccc080a5adc..3deead949c51e 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableLocationResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableLocationResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class RestorableLocationResourceInfo : IUtf8JsonSerializable, IJs void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(RestorableLocationResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(LocationName)) { writer.WritePropertyName("locationName"u8); @@ -62,7 +70,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod #endif } } - writer.WriteEndObject(); } RestorableLocationResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongoDBCollection.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongoDBCollection.Serialization.cs index c5f4a2ad48656..1440d6c53c717 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongoDBCollection.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongoDBCollection.Serialization.cs @@ -20,6 +20,15 @@ public partial class RestorableMongoDBCollection : IUtf8JsonSerializable, IJsonM void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,27 +36,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(RestorableMongoDBCollection)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -56,22 +45,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR writer.WriteObjectValue(Resource, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } RestorableMongoDBCollection IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongoDBCollectionsListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongoDBCollectionsListResult.Serialization.cs index 73e451ebef2ad..27f5978ad2d04 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongoDBCollectionsListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongoDBCollectionsListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class RestorableMongoDBCollectionsListResult : IUtf8JsonSeriali void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter wri throw new FormatException($"The model {nameof(RestorableMongoDBCollectionsListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter wri #endif } } - writer.WriteEndObject(); } RestorableMongoDBCollectionsListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongoDBDatabase.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongoDBDatabase.Serialization.cs index 1fa6de11e7528..155e13bf32878 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongoDBDatabase.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongoDBDatabase.Serialization.cs @@ -20,6 +20,15 @@ public partial class RestorableMongoDBDatabase : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,27 +36,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(RestorableMongoDBDatabase)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -56,22 +45,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteObjectValue(Resource, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } RestorableMongoDBDatabase IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongoDBDatabasesListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongoDBDatabasesListResult.Serialization.cs index f5450d4844533..4b3b29c19345c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongoDBDatabasesListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongoDBDatabasesListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class RestorableMongoDBDatabasesListResult : IUtf8JsonSerializa void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter write throw new FormatException($"The model {nameof(RestorableMongoDBDatabasesListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter write #endif } } - writer.WriteEndObject(); } RestorableMongoDBDatabasesListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongoDBResourceData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongoDBResourceData.Serialization.cs index 2540ed9fb6c19..d066d1465abe2 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongoDBResourceData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongoDBResourceData.Serialization.cs @@ -21,6 +21,15 @@ public partial class RestorableMongoDBResourceData : IUtf8JsonSerializable, IJso void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,7 +37,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(RestorableMongoDBResourceData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(DatabaseName)) { writer.WritePropertyName("databaseName"u8); @@ -44,42 +53,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode } writer.WriteEndArray(); } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } RestorableMongoDBResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongoDBResourcesListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongoDBResourcesListResult.Serialization.cs index 1a8c134406640..2360b6282db02 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongoDBResourcesListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableMongoDBResourcesListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class RestorableMongoDBResourcesListResult : IUtf8JsonSerializa void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter write throw new FormatException($"The model {nameof(RestorableMongoDBResourcesListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter write #endif } } - writer.WriteEndObject(); } RestorableMongoDBResourcesListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainer.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainer.Serialization.cs index 793accaf91aa5..7499b5a3d0546 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainer.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainer.Serialization.cs @@ -20,6 +20,15 @@ public partial class RestorableSqlContainer : IUtf8JsonSerializable, IJsonModel< void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,27 +36,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader throw new FormatException($"The model {nameof(RestorableSqlContainer)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -56,22 +45,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReader writer.WriteObjectValue(Resource, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } RestorableSqlContainer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) 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 ae926e9fc922d..46c8a6f244493 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 @@ -20,6 +20,15 @@ public partial class RestorableSqlContainerPropertiesResourceContainer : IUtf8Js void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,7 @@ void IJsonModel.Write(Utf8Jso throw new FormatException($"The model {nameof(RestorableSqlContainerPropertiesResourceContainer)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (options.Format != "W" && Optional.IsDefined(Self)) { writer.WritePropertyName("_self"u8); @@ -48,84 +57,6 @@ void IJsonModel.Write(Utf8Jso writer.WritePropertyName("_etag"u8); writer.WriteStringValue(ETag.Value.ToString()); } - writer.WritePropertyName("id"u8); - writer.WriteStringValue(ContainerName); - if (Optional.IsDefined(IndexingPolicy)) - { - writer.WritePropertyName("indexingPolicy"u8); - writer.WriteObjectValue(IndexingPolicy, options); - } - if (Optional.IsDefined(PartitionKey)) - { - writer.WritePropertyName("partitionKey"u8); - writer.WriteObjectValue(PartitionKey, options); - } - if (Optional.IsDefined(DefaultTtl)) - { - writer.WritePropertyName("defaultTtl"u8); - writer.WriteNumberValue(DefaultTtl.Value); - } - if (Optional.IsDefined(UniqueKeyPolicy)) - { - writer.WritePropertyName("uniqueKeyPolicy"u8); - writer.WriteObjectValue(UniqueKeyPolicy, options); - } - if (Optional.IsDefined(ConflictResolutionPolicy)) - { - writer.WritePropertyName("conflictResolutionPolicy"u8); - writer.WriteObjectValue(ConflictResolutionPolicy, options); - } - if (Optional.IsDefined(ClientEncryptionPolicy)) - { - writer.WritePropertyName("clientEncryptionPolicy"u8); - writer.WriteObjectValue(ClientEncryptionPolicy, options); - } - if (Optional.IsDefined(AnalyticalStorageTtl)) - { - writer.WritePropertyName("analyticalStorageTtl"u8); - writer.WriteNumberValue(AnalyticalStorageTtl.Value); - } - if (Optional.IsDefined(RestoreParameters)) - { - writer.WritePropertyName("restoreParameters"u8); - writer.WriteObjectValue(RestoreParameters, options); - } - if (Optional.IsDefined(CreateMode)) - { - writer.WritePropertyName("createMode"u8); - writer.WriteStringValue(CreateMode.Value.ToString()); - } - if (Optional.IsDefined(MaterializedViewDefinition)) - { - writer.WritePropertyName("materializedViewDefinition"u8); - writer.WriteObjectValue(MaterializedViewDefinition, options); - } - if (Optional.IsCollectionDefined(ComputedProperties)) - { - writer.WritePropertyName("computedProperties"u8); - writer.WriteStartArray(); - foreach (var item in ComputedProperties) - { - writer.WriteObjectValue(item, options); - } - writer.WriteEndArray(); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } RestorableSqlContainerPropertiesResourceContainer IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainersListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainersListResult.Serialization.cs index adec3abb1be02..afc47bb32f147 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainersListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlContainersListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class RestorableSqlContainersListResult : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(RestorableSqlContainersListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, #endif } } - writer.WriteEndObject(); } RestorableSqlContainersListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabase.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabase.Serialization.cs index 9b9e3f64ccde4..786a76be4ae41 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabase.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabase.Serialization.cs @@ -20,6 +20,15 @@ public partial class RestorableSqlDatabase : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,27 +36,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(RestorableSqlDatabase)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -56,22 +45,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW writer.WriteObjectValue(Resource, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } RestorableSqlDatabase IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasePropertiesResourceDatabase.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasePropertiesResourceDatabase.Serialization.cs index b51085656e1f5..7d477850e17f9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasePropertiesResourceDatabase.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasePropertiesResourceDatabase.Serialization.cs @@ -19,6 +19,15 @@ public partial class RestorableSqlDatabasePropertiesResourceDatabase : IUtf8Json void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,7 @@ void IJsonModel.Write(Utf8JsonW throw new FormatException($"The model {nameof(RestorableSqlDatabasePropertiesResourceDatabase)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (options.Format != "W" && Optional.IsDefined(Colls)) { writer.WritePropertyName("_colls"u8); @@ -57,34 +66,6 @@ void IJsonModel.Write(Utf8JsonW writer.WritePropertyName("_etag"u8); writer.WriteStringValue(ETag.Value.ToString()); } - writer.WritePropertyName("id"u8); - writer.WriteStringValue(DatabaseName); - if (Optional.IsDefined(RestoreParameters)) - { - writer.WritePropertyName("restoreParameters"u8); - writer.WriteObjectValue(RestoreParameters, options); - } - if (Optional.IsDefined(CreateMode)) - { - writer.WritePropertyName("createMode"u8); - writer.WriteStringValue(CreateMode.Value.ToString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } RestorableSqlDatabasePropertiesResourceDatabase IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasesListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasesListResult.Serialization.cs index 84b8cc7983667..bf585a581c59d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasesListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlDatabasesListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class RestorableSqlDatabasesListResult : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M throw new FormatException($"The model {nameof(RestorableSqlDatabasesListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M #endif } } - writer.WriteEndObject(); } RestorableSqlDatabasesListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlResourceData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlResourceData.Serialization.cs index 70e4c5e2b09f9..d26090d19f9a9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlResourceData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlResourceData.Serialization.cs @@ -21,6 +21,15 @@ public partial class RestorableSqlResourceData : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,7 +37,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(RestorableSqlResourceData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(DatabaseName)) { writer.WritePropertyName("databaseName"u8); @@ -44,42 +53,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea } writer.WriteEndArray(); } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } RestorableSqlResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlResourcesListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlResourcesListResult.Serialization.cs index 3211570ef9057..a2f794efdd934 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlResourcesListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableSqlResourcesListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class RestorableSqlResourcesListResult : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M throw new FormatException($"The model {nameof(RestorableSqlResourcesListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M #endif } } - writer.WriteEndObject(); } RestorableSqlResourcesListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableTable.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableTable.Serialization.cs index 2f37521bbb0d0..127e2ceefa5ab 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableTable.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableTable.Serialization.cs @@ -20,6 +20,15 @@ public partial class RestorableTable : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,27 +36,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO throw new FormatException($"The model {nameof(RestorableTable)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -56,22 +45,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterO writer.WriteObjectValue(Resource, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } RestorableTable IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableTableResourceData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableTableResourceData.Serialization.cs index 56e0b046b2b87..fbb0fa1eb0810 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableTableResourceData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableTableResourceData.Serialization.cs @@ -19,6 +19,15 @@ public partial class RestorableTableResourceData : IUtf8JsonSerializable, IJsonM void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(RestorableTableResourceData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsDefined(Id)) { writer.WritePropertyName("id"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR #endif } } - writer.WriteEndObject(); } RestorableTableResourceData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableTableResourcesListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableTableResourcesListResult.Serialization.cs index f35018c96409f..e2e82dcf8520d 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableTableResourcesListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableTableResourcesListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class RestorableTableResourcesListResult : IUtf8JsonSerializabl void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(RestorableTableResourcesListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, #endif } } - writer.WriteEndObject(); } RestorableTableResourcesListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableTablesListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableTablesListResult.Serialization.cs index 583a3e0efb2d7..890ba5d32e6aa 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableTablesListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestorableTablesListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class RestorableTablesListResult : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(RestorableTablesListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe #endif } } - writer.WriteEndObject(); } RestorableTablesListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestoreParametersBase.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestoreParametersBase.Serialization.cs index a7f6baadc1b04..47341e7d63a8a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestoreParametersBase.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RestoreParametersBase.Serialization.cs @@ -19,6 +19,15 @@ public partial class RestoreParametersBase : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(RestoreParametersBase)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(RestoreSource)) { writer.WritePropertyName("restoreSource"u8); @@ -57,7 +65,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW #endif } } - writer.WriteEndObject(); } RestoreParametersBase IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputParameters.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputParameters.Serialization.cs index 2adaa73f9dd43..8d2ddb933b04f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputParameters.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputParameters.Serialization.cs @@ -21,6 +21,15 @@ public partial class RetrieveThroughputParameters : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,67 +37,18 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(RetrieveThroughputParameters)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); writer.WriteObjectValue(Resource, options); writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } RetrieveThroughputParameters IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputPropertiesResource.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputPropertiesResource.Serialization.cs index ad10bd2bd2cb4..ed27bbbe0a623 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputPropertiesResource.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/RetrieveThroughputPropertiesResource.Serialization.cs @@ -21,6 +21,15 @@ public partial class RetrieveThroughputPropertiesResource : IUtf8JsonSerializabl void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,7 +37,6 @@ void IJsonModel.Write(Utf8JsonWriter write throw new FormatException($"The model {nameof(RetrieveThroughputPropertiesResource)} does not support writing '{format}' format."); } - writer.WriteStartObject(); writer.WritePropertyName("physicalPartitionIds"u8); writer.WriteStartArray(); foreach (var item in PhysicalPartitionIds) @@ -51,7 +59,6 @@ void IJsonModel.Write(Utf8JsonWriter write #endif } } - writer.WriteEndObject(); } RetrieveThroughputPropertiesResource IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ServiceResourceCreateUpdateProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ServiceResourceCreateUpdateProperties.Serialization.cs index 3da3ce3ad9ebe..ef6843e533acc 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ServiceResourceCreateUpdateProperties.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ServiceResourceCreateUpdateProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class ServiceResourceCreateUpdateProperties : IUtf8JsonSerializab void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,7 +34,6 @@ void IJsonModel.Write(Utf8JsonWriter writ throw new FormatException($"The model {nameof(ServiceResourceCreateUpdateProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(InstanceSize)) { writer.WritePropertyName("instanceSize"u8); @@ -53,7 +61,6 @@ void IJsonModel.Write(Utf8JsonWriter writ #endif } } - writer.WriteEndObject(); } ServiceResourceCreateUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SpatialSpec.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SpatialSpec.Serialization.cs index 32797dcdc6dda..659f672d5decd 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SpatialSpec.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SpatialSpec.Serialization.cs @@ -20,6 +20,15 @@ public partial class SpatialSpec : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptio throw new FormatException($"The model {nameof(SpatialSpec)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Path)) { writer.WritePropertyName("path"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptio #endif } } - writer.WriteEndObject(); } SpatialSpec IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlDedicatedGatewayRegionalService.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlDedicatedGatewayRegionalService.Serialization.cs index 6608bc316b5b9..bffedeeb07975 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlDedicatedGatewayRegionalService.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlDedicatedGatewayRegionalService.Serialization.cs @@ -19,6 +19,15 @@ public partial class SqlDedicatedGatewayRegionalService : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,43 +35,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, throw new FormatException($"The model {nameof(SqlDedicatedGatewayRegionalService)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (options.Format != "W" && Optional.IsDefined(SqlDedicatedGatewayEndpoint)) { writer.WritePropertyName("sqlDedicatedGatewayEndpoint"u8); writer.WriteStringValue(SqlDedicatedGatewayEndpoint); } - if (options.Format != "W" && Optional.IsDefined(Name)) - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W" && Optional.IsDefined(Location)) - { - writer.WritePropertyName("location"u8); - writer.WriteStringValue(Location.Value); - } - if (options.Format != "W" && Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.Value.ToString()); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } SqlDedicatedGatewayRegionalService IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlDedicatedGatewayServiceProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlDedicatedGatewayServiceProperties.Serialization.cs index dafdb7e2755f7..46d52efdcab08 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlDedicatedGatewayServiceProperties.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlDedicatedGatewayServiceProperties.Serialization.cs @@ -20,6 +20,15 @@ public partial class SqlDedicatedGatewayServiceProperties : IUtf8JsonSerializabl void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,7 @@ void IJsonModel.Write(Utf8JsonWriter write throw new FormatException($"The model {nameof(SqlDedicatedGatewayServiceProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(SqlDedicatedGatewayEndpoint)) { writer.WritePropertyName("sqlDedicatedGatewayEndpoint"u8); @@ -48,28 +57,6 @@ void IJsonModel.Write(Utf8JsonWriter write } writer.WriteEndArray(); } - if (options.Format != "W" && Optional.IsDefined(CreatedOn)) - { - writer.WritePropertyName("creationTime"u8); - writer.WriteStringValue(CreatedOn.Value, "O"); - } - if (Optional.IsDefined(InstanceSize)) - { - writer.WritePropertyName("instanceSize"u8); - writer.WriteStringValue(InstanceSize.Value.ToString()); - } - if (Optional.IsDefined(InstanceCount)) - { - writer.WritePropertyName("instanceCount"u8); - writer.WriteNumberValue(InstanceCount.Value); - } - writer.WritePropertyName("serviceType"u8); - writer.WriteStringValue(ServiceType.ToString()); - if (options.Format != "W" && Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.Value.ToString()); - } foreach (var item in AdditionalProperties) { writer.WritePropertyName(item.Key); @@ -82,7 +69,6 @@ void IJsonModel.Write(Utf8JsonWriter write } #endif } - writer.WriteEndObject(); } SqlDedicatedGatewayServiceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlDedicatedGatewayServiceResourceCreateUpdateProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlDedicatedGatewayServiceResourceCreateUpdateProperties.Serialization.cs index 2341f3c862343..ade8fa6e719b1 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlDedicatedGatewayServiceResourceCreateUpdateProperties.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/SqlDedicatedGatewayServiceResourceCreateUpdateProperties.Serialization.cs @@ -18,6 +18,15 @@ public partial class SqlDedicatedGatewayServiceResourceCreateUpdateProperties : void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,40 +34,12 @@ void IJsonModel.Write( throw new FormatException($"The model {nameof(SqlDedicatedGatewayServiceResourceCreateUpdateProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(DedicatedGatewayType)) { writer.WritePropertyName("dedicatedGatewayType"u8); writer.WriteStringValue(DedicatedGatewayType.Value.ToString()); } - if (Optional.IsDefined(InstanceSize)) - { - writer.WritePropertyName("instanceSize"u8); - writer.WriteStringValue(InstanceSize.Value.ToString()); - } - if (Optional.IsDefined(InstanceCount)) - { - writer.WritePropertyName("instanceCount"u8); - writer.WriteNumberValue(InstanceCount.Value); - } - writer.WritePropertyName("serviceType"u8); - writer.WriteStringValue(ServiceType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } SqlDedicatedGatewayServiceResourceCreateUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPolicyResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPolicyResourceInfo.Serialization.cs index 6bc6ec10e2b4a..a609ab2419710 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPolicyResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPolicyResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class ThroughputPolicyResourceInfo : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(ThroughputPolicyResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(IsEnabled)) { writer.WritePropertyName("isEnabled"u8); @@ -52,7 +60,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model #endif } } - writer.WriteEndObject(); } ThroughputPolicyResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolAccountsListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolAccountsListResult.Serialization.cs index b25cf83d836c0..b60e6244e0d4f 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolAccountsListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolAccountsListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class ThroughputPoolAccountsListResult : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M throw new FormatException($"The model {nameof(ThroughputPoolAccountsListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, M #endif } } - writer.WriteEndObject(); } ThroughputPoolAccountsListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolsListResult.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolsListResult.Serialization.cs index 7cca36703583e..0c937569e3a34 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolsListResult.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputPoolsListResult.Serialization.cs @@ -20,6 +20,15 @@ internal partial class ThroughputPoolsListResult : IUtf8JsonSerializable, IJsonM void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -27,7 +36,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(ThroughputPoolsListResult)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (options.Format != "W" && Optional.IsCollectionDefined(Value)) { writer.WritePropertyName("value"u8); @@ -58,7 +66,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea #endif } } - writer.WriteEndObject(); } ThroughputPoolsListResult IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsResourceInfo.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsResourceInfo.Serialization.cs index f1a5ec6942472..3bc4b16d377d9 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsResourceInfo.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsResourceInfo.Serialization.cs @@ -19,6 +19,15 @@ public partial class ThroughputSettingsResourceInfo : IUtf8JsonSerializable, IJs void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,7 +35,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod throw new FormatException($"The model {nameof(ThroughputSettingsResourceInfo)} does not support writing '{format}' format."); } - writer.WriteStartObject(); if (Optional.IsDefined(Throughput)) { writer.WritePropertyName("throughput"u8); @@ -72,7 +80,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mod #endif } } - writer.WriteEndObject(); } ThroughputSettingsResourceInfo IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsUpdateData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsUpdateData.Serialization.cs index 2a6222569248a..c0731217dcc39 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsUpdateData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/ThroughputSettingsUpdateData.Serialization.cs @@ -21,6 +21,15 @@ public partial class ThroughputSettingsUpdateData : IUtf8JsonSerializable, IJson void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,67 +37,18 @@ void IJsonModel.Write(Utf8JsonWriter writer, Model throw new FormatException($"The model {nameof(ThroughputSettingsUpdateData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); writer.WritePropertyName("resource"u8); writer.WriteObjectValue(Resource, options); writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } ThroughputSettingsUpdateData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownBackupPolicy.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownBackupPolicy.Serialization.cs index a4b6daddd3bfd..d0d4e9c3ab1c3 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownBackupPolicy.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownBackupPolicy.Serialization.cs @@ -19,6 +19,15 @@ internal partial class UnknownBackupPolicy : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,30 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelR throw new FormatException($"The model {nameof(CosmosDBAccountBackupPolicy)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - writer.WritePropertyName("type"u8); - writer.WriteStringValue(BackupPolicyType.ToString()); - if (Optional.IsDefined(MigrationState)) - { - writer.WritePropertyName("migrationState"u8); - writer.WriteObjectValue(MigrationState, options); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } CosmosDBAccountBackupPolicy IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownDataTransferDataSourceSink.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownDataTransferDataSourceSink.Serialization.cs index 504a2110bb4d3..635af56d94272 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownDataTransferDataSourceSink.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownDataTransferDataSourceSink.Serialization.cs @@ -19,6 +19,15 @@ internal partial class UnknownDataTransferDataSourceSink : IUtf8JsonSerializable void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,25 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRe throw new FormatException($"The model {nameof(DataTransferDataSourceSink)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - writer.WritePropertyName("component"u8); - writer.WriteStringValue(Component.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } DataTransferDataSourceSink IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownServiceResourceCreateUpdateProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownServiceResourceCreateUpdateProperties.Serialization.cs index 932c20c07f518..4ab6cd74071da 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownServiceResourceCreateUpdateProperties.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownServiceResourceCreateUpdateProperties.Serialization.cs @@ -18,6 +18,15 @@ internal partial class UnknownServiceResourceCreateUpdateProperties : IUtf8JsonS void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -25,35 +34,7 @@ void IJsonModel.Write(Utf8JsonWriter writ throw new FormatException($"The model {nameof(ServiceResourceCreateUpdateProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (Optional.IsDefined(InstanceSize)) - { - writer.WritePropertyName("instanceSize"u8); - writer.WriteStringValue(InstanceSize.Value.ToString()); - } - if (Optional.IsDefined(InstanceCount)) - { - writer.WritePropertyName("instanceCount"u8); - writer.WriteNumberValue(InstanceCount.Value); - } - writer.WritePropertyName("serviceType"u8); - writer.WriteStringValue(ServiceType.ToString()); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); + base.JsonModelWriteCore(writer, options); } ServiceResourceCreateUpdateProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownServiceResourceProperties.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownServiceResourceProperties.Serialization.cs index 07abdf1fe85d0..5af89fab9fb53 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownServiceResourceProperties.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/Models/UnknownServiceResourceProperties.Serialization.cs @@ -19,6 +19,15 @@ internal partial class UnknownServiceResourceProperties : IUtf8JsonSerializable, void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -26,29 +35,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(CosmosDBServiceProperties)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W" && Optional.IsDefined(CreatedOn)) - { - writer.WritePropertyName("creationTime"u8); - writer.WriteStringValue(CreatedOn.Value, "O"); - } - if (Optional.IsDefined(InstanceSize)) - { - writer.WritePropertyName("instanceSize"u8); - writer.WriteStringValue(InstanceSize.Value.ToString()); - } - if (Optional.IsDefined(InstanceCount)) - { - writer.WritePropertyName("instanceCount"u8); - writer.WriteNumberValue(InstanceCount.Value); - } - writer.WritePropertyName("serviceType"u8); - writer.WriteStringValue(ServiceType.ToString()); - if (options.Format != "W" && Optional.IsDefined(Status)) - { - writer.WritePropertyName("status"u8); - writer.WriteStringValue(Status.Value.ToString()); - } + base.JsonModelWriteCore(writer, options); foreach (var item in AdditionalProperties) { writer.WritePropertyName(item.Key); @@ -61,7 +48,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea } #endif } - writer.WriteEndObject(); } CosmosDBServiceProperties IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionData.Serialization.cs index 9dd32c56d83c0..846659064c3f7 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBCollectionData.Serialization.cs @@ -22,6 +22,15 @@ public partial class MongoDBCollectionData : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,46 +38,13 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(MongoDBCollectionData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -82,22 +58,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW writer.WriteObjectValue(Options, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } MongoDBCollectionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseData.Serialization.cs index d18b18b64154b..b18cdee8f97f0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBDatabaseData.Serialization.cs @@ -22,6 +22,15 @@ public partial class MongoDBDatabaseData : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,46 +38,13 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri throw new FormatException($"The model {nameof(MongoDBDatabaseData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -82,22 +58,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWri writer.WriteObjectValue(Options, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } MongoDBDatabaseData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionData.Serialization.cs index f494784e31ebd..32deb330430e0 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBRoleDefinitionData.Serialization.cs @@ -22,6 +22,15 @@ public partial class MongoDBRoleDefinitionData : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,27 +38,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(MongoDBRoleDefinitionData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(RoleName)) @@ -88,22 +77,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteEndArray(); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } MongoDBRoleDefinitionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionData.Serialization.cs index 4dbfb90cbcf63..6e4d5bcc87e23 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/MongoDBUserDefinitionData.Serialization.cs @@ -22,6 +22,15 @@ public partial class MongoDBUserDefinitionData : IUtf8JsonSerializable, IJsonMod void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,27 +38,7 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea throw new FormatException($"The model {nameof(MongoDBUserDefinitionData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } + base.JsonModelWriteCore(writer, options); writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(UserName)) @@ -88,22 +77,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelRea writer.WriteStringValue(Mechanisms); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } MongoDBUserDefinitionData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationData.Serialization.cs index 0505e42a6b88f..a86383273c50a 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/NetworkSecurityPerimeterConfigurationData.Serialization.cs @@ -21,6 +21,15 @@ public partial class NetworkSecurityPerimeterConfigurationData : IUtf8JsonSerial void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -28,48 +37,12 @@ void IJsonModel.Write(Utf8JsonWriter throw new FormatException($"The model {nameof(NetworkSecurityPerimeterConfigurationData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Properties)) { writer.WritePropertyName("properties"u8); writer.WriteObjectValue(Properties, options); } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } NetworkSecurityPerimeterConfigurationData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountData.Serialization.cs index 9837575f9dc19..0de995a52723c 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/RestorableCosmosDBAccountData.Serialization.cs @@ -22,6 +22,15 @@ public partial class RestorableCosmosDBAccountData : IUtf8JsonSerializable, IJso void IUtf8JsonSerializable.Write(Utf8JsonWriter writer) => ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,32 +38,12 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode throw new FormatException($"The model {nameof(RestorableCosmosDBAccountData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Location)) { writer.WritePropertyName("location"u8); writer.WriteStringValue(Location.Value); } - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(AccountName)) @@ -93,22 +82,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, Mode writer.WriteEndArray(); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } RestorableCosmosDBAccountData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ThroughputSettingData.Serialization.cs b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ThroughputSettingData.Serialization.cs index 21b4a4133bd87..1670f6a5310aa 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ThroughputSettingData.Serialization.cs +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/Generated/ThroughputSettingData.Serialization.cs @@ -22,6 +22,15 @@ public partial class ThroughputSettingData : IUtf8JsonSerializable, IJsonModel ((IJsonModel)this).Write(writer, ModelSerializationExtensions.WireOptions); void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderWriterOptions options) + { + writer.WriteStartObject(); + JsonModelWriteCore(writer, options); + writer.WriteEndObject(); + } + + /// The JSON writer. + /// The client options for reading and writing models. + protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWriterOptions options) { var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format; if (format != "J") @@ -29,46 +38,13 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW throw new FormatException($"The model {nameof(ThroughputSettingData)} does not support writing '{format}' format."); } - writer.WriteStartObject(); + base.JsonModelWriteCore(writer, options); if (Optional.IsDefined(Identity)) { writer.WritePropertyName("identity"u8); var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } }; JsonSerializer.Serialize(writer, Identity, serializeOptions); } - 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); - if (options.Format != "W") - { - writer.WritePropertyName("id"u8); - writer.WriteStringValue(Id); - } - if (options.Format != "W") - { - writer.WritePropertyName("name"u8); - writer.WriteStringValue(Name); - } - if (options.Format != "W") - { - writer.WritePropertyName("type"u8); - writer.WriteStringValue(ResourceType); - } - if (options.Format != "W" && Optional.IsDefined(SystemData)) - { - writer.WritePropertyName("systemData"u8); - JsonSerializer.Serialize(writer, SystemData); - } writer.WritePropertyName("properties"u8); writer.WriteStartObject(); if (Optional.IsDefined(Resource)) @@ -77,22 +53,6 @@ void IJsonModel.Write(Utf8JsonWriter writer, ModelReaderW writer.WriteObjectValue(Resource, options); } writer.WriteEndObject(); - if (options.Format != "W" && _serializedAdditionalRawData != null) - { - foreach (var item in _serializedAdditionalRawData) - { - writer.WritePropertyName(item.Key); -#if NET6_0_OR_GREATER - writer.WriteRawValue(item.Value); -#else - using (JsonDocument document = JsonDocument.Parse(item.Value)) - { - JsonSerializer.Serialize(writer, document.RootElement); - } -#endif - } - } - writer.WriteEndObject(); } ThroughputSettingData IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options) diff --git a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md index 34c76f1254caf..28ee9633524d6 100644 --- a/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md +++ b/sdk/cosmosdb/Azure.ResourceManager.CosmosDB/src/autorest.md @@ -21,6 +21,7 @@ modelerfour: flatten-payloads: false lenient-model-deduplication: true use-model-reader-writer: true +use-write-core: true enable-bicep-serialization: true #mgmt-debug: