diff --git a/sdk/postgresql/Azure.ResourceManager.PostgreSql/samples/Generated/Samples/Sample_PostgreSqlFlexibleServerCollection.cs b/sdk/postgresql/Azure.ResourceManager.PostgreSql/samples/Generated/Samples/Sample_PostgreSqlFlexibleServerCollection.cs
index 49f00432c084..15ac087aa3ce 100644
--- a/sdk/postgresql/Azure.ResourceManager.PostgreSql/samples/Generated/Samples/Sample_PostgreSqlFlexibleServerCollection.cs
+++ b/sdk/postgresql/Azure.ResourceManager.PostgreSql/samples/Generated/Samples/Sample_PostgreSqlFlexibleServerCollection.cs
@@ -44,12 +44,12 @@ public async Task CreateOrUpdate_CreateADatabaseAsAGeoRestoreInGeoPairedLocation
string serverName = "pgtestsvc5geo";
PostgreSqlFlexibleServerData data = new PostgreSqlFlexibleServerData(new AzureLocation("eastus"))
{
- Identity = new PostgreSqlFlexibleServerUserAssignedIdentity(PostgreSqlFlexibleServerIdentityType.UserAssigned)
+ Identity = new ManagedServiceIdentity("UserAssigned")
{
UserAssignedIdentities =
{
-["/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity"] = new UserAssignedIdentity(),
-["/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"] = new UserAssignedIdentity()
+[new ResourceIdentifier("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity")] = new UserAssignedIdentity(),
+[new ResourceIdentifier("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity")] = new UserAssignedIdentity()
},
},
DataEncryption = new PostgreSqlFlexibleServerDataEncryption
@@ -284,11 +284,11 @@ public async Task CreateOrUpdate_ServerCreateReplica()
string serverName = "pgtestsvc5rep";
PostgreSqlFlexibleServerData data = new PostgreSqlFlexibleServerData(new AzureLocation("westus"))
{
- Identity = new PostgreSqlFlexibleServerUserAssignedIdentity(PostgreSqlFlexibleServerIdentityType.UserAssigned)
+ Identity = new ManagedServiceIdentity("UserAssigned")
{
UserAssignedIdentities =
{
-["/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"] = new UserAssignedIdentity()
+[new ResourceIdentifier("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity")] = new UserAssignedIdentity()
},
},
DataEncryption = new PostgreSqlFlexibleServerDataEncryption
@@ -380,11 +380,11 @@ public async Task CreateOrUpdate_ServerCreateWithDataEncryptionEnabled()
PostgreSqlFlexibleServerData data = new PostgreSqlFlexibleServerData(new AzureLocation("westus"))
{
Sku = new PostgreSqlFlexibleServerSku("Standard_D4s_v3", PostgreSqlFlexibleServerSkuTier.GeneralPurpose),
- Identity = new PostgreSqlFlexibleServerUserAssignedIdentity(PostgreSqlFlexibleServerIdentityType.UserAssigned)
+ Identity = new ManagedServiceIdentity("UserAssigned")
{
UserAssignedIdentities =
{
-["/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"] = new UserAssignedIdentity()
+[new ResourceIdentifier("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity")] = new UserAssignedIdentity()
},
},
AdministratorLogin = "cloudsa",
diff --git a/sdk/postgresql/Azure.ResourceManager.PostgreSql/samples/Generated/Samples/Sample_PostgreSqlFlexibleServerResource.cs b/sdk/postgresql/Azure.ResourceManager.PostgreSql/samples/Generated/Samples/Sample_PostgreSqlFlexibleServerResource.cs
index e61133464075..0bf5827c7e24 100644
--- a/sdk/postgresql/Azure.ResourceManager.PostgreSql/samples/Generated/Samples/Sample_PostgreSqlFlexibleServerResource.cs
+++ b/sdk/postgresql/Azure.ResourceManager.PostgreSql/samples/Generated/Samples/Sample_PostgreSqlFlexibleServerResource.cs
@@ -377,12 +377,12 @@ public async Task Update_ServerUpdateWithDataEncryptionEnabled()
PostgreSqlFlexibleServerPatch patch = new PostgreSqlFlexibleServerPatch
{
Sku = new PostgreSqlFlexibleServerSku("Standard_D8s_v3", PostgreSqlFlexibleServerSkuTier.GeneralPurpose),
- Identity = new PostgreSqlFlexibleServerUserAssignedIdentity(PostgreSqlFlexibleServerIdentityType.UserAssigned)
+ Identity = new ManagedServiceIdentity("UserAssigned")
{
UserAssignedIdentities =
{
-["/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity"] = new UserAssignedIdentity(),
-["/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity"] = new UserAssignedIdentity()
+[new ResourceIdentifier("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-geo-usermanagedidentity")] = new UserAssignedIdentity(),
+[new ResourceIdentifier("/subscriptions/ffffffff-ffff-ffff-ffff-ffffffffffff/resourceGroups/testresourcegroup/providers/Microsoft.ManagedIdentity/userAssignedIdentities/test-usermanagedidentity")] = new UserAssignedIdentity()
},
},
AdministratorLoginPassword = "newpassword",
diff --git a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/ArmPostgreSqlFlexibleServersModelFactory.cs b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/ArmPostgreSqlFlexibleServersModelFactory.cs
index 89d0aa1df2b5..55088f87c119 100644
--- a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/ArmPostgreSqlFlexibleServersModelFactory.cs
+++ b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/ArmPostgreSqlFlexibleServersModelFactory.cs
@@ -402,7 +402,7 @@ public static PostgreSqlFlexibleServerFirewallRuleData PostgreSqlFlexibleServerF
/// The mode to create a new PostgreSQL server.
/// List of private endpoint connections associated with the specified resource.
/// A new instance for mocking.
- public static PostgreSqlFlexibleServerData PostgreSqlFlexibleServerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, PostgreSqlFlexibleServerSku sku = null, PostgreSqlFlexibleServerUserAssignedIdentity identity = null, string administratorLogin = null, string administratorLoginPassword = null, PostgreSqlFlexibleServerVersion? version = null, string minorVersion = null, PostgreSqlFlexibleServerState? state = null, string fullyQualifiedDomainName = null, PostgreSqlFlexibleServerStorage storage = null, PostgreSqlFlexibleServerAuthConfig authConfig = null, PostgreSqlFlexibleServerDataEncryption dataEncryption = null, PostgreSqlFlexibleServerBackupProperties backup = null, PostgreSqlFlexibleServerNetwork network = null, PostgreSqlFlexibleServerHighAvailability highAvailability = null, PostgreSqlFlexibleServerMaintenanceWindow maintenanceWindow = null, ResourceIdentifier sourceServerResourceId = null, DateTimeOffset? pointInTimeUtc = null, string availabilityZone = null, PostgreSqlFlexibleServerReplicationRole? replicationRole = null, int? replicaCapacity = null, PostgreSqlFlexibleServersReplica replica = null, PostgreSqlFlexibleServerCreateMode? createMode = null, IEnumerable privateEndpointConnections = null)
+ public static PostgreSqlFlexibleServerData PostgreSqlFlexibleServerData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, IDictionary tags = null, AzureLocation location = default, PostgreSqlFlexibleServerSku sku = null, ManagedServiceIdentity identity = null, string administratorLogin = null, string administratorLoginPassword = null, PostgreSqlFlexibleServerVersion? version = null, string minorVersion = null, PostgreSqlFlexibleServerState? state = null, string fullyQualifiedDomainName = null, PostgreSqlFlexibleServerStorage storage = null, PostgreSqlFlexibleServerAuthConfig authConfig = null, PostgreSqlFlexibleServerDataEncryption dataEncryption = null, PostgreSqlFlexibleServerBackupProperties backup = null, PostgreSqlFlexibleServerNetwork network = null, PostgreSqlFlexibleServerHighAvailability highAvailability = null, PostgreSqlFlexibleServerMaintenanceWindow maintenanceWindow = null, ResourceIdentifier sourceServerResourceId = null, DateTimeOffset? pointInTimeUtc = null, string availabilityZone = null, PostgreSqlFlexibleServerReplicationRole? replicationRole = null, int? replicaCapacity = null, PostgreSqlFlexibleServersReplica replica = null, PostgreSqlFlexibleServerCreateMode? createMode = null, IEnumerable privateEndpointConnections = null)
{
tags ??= new Dictionary();
privateEndpointConnections ??= new List();
@@ -440,18 +440,6 @@ public static PostgreSqlFlexibleServerData PostgreSqlFlexibleServerData(Resource
serializedAdditionalRawData: null);
}
- /// Initializes a new instance of .
- /// represents user assigned identities map.
- /// the types of identities associated with this resource; currently restricted to 'None and UserAssigned'.
- /// Tenant id of the server.
- /// A new instance for mocking.
- public static PostgreSqlFlexibleServerUserAssignedIdentity PostgreSqlFlexibleServerUserAssignedIdentity(IDictionary userAssignedIdentities = null, PostgreSqlFlexibleServerIdentityType identityType = default, Guid? tenantId = null)
- {
- userAssignedIdentities ??= new Dictionary();
-
- return new PostgreSqlFlexibleServerUserAssignedIdentity(userAssignedIdentities, identityType, tenantId, serializedAdditionalRawData: null);
- }
-
/// Initializes a new instance of .
/// Backup retention days for the server.
/// A value indicating whether Geo-Redundant backup is enabled on the server.
diff --git a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Models/PostgreSqlFlexibleServerIdentityType.cs b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Models/PostgreSqlFlexibleServerIdentityType.cs
index bb931dea17ec..4c05f1a4e85b 100644
--- a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Models/PostgreSqlFlexibleServerIdentityType.cs
+++ b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Models/PostgreSqlFlexibleServerIdentityType.cs
@@ -10,7 +10,7 @@
namespace Azure.ResourceManager.PostgreSql.FlexibleServers.Models
{
- /// the types of identities associated with this resource; currently restricted to 'None and UserAssigned'.
+ /// the types of identities associated with this resource.
public readonly partial struct PostgreSqlFlexibleServerIdentityType : IEquatable
{
private readonly string _value;
@@ -24,11 +24,14 @@ public PostgreSqlFlexibleServerIdentityType(string value)
private const string NoneValue = "None";
private const string UserAssignedValue = "UserAssigned";
+ private const string SystemAssignedUserAssignedValue = "SystemAssigned,UserAssigned";
/// None.
public static PostgreSqlFlexibleServerIdentityType None { get; } = new PostgreSqlFlexibleServerIdentityType(NoneValue);
/// UserAssigned.
public static PostgreSqlFlexibleServerIdentityType UserAssigned { get; } = new PostgreSqlFlexibleServerIdentityType(UserAssignedValue);
+ /// SystemAssigned,UserAssigned.
+ public static PostgreSqlFlexibleServerIdentityType SystemAssignedUserAssigned { get; } = new PostgreSqlFlexibleServerIdentityType(SystemAssignedUserAssignedValue);
/// Determines if two values are the same.
public static bool operator ==(PostgreSqlFlexibleServerIdentityType left, PostgreSqlFlexibleServerIdentityType right) => left.Equals(right);
/// Determines if two values are not the same.
diff --git a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Models/PostgreSqlFlexibleServerPatch.Serialization.cs b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Models/PostgreSqlFlexibleServerPatch.Serialization.cs
index e8c044fcff6f..0c1bf902aa36 100644
--- a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Models/PostgreSqlFlexibleServerPatch.Serialization.cs
+++ b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Models/PostgreSqlFlexibleServerPatch.Serialization.cs
@@ -10,6 +10,7 @@
using System.Collections.Generic;
using System.Text.Json;
using Azure.Core;
+using Azure.ResourceManager.Models;
namespace Azure.ResourceManager.PostgreSql.FlexibleServers.Models
{
@@ -42,7 +43,8 @@ protected virtual void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWrit
if (Optional.IsDefined(Identity))
{
writer.WritePropertyName("identity"u8);
- writer.WriteObjectValue(Identity, options);
+ var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } };
+ JsonSerializer.Serialize(writer, Identity, serializeOptions);
}
if (Optional.IsCollectionDefined(Tags))
{
@@ -166,7 +168,7 @@ internal static PostgreSqlFlexibleServerPatch DeserializePostgreSqlFlexibleServe
return null;
}
PostgreSqlFlexibleServerSku sku = default;
- PostgreSqlFlexibleServerUserAssignedIdentity identity = default;
+ ManagedServiceIdentity identity = default;
IDictionary tags = default;
AzureLocation? location = default;
string administratorLogin = default;
@@ -201,7 +203,8 @@ internal static PostgreSqlFlexibleServerPatch DeserializePostgreSqlFlexibleServe
{
continue;
}
- identity = PostgreSqlFlexibleServerUserAssignedIdentity.DeserializePostgreSqlFlexibleServerUserAssignedIdentity(property.Value, options);
+ var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } };
+ identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions);
continue;
}
if (property.NameEquals("tags"u8))
diff --git a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Models/PostgreSqlFlexibleServerPatch.cs b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Models/PostgreSqlFlexibleServerPatch.cs
index 320afc87de22..1afaf44bc1ed 100644
--- a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Models/PostgreSqlFlexibleServerPatch.cs
+++ b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Models/PostgreSqlFlexibleServerPatch.cs
@@ -8,6 +8,7 @@
using System;
using System.Collections.Generic;
using Azure.Core;
+using Azure.ResourceManager.Models;
namespace Azure.ResourceManager.PostgreSql.FlexibleServers.Models
{
@@ -71,7 +72,7 @@ public PostgreSqlFlexibleServerPatch()
/// Replica properties of a server. These Replica properties are required to be passed only in case you want to Promote a server.
/// Network properties of a server. These are required to be passed only in case if server is a private access server.
/// Keeps track of any properties unknown to the library.
- internal PostgreSqlFlexibleServerPatch(PostgreSqlFlexibleServerSku sku, PostgreSqlFlexibleServerUserAssignedIdentity identity, IDictionary tags, AzureLocation? location, string administratorLogin, string administratorLoginPassword, PostgreSqlFlexibleServerVersion? version, PostgreSqlFlexibleServerStorage storage, PostgreSqlFlexibleServerBackupProperties backup, PostgreSqlFlexibleServerHighAvailability highAvailability, PostgreSqlFlexibleServerMaintenanceWindow maintenanceWindow, PostgreSqlFlexibleServerAuthConfig authConfig, PostgreSqlFlexibleServerDataEncryption dataEncryption, PostgreSqlFlexibleServerCreateModeForUpdate? createMode, PostgreSqlFlexibleServerReplicationRole? replicationRole, PostgreSqlFlexibleServersReplica replica, PostgreSqlFlexibleServerNetwork network, IDictionary serializedAdditionalRawData)
+ internal PostgreSqlFlexibleServerPatch(PostgreSqlFlexibleServerSku sku, ManagedServiceIdentity identity, IDictionary tags, AzureLocation? location, string administratorLogin, string administratorLoginPassword, PostgreSqlFlexibleServerVersion? version, PostgreSqlFlexibleServerStorage storage, PostgreSqlFlexibleServerBackupProperties backup, PostgreSqlFlexibleServerHighAvailability highAvailability, PostgreSqlFlexibleServerMaintenanceWindow maintenanceWindow, PostgreSqlFlexibleServerAuthConfig authConfig, PostgreSqlFlexibleServerDataEncryption dataEncryption, PostgreSqlFlexibleServerCreateModeForUpdate? createMode, PostgreSqlFlexibleServerReplicationRole? replicationRole, PostgreSqlFlexibleServersReplica replica, PostgreSqlFlexibleServerNetwork network, IDictionary serializedAdditionalRawData)
{
Sku = sku;
Identity = identity;
@@ -98,7 +99,7 @@ internal PostgreSqlFlexibleServerPatch(PostgreSqlFlexibleServerSku sku, PostgreS
public PostgreSqlFlexibleServerSku Sku { get; set; }
/// Describes the identity of the application.
[WirePath("identity")]
- public PostgreSqlFlexibleServerUserAssignedIdentity Identity { get; set; }
+ public ManagedServiceIdentity Identity { get; set; }
/// Application-specific metadata in the form of key-value pairs.
[WirePath("tags")]
public IDictionary Tags { get; }
diff --git a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Models/PostgreSqlFlexibleServerUserAssignedIdentity.Serialization.cs b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Models/PostgreSqlFlexibleServerUserAssignedIdentity.Serialization.cs
deleted file mode 100644
index c1ad6f896baf..000000000000
--- a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Models/PostgreSqlFlexibleServerUserAssignedIdentity.Serialization.cs
+++ /dev/null
@@ -1,238 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.ClientModel.Primitives;
-using System.Collections.Generic;
-using System.Linq;
-using System.Text;
-using System.Text.Json;
-using Azure.Core;
-using Azure.ResourceManager.Models;
-
-namespace Azure.ResourceManager.PostgreSql.FlexibleServers.Models
-{
- public partial class PostgreSqlFlexibleServerUserAssignedIdentity : 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")
- {
- throw new FormatException($"The model {nameof(PostgreSqlFlexibleServerUserAssignedIdentity)} does not support writing '{format}' format.");
- }
-
- if (Optional.IsCollectionDefined(UserAssignedIdentities))
- {
- writer.WritePropertyName("userAssignedIdentities"u8);
- writer.WriteStartObject();
- foreach (var item in UserAssignedIdentities)
- {
- writer.WritePropertyName(item.Key);
- JsonSerializer.Serialize(writer, item.Value);
- }
- writer.WriteEndObject();
- }
- writer.WritePropertyName("type"u8);
- writer.WriteStringValue(IdentityType.ToString());
- if (options.Format != "W" && Optional.IsDefined(TenantId))
- {
- writer.WritePropertyName("tenantId"u8);
- writer.WriteStringValue(TenantId.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, ModelSerializationExtensions.JsonDocumentOptions))
- {
- JsonSerializer.Serialize(writer, document.RootElement);
- }
-#endif
- }
- }
- }
-
- PostgreSqlFlexibleServerUserAssignedIdentity IJsonModel.Create(ref Utf8JsonReader reader, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
- if (format != "J")
- {
- throw new FormatException($"The model {nameof(PostgreSqlFlexibleServerUserAssignedIdentity)} does not support reading '{format}' format.");
- }
-
- using JsonDocument document = JsonDocument.ParseValue(ref reader);
- return DeserializePostgreSqlFlexibleServerUserAssignedIdentity(document.RootElement, options);
- }
-
- internal static PostgreSqlFlexibleServerUserAssignedIdentity DeserializePostgreSqlFlexibleServerUserAssignedIdentity(JsonElement element, ModelReaderWriterOptions options = null)
- {
- options ??= ModelSerializationExtensions.WireOptions;
-
- if (element.ValueKind == JsonValueKind.Null)
- {
- return null;
- }
- IDictionary userAssignedIdentities = default;
- PostgreSqlFlexibleServerIdentityType type = default;
- Guid? tenantId = default;
- IDictionary serializedAdditionalRawData = default;
- Dictionary rawDataDictionary = new Dictionary();
- foreach (var property in element.EnumerateObject())
- {
- if (property.NameEquals("userAssignedIdentities"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- Dictionary dictionary = new Dictionary();
- foreach (var property0 in property.Value.EnumerateObject())
- {
- dictionary.Add(property0.Name, JsonSerializer.Deserialize(property0.Value.GetRawText()));
- }
- userAssignedIdentities = dictionary;
- continue;
- }
- if (property.NameEquals("type"u8))
- {
- type = new PostgreSqlFlexibleServerIdentityType(property.Value.GetString());
- continue;
- }
- if (property.NameEquals("tenantId"u8))
- {
- if (property.Value.ValueKind == JsonValueKind.Null)
- {
- continue;
- }
- tenantId = property.Value.GetGuid();
- continue;
- }
- if (options.Format != "W")
- {
- rawDataDictionary.Add(property.Name, BinaryData.FromString(property.Value.GetRawText()));
- }
- }
- serializedAdditionalRawData = rawDataDictionary;
- return new PostgreSqlFlexibleServerUserAssignedIdentity(userAssignedIdentities ?? new ChangeTrackingDictionary(), type, tenantId, serializedAdditionalRawData);
- }
-
- private BinaryData SerializeBicep(ModelReaderWriterOptions options)
- {
- StringBuilder builder = new StringBuilder();
- BicepModelReaderWriterOptions bicepOptions = options as BicepModelReaderWriterOptions;
- IDictionary propertyOverrides = null;
- bool hasObjectOverride = bicepOptions != null && bicepOptions.PropertyOverrides.TryGetValue(this, out propertyOverrides);
- bool hasPropertyOverride = false;
- string propertyOverride = null;
-
- builder.AppendLine("{");
-
- hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UserAssignedIdentities), out propertyOverride);
- if (hasPropertyOverride)
- {
- builder.Append(" userAssignedIdentities: ");
- builder.AppendLine(propertyOverride);
- }
- else
- {
- if (Optional.IsCollectionDefined(UserAssignedIdentities))
- {
- if (UserAssignedIdentities.Any())
- {
- builder.Append(" userAssignedIdentities: ");
- builder.AppendLine("{");
- foreach (var item in UserAssignedIdentities)
- {
- builder.Append($" '{item.Key}': ");
- BicepSerializationHelpers.AppendChildObject(builder, item.Value, options, 4, false, " userAssignedIdentities: ");
- }
- builder.AppendLine(" }");
- }
- }
- }
-
- hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(IdentityType), out propertyOverride);
- if (hasPropertyOverride)
- {
- builder.Append(" type: ");
- builder.AppendLine(propertyOverride);
- }
- else
- {
- builder.Append(" type: ");
- builder.AppendLine($"'{IdentityType.ToString()}'");
- }
-
- hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(TenantId), out propertyOverride);
- if (hasPropertyOverride)
- {
- builder.Append(" tenantId: ");
- builder.AppendLine(propertyOverride);
- }
- else
- {
- if (Optional.IsDefined(TenantId))
- {
- builder.Append(" tenantId: ");
- builder.AppendLine($"'{TenantId.Value.ToString()}'");
- }
- }
-
- builder.AppendLine("}");
- return BinaryData.FromString(builder.ToString());
- }
-
- BinaryData IPersistableModel.Write(ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- return ModelReaderWriter.Write(this, options, AzureResourceManagerPostgreSqlContext.Default);
- case "bicep":
- return SerializeBicep(options);
- default:
- throw new FormatException($"The model {nameof(PostgreSqlFlexibleServerUserAssignedIdentity)} does not support writing '{options.Format}' format.");
- }
- }
-
- PostgreSqlFlexibleServerUserAssignedIdentity IPersistableModel.Create(BinaryData data, ModelReaderWriterOptions options)
- {
- var format = options.Format == "W" ? ((IPersistableModel)this).GetFormatFromOptions(options) : options.Format;
-
- switch (format)
- {
- case "J":
- {
- using JsonDocument document = JsonDocument.Parse(data, ModelSerializationExtensions.JsonDocumentOptions);
- return DeserializePostgreSqlFlexibleServerUserAssignedIdentity(document.RootElement, options);
- }
- default:
- throw new FormatException($"The model {nameof(PostgreSqlFlexibleServerUserAssignedIdentity)} does not support reading '{options.Format}' format.");
- }
- }
-
- string IPersistableModel.GetFormatFromOptions(ModelReaderWriterOptions options) => "J";
- }
-}
diff --git a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Models/PostgreSqlFlexibleServerUserAssignedIdentity.cs b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Models/PostgreSqlFlexibleServerUserAssignedIdentity.cs
deleted file mode 100644
index 84a7d8ac2a2f..000000000000
--- a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/Models/PostgreSqlFlexibleServerUserAssignedIdentity.cs
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License.
-
-//
-
-#nullable disable
-
-using System;
-using System.Collections.Generic;
-using Azure.ResourceManager.Models;
-
-namespace Azure.ResourceManager.PostgreSql.FlexibleServers.Models
-{
- /// Information describing the identities associated with this application.
- public partial class PostgreSqlFlexibleServerUserAssignedIdentity
- {
- ///
- /// Keeps track of any properties unknown to the library.
- ///
- /// To assign an object to the value of this property use .
- ///
- ///
- /// To assign an already formatted json string to this property use .
- ///
- ///
- /// Examples:
- ///
- /// -
- /// BinaryData.FromObjectAsJson("foo")
- /// Creates a payload of "foo".
- ///
- /// -
- /// BinaryData.FromString("\"foo\"")
- /// Creates a payload of "foo".
- ///
- /// -
- /// BinaryData.FromObjectAsJson(new { key = "value" })
- /// Creates a payload of { "key": "value" }.
- ///
- /// -
- /// BinaryData.FromString("{\"key\": \"value\"}")
- /// Creates a payload of { "key": "value" }.
- ///
- ///
- ///
- ///
- private IDictionary _serializedAdditionalRawData;
-
- /// Initializes a new instance of .
- /// the types of identities associated with this resource; currently restricted to 'None and UserAssigned'.
- public PostgreSqlFlexibleServerUserAssignedIdentity(PostgreSqlFlexibleServerIdentityType identityType)
- {
- UserAssignedIdentities = new ChangeTrackingDictionary();
- IdentityType = identityType;
- }
-
- /// Initializes a new instance of .
- /// represents user assigned identities map.
- /// the types of identities associated with this resource; currently restricted to 'None and UserAssigned'.
- /// Tenant id of the server.
- /// Keeps track of any properties unknown to the library.
- internal PostgreSqlFlexibleServerUserAssignedIdentity(IDictionary userAssignedIdentities, PostgreSqlFlexibleServerIdentityType identityType, Guid? tenantId, IDictionary serializedAdditionalRawData)
- {
- UserAssignedIdentities = userAssignedIdentities;
- IdentityType = identityType;
- TenantId = tenantId;
- _serializedAdditionalRawData = serializedAdditionalRawData;
- }
-
- /// Initializes a new instance of for deserialization.
- internal PostgreSqlFlexibleServerUserAssignedIdentity()
- {
- }
-
- /// represents user assigned identities map.
- [WirePath("userAssignedIdentities")]
- public IDictionary UserAssignedIdentities { get; }
- /// the types of identities associated with this resource; currently restricted to 'None and UserAssigned'.
- [WirePath("type")]
- public PostgreSqlFlexibleServerIdentityType IdentityType { get; set; }
- /// Tenant id of the server.
- [WirePath("tenantId")]
- public Guid? TenantId { get; }
- }
-}
diff --git a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/PostgreSqlFlexibleServerData.Serialization.cs b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/PostgreSqlFlexibleServerData.Serialization.cs
index ca75658a7838..3c9f45f85fde 100644
--- a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/PostgreSqlFlexibleServerData.Serialization.cs
+++ b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/PostgreSqlFlexibleServerData.Serialization.cs
@@ -47,7 +47,8 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri
if (Optional.IsDefined(Identity))
{
writer.WritePropertyName("identity"u8);
- writer.WriteObjectValue(Identity, options);
+ var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } };
+ JsonSerializer.Serialize(writer, Identity, serializeOptions);
}
writer.WritePropertyName("properties"u8);
writer.WriteStartObject();
@@ -185,7 +186,7 @@ internal static PostgreSqlFlexibleServerData DeserializePostgreSqlFlexibleServer
return null;
}
PostgreSqlFlexibleServerSku sku = default;
- PostgreSqlFlexibleServerUserAssignedIdentity identity = default;
+ ManagedServiceIdentity identity = default;
IDictionary tags = default;
AzureLocation location = default;
ResourceIdentifier id = default;
@@ -232,7 +233,8 @@ internal static PostgreSqlFlexibleServerData DeserializePostgreSqlFlexibleServer
{
continue;
}
- identity = PostgreSqlFlexibleServerUserAssignedIdentity.DeserializePostgreSqlFlexibleServerUserAssignedIdentity(property.Value, options);
+ var serializeOptions = new JsonSerializerOptions { Converters = { new ManagedServiceIdentityTypeV3Converter() } };
+ identity = JsonSerializer.Deserialize(property.Value.GetRawText(), serializeOptions);
continue;
}
if (property.NameEquals("tags"u8))
diff --git a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/PostgreSqlFlexibleServerData.cs b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/PostgreSqlFlexibleServerData.cs
index e2f54e0dc905..e9adb3a668f7 100644
--- a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/PostgreSqlFlexibleServerData.cs
+++ b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/PostgreSqlFlexibleServerData.cs
@@ -89,7 +89,7 @@ public PostgreSqlFlexibleServerData(AzureLocation location) : base(location)
/// The mode to create a new PostgreSQL server.
/// List of private endpoint connections associated with the specified resource.
/// Keeps track of any properties unknown to the library.
- internal PostgreSqlFlexibleServerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, PostgreSqlFlexibleServerSku sku, PostgreSqlFlexibleServerUserAssignedIdentity identity, string administratorLogin, string administratorLoginPassword, PostgreSqlFlexibleServerVersion? version, string minorVersion, PostgreSqlFlexibleServerState? state, string fullyQualifiedDomainName, PostgreSqlFlexibleServerStorage storage, PostgreSqlFlexibleServerAuthConfig authConfig, PostgreSqlFlexibleServerDataEncryption dataEncryption, PostgreSqlFlexibleServerBackupProperties backup, PostgreSqlFlexibleServerNetwork network, PostgreSqlFlexibleServerHighAvailability highAvailability, PostgreSqlFlexibleServerMaintenanceWindow maintenanceWindow, ResourceIdentifier sourceServerResourceId, DateTimeOffset? pointInTimeUtc, string availabilityZone, PostgreSqlFlexibleServerReplicationRole? replicationRole, int? replicaCapacity, PostgreSqlFlexibleServersReplica replica, PostgreSqlFlexibleServerCreateMode? createMode, IReadOnlyList privateEndpointConnections, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location)
+ internal PostgreSqlFlexibleServerData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, IDictionary tags, AzureLocation location, PostgreSqlFlexibleServerSku sku, ManagedServiceIdentity identity, string administratorLogin, string administratorLoginPassword, PostgreSqlFlexibleServerVersion? version, string minorVersion, PostgreSqlFlexibleServerState? state, string fullyQualifiedDomainName, PostgreSqlFlexibleServerStorage storage, PostgreSqlFlexibleServerAuthConfig authConfig, PostgreSqlFlexibleServerDataEncryption dataEncryption, PostgreSqlFlexibleServerBackupProperties backup, PostgreSqlFlexibleServerNetwork network, PostgreSqlFlexibleServerHighAvailability highAvailability, PostgreSqlFlexibleServerMaintenanceWindow maintenanceWindow, ResourceIdentifier sourceServerResourceId, DateTimeOffset? pointInTimeUtc, string availabilityZone, PostgreSqlFlexibleServerReplicationRole? replicationRole, int? replicaCapacity, PostgreSqlFlexibleServersReplica replica, PostgreSqlFlexibleServerCreateMode? createMode, IReadOnlyList privateEndpointConnections, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData, tags, location)
{
Sku = sku;
Identity = identity;
@@ -127,7 +127,7 @@ internal PostgreSqlFlexibleServerData()
public PostgreSqlFlexibleServerSku Sku { get; set; }
/// Describes the identity of the application.
[WirePath("identity")]
- public PostgreSqlFlexibleServerUserAssignedIdentity Identity { get; set; }
+ public ManagedServiceIdentity Identity { get; set; }
/// The administrator's login name of a server. Can only be specified when the server is being created (and is required for creation).
[WirePath("properties.administratorLogin")]
public string AdministratorLogin { get; set; }
diff --git a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/PostgreSqlFlexibleServerResource.cs b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/PostgreSqlFlexibleServerResource.cs
index 67748d5c7434..880084a7c6cc 100644
--- a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/PostgreSqlFlexibleServerResource.cs
+++ b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/PostgreSqlFlexibleServerResource.cs
@@ -43,7 +43,7 @@ public static ResourceIdentifier CreateResourceIdentifier(string subscriptionId,
private readonly ClientDiagnostics _flexibleServerClientDiagnostics;
private readonly FlexibleServerRestOperations _flexibleServerRestClient;
private readonly ClientDiagnostics _defaultClientDiagnostics;
- private readonly PostgreSQLServerManagementRestOperations _defaultRestClient;
+ private readonly PostgreSQLManagementRestOperations _defaultRestClient;
private readonly ClientDiagnostics _logFilesClientDiagnostics;
private readonly LogFilesRestOperations _logFilesRestClient;
private readonly PostgreSqlFlexibleServerData _data;
@@ -78,7 +78,7 @@ internal PostgreSqlFlexibleServerResource(ArmClient client, ResourceIdentifier i
_flexibleServerClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.PostgreSql.FlexibleServers", ProviderConstants.DefaultProviderNamespace, Diagnostics);
_flexibleServerRestClient = new FlexibleServerRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint);
_defaultClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.PostgreSql.FlexibleServers", ProviderConstants.DefaultProviderNamespace, Diagnostics);
- _defaultRestClient = new PostgreSQLServerManagementRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint);
+ _defaultRestClient = new PostgreSQLManagementRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint);
_logFilesClientDiagnostics = new ClientDiagnostics("Azure.ResourceManager.PostgreSql.FlexibleServers", ProviderConstants.DefaultProviderNamespace, Diagnostics);
_logFilesRestClient = new LogFilesRestOperations(Pipeline, Diagnostics.ApplicationId, Endpoint);
#if DEBUG
diff --git a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/PostgreSQLServerManagementRestOperations.cs b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/PostgreSQLManagementRestOperations.cs
similarity index 96%
rename from sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/PostgreSQLServerManagementRestOperations.cs
rename to sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/PostgreSQLManagementRestOperations.cs
index c91196cd5544..78d53c249cf9 100644
--- a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/PostgreSQLServerManagementRestOperations.cs
+++ b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/PostgreSqlFlexibleServers/Generated/RestOperations/PostgreSQLManagementRestOperations.cs
@@ -15,20 +15,20 @@
namespace Azure.ResourceManager.PostgreSql.FlexibleServers
{
- internal partial class PostgreSQLServerManagementRestOperations
+ internal partial class PostgreSQLManagementRestOperations
{
private readonly TelemetryDetails _userAgent;
private readonly HttpPipeline _pipeline;
private readonly Uri _endpoint;
private readonly string _apiVersion;
- /// Initializes a new instance of PostgreSQLServerManagementRestOperations.
+ /// Initializes a new instance of PostgreSQLManagementRestOperations.
/// The HTTP pipeline for sending and receiving REST requests and responses.
/// The application id to use for user agent.
/// server parameter.
/// Api Version.
/// or is null.
- public PostgreSQLServerManagementRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default)
+ public PostgreSQLManagementRestOperations(HttpPipeline pipeline, string applicationId, Uri endpoint = null, string apiVersion = default)
{
_pipeline = pipeline ?? throw new ArgumentNullException(nameof(pipeline));
_endpoint = endpoint ?? new Uri("https://management.azure.com");
diff --git a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/autorest.md b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/autorest.md
index 3d398b1e7e0c..f56cc9959559 100644
--- a/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/autorest.md
+++ b/sdk/postgresql/Azure.ResourceManager.PostgreSql/src/autorest.md
@@ -22,7 +22,7 @@ enable-bicep-serialization: true
``` yaml $(tag) == 'package-2020-01-01'
namespace: Azure.ResourceManager.PostgreSql
-require: https://github.com/Azure/azure-rest-api-specs/blob/eca38ee0caf445cb1e79c8e7bbaf9e1dca36479a/specification/postgresql/resource-manager/readme.md
+require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/postgresql/resource-manager/readme.md
output-folder: $(this-folder)/PostgreSql/Generated
sample-gen:
output-folder: $(this-folder)/../tests/Generated
@@ -159,7 +159,7 @@ directive:
``` yaml $(tag) == 'package-flexibleserver-2024-08-01'
namespace: Azure.ResourceManager.PostgreSql.FlexibleServers
-require: https://github.com/Azure/azure-rest-api-specs/blob/7e2cb423d45186cd1bff123f35e7d43bc4c0f268/specification/postgresql/resource-manager/readme.md
+require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/postgresql/resource-manager/readme.md
output-folder: $(this-folder)/PostgreSqlFlexibleServers/Generated
sample-gen:
output-folder: $(this-folder)/../samples/Generated
diff --git a/sdk/storage/ci.yml b/sdk/storage/ci.yml
index 2ca0501b60bd..4e749e6b85b1 100644
--- a/sdk/storage/ci.yml
+++ b/sdk/storage/ci.yml
@@ -12,6 +12,8 @@ trigger:
- sdk/storage/Azure.Storage.DataMovement/
- sdk/storage/Azure.Storage.DataMovement.Blobs/
- sdk/storage/Azure.Storage.DataMovement.Files/
+ exclude:
+ - sdk/storage/Azure.ResourceManager.Storage/
- sdk/storage/Azure.Storage.DataMovement.Blobs.Files.Shares/
exclude:
- sdk/storage/Azure.ResourceManager.Storage/