/// <summary>
 /// Adds search options to the query parameters.
 /// </summary>
 /// <param name="list">The dictionary of query parameters.</param>
 /// <param name="options">An ApiSearchOptions object containing search options.</param>
 /// <param name="performsAction">Whether the query performs an action other than selecting data.</param>
 /// <returns></returns>
 internal static Dictionary <string, object> AddSearchOptions(this Dictionary <string, object> list, ApiSearchOptions options, bool performsAction = false)
 {
     if (options != null)
     {
         var condition = options.GetCondition();
         list.AddIfHasValue("ids", options.Ids)
         .AddIfHasValue("group_ids", options.GroupIds)
         .AddIfHasValue("start", options.Start)
         .AddIfHasValue("range", options.Range)
         .AddIfHasValue("condition", condition)
         .AddIfHasValue("search", options.Search);
         if (!string.IsNullOrEmpty(options.Search) && options.SearchNotes)
         {
             list.Add("searchNotes", options.SearchNotes);
         }
         if (performsAction && options.Ids == null)
         {
             list.Add("performAll", "1");
         }
     }
     else
     {
         list.Add("performAll", "1");
     }
     return(list);
 }
 /// <summary>
 /// Adds Conditions, Search and SearchNotes query parameters.
 /// </summary>
 /// <param name="list">The dictionary of query parameters.</param>
 /// <param name="condition">Sets more specific criterias for which objects to bring back.</param>
 /// <param name="search">A string to search your objects for.</param>
 /// <param name="searchNotes">Used in conjunction with the search parameter to indicate whether or not object notes should be searched for the specified string in addition to other object fields.</param>
 /// <returns>The query dictionary.</returns>
 internal static Dictionary <string, object> AddConditions(this Dictionary <string, object> list, ApiSearchOptions condition = null, string search = null, bool searchNotes = false)
 {
     if (condition != null)
     {
         list.Add("condition", condition.ToString());
     }
     if (!string.IsNullOrEmpty(search))
     {
         list.Add("search", search);
         if (searchNotes)
         {
             list.Add("searchNotes", searchNotes);
         }
     }
     return(list);
 }