Skip to content

Commit 04a0a8f

Browse files
jruttleJonathan RuttleCopilot
authored
Add New-AzDenyAssignment and Remove-AzDenyAssignment cmdlets (#29340)
Co-authored-by: Jonathan Ruttle <jruttle@microsoft.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 3dcceb6 commit 04a0a8f

39 files changed

Lines changed: 7016 additions & 64 deletions

src/Resources/Authorization.Management.Sdk/Generated/AuthorizationManagementClient.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,9 @@ public AuthorizationManagementClient(System.Uri baseUri, Microsoft.Rest.ServiceC
294294
/// <param name='rootHandler'>
295295
/// Optional. The http client handler used to handle http transport.
296296
/// </param>
297+
/// <param name='handlers'>
298+
/// Optional. The delegating handlers to add to the http client pipeline.
299+
/// </param>
297300
/// <exception cref="System.ArgumentNullException">
298301
/// Thrown when a required parameter is null
299302
/// </exception>

src/Resources/Authorization.Management.Sdk/Generated/DenyAssignmentsOperations.cs

Lines changed: 473 additions & 32 deletions
Large diffs are not rendered by default.

src/Resources/Authorization.Management.Sdk/Generated/DenyAssignmentsOperationsExtensions.cs

Lines changed: 81 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ public static partial class DenyAssignmentsOperationsExtensions
154154
/// The operations group for this extension method.
155155
/// </param>
156156
/// <param name='scope'>
157-
/// The scope of the deny assignment.
157+
/// The scope at which the operation is performed.
158158
/// </param>
159159
/// <param name='denyAssignmentId'>
160160
/// The ID of the deny assignment to get.
@@ -171,7 +171,7 @@ public static DenyAssignment Get(this IDenyAssignmentsOperations operations, str
171171
/// The operations group for this extension method.
172172
/// </param>
173173
/// <param name='scope'>
174-
/// The scope of the deny assignment.
174+
/// The scope at which the operation is performed.
175175
/// </param>
176176
/// <param name='denyAssignmentId'>
177177
/// The ID of the deny assignment to get.
@@ -187,6 +187,83 @@ public static DenyAssignment Get(this IDenyAssignmentsOperations operations, str
187187
}
188188
}
189189
/// <summary>
190+
/// Create or update a deny assignment by scope and name.
191+
/// </summary>
192+
/// <param name='operations'>
193+
/// The operations group for this extension method.
194+
/// </param>
195+
/// <param name='scope'>
196+
/// The scope at which the operation is performed.
197+
/// </param>
198+
/// <param name='denyAssignmentId'>
199+
/// The ID of the deny assignment to create. A new GUID should be used for each
200+
/// new deny assignment.
201+
/// </param>
202+
public static DenyAssignment CreateOrUpdate(this IDenyAssignmentsOperations operations, string scope, string denyAssignmentId, DenyAssignment parameters)
203+
{
204+
return ((IDenyAssignmentsOperations)operations).CreateOrUpdateAsync(scope, denyAssignmentId, parameters).GetAwaiter().GetResult();
205+
}
206+
207+
/// <summary>
208+
/// Create or update a deny assignment by scope and name.
209+
/// </summary>
210+
/// <param name='operations'>
211+
/// The operations group for this extension method.
212+
/// </param>
213+
/// <param name='scope'>
214+
/// The scope at which the operation is performed.
215+
/// </param>
216+
/// <param name='denyAssignmentId'>
217+
/// The ID of the deny assignment to create. A new GUID should be used for each
218+
/// new deny assignment.
219+
/// </param>
220+
/// <param name='cancellationToken'>
221+
/// The cancellation token.
222+
/// </param>
223+
public static async System.Threading.Tasks.Task<DenyAssignment> CreateOrUpdateAsync(this IDenyAssignmentsOperations operations, string scope, string denyAssignmentId, DenyAssignment parameters, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
224+
{
225+
using (var _result = await operations.CreateOrUpdateWithHttpMessagesAsync(scope, denyAssignmentId, parameters, null, cancellationToken).ConfigureAwait(false))
226+
{
227+
return _result.Body;
228+
}
229+
}
230+
/// <summary>
231+
/// Delete a deny assignment by scope and name.
232+
/// </summary>
233+
/// <param name='operations'>
234+
/// The operations group for this extension method.
235+
/// </param>
236+
/// <param name='scope'>
237+
/// The scope at which the operation is performed.
238+
/// </param>
239+
/// <param name='denyAssignmentId'>
240+
/// The ID of the deny assignment to delete.
241+
/// </param>
242+
public static void Delete(this IDenyAssignmentsOperations operations, string scope, string denyAssignmentId)
243+
{
244+
((IDenyAssignmentsOperations)operations).DeleteAsync(scope, denyAssignmentId).GetAwaiter().GetResult();
245+
}
246+
247+
/// <summary>
248+
/// Delete a deny assignment by scope and name.
249+
/// </summary>
250+
/// <param name='operations'>
251+
/// The operations group for this extension method.
252+
/// </param>
253+
/// <param name='scope'>
254+
/// The scope at which the operation is performed.
255+
/// </param>
256+
/// <param name='denyAssignmentId'>
257+
/// The ID of the deny assignment to delete.
258+
/// </param>
259+
/// <param name='cancellationToken'>
260+
/// The cancellation token.
261+
/// </param>
262+
public static async System.Threading.Tasks.Task DeleteAsync(this IDenyAssignmentsOperations operations, string scope, string denyAssignmentId, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken))
263+
{
264+
(await operations.DeleteWithHttpMessagesAsync(scope, denyAssignmentId, null, cancellationToken).ConfigureAwait(false)).Dispose();
265+
}
266+
/// <summary>
190267
/// Gets a deny assignment by ID.
191268
/// </summary>
192269
/// <param name='operations'>
@@ -237,7 +314,7 @@ public static DenyAssignment GetById(this IDenyAssignmentsOperations operations,
237314
///
238315
/// </param>
239316
/// <param name='scope'>
240-
/// The scope of the deny assignments.
317+
/// The scope at which the operation is performed.
241318
/// </param>
242319
public static Microsoft.Rest.Azure.IPage<DenyAssignment> ListForScope(this IDenyAssignmentsOperations operations, string scope, Microsoft.Rest.Azure.OData.ODataQuery<DenyAssignmentFilter> odataQuery = default(Microsoft.Rest.Azure.OData.ODataQuery<DenyAssignmentFilter>))
243320
{
@@ -254,7 +331,7 @@ public static DenyAssignment GetById(this IDenyAssignmentsOperations operations,
254331
///
255332
/// </param>
256333
/// <param name='scope'>
257-
/// The scope of the deny assignments.
334+
/// The scope at which the operation is performed.
258335
/// </param>
259336
/// <param name='cancellationToken'>
260337
/// The cancellation token.

src/Resources/Authorization.Management.Sdk/Generated/IDenyAssignmentsOperations.cs

Lines changed: 55 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public partial interface IDenyAssignmentsOperations
107107
/// Get the specified deny assignment.
108108
/// </remarks>
109109
/// <param name='scope'>
110-
/// The scope of the deny assignment.
110+
/// The scope at which the operation is performed.
111111
/// </param>
112112
/// <param name='denyAssignmentId'>
113113
/// The ID of the deny assignment to get.
@@ -126,6 +126,59 @@ public partial interface IDenyAssignmentsOperations
126126
/// </exception>
127127
System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<DenyAssignment>> GetWithHttpMessagesAsync(string scope, string denyAssignmentId, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
128128

129+
/// <summary>
130+
/// Create or update a deny assignment by scope and name.
131+
/// </summary>
132+
/// <remarks>
133+
/// Create or update a deny assignment by scope and name.
134+
/// </remarks>
135+
/// <param name='scope'>
136+
/// The scope at which the operation is performed.
137+
/// </param>
138+
/// <param name='denyAssignmentId'>
139+
/// The ID of the deny assignment to create. A new GUID should be used for each
140+
/// new deny assignment.
141+
/// </param>
142+
/// <param name='parameters'>
143+
/// Parameters for the deny assignment.
144+
/// </param>
145+
/// <param name='customHeaders'>
146+
/// The headers that will be added to request.
147+
/// </param>
148+
/// <param name='cancellationToken'>
149+
/// The cancellation token.
150+
/// </param>
151+
/// <exception cref="Microsoft.Rest.Azure.CloudException">
152+
/// Thrown when the operation returned an invalid status code
153+
/// </exception>
154+
/// <exception cref="Microsoft.Rest.SerializationException">
155+
/// Thrown when unable to deserialize the response
156+
/// </exception>
157+
System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse<DenyAssignment>> CreateOrUpdateWithHttpMessagesAsync(string scope, string denyAssignmentId, DenyAssignment parameters, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
158+
159+
/// <summary>
160+
/// Delete a deny assignment by scope and name.
161+
/// </summary>
162+
/// <remarks>
163+
/// Delete a deny assignment by scope and name.
164+
/// </remarks>
165+
/// <param name='scope'>
166+
/// The scope at which the operation is performed.
167+
/// </param>
168+
/// <param name='denyAssignmentId'>
169+
/// The ID of the deny assignment to delete.
170+
/// </param>
171+
/// <param name='customHeaders'>
172+
/// The headers that will be added to request.
173+
/// </param>
174+
/// <param name='cancellationToken'>
175+
/// The cancellation token.
176+
/// </param>
177+
/// <exception cref="Microsoft.Rest.Azure.CloudException">
178+
/// Thrown when the operation returned an invalid status code
179+
/// </exception>
180+
System.Threading.Tasks.Task<Microsoft.Rest.Azure.AzureOperationResponse> DeleteWithHttpMessagesAsync(string scope, string denyAssignmentId, System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> customHeaders = null, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken));
181+
129182
/// <summary>
130183
/// Gets a deny assignment by ID.
131184
/// </summary>
@@ -163,7 +216,7 @@ public partial interface IDenyAssignmentsOperations
163216
///
164217
/// </param>
165218
/// <param name='scope'>
166-
/// The scope of the deny assignments.
219+
/// The scope at which the operation is performed.
167220
/// </param>
168221
/// <param name='customHeaders'>
169222
/// The headers that will be added to request.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
// Copyright (c) Microsoft Corporation. All rights reserved.
2+
// Licensed under the MIT License. See License.txt in the project root for license information.
3+
// Code generated by Microsoft (R) AutoRest Code Generator.
4+
// Changes may cause incorrect behavior and will be lost if the code is regenerated.
5+
6+
namespace Microsoft.Azure.Management.Authorization.Models
7+
{
8+
9+
/// <summary>
10+
/// Defines values for CreatedByType.
11+
/// </summary>
12+
13+
14+
public static class CreatedByType
15+
{
16+
public const string User = "User";
17+
public const string Application = "Application";
18+
public const string ManagedIdentity = "ManagedIdentity";
19+
public const string Key = "Key";
20+
}
21+
}

0 commit comments

Comments
 (0)