/// <summary> /// Construct the url to make an API call get a list of plugins in the requested category /// </summary> /// <param name="pluginCategory">The category to list</param> /// <param name="field">the fields to retrieve</param> /// <param name="sortField">the PluginInfoField to sort the results</param> /// <param name="negateSort">should the results list be reversed?</param> /// <param name="limit">the maximum amount or results</param> /// <returns>The URL to make the api call to, as a string</returns> public static string ConstructUrl( PluginCategory pluginCategory, PluginInfoField[] field, PluginInfoField sortField, Boolean negateSort, int limit) { return(ConstructUrl(pluginCategory, field, limit) + GetSortUrlValue(sortField, negateSort)); }
/// <summary> /// Get the URL value for a sort command /// </summary> /// <param name="sortfield">the PluginInfoField to sort</param> /// <param name="negate">should the sort direction be reversed?</param> /// <returns>the url value for the sort command</returns> private static string GetSortUrlValue(PluginInfoField sortfield, Boolean negate) { String result = "&sort="; if (negate) { result += "-"; } result += GetFieldUrlValue(sortfield); return(result); }
/// <summary> /// Construct the url to make an API call to get a list of all plugins /// </summary> /// <param name="field">the fields to retrieve</param> /// <param name="sortField">the PluginInfoField to sort the results</param> /// <param name="negateSort">should the results list be reversed?</param> /// <param name="limit">the maximum amount or results</param> /// <returns>The URL to make the api call to, as a string</returns> public static string ConstructUrl(PluginInfoField[] field, PluginInfoField sortField, Boolean negateSort, int limit) { return ConstructUrl(field, limit) + GetSortUrlValue(sortField, negateSort); }
/// <summary> /// Construct the url to make an API call to get a list of all plugins /// </summary> /// <param name="field">the fields to retrieve</param> /// <param name="sortField">the PluginInfoField to sort the results</param> /// <param name="limit">the maximum amount or results</param> /// <returns>The URL to make the api call to, as a string</returns> public static string ConstructUrl(PluginInfoField[] field, PluginInfoField sortField, int limit) { return ConstructUrl(field, sortField, false, limit); }
/// <summary> /// Construct the url to make an API call to get a list of all plugins /// </summary> /// <param name="field">the fields to retrieve</param> /// <param name="limit">the maximum amount or results</param> /// <returns>The URL to make the api call to, as a string</returns> public static string ConstructUrl(PluginInfoField[] field, int limit) { return ConstructUrl(field) + GetLimitUrlValue(limit); }
/// <summary> /// Construct the url to make an API call to get a list of all plugins /// </summary> /// <param name="field">the fields to retrieve</param> /// <returns>The URL to make the api call to, as a string</returns> public static string ConstructUrl(PluginInfoField[] field) { return ConstructUrl() + GetFieldArrayUrlValue(field); }
/// <summary> /// Get the URL value for a sort command /// </summary> /// <param name="sortfield">the PluginInfoField to sort</param> /// <param name="negate">should the sort direction be reversed?</param> /// <returns>the url value for the sort command</returns> private static string GetSortUrlValue(PluginInfoField sortfield, Boolean negate) { String result = "&sort="; if (negate) { result += "-"; } result += GetFieldUrlValue(sortfield); return result; }
/// <summary> /// Convert enum to string for API usage /// </summary> /// <param name="field"></param> /// <returns></returns> private static string GetFieldUrlValue(PluginInfoField field) { return field.ToString().ToLower().Replace("vf_", "versions.").Replace("pop_", "popularity."); }
/// <summary> /// Construct the url to make an API call to search for a given value in the selected PluginInfoField /// </summary> /// <param name="searchField">The PluginInfoField to search</param> /// <param name="action">The relation between the given value and the result</param> /// <param name="value">the value to search for</param> /// <param name="limit">the maximum amount of results</param> /// <returns>The URL to make the api call to, as a string</returns> public static string ConstructUrl(PluginInfoField searchField, SearchAction action, String value, int limit) { return ConstructBaseUrl() + "/search/" + GetFieldUrlValue(searchField) + "/" + GetSearchActionUrlValue(action) + "/" + value + GetFieldArrayUrlValue(FieldsSimple); }
/// <summary> /// Construct the url to make an API call to search for a given value in the selected PluginInfoField /// </summary> /// <param name="searchField">The PluginInfoField to search</param> /// <param name="action">The relation between the given value and the result</param> /// <param name="value">the value to search for</param> /// <returns>The URL to make the api call to, as a string</returns> public static string ConstructUrl(PluginInfoField searchField, SearchAction action, String value) { return ConstructUrl(searchField, action, value, DefaultLimit); }
/// <summary> /// Construct the url to make an API call get a list of plugins in the requested category /// </summary> /// <param name="pluginCategory">The category to list</param> /// <param name="field">the fields to retrieve</param> /// <returns>The URL to make the api call to, as a string</returns> public static string ConstructUrl(PluginCategory pluginCategory, PluginInfoField[] field) { return ConstructUrl(pluginCategory) + GetFieldArrayUrlValue(field); }
/// <summary> /// Construct the url to make an API call to get a list of all plugins /// </summary> /// <param name="field">the fields to retrieve</param> /// <param name="sortField">the PluginInfoField to sort the results</param> /// <param name="limit">the maximum amount or results</param> /// <returns>The URL to make the api call to, as a string</returns> public static string ConstructUrl(PluginInfoField[] field, PluginInfoField sortField, int limit) { return(ConstructUrl(field, sortField, false, limit)); }
/// <summary> /// Convert enum to string for API usage /// </summary> /// <param name="field"></param> /// <returns></returns> private static string GetFieldUrlValue(PluginInfoField field) { return(field.ToString().ToLower().Replace("vf_", "versions.").Replace("pop_", "popularity.")); }
/// <summary> /// Construct the url to make an API call to search for a given value in the selected PluginInfoField /// </summary> /// <param name="searchField">The PluginInfoField to search</param> /// <param name="action">The relation between the given value and the result</param> /// <param name="value">the value to search for</param> /// <param name="limit">the maximum amount of results</param> /// <returns>The URL to make the api call to, as a string</returns> public static string ConstructUrl(PluginInfoField searchField, SearchAction action, String value, int limit) { return(ConstructBaseUrl() + "/search/" + GetFieldUrlValue(searchField) + "/" + GetSearchActionUrlValue(action) + "/" + value + GetFieldArrayUrlValue(FieldsSimple)); }
/// <summary> /// Construct the url to make an API call to search for a given value in the selected PluginInfoField /// </summary> /// <param name="searchField">The PluginInfoField to search</param> /// <param name="action">The relation between the given value and the result</param> /// <param name="value">the value to search for</param> /// <returns>The URL to make the api call to, as a string</returns> public static string ConstructUrl(PluginInfoField searchField, SearchAction action, String value) { return(ConstructUrl(searchField, action, value, DefaultLimit)); }