public virtual ConnectionMonitorStopOperation Stop(bool waitForCompletion = true, CancellationToken cancellationToken = default)
 {
     using var scope = _clientDiagnostics.CreateScope("ConnectionMonitor.Stop");
     scope.Start();
     try
     {
         var response  = _connectionMonitorsRestClient.Stop(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken);
         var operation = new ConnectionMonitorStopOperation(_clientDiagnostics, Pipeline, _connectionMonitorsRestClient.CreateStopRequest(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;
     }
 }
        public async virtual Task <ConnectionMonitorStopOperation> StopAsync(bool waitForCompletion, CancellationToken cancellationToken = default)
        {
            using var scope = _connectionMonitorClientDiagnostics.CreateScope("ConnectionMonitor.Stop");
            scope.Start();
            try
            {
                var response = await _connectionMonitorRestClient.StopAsync(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name, cancellationToken).ConfigureAwait(false);

                var operation = new ConnectionMonitorStopOperation(_connectionMonitorClientDiagnostics, Pipeline, _connectionMonitorRestClient.CreateStopRequest(Id.SubscriptionId, Id.ResourceGroupName, Id.Parent.Name, Id.Name).Request, response);
                if (waitForCompletion)
                {
                    await operation.WaitForCompletionResponseAsync(cancellationToken).ConfigureAwait(false);
                }
                return(operation);
            }
            catch (Exception e)
            {
                scope.Failed(e);
                throw;
            }
        }