public async virtual Task <Response <ImmutabilityPolicy> > ExtendImmutabilityPolicyAsync(string ifMatch, ImmutabilityPolicyData parameters = null, CancellationToken cancellationToken = default) { Argument.AssertNotNull(ifMatch, nameof(ifMatch)); using var scope = _immutabilityPolicyBlobContainersClientDiagnostics.CreateScope("ImmutabilityPolicy.ExtendImmutabilityPolicy"); scope.Start(); try { var response = await _immutabilityPolicyBlobContainersRestClient.ExtendImmutabilityPolicyAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Parent.Name, Id.Parent.Name, ifMatch, parameters, 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> > ExtendImmutabilityPolicyAsync(string ifMatch, ImmutabilityPolicy parameters = null, CancellationToken cancellationToken = default) { if (ifMatch == null) { throw new ArgumentNullException(nameof(ifMatch)); } using var scope = _clientDiagnostics.CreateScope("BlobContainer.ExtendImmutabilityPolicy"); scope.Start(); try { var response = await _restClient.ExtendImmutabilityPolicyAsync(Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, ifMatch, parameters, cancellationToken).ConfigureAwait(false); return(response); } catch (Exception e) { scope.Failed(e); throw; } }