public virtual ArmOperation Delete(WaitUntil waitUntil, CancellationToken cancellationToken = default) { using var scope = _virtualApplicationApplicationsClientDiagnostics.CreateScope("VirtualApplication.Delete"); scope.Start(); try { var response = _virtualApplicationApplicationsRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); var operation = new DesktopVirtualizationArmOperation(response); if (waitUntil == WaitUntil.Completed) { operation.WaitForCompletionResponse(cancellationToken); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual ArmOperation Delete(bool waitForCompletion, bool?force = null, CancellationToken cancellationToken = default) { using var scope = _sessionHostClientDiagnostics.CreateScope("SessionHost.Delete"); scope.Start(); try { var response = _sessionHostRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, force, cancellationToken); var operation = new DesktopVirtualizationArmOperation(response); if (waitForCompletion) { operation.WaitForCompletionResponse(cancellationToken); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }