Example #1
0
 public virtual VirtualMachineRunCommandDeleteOperation Delete(bool waitForCompletion, CancellationToken cancellationToken = default)
 {
     using var scope = _virtualMachineRunCommandClientDiagnostics.CreateScope("VirtualMachineRunCommand.Delete");
     scope.Start();
     try
     {
         var response  = _virtualMachineRunCommandRestClient.Delete(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
         var operation = new VirtualMachineRunCommandDeleteOperation(_virtualMachineRunCommandClientDiagnostics, Pipeline, _virtualMachineRunCommandRestClient.CreateDeleteRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response);
         if (waitForCompletion)
         {
             operation.WaitForCompletionResponse(cancellationToken);
         }
         return(operation);
     }
     catch (Exception e)
     {
         scope.Failed(e);
         throw;
     }
 }