public async virtual Task <Response <LegalHold> > SetLegalHoldAsync(LegalHold legalHold, CancellationToken cancellationToken = default) { Argument.AssertNotNull(legalHold, nameof(legalHold)); using var scope = _blobContainerClientDiagnostics.CreateScope("BlobContainer.SetLegalHold"); scope.Start(); try { var response = await _blobContainerRestClient.SetLegalHoldAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Name, legalHold, cancellationToken).ConfigureAwait(false); return(response); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual async Task <Response <LegalHold> > SetLegalHoldAsync(LegalHold legalHold, CancellationToken cancellationToken = default) { if (legalHold == null) { throw new ArgumentNullException(nameof(legalHold)); } using var scope = _clientDiagnostics.CreateScope("BlobContainer.SetLegalHold"); scope.Start(); try { var response = await _restClient.SetLegalHoldAsync(Id.ResourceGroupName, Id.Parent.Parent.Name, Id.Parent.Name, Id.Name, legalHold, cancellationToken).ConfigureAwait(false); return(response); } catch (Exception e) { scope.Failed(e); throw; } }