public virtual ArmOperation Delete(bool waitForCompletion, CancellationToken cancellationToken = default) { using var scope = _arcSettingClientDiagnostics.CreateScope("ArcSetting.Delete"); scope.Start(); try { var response = _arcSettingRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken); var operation = new StackHCIArmOperation(_arcSettingClientDiagnostics, Pipeline, _arcSettingRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response, OperationFinalStateVia.AzureAsyncOperation); if (waitForCompletion) { operation.WaitForCompletionResponse(cancellationToken); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }
public virtual ArmOperation Delete(bool waitForCompletion, CancellationToken cancellationToken = default) { using var scope = _hciClusterClustersClientDiagnostics.CreateScope("HciCluster.Delete"); scope.Start(); try { var response = _hciClusterClustersRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Name, cancellationToken); var operation = new StackHCIArmOperation(response); if (waitForCompletion) { operation.WaitForCompletionResponse(cancellationToken); } return(operation); } catch (Exception e) { scope.Failed(e); throw; } }