Skip to content

Commit

Permalink
Azure.Provisioning - Add WebPubSubService.AssignRole (#46015)
Browse files Browse the repository at this point in the history
  • Loading branch information
tg-msft authored Sep 18, 2024
1 parent 909e113 commit d542f3a
Show file tree
Hide file tree
Showing 7 changed files with 165 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ public enum PrivateLinkServiceConnectionStatus
public SignalRBuiltInRole(string value) { throw null; }
public static Azure.Provisioning.SignalR.SignalRBuiltInRole SignalRAccessKeyReader { get { throw null; } }
public static Azure.Provisioning.SignalR.SignalRBuiltInRole SignalRAppServer { get { throw null; } }
public static Azure.Provisioning.SignalR.SignalRBuiltInRole SignalRContributor { get { throw null; } }
public static Azure.Provisioning.SignalR.SignalRBuiltInRole SignalRRestApiOwner { get { throw null; } }
public static Azure.Provisioning.SignalR.SignalRBuiltInRole SignalRRestApiReader { get { throw null; } }
public static Azure.Provisioning.SignalR.SignalRBuiltInRole SignalRServiceOwner { get { throw null; } }
public static Azure.Provisioning.SignalR.SignalRBuiltInRole SignalRWebPubSubContributor { get { throw null; } }
public bool Equals(Azure.Provisioning.SignalR.SignalRBuiltInRole other) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public override bool Equals(object? obj) { throw null; }
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,27 @@ public enum UpstreamAuthType
None = 0,
ManagedIdentity = 1,
}
[System.Runtime.InteropServices.StructLayoutAttribute(System.Runtime.InteropServices.LayoutKind.Sequential)]
public readonly partial struct WebPubSubBuiltInRole : System.IEquatable<Azure.Provisioning.WebPubSub.WebPubSubBuiltInRole>
{
private readonly object _dummy;
private readonly int _dummyPrimitive;
public WebPubSubBuiltInRole(string value) { throw null; }
public static Azure.Provisioning.WebPubSub.WebPubSubBuiltInRole WebPubSubContributor { get { throw null; } }
public static Azure.Provisioning.WebPubSub.WebPubSubBuiltInRole WebPubSubServiceOwner { get { throw null; } }
public static Azure.Provisioning.WebPubSub.WebPubSubBuiltInRole WebPubSubServiceReader { get { throw null; } }
public bool Equals(Azure.Provisioning.WebPubSub.WebPubSubBuiltInRole other) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public override bool Equals(object? obj) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public static string GetBuiltInRoleName(Azure.Provisioning.WebPubSub.WebPubSubBuiltInRole value) { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
public override int GetHashCode() { throw null; }
public static bool operator ==(Azure.Provisioning.WebPubSub.WebPubSubBuiltInRole left, Azure.Provisioning.WebPubSub.WebPubSubBuiltInRole right) { throw null; }
public static implicit operator Azure.Provisioning.WebPubSub.WebPubSubBuiltInRole (string value) { throw null; }
public static bool operator !=(Azure.Provisioning.WebPubSub.WebPubSubBuiltInRole left, Azure.Provisioning.WebPubSub.WebPubSubBuiltInRole right) { throw null; }
public override string ToString() { throw null; }
}
public partial class WebPubSubEventHandler : Azure.Provisioning.Primitives.ProvisioningConstruct
{
public WebPubSubEventHandler() : base (default(Azure.Provisioning.ProvisioningContext)) { }
Expand Down Expand Up @@ -179,6 +200,8 @@ public partial class WebPubSubService : Azure.Provisioning.Primitives.Resource
public Azure.Provisioning.BicepValue<Azure.Provisioning.Resources.SystemData> SystemData { get { throw null; } }
public Azure.Provisioning.BicepDictionary<string> Tags { get { throw null; } set { } }
public Azure.Provisioning.BicepValue<string> Version { get { throw null; } }
public Azure.Provisioning.Authorization.RoleAssignment AssignRole(Azure.Provisioning.WebPubSub.WebPubSubBuiltInRole role, Azure.Provisioning.BicepValue<Azure.Provisioning.Authorization.RoleManagementPrincipalType> principalType, Azure.Provisioning.BicepValue<System.Guid> principalId) { throw null; }
public Azure.Provisioning.Authorization.RoleAssignment AssignRole(Azure.Provisioning.WebPubSub.WebPubSubBuiltInRole role, Azure.Provisioning.Roles.UserAssignedIdentity identity) { throw null; }
public static Azure.Provisioning.WebPubSub.WebPubSubService FromExisting(string resourceName, string? resourceVersion = null) { throw null; }
public Azure.Provisioning.WebPubSub.WebPubSubKeys GetKeys() { throw null; }
[System.ComponentModel.EditorBrowsableAttribute(System.ComponentModel.EditorBrowsableState.Never)]
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ protected override void Customize()
Roles.Add(new Role("SignalRRestApiOwner", "fd53cd77-2268-407a-8f46-7e7863d0f521", "Full access to Azure SignalR Service REST APIs"));
Roles.Add(new Role("SignalRRestApiReader", "ddde6b66-c0df-4114-a159-3618637b3035", "Read-only access to Azure SignalR Service REST APIs"));
Roles.Add(new Role("SignalRServiceOwner", "7e4f1700-ea5a-4f59-8f37-079cfe29dce3", "Full access to Azure SignalR Service REST APIs"));
Roles.Add(new Role("SignalRWebPubSubContributor", "8cf5e20a-e4b2-4e9d-b3a1-5ceb692c2761", "Create, Read, Update, and Delete SignalR service resources"));
Roles.Add(new Role("SignalRContributor", "8cf5e20a-e4b2-4e9d-b3a1-5ceb692c2761", "Create, Read, Update, and Delete SignalR service resources"));

// Assign Roles
CustomizeResource<SignalRResource>(r => r.GenerateRoleAssignment = true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,13 @@ protected override void Customize()

// Naming requirements
AddNameRequirements<WebPubSubResource>(min: 3, max: 63, lower: true, upper: true, digits: true, hyphen: true);

// Roles
Roles.Add(new Role("WebPubSubServiceReader", "bfb1c7d2-fb1a-466b-b2ba-aee63b92deaf", "Read-only access to Azure Web PubSub Service REST APIs"));
Roles.Add(new Role("WebPubSubServiceOwner", "12cf5a90-567b-43ae-8102-96cf46c7d9b4", "Full access to Azure Web PubSub Service REST APIs"));
Roles.Add(new Role("WebPubSubContributor", "8cf5e20a-e4b2-4e9d-b3a1-5ceb692c2761", "Create, Read, Update, and Delete Web PubSub service resources"));

// Assign Roles
CustomizeResource<WebPubSubResource>(r => r.GenerateRoleAssignment = true);
}
}

0 comments on commit d542f3a

Please sign in to comment.