public async virtual Task <Response <ImmutabilityPolicy> > LockImmutabilityPolicyAsync(string ifMatch, CancellationToken cancellationToken = default) { Argument.AssertNotNull(ifMatch, nameof(ifMatch)); using var scope = _immutabilityPolicyBlobContainersClientDiagnostics.CreateScope("ImmutabilityPolicy.LockImmutabilityPolicy"); scope.Start(); try { var response = await _immutabilityPolicyBlobContainersRestClient.LockImmutabilityPolicyAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Name, ifMatch, cancellationToken).ConfigureAwait(false); return(Response.FromValue(new ImmutabilityPolicy(Client, response.Value), response.GetRawResponse())); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual async Task <Response <ImmutabilityPolicy> > LockImmutabilityPolicyAsync(string ifMatch, CancellationToken cancellationToken = default) { if (ifMatch == null) { throw new ArgumentNullException(nameof(ifMatch)); } using var scope = _clientDiagnostics.CreateScope("BlobContainer.LockImmutabilityPolicy"); scope.Start(); try { var response = await _restClient.LockImmutabilityPolicyAsync(Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, ifMatch, cancellationToken).ConfigureAwait(false); return(response); } catch (Exception e) { scope.Failed(e); throw; } }