/// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Monitoring.Alerts.IIncidentOperations.
 /// </param>
 /// <param name='ruleId'>
 /// The rule id.
 /// </param>
 /// <param name='isActive'>
 /// A boolean to retrieve only active or resolved incidents.
 /// </param>
 /// <returns>
 /// The List incidents operation response.
 /// </returns>
 public static IncidentListResponse ListForRule(this IIncidentOperations operations, string ruleId, bool isActive)
 {
     try
     {
         return(operations.ListForRuleAsync(ruleId, isActive).Result);
     }
     catch (AggregateException ex)
     {
         if (ex.InnerExceptions.Count > 1)
         {
             throw;
         }
         else
         {
             throw ex.InnerException;
         }
     }
 }
 /// <param name='operations'>
 /// Reference to the
 /// Microsoft.WindowsAzure.Management.Monitoring.Alerts.IIncidentOperations.
 /// </param>
 /// <param name='ruleId'>
 /// The rule id.
 /// </param>
 /// <param name='isActive'>
 /// A boolean to retrieve only active or resolved incidents.
 /// </param>
 /// <returns>
 /// The List incidents operation response.
 /// </returns>
 public static Task <IncidentListResponse> ListForRuleAsync(this IIncidentOperations operations, string ruleId, bool isActive)
 {
     return(operations.ListForRuleAsync(ruleId, isActive, CancellationToken.None));
 }