public async virtual Task <ExpressRouteGatewayUpdateTagsOperation> UpdateTagsAsync(TagsObject expressRouteGatewayParameters, bool waitForCompletion = true, CancellationToken cancellationToken = default) { if (expressRouteGatewayParameters == null) { throw new ArgumentNullException(nameof(expressRouteGatewayParameters)); } using var scope = _clientDiagnostics.CreateScope("ExpressRouteGateway.UpdateTags"); scope.Start(); try { var response = await _restClient.UpdateTagsAsync(Id.ResourceGroupName, Id.Name, expressRouteGatewayParameters, cancellationToken).ConfigureAwait(false); var operation = new ExpressRouteGatewayUpdateTagsOperation(this, _clientDiagnostics, Pipeline, _restClient.CreateUpdateTagsRequest(Id.ResourceGroupName, Id.Name, expressRouteGatewayParameters).Request, response); if (waitForCompletion) { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual async Task <ArmOperation <ExpressRouteGatewayResource> > UpdateAsync(WaitUntil waitUntil, TagsObject expressRouteGatewayParameters, CancellationToken cancellationToken = default) { Argument.AssertNotNull(expressRouteGatewayParameters, nameof(expressRouteGatewayParameters)); using var scope = _expressRouteGatewayClientDiagnostics.CreateScope("ExpressRouteGatewayResource.Update"); scope.Start(); try { var response = await _expressRouteGatewayRestClient.UpdateTagsAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expressRouteGatewayParameters, cancellationToken).ConfigureAwait(false); var operation = new NetworkArmOperation <ExpressRouteGatewayResource>(new ExpressRouteGatewayOperationSource(Client), _expressRouteGatewayClientDiagnostics, Pipeline, _expressRouteGatewayRestClient.CreateUpdateTagsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, expressRouteGatewayParameters).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) { await operation.WaitForCompletionAsync(cancellationToken).ConfigureAwait(false); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }