public virtual P2SVpnGatewayUpdateTagsOperation UpdateTags(TagsObject p2SVpnGatewayParameters, bool waitForCompletion = true, CancellationToken cancellationToken = default) { if (p2SVpnGatewayParameters == null) { throw new ArgumentNullException(nameof(p2SVpnGatewayParameters)); } using var scope = _clientDiagnostics.CreateScope("P2SVpnGateway.UpdateTags"); scope.Start(); try { var response = _restClient.UpdateTags(Id.ResourceGroupName, Id.Name, p2SVpnGatewayParameters, cancellationToken); var operation = new P2SVpnGatewayUpdateTagsOperation(this, _clientDiagnostics, Pipeline, _restClient.CreateUpdateTagsRequest(Id.ResourceGroupName, Id.Name, p2SVpnGatewayParameters).Request, response); if (waitForCompletion) { operation.WaitForCompletion(cancellationToken); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual ArmOperation <P2SVpnGatewayResource> Update(WaitUntil waitUntil, TagsObject p2SVpnGatewayParameters, CancellationToken cancellationToken = default) { Argument.AssertNotNull(p2SVpnGatewayParameters, nameof(p2SVpnGatewayParameters)); using var scope = _p2SVpnGatewayP2sVpnGatewaysClientDiagnostics.CreateScope("P2SVpnGatewayResource.Update"); scope.Start(); try { var response = _p2SVpnGatewayP2sVpnGatewaysRestClient.UpdateTags(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, p2SVpnGatewayParameters, cancellationToken); var operation = new NetworkArmOperation <P2SVpnGatewayResource>(new P2SVpnGatewayOperationSource(Client), _p2SVpnGatewayP2sVpnGatewaysClientDiagnostics, Pipeline, _p2SVpnGatewayP2sVpnGatewaysRestClient.CreateUpdateTagsRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, p2SVpnGatewayParameters).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) { operation.WaitForCompletion(cancellationToken); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }