< Summary

Class:Azure.ResourceManager.Resources.ManagementLocksOperations
Assembly:Azure.ResourceManager.Resources
File(s):C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\ManagementLocksOperations.cs
Covered lines:0
Uncovered lines:340
Coverable lines:340
Total lines:902
Line coverage:0% (0 of 340)
Covered branches:0
Total branches:28
Branch coverage:0% (0 of 28)

Metrics

MethodCyclomatic complexity Line coverage Branch coverage
get_RestClient()-0%100%
.ctor()-0%100%
.ctor(...)-0%100%
CreateOrUpdateAtResourceGroupLevelAsync()-0%100%
CreateOrUpdateAtResourceGroupLevel(...)-0%100%
DeleteAtResourceGroupLevelAsync()-0%100%
DeleteAtResourceGroupLevel(...)-0%100%
GetAtResourceGroupLevelAsync()-0%100%
GetAtResourceGroupLevel(...)-0%100%
CreateOrUpdateByScopeAsync()-0%100%
CreateOrUpdateByScope(...)-0%100%
DeleteByScopeAsync()-0%100%
DeleteByScope(...)-0%100%
GetByScopeAsync()-0%100%
GetByScope(...)-0%100%
CreateOrUpdateAtResourceLevelAsync()-0%100%
CreateOrUpdateAtResourceLevel(...)-0%100%
DeleteAtResourceLevelAsync()-0%100%
DeleteAtResourceLevel(...)-0%100%
GetAtResourceLevelAsync()-0%100%
GetAtResourceLevel(...)-0%100%
CreateOrUpdateAtSubscriptionLevelAsync()-0%100%
CreateOrUpdateAtSubscriptionLevel(...)-0%100%
DeleteAtSubscriptionLevelAsync()-0%100%
DeleteAtSubscriptionLevel(...)-0%100%
GetAtSubscriptionLevelAsync()-0%100%
GetAtSubscriptionLevel(...)-0%100%
ListAtResourceGroupLevelAsync(...)-0%0%
<ListAtResourceGroupLevelAsync()-0%100%
<ListAtResourceGroupLevelAsync()-0%100%
ListAtResourceGroupLevel(...)-0%0%
ListAtResourceLevelAsync(...)-0%0%
<ListAtResourceLevelAsync()-0%100%
<ListAtResourceLevelAsync()-0%100%
ListAtResourceLevel(...)-0%0%
<ListAtSubscriptionLevelAsync()-0%100%
<ListAtSubscriptionLevelAsync()-0%100%
ListAtSubscriptionLevelAsync(...)-0%100%
ListAtSubscriptionLevel(...)-0%100%
ListByScopeAsync(...)-0%0%
<ListByScopeAsync()-0%100%
<ListByScopeAsync()-0%100%
ListByScope(...)-0%0%

File(s)

C:\Git\azure-sdk-for-net\sdk\resources\Azure.ResourceManager.Resources\src\Generated\ManagementLocksOperations.cs

#LineLine coverage
 1// Copyright (c) Microsoft Corporation. All rights reserved.
 2// Licensed under the MIT License.
 3
 4// <auto-generated/>
 5
 6#nullable disable
 7
 8using System;
 9using System.Threading;
 10using System.Threading.Tasks;
 11using Azure;
 12using Azure.Core;
 13using Azure.Core.Pipeline;
 14using Azure.ResourceManager.Resources.Models;
 15
 16namespace Azure.ResourceManager.Resources
 17{
 18    /// <summary> The ManagementLocks service client. </summary>
 19    public partial class ManagementLocksOperations
 20    {
 21        private readonly ClientDiagnostics _clientDiagnostics;
 22        private readonly HttpPipeline _pipeline;
 023        internal ManagementLocksRestOperations RestClient { get; }
 24        /// <summary> Initializes a new instance of ManagementLocksOperations for mocking. </summary>
 025        protected ManagementLocksOperations()
 26        {
 027        }
 28        /// <summary> Initializes a new instance of ManagementLocksOperations. </summary>
 29        /// <param name="clientDiagnostics"> The handler for diagnostic messaging in the client. </param>
 30        /// <param name="pipeline"> The HTTP pipeline for sending and receiving REST requests and responses. </param>
 31        /// <param name="subscriptionId"> The ID of the target subscription. </param>
 32        /// <param name="endpoint"> server parameter. </param>
 033        internal ManagementLocksOperations(ClientDiagnostics clientDiagnostics, HttpPipeline pipeline, string subscripti
 34        {
 035            RestClient = new ManagementLocksRestOperations(clientDiagnostics, pipeline, subscriptionId, endpoint);
 036            _clientDiagnostics = clientDiagnostics;
 037            _pipeline = pipeline;
 038        }
 39
 40        /// <summary> When you apply a lock at a parent scope, all child resources inherit the same lock. To create mana
 41        /// <param name="resourceGroupName"> The name of the resource group to lock. </param>
 42        /// <param name="lockName"> The lock name. The lock name can be a maximum of 260 characters. It cannot contain &
 43        /// <param name="parameters"> The management lock parameters. </param>
 44        /// <param name="cancellationToken"> The cancellation token to use. </param>
 45        public virtual async Task<Response<ManagementLockObject>> CreateOrUpdateAtResourceGroupLevelAsync(string resourc
 46        {
 047            using var scope = _clientDiagnostics.CreateScope("ManagementLocksOperations.CreateOrUpdateAtResourceGroupLev
 048            scope.Start();
 49            try
 50            {
 051                return await RestClient.CreateOrUpdateAtResourceGroupLevelAsync(resourceGroupName, lockName, parameters,
 52            }
 053            catch (Exception e)
 54            {
 055                scope.Failed(e);
 056                throw;
 57            }
 058        }
 59
 60        /// <summary> When you apply a lock at a parent scope, all child resources inherit the same lock. To create mana
 61        /// <param name="resourceGroupName"> The name of the resource group to lock. </param>
 62        /// <param name="lockName"> The lock name. The lock name can be a maximum of 260 characters. It cannot contain &
 63        /// <param name="parameters"> The management lock parameters. </param>
 64        /// <param name="cancellationToken"> The cancellation token to use. </param>
 65        public virtual Response<ManagementLockObject> CreateOrUpdateAtResourceGroupLevel(string resourceGroupName, strin
 66        {
 067            using var scope = _clientDiagnostics.CreateScope("ManagementLocksOperations.CreateOrUpdateAtResourceGroupLev
 068            scope.Start();
 69            try
 70            {
 071                return RestClient.CreateOrUpdateAtResourceGroupLevel(resourceGroupName, lockName, parameters, cancellati
 72            }
 073            catch (Exception e)
 74            {
 075                scope.Failed(e);
 076                throw;
 77            }
 078        }
 79
 80        /// <summary> To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authori
 81        /// <param name="resourceGroupName"> The name of the resource group containing the lock. </param>
 82        /// <param name="lockName"> The name of lock to delete. </param>
 83        /// <param name="cancellationToken"> The cancellation token to use. </param>
 84        public virtual async Task<Response> DeleteAtResourceGroupLevelAsync(string resourceGroupName, string lockName, C
 85        {
 086            using var scope = _clientDiagnostics.CreateScope("ManagementLocksOperations.DeleteAtResourceGroupLevel");
 087            scope.Start();
 88            try
 89            {
 090                return await RestClient.DeleteAtResourceGroupLevelAsync(resourceGroupName, lockName, cancellationToken).
 91            }
 092            catch (Exception e)
 93            {
 094                scope.Failed(e);
 095                throw;
 96            }
 097        }
 98
 99        /// <summary> To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authori
 100        /// <param name="resourceGroupName"> The name of the resource group containing the lock. </param>
 101        /// <param name="lockName"> The name of lock to delete. </param>
 102        /// <param name="cancellationToken"> The cancellation token to use. </param>
 103        public virtual Response DeleteAtResourceGroupLevel(string resourceGroupName, string lockName, CancellationToken 
 104        {
 0105            using var scope = _clientDiagnostics.CreateScope("ManagementLocksOperations.DeleteAtResourceGroupLevel");
 0106            scope.Start();
 107            try
 108            {
 0109                return RestClient.DeleteAtResourceGroupLevel(resourceGroupName, lockName, cancellationToken);
 110            }
 0111            catch (Exception e)
 112            {
 0113                scope.Failed(e);
 0114                throw;
 115            }
 0116        }
 117
 118        /// <summary> Gets a management lock at the resource group level. </summary>
 119        /// <param name="resourceGroupName"> The name of the locked resource group. </param>
 120        /// <param name="lockName"> The name of the lock to get. </param>
 121        /// <param name="cancellationToken"> The cancellation token to use. </param>
 122        public virtual async Task<Response<ManagementLockObject>> GetAtResourceGroupLevelAsync(string resourceGroupName,
 123        {
 0124            using var scope = _clientDiagnostics.CreateScope("ManagementLocksOperations.GetAtResourceGroupLevel");
 0125            scope.Start();
 126            try
 127            {
 0128                return await RestClient.GetAtResourceGroupLevelAsync(resourceGroupName, lockName, cancellationToken).Con
 129            }
 0130            catch (Exception e)
 131            {
 0132                scope.Failed(e);
 0133                throw;
 134            }
 0135        }
 136
 137        /// <summary> Gets a management lock at the resource group level. </summary>
 138        /// <param name="resourceGroupName"> The name of the locked resource group. </param>
 139        /// <param name="lockName"> The name of the lock to get. </param>
 140        /// <param name="cancellationToken"> The cancellation token to use. </param>
 141        public virtual Response<ManagementLockObject> GetAtResourceGroupLevel(string resourceGroupName, string lockName,
 142        {
 0143            using var scope = _clientDiagnostics.CreateScope("ManagementLocksOperations.GetAtResourceGroupLevel");
 0144            scope.Start();
 145            try
 146            {
 0147                return RestClient.GetAtResourceGroupLevel(resourceGroupName, lockName, cancellationToken);
 148            }
 0149            catch (Exception e)
 150            {
 0151                scope.Failed(e);
 0152                throw;
 153            }
 0154        }
 155
 156        /// <summary> Create or update a management lock by scope. </summary>
 157        /// <param name="scope"> The scope for the lock. When providing a scope for the assignment, use &apos;/subscript
 158        /// <param name="lockName"> The name of lock. </param>
 159        /// <param name="parameters"> Create or update management lock parameters. </param>
 160        /// <param name="cancellationToken"> The cancellation token to use. </param>
 161        public virtual async Task<Response<ManagementLockObject>> CreateOrUpdateByScopeAsync(string scope, string lockNa
 162        {
 0163            using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.CreateOrUpdateByScope");
 0164            scope0.Start();
 165            try
 166            {
 0167                return await RestClient.CreateOrUpdateByScopeAsync(scope, lockName, parameters, cancellationToken).Confi
 168            }
 0169            catch (Exception e)
 170            {
 0171                scope0.Failed(e);
 0172                throw;
 173            }
 0174        }
 175
 176        /// <summary> Create or update a management lock by scope. </summary>
 177        /// <param name="scope"> The scope for the lock. When providing a scope for the assignment, use &apos;/subscript
 178        /// <param name="lockName"> The name of lock. </param>
 179        /// <param name="parameters"> Create or update management lock parameters. </param>
 180        /// <param name="cancellationToken"> The cancellation token to use. </param>
 181        public virtual Response<ManagementLockObject> CreateOrUpdateByScope(string scope, string lockName, ManagementLoc
 182        {
 0183            using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.CreateOrUpdateByScope");
 0184            scope0.Start();
 185            try
 186            {
 0187                return RestClient.CreateOrUpdateByScope(scope, lockName, parameters, cancellationToken);
 188            }
 0189            catch (Exception e)
 190            {
 0191                scope0.Failed(e);
 0192                throw;
 193            }
 0194        }
 195
 196        /// <summary> Delete a management lock by scope. </summary>
 197        /// <param name="scope"> The scope for the lock. </param>
 198        /// <param name="lockName"> The name of lock. </param>
 199        /// <param name="cancellationToken"> The cancellation token to use. </param>
 200        public virtual async Task<Response> DeleteByScopeAsync(string scope, string lockName, CancellationToken cancella
 201        {
 0202            using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.DeleteByScope");
 0203            scope0.Start();
 204            try
 205            {
 0206                return await RestClient.DeleteByScopeAsync(scope, lockName, cancellationToken).ConfigureAwait(false);
 207            }
 0208            catch (Exception e)
 209            {
 0210                scope0.Failed(e);
 0211                throw;
 212            }
 0213        }
 214
 215        /// <summary> Delete a management lock by scope. </summary>
 216        /// <param name="scope"> The scope for the lock. </param>
 217        /// <param name="lockName"> The name of lock. </param>
 218        /// <param name="cancellationToken"> The cancellation token to use. </param>
 219        public virtual Response DeleteByScope(string scope, string lockName, CancellationToken cancellationToken = defau
 220        {
 0221            using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.DeleteByScope");
 0222            scope0.Start();
 223            try
 224            {
 0225                return RestClient.DeleteByScope(scope, lockName, cancellationToken);
 226            }
 0227            catch (Exception e)
 228            {
 0229                scope0.Failed(e);
 0230                throw;
 231            }
 0232        }
 233
 234        /// <summary> Get a management lock by scope. </summary>
 235        /// <param name="scope"> The scope for the lock. </param>
 236        /// <param name="lockName"> The name of lock. </param>
 237        /// <param name="cancellationToken"> The cancellation token to use. </param>
 238        public virtual async Task<Response<ManagementLockObject>> GetByScopeAsync(string scope, string lockName, Cancell
 239        {
 0240            using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.GetByScope");
 0241            scope0.Start();
 242            try
 243            {
 0244                return await RestClient.GetByScopeAsync(scope, lockName, cancellationToken).ConfigureAwait(false);
 245            }
 0246            catch (Exception e)
 247            {
 0248                scope0.Failed(e);
 0249                throw;
 250            }
 0251        }
 252
 253        /// <summary> Get a management lock by scope. </summary>
 254        /// <param name="scope"> The scope for the lock. </param>
 255        /// <param name="lockName"> The name of lock. </param>
 256        /// <param name="cancellationToken"> The cancellation token to use. </param>
 257        public virtual Response<ManagementLockObject> GetByScope(string scope, string lockName, CancellationToken cancel
 258        {
 0259            using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.GetByScope");
 0260            scope0.Start();
 261            try
 262            {
 0263                return RestClient.GetByScope(scope, lockName, cancellationToken);
 264            }
 0265            catch (Exception e)
 266            {
 0267                scope0.Failed(e);
 0268                throw;
 269            }
 0270        }
 271
 272        /// <summary> When you apply a lock at a parent scope, all child resources inherit the same lock. To create mana
 273        /// <param name="resourceGroupName"> The name of the resource group containing the resource to lock. </param>
 274        /// <param name="resourceProviderNamespace"> The resource provider namespace of the resource to lock. </param>
 275        /// <param name="parentResourcePath"> The parent resource identity. </param>
 276        /// <param name="resourceType"> The resource type of the resource to lock. </param>
 277        /// <param name="resourceName"> The name of the resource to lock. </param>
 278        /// <param name="lockName"> The name of lock. The lock name can be a maximum of 260 characters. It cannot contai
 279        /// <param name="parameters"> Parameters for creating or updating a  management lock. </param>
 280        /// <param name="cancellationToken"> The cancellation token to use. </param>
 281        public virtual async Task<Response<ManagementLockObject>> CreateOrUpdateAtResourceLevelAsync(string resourceGrou
 282        {
 0283            using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.CreateOrUpdateAtResourceLevel")
 0284            scope0.Start();
 285            try
 286            {
 0287                return await RestClient.CreateOrUpdateAtResourceLevelAsync(resourceGroupName, resourceProviderNamespace,
 288            }
 0289            catch (Exception e)
 290            {
 0291                scope0.Failed(e);
 0292                throw;
 293            }
 0294        }
 295
 296        /// <summary> When you apply a lock at a parent scope, all child resources inherit the same lock. To create mana
 297        /// <param name="resourceGroupName"> The name of the resource group containing the resource to lock. </param>
 298        /// <param name="resourceProviderNamespace"> The resource provider namespace of the resource to lock. </param>
 299        /// <param name="parentResourcePath"> The parent resource identity. </param>
 300        /// <param name="resourceType"> The resource type of the resource to lock. </param>
 301        /// <param name="resourceName"> The name of the resource to lock. </param>
 302        /// <param name="lockName"> The name of lock. The lock name can be a maximum of 260 characters. It cannot contai
 303        /// <param name="parameters"> Parameters for creating or updating a  management lock. </param>
 304        /// <param name="cancellationToken"> The cancellation token to use. </param>
 305        public virtual Response<ManagementLockObject> CreateOrUpdateAtResourceLevel(string resourceGroupName, string res
 306        {
 0307            using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.CreateOrUpdateAtResourceLevel")
 0308            scope0.Start();
 309            try
 310            {
 0311                return RestClient.CreateOrUpdateAtResourceLevel(resourceGroupName, resourceProviderNamespace, parentReso
 312            }
 0313            catch (Exception e)
 314            {
 0315                scope0.Failed(e);
 0316                throw;
 317            }
 0318        }
 319
 320        /// <summary> To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authori
 321        /// <param name="resourceGroupName"> The name of the resource group containing the resource with the lock to del
 322        /// <param name="resourceProviderNamespace"> The resource provider namespace of the resource with the lock to de
 323        /// <param name="parentResourcePath"> The parent resource identity. </param>
 324        /// <param name="resourceType"> The resource type of the resource with the lock to delete. </param>
 325        /// <param name="resourceName"> The name of the resource with the lock to delete. </param>
 326        /// <param name="lockName"> The name of the lock to delete. </param>
 327        /// <param name="cancellationToken"> The cancellation token to use. </param>
 328        public virtual async Task<Response> DeleteAtResourceLevelAsync(string resourceGroupName, string resourceProvider
 329        {
 0330            using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.DeleteAtResourceLevel");
 0331            scope0.Start();
 332            try
 333            {
 0334                return await RestClient.DeleteAtResourceLevelAsync(resourceGroupName, resourceProviderNamespace, parentR
 335            }
 0336            catch (Exception e)
 337            {
 0338                scope0.Failed(e);
 0339                throw;
 340            }
 0341        }
 342
 343        /// <summary> To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authori
 344        /// <param name="resourceGroupName"> The name of the resource group containing the resource with the lock to del
 345        /// <param name="resourceProviderNamespace"> The resource provider namespace of the resource with the lock to de
 346        /// <param name="parentResourcePath"> The parent resource identity. </param>
 347        /// <param name="resourceType"> The resource type of the resource with the lock to delete. </param>
 348        /// <param name="resourceName"> The name of the resource with the lock to delete. </param>
 349        /// <param name="lockName"> The name of the lock to delete. </param>
 350        /// <param name="cancellationToken"> The cancellation token to use. </param>
 351        public virtual Response DeleteAtResourceLevel(string resourceGroupName, string resourceProviderNamespace, string
 352        {
 0353            using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.DeleteAtResourceLevel");
 0354            scope0.Start();
 355            try
 356            {
 0357                return RestClient.DeleteAtResourceLevel(resourceGroupName, resourceProviderNamespace, parentResourcePath
 358            }
 0359            catch (Exception e)
 360            {
 0361                scope0.Failed(e);
 0362                throw;
 363            }
 0364        }
 365
 366        /// <summary> Get the management lock of a resource or any level below resource. </summary>
 367        /// <param name="resourceGroupName"> The name of the resource group. </param>
 368        /// <param name="resourceProviderNamespace"> The namespace of the resource provider. </param>
 369        /// <param name="parentResourcePath"> An extra path parameter needed in some services, like SQL Databases. </par
 370        /// <param name="resourceType"> The type of the resource. </param>
 371        /// <param name="resourceName"> The name of the resource. </param>
 372        /// <param name="lockName"> The name of lock. </param>
 373        /// <param name="cancellationToken"> The cancellation token to use. </param>
 374        public virtual async Task<Response<ManagementLockObject>> GetAtResourceLevelAsync(string resourceGroupName, stri
 375        {
 0376            using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.GetAtResourceLevel");
 0377            scope0.Start();
 378            try
 379            {
 0380                return await RestClient.GetAtResourceLevelAsync(resourceGroupName, resourceProviderNamespace, parentReso
 381            }
 0382            catch (Exception e)
 383            {
 0384                scope0.Failed(e);
 0385                throw;
 386            }
 0387        }
 388
 389        /// <summary> Get the management lock of a resource or any level below resource. </summary>
 390        /// <param name="resourceGroupName"> The name of the resource group. </param>
 391        /// <param name="resourceProviderNamespace"> The namespace of the resource provider. </param>
 392        /// <param name="parentResourcePath"> An extra path parameter needed in some services, like SQL Databases. </par
 393        /// <param name="resourceType"> The type of the resource. </param>
 394        /// <param name="resourceName"> The name of the resource. </param>
 395        /// <param name="lockName"> The name of lock. </param>
 396        /// <param name="cancellationToken"> The cancellation token to use. </param>
 397        public virtual Response<ManagementLockObject> GetAtResourceLevel(string resourceGroupName, string resourceProvid
 398        {
 0399            using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.GetAtResourceLevel");
 0400            scope0.Start();
 401            try
 402            {
 0403                return RestClient.GetAtResourceLevel(resourceGroupName, resourceProviderNamespace, parentResourcePath, r
 404            }
 0405            catch (Exception e)
 406            {
 0407                scope0.Failed(e);
 0408                throw;
 409            }
 0410        }
 411
 412        /// <summary> When you apply a lock at a parent scope, all child resources inherit the same lock. To create mana
 413        /// <param name="lockName"> The name of lock. The lock name can be a maximum of 260 characters. It cannot contai
 414        /// <param name="parameters"> The management lock parameters. </param>
 415        /// <param name="cancellationToken"> The cancellation token to use. </param>
 416        public virtual async Task<Response<ManagementLockObject>> CreateOrUpdateAtSubscriptionLevelAsync(string lockName
 417        {
 0418            using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.CreateOrUpdateAtSubscriptionLev
 0419            scope0.Start();
 420            try
 421            {
 0422                return await RestClient.CreateOrUpdateAtSubscriptionLevelAsync(lockName, parameters, cancellationToken).
 423            }
 0424            catch (Exception e)
 425            {
 0426                scope0.Failed(e);
 0427                throw;
 428            }
 0429        }
 430
 431        /// <summary> When you apply a lock at a parent scope, all child resources inherit the same lock. To create mana
 432        /// <param name="lockName"> The name of lock. The lock name can be a maximum of 260 characters. It cannot contai
 433        /// <param name="parameters"> The management lock parameters. </param>
 434        /// <param name="cancellationToken"> The cancellation token to use. </param>
 435        public virtual Response<ManagementLockObject> CreateOrUpdateAtSubscriptionLevel(string lockName, ManagementLockO
 436        {
 0437            using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.CreateOrUpdateAtSubscriptionLev
 0438            scope0.Start();
 439            try
 440            {
 0441                return RestClient.CreateOrUpdateAtSubscriptionLevel(lockName, parameters, cancellationToken);
 442            }
 0443            catch (Exception e)
 444            {
 0445                scope0.Failed(e);
 0446                throw;
 447            }
 0448        }
 449
 450        /// <summary> To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authori
 451        /// <param name="lockName"> The name of lock to delete. </param>
 452        /// <param name="cancellationToken"> The cancellation token to use. </param>
 453        public virtual async Task<Response> DeleteAtSubscriptionLevelAsync(string lockName, CancellationToken cancellati
 454        {
 0455            using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.DeleteAtSubscriptionLevel");
 0456            scope0.Start();
 457            try
 458            {
 0459                return await RestClient.DeleteAtSubscriptionLevelAsync(lockName, cancellationToken).ConfigureAwait(false
 460            }
 0461            catch (Exception e)
 462            {
 0463                scope0.Failed(e);
 0464                throw;
 465            }
 0466        }
 467
 468        /// <summary> To delete management locks, you must have access to Microsoft.Authorization/* or Microsoft.Authori
 469        /// <param name="lockName"> The name of lock to delete. </param>
 470        /// <param name="cancellationToken"> The cancellation token to use. </param>
 471        public virtual Response DeleteAtSubscriptionLevel(string lockName, CancellationToken cancellationToken = default
 472        {
 0473            using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.DeleteAtSubscriptionLevel");
 0474            scope0.Start();
 475            try
 476            {
 0477                return RestClient.DeleteAtSubscriptionLevel(lockName, cancellationToken);
 478            }
 0479            catch (Exception e)
 480            {
 0481                scope0.Failed(e);
 0482                throw;
 483            }
 0484        }
 485
 486        /// <summary> Gets a management lock at the subscription level. </summary>
 487        /// <param name="lockName"> The name of the lock to get. </param>
 488        /// <param name="cancellationToken"> The cancellation token to use. </param>
 489        public virtual async Task<Response<ManagementLockObject>> GetAtSubscriptionLevelAsync(string lockName, Cancellat
 490        {
 0491            using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.GetAtSubscriptionLevel");
 0492            scope0.Start();
 493            try
 494            {
 0495                return await RestClient.GetAtSubscriptionLevelAsync(lockName, cancellationToken).ConfigureAwait(false);
 496            }
 0497            catch (Exception e)
 498            {
 0499                scope0.Failed(e);
 0500                throw;
 501            }
 0502        }
 503
 504        /// <summary> Gets a management lock at the subscription level. </summary>
 505        /// <param name="lockName"> The name of the lock to get. </param>
 506        /// <param name="cancellationToken"> The cancellation token to use. </param>
 507        public virtual Response<ManagementLockObject> GetAtSubscriptionLevel(string lockName, CancellationToken cancella
 508        {
 0509            using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.GetAtSubscriptionLevel");
 0510            scope0.Start();
 511            try
 512            {
 0513                return RestClient.GetAtSubscriptionLevel(lockName, cancellationToken);
 514            }
 0515            catch (Exception e)
 516            {
 0517                scope0.Failed(e);
 0518                throw;
 519            }
 0520        }
 521
 522        /// <summary> Gets all the management locks for a resource group. </summary>
 523        /// <param name="resourceGroupName"> The name of the resource group containing the locks to get. </param>
 524        /// <param name="filter"> The filter to apply on the operation. </param>
 525        /// <param name="cancellationToken"> The cancellation token to use. </param>
 526        public virtual AsyncPageable<ManagementLockObject> ListAtResourceGroupLevelAsync(string resourceGroupName, strin
 527        {
 0528            if (resourceGroupName == null)
 529            {
 0530                throw new ArgumentNullException(nameof(resourceGroupName));
 531            }
 532
 533            async Task<Page<ManagementLockObject>> FirstPageFunc(int? pageSizeHint)
 534            {
 0535                using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.ListAtResourceGroupLevel");
 0536                scope0.Start();
 537                try
 538                {
 0539                    var response = await RestClient.ListAtResourceGroupLevelAsync(resourceGroupName, filter, cancellatio
 0540                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 541                }
 0542                catch (Exception e)
 543                {
 0544                    scope0.Failed(e);
 0545                    throw;
 546                }
 0547            }
 548            async Task<Page<ManagementLockObject>> NextPageFunc(string nextLink, int? pageSizeHint)
 549            {
 0550                using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.ListAtResourceGroupLevel");
 0551                scope0.Start();
 552                try
 553                {
 0554                    var response = await RestClient.ListAtResourceGroupLevelNextPageAsync(nextLink, resourceGroupName, f
 0555                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 556                }
 0557                catch (Exception e)
 558                {
 0559                    scope0.Failed(e);
 0560                    throw;
 561                }
 0562            }
 0563            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 564        }
 565
 566        /// <summary> Gets all the management locks for a resource group. </summary>
 567        /// <param name="resourceGroupName"> The name of the resource group containing the locks to get. </param>
 568        /// <param name="filter"> The filter to apply on the operation. </param>
 569        /// <param name="cancellationToken"> The cancellation token to use. </param>
 570        public virtual Pageable<ManagementLockObject> ListAtResourceGroupLevel(string resourceGroupName, string filter =
 571        {
 0572            if (resourceGroupName == null)
 573            {
 0574                throw new ArgumentNullException(nameof(resourceGroupName));
 575            }
 576
 577            Page<ManagementLockObject> FirstPageFunc(int? pageSizeHint)
 578            {
 0579                using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.ListAtResourceGroupLevel");
 0580                scope0.Start();
 581                try
 582                {
 0583                    var response = RestClient.ListAtResourceGroupLevel(resourceGroupName, filter, cancellationToken);
 0584                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 585                }
 0586                catch (Exception e)
 587                {
 0588                    scope0.Failed(e);
 0589                    throw;
 590                }
 0591            }
 592            Page<ManagementLockObject> NextPageFunc(string nextLink, int? pageSizeHint)
 593            {
 0594                using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.ListAtResourceGroupLevel");
 0595                scope0.Start();
 596                try
 597                {
 0598                    var response = RestClient.ListAtResourceGroupLevelNextPage(nextLink, resourceGroupName, filter, canc
 0599                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 600                }
 0601                catch (Exception e)
 602                {
 0603                    scope0.Failed(e);
 0604                    throw;
 605                }
 0606            }
 0607            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 608        }
 609
 610        /// <summary> Gets all the management locks for a resource or any level below resource. </summary>
 611        /// <param name="resourceGroupName"> The name of the resource group containing the locked resource. The name is 
 612        /// <param name="resourceProviderNamespace"> The namespace of the resource provider. </param>
 613        /// <param name="parentResourcePath"> The parent resource identity. </param>
 614        /// <param name="resourceType"> The resource type of the locked resource. </param>
 615        /// <param name="resourceName"> The name of the locked resource. </param>
 616        /// <param name="filter"> The filter to apply on the operation. </param>
 617        /// <param name="cancellationToken"> The cancellation token to use. </param>
 618        public virtual AsyncPageable<ManagementLockObject> ListAtResourceLevelAsync(string resourceGroupName, string res
 619        {
 0620            if (resourceGroupName == null)
 621            {
 0622                throw new ArgumentNullException(nameof(resourceGroupName));
 623            }
 0624            if (resourceProviderNamespace == null)
 625            {
 0626                throw new ArgumentNullException(nameof(resourceProviderNamespace));
 627            }
 0628            if (parentResourcePath == null)
 629            {
 0630                throw new ArgumentNullException(nameof(parentResourcePath));
 631            }
 0632            if (resourceType == null)
 633            {
 0634                throw new ArgumentNullException(nameof(resourceType));
 635            }
 0636            if (resourceName == null)
 637            {
 0638                throw new ArgumentNullException(nameof(resourceName));
 639            }
 640
 641            async Task<Page<ManagementLockObject>> FirstPageFunc(int? pageSizeHint)
 642            {
 0643                using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.ListAtResourceLevel");
 0644                scope0.Start();
 645                try
 646                {
 0647                    var response = await RestClient.ListAtResourceLevelAsync(resourceGroupName, resourceProviderNamespac
 0648                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 649                }
 0650                catch (Exception e)
 651                {
 0652                    scope0.Failed(e);
 0653                    throw;
 654                }
 0655            }
 656            async Task<Page<ManagementLockObject>> NextPageFunc(string nextLink, int? pageSizeHint)
 657            {
 0658                using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.ListAtResourceLevel");
 0659                scope0.Start();
 660                try
 661                {
 0662                    var response = await RestClient.ListAtResourceLevelNextPageAsync(nextLink, resourceGroupName, resour
 0663                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 664                }
 0665                catch (Exception e)
 666                {
 0667                    scope0.Failed(e);
 0668                    throw;
 669                }
 0670            }
 0671            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 672        }
 673
 674        /// <summary> Gets all the management locks for a resource or any level below resource. </summary>
 675        /// <param name="resourceGroupName"> The name of the resource group containing the locked resource. The name is 
 676        /// <param name="resourceProviderNamespace"> The namespace of the resource provider. </param>
 677        /// <param name="parentResourcePath"> The parent resource identity. </param>
 678        /// <param name="resourceType"> The resource type of the locked resource. </param>
 679        /// <param name="resourceName"> The name of the locked resource. </param>
 680        /// <param name="filter"> The filter to apply on the operation. </param>
 681        /// <param name="cancellationToken"> The cancellation token to use. </param>
 682        public virtual Pageable<ManagementLockObject> ListAtResourceLevel(string resourceGroupName, string resourceProvi
 683        {
 0684            if (resourceGroupName == null)
 685            {
 0686                throw new ArgumentNullException(nameof(resourceGroupName));
 687            }
 0688            if (resourceProviderNamespace == null)
 689            {
 0690                throw new ArgumentNullException(nameof(resourceProviderNamespace));
 691            }
 0692            if (parentResourcePath == null)
 693            {
 0694                throw new ArgumentNullException(nameof(parentResourcePath));
 695            }
 0696            if (resourceType == null)
 697            {
 0698                throw new ArgumentNullException(nameof(resourceType));
 699            }
 0700            if (resourceName == null)
 701            {
 0702                throw new ArgumentNullException(nameof(resourceName));
 703            }
 704
 705            Page<ManagementLockObject> FirstPageFunc(int? pageSizeHint)
 706            {
 0707                using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.ListAtResourceLevel");
 0708                scope0.Start();
 709                try
 710                {
 0711                    var response = RestClient.ListAtResourceLevel(resourceGroupName, resourceProviderNamespace, parentRe
 0712                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 713                }
 0714                catch (Exception e)
 715                {
 0716                    scope0.Failed(e);
 0717                    throw;
 718                }
 0719            }
 720            Page<ManagementLockObject> NextPageFunc(string nextLink, int? pageSizeHint)
 721            {
 0722                using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.ListAtResourceLevel");
 0723                scope0.Start();
 724                try
 725                {
 0726                    var response = RestClient.ListAtResourceLevelNextPage(nextLink, resourceGroupName, resourceProviderN
 0727                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 728                }
 0729                catch (Exception e)
 730                {
 0731                    scope0.Failed(e);
 0732                    throw;
 733                }
 0734            }
 0735            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 736        }
 737
 738        /// <summary> Gets all the management locks for a subscription. </summary>
 739        /// <param name="filter"> The filter to apply on the operation. </param>
 740        /// <param name="cancellationToken"> The cancellation token to use. </param>
 741        public virtual AsyncPageable<ManagementLockObject> ListAtSubscriptionLevelAsync(string filter = null, Cancellati
 742        {
 743            async Task<Page<ManagementLockObject>> FirstPageFunc(int? pageSizeHint)
 744            {
 0745                using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.ListAtSubscriptionLevel");
 0746                scope0.Start();
 747                try
 748                {
 0749                    var response = await RestClient.ListAtSubscriptionLevelAsync(filter, cancellationToken).ConfigureAwa
 0750                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 751                }
 0752                catch (Exception e)
 753                {
 0754                    scope0.Failed(e);
 0755                    throw;
 756                }
 0757            }
 758            async Task<Page<ManagementLockObject>> NextPageFunc(string nextLink, int? pageSizeHint)
 759            {
 0760                using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.ListAtSubscriptionLevel");
 0761                scope0.Start();
 762                try
 763                {
 0764                    var response = await RestClient.ListAtSubscriptionLevelNextPageAsync(nextLink, filter, cancellationT
 0765                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 766                }
 0767                catch (Exception e)
 768                {
 0769                    scope0.Failed(e);
 0770                    throw;
 771                }
 0772            }
 0773            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 774        }
 775
 776        /// <summary> Gets all the management locks for a subscription. </summary>
 777        /// <param name="filter"> The filter to apply on the operation. </param>
 778        /// <param name="cancellationToken"> The cancellation token to use. </param>
 779        public virtual Pageable<ManagementLockObject> ListAtSubscriptionLevel(string filter = null, CancellationToken ca
 780        {
 781            Page<ManagementLockObject> FirstPageFunc(int? pageSizeHint)
 782            {
 0783                using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.ListAtSubscriptionLevel");
 0784                scope0.Start();
 785                try
 786                {
 0787                    var response = RestClient.ListAtSubscriptionLevel(filter, cancellationToken);
 0788                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 789                }
 0790                catch (Exception e)
 791                {
 0792                    scope0.Failed(e);
 0793                    throw;
 794                }
 0795            }
 796            Page<ManagementLockObject> NextPageFunc(string nextLink, int? pageSizeHint)
 797            {
 0798                using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.ListAtSubscriptionLevel");
 0799                scope0.Start();
 800                try
 801                {
 0802                    var response = RestClient.ListAtSubscriptionLevelNextPage(nextLink, filter, cancellationToken);
 0803                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 804                }
 0805                catch (Exception e)
 806                {
 0807                    scope0.Failed(e);
 0808                    throw;
 809                }
 0810            }
 0811            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 812        }
 813
 814        /// <summary> Gets all the management locks for a scope. </summary>
 815        /// <param name="scope"> The scope for the lock. When providing a scope for the assignment, use &apos;/subscript
 816        /// <param name="filter"> The filter to apply on the operation. </param>
 817        /// <param name="cancellationToken"> The cancellation token to use. </param>
 818        public virtual AsyncPageable<ManagementLockObject> ListByScopeAsync(string scope, string filter = null, Cancella
 819        {
 0820            if (scope == null)
 821            {
 0822                throw new ArgumentNullException(nameof(scope));
 823            }
 824
 825            async Task<Page<ManagementLockObject>> FirstPageFunc(int? pageSizeHint)
 826            {
 0827                using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.ListByScope");
 0828                scope0.Start();
 829                try
 830                {
 0831                    var response = await RestClient.ListByScopeAsync(scope, filter, cancellationToken).ConfigureAwait(fa
 0832                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 833                }
 0834                catch (Exception e)
 835                {
 0836                    scope0.Failed(e);
 0837                    throw;
 838                }
 0839            }
 840            async Task<Page<ManagementLockObject>> NextPageFunc(string nextLink, int? pageSizeHint)
 841            {
 0842                using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.ListByScope");
 0843                scope0.Start();
 844                try
 845                {
 0846                    var response = await RestClient.ListByScopeNextPageAsync(nextLink, scope, filter, cancellationToken)
 0847                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 848                }
 0849                catch (Exception e)
 850                {
 0851                    scope0.Failed(e);
 0852                    throw;
 853                }
 0854            }
 0855            return PageableHelpers.CreateAsyncEnumerable(FirstPageFunc, NextPageFunc);
 856        }
 857
 858        /// <summary> Gets all the management locks for a scope. </summary>
 859        /// <param name="scope"> The scope for the lock. When providing a scope for the assignment, use &apos;/subscript
 860        /// <param name="filter"> The filter to apply on the operation. </param>
 861        /// <param name="cancellationToken"> The cancellation token to use. </param>
 862        public virtual Pageable<ManagementLockObject> ListByScope(string scope, string filter = null, CancellationToken 
 863        {
 0864            if (scope == null)
 865            {
 0866                throw new ArgumentNullException(nameof(scope));
 867            }
 868
 869            Page<ManagementLockObject> FirstPageFunc(int? pageSizeHint)
 870            {
 0871                using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.ListByScope");
 0872                scope0.Start();
 873                try
 874                {
 0875                    var response = RestClient.ListByScope(scope, filter, cancellationToken);
 0876                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 877                }
 0878                catch (Exception e)
 879                {
 0880                    scope0.Failed(e);
 0881                    throw;
 882                }
 0883            }
 884            Page<ManagementLockObject> NextPageFunc(string nextLink, int? pageSizeHint)
 885            {
 0886                using var scope0 = _clientDiagnostics.CreateScope("ManagementLocksOperations.ListByScope");
 0887                scope0.Start();
 888                try
 889                {
 0890                    var response = RestClient.ListByScopeNextPage(nextLink, scope, filter, cancellationToken);
 0891                    return Page.FromValues(response.Value.Value, response.Value.NextLink, response.GetRawResponse());
 892                }
 0893                catch (Exception e)
 894                {
 0895                    scope0.Failed(e);
 0896                    throw;
 897                }
 0898            }
 0899            return PageableHelpers.CreateEnumerable(FirstPageFunc, NextPageFunc);
 900        }
 901    }
 902}