public virtual ArmOperation RefreshValidationToken(WaitUntil waitUntil, CancellationToken cancellationToken = default) { using var scope = _afdCustomDomainClientDiagnostics.CreateScope("AfdCustomDomainResource.RefreshValidationToken"); scope.Start(); try { var response = _afdCustomDomainRestClient.RefreshValidationToken(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); var operation = new CdnArmOperation(_afdCustomDomainClientDiagnostics, Pipeline, _afdCustomDomainRestClient.CreateRefreshValidationTokenRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitUntil == WaitUntil.Completed) { operation.WaitForCompletionResponse(cancellationToken); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual AfdCustomDomainRefreshValidationTokenOperation RefreshValidationToken(bool waitForCompletion, CancellationToken cancellationToken = default) { using var scope = _clientDiagnostics.CreateScope("AfdCustomDomain.RefreshValidationToken"); scope.Start(); try { var response = _afdCustomDomainsRestClient.RefreshValidationToken(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); var operation = new AfdCustomDomainRefreshValidationTokenOperation(_clientDiagnostics, Pipeline, _afdCustomDomainsRestClient.CreateRefreshValidationTokenRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response); if (waitForCompletion) { operation.WaitForCompletion(cancellationToken); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }