/// <summary> /// Creates or updates a management lock at the resource level or any level /// below the resource. /// </summary> /// <remarks> /// When you apply a lock at a parent scope, all child resources inherit the /// same lock. To create management locks, you must have access to /// Microsoft.Authorization/* or Microsoft.Authorization/locks/* actions. Of /// the built-in roles, only Owner and User Access Administrator are granted /// those actions. /// </remarks> /// <param name='operations'> /// The operations group for this extension method. /// </param> /// <param name='resourceGroupName'> /// The name of the resource group containing the resource to lock. /// </param> /// <param name='resourceProviderNamespace'> /// The resource provider namespace of the resource to lock. /// </param> /// <param name='parentResourcePath'> /// The parent resource identity. /// </param> /// <param name='resourceType'> /// The resource type of the resource to lock. /// </param> /// <param name='resourceName'> /// The name of the resource to lock. /// </param> /// <param name='lockName'> /// The name of lock. The lock name can be a maximum of 260 characters. It /// cannot contain <, > %, &, :, \, ?, /, or any control characters. /// </param> /// <param name='parameters'> /// Parameters for creating or updating a management lock. /// </param> /// <param name='cancellationToken'> /// The cancellation token. /// </param> public static async Task <ManagementLockObject> CreateOrUpdateAtResourceLevelAsync(this IManagementLocksOperations operations, string resourceGroupName, string resourceProviderNamespace, string parentResourcePath, string resourceType, string resourceName, string lockName, ManagementLockObject parameters, CancellationToken cancellationToken = default(CancellationToken)) { using (var _result = await operations.CreateOrUpdateAtResourceLevelWithHttpMessagesAsync(resourceGroupName, resourceProviderNamespace, parentResourcePath, resourceType, resourceName, lockName, parameters, null, cancellationToken).ConfigureAwait(false)) { return(_result.Body); } }