diff --git a/sdk/authorization/Azure.ResourceManager.Authorization/api/Azure.ResourceManager.Authorization.netstandard2.0.cs b/sdk/authorization/Azure.ResourceManager.Authorization/api/Azure.ResourceManager.Authorization.netstandard2.0.cs index e16fd7cdf207..f2a740ae3046 100644 --- a/sdk/authorization/Azure.ResourceManager.Authorization/api/Azure.ResourceManager.Authorization.netstandard2.0.cs +++ b/sdk/authorization/Azure.ResourceManager.Authorization/api/Azure.ResourceManager.Authorization.netstandard2.0.cs @@ -158,10 +158,14 @@ public partial class AuthorizationRoleDefinitionData : Azure.ResourceManager.Mod { public AuthorizationRoleDefinitionData() { } public System.Collections.Generic.IList AssignableScopes { get { throw null; } } + public string CreatedBy { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } public string Description { get { throw null; } set { } } public System.Collections.Generic.IList Permissions { get { throw null; } } public string RoleName { get { throw null; } set { } } public Azure.ResourceManager.Authorization.Models.AuthorizationRoleType? RoleType { get { throw null; } set { } } + public string UpdatedBy { get { throw null; } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Authorization.AuthorizationRoleDefinitionData 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) { } @@ -206,6 +210,10 @@ protected DenyAssignmentCollection() { } public partial class DenyAssignmentData : Azure.ResourceManager.Models.ResourceData, System.ClientModel.Primitives.IJsonModel, System.ClientModel.Primitives.IPersistableModel { internal DenyAssignmentData() { } + public string Condition { get { throw null; } } + public string ConditionVersion { get { throw null; } } + public string CreatedBy { get { throw null; } } + public System.DateTimeOffset? CreatedOn { get { throw null; } } public string DenyAssignmentName { get { throw null; } } public string Description { get { throw null; } } public System.Collections.Generic.IReadOnlyList ExcludePrincipals { get { throw null; } } @@ -214,6 +222,8 @@ internal DenyAssignmentData() { } public System.Collections.Generic.IReadOnlyList Permissions { get { throw null; } } public System.Collections.Generic.IReadOnlyList Principals { get { throw null; } } public string Scope { get { throw null; } } + public string UpdatedBy { get { throw null; } } + public System.DateTimeOffset? UpdatedOn { get { throw null; } } protected override void JsonModelWriteCore(System.Text.Json.Utf8JsonWriter writer, System.ClientModel.Primitives.ModelReaderWriterOptions options) { } Azure.ResourceManager.Authorization.DenyAssignmentData 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) { } @@ -874,8 +884,12 @@ public static partial class ArmAuthorizationModelFactory public static Azure.ResourceManager.Authorization.Models.AuthorizationProviderOperationInfo AuthorizationProviderOperationInfo(string name = null, string displayName = null, string description = null, string origin = null, System.BinaryData properties = null, bool? isDataAction = default(bool?)) { throw null; } public static Azure.ResourceManager.Authorization.AuthorizationProviderOperationsMetadataData AuthorizationProviderOperationsMetadataData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string displayName = null, System.Collections.Generic.IEnumerable resourceTypes = null, System.Collections.Generic.IEnumerable operations = null) { throw null; } public static Azure.ResourceManager.Authorization.Models.AuthorizationProviderResourceType AuthorizationProviderResourceType(string name = null, string displayName = null, System.Collections.Generic.IEnumerable operations = null) { throw null; } - public static Azure.ResourceManager.Authorization.AuthorizationRoleDefinitionData AuthorizationRoleDefinitionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string roleName = null, string description = null, Azure.ResourceManager.Authorization.Models.AuthorizationRoleType? roleType = default(Azure.ResourceManager.Authorization.Models.AuthorizationRoleType?), System.Collections.Generic.IEnumerable permissions = null, System.Collections.Generic.IEnumerable assignableScopes = null) { throw null; } - public static Azure.ResourceManager.Authorization.DenyAssignmentData DenyAssignmentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string denyAssignmentName = null, string description = null, System.Collections.Generic.IEnumerable permissions = null, string scope = null, bool? isAppliedToChildScopes = default(bool?), System.Collections.Generic.IEnumerable principals = null, System.Collections.Generic.IEnumerable excludePrincipals = null, bool? isSystemProtected = default(bool?)) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.Authorization.AuthorizationRoleDefinitionData AuthorizationRoleDefinitionData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, string roleName, string description, Azure.ResourceManager.Authorization.Models.AuthorizationRoleType? roleType, System.Collections.Generic.IEnumerable permissions, System.Collections.Generic.IEnumerable assignableScopes) { throw null; } + public static Azure.ResourceManager.Authorization.AuthorizationRoleDefinitionData AuthorizationRoleDefinitionData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string roleName = null, string description = null, Azure.ResourceManager.Authorization.Models.AuthorizationRoleType? roleType = default(Azure.ResourceManager.Authorization.Models.AuthorizationRoleType?), System.Collections.Generic.IEnumerable permissions = null, System.Collections.Generic.IEnumerable assignableScopes = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?), string createdBy = null, string updatedBy = null) { throw null; } + [System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)] + public static Azure.ResourceManager.Authorization.DenyAssignmentData DenyAssignmentData(Azure.Core.ResourceIdentifier id, string name, Azure.Core.ResourceType resourceType, Azure.ResourceManager.Models.SystemData systemData, string denyAssignmentName, string description, System.Collections.Generic.IEnumerable permissions, string scope, bool? isAppliedToChildScopes, System.Collections.Generic.IEnumerable principals, System.Collections.Generic.IEnumerable excludePrincipals, bool? isSystemProtected) { throw null; } + public static Azure.ResourceManager.Authorization.DenyAssignmentData DenyAssignmentData(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, string denyAssignmentName = null, string description = null, System.Collections.Generic.IEnumerable permissions = null, string scope = null, bool? isAppliedToChildScopes = default(bool?), System.Collections.Generic.IEnumerable principals = null, System.Collections.Generic.IEnumerable excludePrincipals = null, bool? isSystemProtected = default(bool?), string condition = null, string conditionVersion = null, System.DateTimeOffset? createdOn = default(System.DateTimeOffset?), System.DateTimeOffset? updatedOn = default(System.DateTimeOffset?), string createdBy = null, string updatedBy = null) { throw null; } public static Azure.ResourceManager.Authorization.Models.DenyAssignmentPermission DenyAssignmentPermission(System.Collections.Generic.IEnumerable actions = null, System.Collections.Generic.IEnumerable notActions = null, System.Collections.Generic.IEnumerable dataActions = null, System.Collections.Generic.IEnumerable notDataActions = null, string condition = null, string conditionVersion = null) { throw null; } public static Azure.ResourceManager.Authorization.Models.EligibleChildResource EligibleChildResource(string id = null, string name = null, string resourceType = null) { throw null; } public static Azure.ResourceManager.Authorization.Models.PolicyAssignmentProperties PolicyAssignmentProperties(Azure.Core.ResourceIdentifier id = null, string name = null, Azure.Core.ResourceType resourceType = default(Azure.Core.ResourceType), Azure.ResourceManager.Models.SystemData systemData = null, Azure.Core.ResourceIdentifier policyId = null, Azure.ResourceManager.Authorization.Models.RoleManagementPrincipal lastModifiedBy = null, System.DateTimeOffset? lastModifiedOn = default(System.DateTimeOffset?), Azure.Core.ResourceIdentifier roleDefinitionId = null, string roleDefinitionDisplayName = null, Azure.ResourceManager.Authorization.Models.AuthorizationRoleType? roleType = default(Azure.ResourceManager.Authorization.Models.AuthorizationRoleType?), Azure.Core.ResourceIdentifier scopeId = null, string scopeDisplayName = null, Azure.ResourceManager.Authorization.Models.RoleManagementScopeType? scopeType = default(Azure.ResourceManager.Authorization.Models.RoleManagementScopeType?)) { throw null; } diff --git a/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/ArmAuthorizationModelFactory.cs b/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/ArmAuthorizationModelFactory.cs index 7314569da556..c57bdcf8dbef 100644 --- a/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/ArmAuthorizationModelFactory.cs +++ b/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/ArmAuthorizationModelFactory.cs @@ -7,6 +7,7 @@ using System; using System.Collections.Generic; +using System.ComponentModel; using System.Linq; using Azure.Core; using Azure.ResourceManager.Models; @@ -49,8 +50,14 @@ public static AuthorizationClassicAdministrator AuthorizationClassicAdministrato /// Array of principals to which the deny assignment applies. /// Array of principals to which the deny assignment does not apply. /// Specifies whether this deny assignment was created by Azure and cannot be edited or deleted. + /// The conditions on the deny assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'. + /// Version of the condition. + /// Time it was created. + /// Time it was updated. + /// Id of the user who created the assignment. + /// Id of the user who updated the assignment. /// A new instance for mocking. - public static DenyAssignmentData DenyAssignmentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string denyAssignmentName = null, string description = null, IEnumerable permissions = null, string scope = null, bool? isAppliedToChildScopes = null, IEnumerable principals = null, IEnumerable excludePrincipals = null, bool? isSystemProtected = null) + public static DenyAssignmentData DenyAssignmentData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string denyAssignmentName = null, string description = null, IEnumerable permissions = null, string scope = null, bool? isAppliedToChildScopes = null, IEnumerable principals = null, IEnumerable excludePrincipals = null, bool? isSystemProtected = null, string condition = null, string conditionVersion = null, DateTimeOffset? createdOn = null, DateTimeOffset? updatedOn = null, string createdBy = null, string updatedBy = null) { permissions ??= new List(); principals ??= new List(); @@ -69,6 +76,12 @@ public static DenyAssignmentData DenyAssignmentData(ResourceIdentifier id = null principals?.ToList(), excludePrincipals?.ToList(), isSystemProtected, + condition, + conditionVersion, + createdOn, + updatedOn, + createdBy, + updatedBy, serializedAdditionalRawData: null); } @@ -247,8 +260,12 @@ public static RoleAssignmentCreateOrUpdateContent RoleAssignmentCreateOrUpdateCo /// The role type. /// Role definition permissions. /// Role definition assignable scopes. + /// Time it was created. + /// Time it was updated. + /// Id of the user who created the assignment. + /// Id of the user who updated the assignment. /// A new instance for mocking. - public static AuthorizationRoleDefinitionData AuthorizationRoleDefinitionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string roleName = null, string description = null, AuthorizationRoleType? roleType = null, IEnumerable permissions = null, IEnumerable assignableScopes = null) + public static AuthorizationRoleDefinitionData AuthorizationRoleDefinitionData(ResourceIdentifier id = null, string name = null, ResourceType resourceType = default, SystemData systemData = null, string roleName = null, string description = null, AuthorizationRoleType? roleType = null, IEnumerable permissions = null, IEnumerable assignableScopes = null, DateTimeOffset? createdOn = null, DateTimeOffset? updatedOn = null, string createdBy = null, string updatedBy = null) { permissions ??= new List(); assignableScopes ??= new List(); @@ -263,6 +280,10 @@ public static AuthorizationRoleDefinitionData AuthorizationRoleDefinitionData(Re roleType, permissions?.ToList(), assignableScopes?.ToList(), + createdOn, + updatedOn, + createdBy, + updatedBy, serializedAdditionalRawData: null); } @@ -722,5 +743,42 @@ public static PolicyAssignmentProperties PolicyAssignmentProperties(ResourceIden scopeType, serializedAdditionalRawData: null); } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The display name of the deny assignment. + /// The description of the deny assignment. + /// An array of permissions that are denied by the deny assignment. + /// The deny assignment scope. + /// Determines if the deny assignment applies to child scopes. Default value is false. + /// Array of principals to which the deny assignment applies. + /// Array of principals to which the deny assignment does not apply. + /// Specifies whether this deny assignment was created by Azure and cannot be edited or deleted. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static DenyAssignmentData DenyAssignmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string denyAssignmentName, string description, IEnumerable permissions, string scope, bool? isAppliedToChildScopes, IEnumerable principals, IEnumerable excludePrincipals, bool? isSystemProtected) + { + return DenyAssignmentData(id: id, name: name, resourceType: resourceType, systemData: systemData, denyAssignmentName: denyAssignmentName, description: description, permissions: permissions, scope: scope, isAppliedToChildScopes: isAppliedToChildScopes, principals: principals, excludePrincipals: excludePrincipals, isSystemProtected: isSystemProtected, condition: default, conditionVersion: default, createdOn: default, updatedOn: default, createdBy: default, updatedBy: default); + } + + /// Initializes a new instance of . + /// The id. + /// The name. + /// The resourceType. + /// The systemData. + /// The role name. + /// The role definition description. + /// The role type. + /// Role definition permissions. + /// Role definition assignable scopes. + /// A new instance for mocking. + [EditorBrowsable(EditorBrowsableState.Never)] + public static AuthorizationRoleDefinitionData AuthorizationRoleDefinitionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string roleName, string description, AuthorizationRoleType? roleType, IEnumerable permissions, IEnumerable assignableScopes) + { + return AuthorizationRoleDefinitionData(id: id, name: name, resourceType: resourceType, systemData: systemData, roleName: roleName, description: description, roleType: roleType, permissions: permissions, assignableScopes: assignableScopes, createdOn: default, updatedOn: default, createdBy: default, updatedBy: default); + } } } diff --git a/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/AuthorizationRoleDefinitionData.Serialization.cs b/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/AuthorizationRoleDefinitionData.Serialization.cs index 1ea282e252ea..5f6153f9c594 100644 --- a/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/AuthorizationRoleDefinitionData.Serialization.cs +++ b/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/AuthorizationRoleDefinitionData.Serialization.cs @@ -76,6 +76,26 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri } writer.WriteEndArray(); } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("createdOn"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(UpdatedOn)) + { + writer.WritePropertyName("updatedOn"u8); + writer.WriteStringValue(UpdatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(CreatedBy)) + { + writer.WritePropertyName("createdBy"u8); + writer.WriteStringValue(CreatedBy); + } + if (options.Format != "W" && Optional.IsDefined(UpdatedBy)) + { + writer.WritePropertyName("updatedBy"u8); + writer.WriteStringValue(UpdatedBy); + } writer.WriteEndObject(); } @@ -108,6 +128,10 @@ internal static AuthorizationRoleDefinitionData DeserializeAuthorizationRoleDefi AuthorizationRoleType? type0 = default; IList permissions = default; IList assignableScopes = default; + DateTimeOffset? createdOn = default; + DateTimeOffset? updatedOn = default; + string createdBy = default; + string updatedBy = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -192,6 +216,34 @@ internal static AuthorizationRoleDefinitionData DeserializeAuthorizationRoleDefi assignableScopes = array; continue; } + if (property0.NameEquals("createdOn"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdOn = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("updatedOn"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedOn = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("createdBy"u8)) + { + createdBy = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("updatedBy"u8)) + { + updatedBy = property0.Value.GetString(); + continue; + } } continue; } @@ -211,6 +263,10 @@ internal static AuthorizationRoleDefinitionData DeserializeAuthorizationRoleDefi type0, permissions ?? new ChangeTrackingList(), assignableScopes ?? new ChangeTrackingList(), + createdOn, + updatedOn, + createdBy, + updatedBy, serializedAdditionalRawData); } @@ -400,6 +456,84 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CreatedOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" createdOn: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CreatedOn)) + { + builder.Append(" createdOn: "); + var formattedDateTimeString = TypeFormatters.ToString(CreatedOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UpdatedOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" updatedOn: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(UpdatedOn)) + { + builder.Append(" updatedOn: "); + var formattedDateTimeString = TypeFormatters.ToString(UpdatedOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CreatedBy), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" createdBy: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CreatedBy)) + { + builder.Append(" createdBy: "); + if (CreatedBy.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{CreatedBy}'''"); + } + else + { + builder.AppendLine($"'{CreatedBy}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UpdatedBy), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" updatedBy: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(UpdatedBy)) + { + builder.Append(" updatedBy: "); + if (UpdatedBy.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{UpdatedBy}'''"); + } + else + { + builder.AppendLine($"'{UpdatedBy}'"); + } + } + } + builder.AppendLine(" }"); builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); diff --git a/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/AuthorizationRoleDefinitionData.cs b/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/AuthorizationRoleDefinitionData.cs index 81876f19e5b3..0e848ccaa5b6 100644 --- a/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/AuthorizationRoleDefinitionData.cs +++ b/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/AuthorizationRoleDefinitionData.cs @@ -68,14 +68,22 @@ public AuthorizationRoleDefinitionData() /// The role type. /// Role definition permissions. /// Role definition assignable scopes. + /// Time it was created. + /// Time it was updated. + /// Id of the user who created the assignment. + /// Id of the user who updated the assignment. /// Keeps track of any properties unknown to the library. - internal AuthorizationRoleDefinitionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string roleName, string description, AuthorizationRoleType? roleType, IList permissions, IList assignableScopes, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal AuthorizationRoleDefinitionData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string roleName, string description, AuthorizationRoleType? roleType, IList permissions, IList assignableScopes, DateTimeOffset? createdOn, DateTimeOffset? updatedOn, string createdBy, string updatedBy, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { RoleName = roleName; Description = description; RoleType = roleType; Permissions = permissions; AssignableScopes = assignableScopes; + CreatedOn = createdOn; + UpdatedOn = updatedOn; + CreatedBy = createdBy; + UpdatedBy = updatedBy; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -94,5 +102,17 @@ internal AuthorizationRoleDefinitionData(ResourceIdentifier id, string name, Res /// Role definition assignable scopes. [WirePath("properties.assignableScopes")] public IList AssignableScopes { get; } + /// Time it was created. + [WirePath("properties.createdOn")] + public DateTimeOffset? CreatedOn { get; } + /// Time it was updated. + [WirePath("properties.updatedOn")] + public DateTimeOffset? UpdatedOn { get; } + /// Id of the user who created the assignment. + [WirePath("properties.createdBy")] + public string CreatedBy { get; } + /// Id of the user who updated the assignment. + [WirePath("properties.updatedBy")] + public string UpdatedBy { get; } } } diff --git a/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/DenyAssignmentData.Serialization.cs b/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/DenyAssignmentData.Serialization.cs index d5c86c48703c..b201af97e1f0 100644 --- a/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/DenyAssignmentData.Serialization.cs +++ b/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/DenyAssignmentData.Serialization.cs @@ -96,6 +96,36 @@ protected override void JsonModelWriteCore(Utf8JsonWriter writer, ModelReaderWri writer.WritePropertyName("isSystemProtected"u8); writer.WriteBooleanValue(IsSystemProtected.Value); } + if (Optional.IsDefined(Condition)) + { + writer.WritePropertyName("condition"u8); + writer.WriteStringValue(Condition); + } + if (Optional.IsDefined(ConditionVersion)) + { + writer.WritePropertyName("conditionVersion"u8); + writer.WriteStringValue(ConditionVersion); + } + if (options.Format != "W" && Optional.IsDefined(CreatedOn)) + { + writer.WritePropertyName("createdOn"u8); + writer.WriteStringValue(CreatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(UpdatedOn)) + { + writer.WritePropertyName("updatedOn"u8); + writer.WriteStringValue(UpdatedOn.Value, "O"); + } + if (options.Format != "W" && Optional.IsDefined(CreatedBy)) + { + writer.WritePropertyName("createdBy"u8); + writer.WriteStringValue(CreatedBy); + } + if (options.Format != "W" && Optional.IsDefined(UpdatedBy)) + { + writer.WritePropertyName("updatedBy"u8); + writer.WriteStringValue(UpdatedBy); + } writer.WriteEndObject(); } @@ -131,6 +161,12 @@ internal static DenyAssignmentData DeserializeDenyAssignmentData(JsonElement ele IReadOnlyList principals = default; IReadOnlyList excludePrincipals = default; bool? isSystemProtected = default; + string condition = default; + string conditionVersion = default; + DateTimeOffset? createdOn = default; + DateTimeOffset? updatedOn = default; + string createdBy = default; + string updatedBy = default; IDictionary serializedAdditionalRawData = default; Dictionary rawDataDictionary = new Dictionary(); foreach (var property in element.EnumerateObject()) @@ -243,6 +279,44 @@ internal static DenyAssignmentData DeserializeDenyAssignmentData(JsonElement ele isSystemProtected = property0.Value.GetBoolean(); continue; } + if (property0.NameEquals("condition"u8)) + { + condition = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("conditionVersion"u8)) + { + conditionVersion = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("createdOn"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + createdOn = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("updatedOn"u8)) + { + if (property0.Value.ValueKind == JsonValueKind.Null) + { + continue; + } + updatedOn = property0.Value.GetDateTimeOffset("O"); + continue; + } + if (property0.NameEquals("createdBy"u8)) + { + createdBy = property0.Value.GetString(); + continue; + } + if (property0.NameEquals("updatedBy"u8)) + { + updatedBy = property0.Value.GetString(); + continue; + } } continue; } @@ -265,6 +339,12 @@ internal static DenyAssignmentData DeserializeDenyAssignmentData(JsonElement ele principals ?? new ChangeTrackingList(), excludePrincipals ?? new ChangeTrackingList(), isSystemProtected, + condition, + conditionVersion, + createdOn, + updatedOn, + createdBy, + updatedBy, serializedAdditionalRawData); } @@ -504,6 +584,130 @@ private BinaryData SerializeBicep(ModelReaderWriterOptions options) } } + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(Condition), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" condition: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(Condition)) + { + builder.Append(" condition: "); + if (Condition.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{Condition}'''"); + } + else + { + builder.AppendLine($"'{Condition}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(ConditionVersion), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" conditionVersion: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(ConditionVersion)) + { + builder.Append(" conditionVersion: "); + if (ConditionVersion.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{ConditionVersion}'''"); + } + else + { + builder.AppendLine($"'{ConditionVersion}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CreatedOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" createdOn: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CreatedOn)) + { + builder.Append(" createdOn: "); + var formattedDateTimeString = TypeFormatters.ToString(CreatedOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UpdatedOn), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" updatedOn: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(UpdatedOn)) + { + builder.Append(" updatedOn: "); + var formattedDateTimeString = TypeFormatters.ToString(UpdatedOn.Value, "o"); + builder.AppendLine($"'{formattedDateTimeString}'"); + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(CreatedBy), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" createdBy: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(CreatedBy)) + { + builder.Append(" createdBy: "); + if (CreatedBy.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{CreatedBy}'''"); + } + else + { + builder.AppendLine($"'{CreatedBy}'"); + } + } + } + + hasPropertyOverride = hasObjectOverride && propertyOverrides.TryGetValue(nameof(UpdatedBy), out propertyOverride); + if (hasPropertyOverride) + { + builder.Append(" updatedBy: "); + builder.AppendLine(propertyOverride); + } + else + { + if (Optional.IsDefined(UpdatedBy)) + { + builder.Append(" updatedBy: "); + if (UpdatedBy.Contains(Environment.NewLine)) + { + builder.AppendLine("'''"); + builder.AppendLine($"{UpdatedBy}'''"); + } + else + { + builder.AppendLine($"'{UpdatedBy}'"); + } + } + } + builder.AppendLine(" }"); builder.AppendLine("}"); return BinaryData.FromString(builder.ToString()); diff --git a/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/DenyAssignmentData.cs b/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/DenyAssignmentData.cs index ca139f54c98b..e5737874d5c1 100644 --- a/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/DenyAssignmentData.cs +++ b/sdk/authorization/Azure.ResourceManager.Authorization/src/Generated/DenyAssignmentData.cs @@ -72,8 +72,14 @@ internal DenyAssignmentData() /// Array of principals to which the deny assignment applies. /// Array of principals to which the deny assignment does not apply. /// Specifies whether this deny assignment was created by Azure and cannot be edited or deleted. + /// The conditions on the deny assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'. + /// Version of the condition. + /// Time it was created. + /// Time it was updated. + /// Id of the user who created the assignment. + /// Id of the user who updated the assignment. /// Keeps track of any properties unknown to the library. - internal DenyAssignmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string denyAssignmentName, string description, IReadOnlyList permissions, string scope, bool? isAppliedToChildScopes, IReadOnlyList principals, IReadOnlyList excludePrincipals, bool? isSystemProtected, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) + internal DenyAssignmentData(ResourceIdentifier id, string name, ResourceType resourceType, SystemData systemData, string denyAssignmentName, string description, IReadOnlyList permissions, string scope, bool? isAppliedToChildScopes, IReadOnlyList principals, IReadOnlyList excludePrincipals, bool? isSystemProtected, string condition, string conditionVersion, DateTimeOffset? createdOn, DateTimeOffset? updatedOn, string createdBy, string updatedBy, IDictionary serializedAdditionalRawData) : base(id, name, resourceType, systemData) { DenyAssignmentName = denyAssignmentName; Description = description; @@ -83,6 +89,12 @@ internal DenyAssignmentData(ResourceIdentifier id, string name, ResourceType res Principals = principals; ExcludePrincipals = excludePrincipals; IsSystemProtected = isSystemProtected; + Condition = condition; + ConditionVersion = conditionVersion; + CreatedOn = createdOn; + UpdatedOn = updatedOn; + CreatedBy = createdBy; + UpdatedBy = updatedBy; _serializedAdditionalRawData = serializedAdditionalRawData; } @@ -110,5 +122,23 @@ internal DenyAssignmentData(ResourceIdentifier id, string name, ResourceType res /// Specifies whether this deny assignment was created by Azure and cannot be edited or deleted. [WirePath("properties.isSystemProtected")] public bool? IsSystemProtected { get; } + /// The conditions on the deny assignment. This limits the resources it can be assigned to. e.g.: @Resource[Microsoft.Storage/storageAccounts/blobServices/containers:ContainerName] StringEqualsIgnoreCase 'foo_storage_container'. + [WirePath("properties.condition")] + public string Condition { get; } + /// Version of the condition. + [WirePath("properties.conditionVersion")] + public string ConditionVersion { get; } + /// Time it was created. + [WirePath("properties.createdOn")] + public DateTimeOffset? CreatedOn { get; } + /// Time it was updated. + [WirePath("properties.updatedOn")] + public DateTimeOffset? UpdatedOn { get; } + /// Id of the user who created the assignment. + [WirePath("properties.createdBy")] + public string CreatedBy { get; } + /// Id of the user who updated the assignment. + [WirePath("properties.updatedBy")] + public string UpdatedBy { get; } } } diff --git a/sdk/authorization/Azure.ResourceManager.Authorization/src/autorest.md b/sdk/authorization/Azure.ResourceManager.Authorization/src/autorest.md index 70c997b1e27b..5c90b4c3f323 100644 --- a/sdk/authorization/Azure.ResourceManager.Authorization/src/autorest.md +++ b/sdk/authorization/Azure.ResourceManager.Authorization/src/autorest.md @@ -8,7 +8,7 @@ azure-arm: true csharp: true library-name: Authorization namespace: Azure.ResourceManager.Authorization -require: https://github.com/Azure/azure-rest-api-specs/blob/a436672b07fb1fe276c203b086b3f0e0d0c4aa24/specification/authorization/resource-manager/readme.md +require: /mnt/vss/_work/1/s/azure-rest-api-specs/specification/authorization/resource-manager/readme.md tag: package-2022-04-01 output-folder: Generated/ clear-output-folder: true