本文整理汇总了C#中StackExchange.StacMan.ApiUrlBuilder类的典型用法代码示例。如果您正苦于以下问题:C# ApiUrlBuilder类的具体用法?C# ApiUrlBuilder怎么用?C# ApiUrlBuilder使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ApiUrlBuilder类属于StackExchange.StacMan命名空间,在下文中一共展示了ApiUrlBuilder类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: ValidateString
Task<StacManResponse<Question>> ISearchMethods.GetMatches(string site, string filter, int? page, int? pagesize, DateTime? fromdate, DateTime? todate, Questions.SearchSort? sort, DateTime? mindate, DateTime? maxdate, int? min, int? max, Order? order, string tagged, string nottagged, string intitle)
{
ValidateString(site, "site");
ValidatePaging(page, pagesize);
ValidateSortMinMax(sort, mindate: mindate, maxdate: maxdate, min: min, max: max);
var ub = new ApiUrlBuilder(Version, "/search", useHttps: false);
ub.AddParameter("site", site);
ub.AddParameter("filter", filter);
ub.AddParameter("page", page);
ub.AddParameter("pagesize", pagesize);
ub.AddParameter("fromdate", fromdate);
ub.AddParameter("todate", todate);
ub.AddParameter("sort", sort);
ub.AddParameter("min", mindate);
ub.AddParameter("max", maxdate);
ub.AddParameter("min", min);
ub.AddParameter("max", max);
ub.AddParameter("order", order);
ub.AddParameter("tagged", tagged);
ub.AddParameter("nottagged", nottagged);
ub.AddParameter("intitle", intitle);
return CreateApiTask<Question>(ub, HttpMethod.GET, "/search");
}
开发者ID:RobTillie,项目名称:StacMan,代码行数:26,代码来源:StacManClient.SearchMethods.cs
示例2: ValidateAndGetFilter
Task<StacManResponse<Post>> IPostMethods.GetByIds(string site, IEnumerable<int> ids, string filter = null, int? page = null, int? pagesize = null, DateTime? fromdate = null, DateTime? todate = null, Posts.Sort? sort = null, DateTime? mindate = null, DateTime? maxdate = null, int? min = null, int? max = null, Order? order = null)
{
var filterObj = ValidateAndGetFilter(filter);
ValidateString(site, "site");
ValidateEnumerable(ids, "ids");
ValidatePaging(page, pagesize);
ValidateSortMinMax(sort, mindate: mindate, maxdate: maxdate, min: min, max: max);
var ub = new ApiUrlBuilder(String.Format("/posts/{0}", String.Join(";", ids)), useHttps: false);
ub.AddParameter("site", site);
ub.AddParameter("filter", filter);
ub.AddParameter("page", page);
ub.AddParameter("pagesize", pagesize);
ub.AddParameter("fromdate", fromdate);
ub.AddParameter("todate", todate);
ub.AddParameter("sort", sort);
ub.AddParameter("min", mindate);
ub.AddParameter("max", maxdate);
ub.AddParameter("min", min);
ub.AddParameter("max", max);
ub.AddParameter("order", order);
return CreateApiTask<Post>(ub, filterObj, "/posts/{ids}");
}
开发者ID:RyannosaurusRex,项目名称:StacMan,代码行数:26,代码来源:StacManClient.PostMethods.cs
示例3: ValidateAndGetFilter
Task<StacManResponse<Answer>> IAnswerMethods.GetAll(string site, string filter = null, int? page = null, int? pagesize = null, DateTime? fromdate = null, DateTime? todate = null, Answers.Sort? sort = null, DateTime? mindate = null, DateTime? maxdate = null, int? min = null, int? max = null, Order? order = null)
{
var filterObj = ValidateAndGetFilter(filter);
ValidateString(site, "site");
ValidatePaging(page, pagesize);
ValidateSortMinMax(sort, mindate: mindate, maxdate: maxdate, min: min, max: max);
var ub = new ApiUrlBuilder("/answers", useHttps: false);
ub.AddParameter("site", site);
ub.AddParameter("filter", filter);
ub.AddParameter("page", page);
ub.AddParameter("pagesize", pagesize);
ub.AddParameter("fromdate", fromdate);
ub.AddParameter("todate", todate);
ub.AddParameter("sort", sort);
ub.AddParameter("min", mindate);
ub.AddParameter("max", maxdate);
ub.AddParameter("min", min);
ub.AddParameter("max", max);
ub.AddParameter("order", order);
return CreateApiTask<Answer>(ub, filterObj, "/answers");
}
开发者ID:RyannosaurusRex,项目名称:StacMan,代码行数:25,代码来源:StacManClient.AnswerMethods.cs
示例4: ValidateAndGetFilter
Task<StacManResponse<Badge>> IBadgeMethods.GetByIds(string site, IEnumerable<int> ids, string filter = null, int? page = null, int? pagesize = null, DateTime? fromdate = null, DateTime? todate = null, Badges.AllSort? sort = null, Badges.Rank? minrank = null, Badges.Rank? maxrank = null, string minname = null, string maxname = null, Badges.BadgeType? mintype = null, Badges.BadgeType? maxtype = null, Order? order = null)
{
var filterObj = ValidateAndGetFilter(filter);
ValidateString(site, "site");
ValidateEnumerable(ids, "ids");
ValidatePaging(page, pagesize);
ValidateSortMinMax(sort, minrank: minrank, maxrank: maxrank, minname: minname, maxname: maxname, mintype: mintype, maxtype: maxtype);
var ub = new ApiUrlBuilder(String.Format("/badges/{0}", String.Join(";", ids)), useHttps: false);
ub.AddParameter("site", site);
ub.AddParameter("filter", filter);
ub.AddParameter("page", page);
ub.AddParameter("pagesize", pagesize);
ub.AddParameter("fromdate", fromdate);
ub.AddParameter("todate", todate);
ub.AddParameter("sort", sort);
ub.AddParameter("min", minrank);
ub.AddParameter("max", maxrank);
ub.AddParameter("min", minname);
ub.AddParameter("max", maxname);
ub.AddParameter("min", mintype);
ub.AddParameter("max", maxtype);
ub.AddParameter("order", order);
return CreateApiTask<Badge>(ub, filterObj, "/badges/{ids}");
}
开发者ID:RyannosaurusRex,项目名称:StacMan,代码行数:28,代码来源:StacManClient.BadgeMethods.cs
示例5: ValidateString
Task<StacManResponse<Badge>> IBadgeMethods.GetAll(string site, string filter, int? page, int? pagesize, DateTime? fromdate, DateTime? todate, Badges.AllSort? sort, Badges.Rank? minrank, Badges.Rank? maxrank, string minname, string maxname, Badges.BadgeType? mintype, Badges.BadgeType? maxtype, Order? order, string inname)
{
ValidateString(site, "site");
ValidatePaging(page, pagesize);
ValidateSortMinMax(sort, minrank: minrank, maxrank: maxrank, minname: minname, maxname: maxname, mintype: mintype, maxtype: maxtype);
var ub = new ApiUrlBuilder(Version, "/badges", useHttps: false);
ub.AddParameter("site", site);
ub.AddParameter("filter", filter);
ub.AddParameter("page", page);
ub.AddParameter("pagesize", pagesize);
ub.AddParameter("fromdate", fromdate);
ub.AddParameter("todate", todate);
ub.AddParameter("sort", sort);
ub.AddParameter("min", minrank);
ub.AddParameter("max", maxrank);
ub.AddParameter("min", minname);
ub.AddParameter("max", maxname);
ub.AddParameter("min", mintype);
ub.AddParameter("max", maxtype);
ub.AddParameter("order", order);
ub.AddParameter("inname", inname);
return CreateApiTask<Badge>(ub, HttpMethod.GET, "/badges");
}
开发者ID:RobTillie,项目名称:StacMan,代码行数:26,代码来源:StacManClient.BadgeMethods.cs
示例6: ValidateAndGetFilter
Task<StacManResponse<Question>> ISearchMethods.GetSimilar(string site, string filter = null, int? page = null, int? pagesize = null, DateTime? fromdate = null, DateTime? todate = null, Questions.SearchSort? sort = null, DateTime? mindate = null, DateTime? maxdate = null, int? min = null, int? max = null, Order? order = null, string tagged = null, string nottagged = null, string inttitle = null)
{
var filterObj = ValidateAndGetFilter(filter);
ValidateString(site, "site");
ValidatePaging(page, pagesize);
ValidateSortMinMax(sort, mindate: mindate, maxdate: maxdate, min: min, max: max);
var ub = new ApiUrlBuilder("/similar", useHttps: false);
ub.AddParameter("site", site);
ub.AddParameter("filter", filter);
ub.AddParameter("page", page);
ub.AddParameter("pagesize", pagesize);
ub.AddParameter("fromdate", fromdate);
ub.AddParameter("todate", todate);
ub.AddParameter("sort", sort);
ub.AddParameter("min", mindate);
ub.AddParameter("max", maxdate);
ub.AddParameter("min", min);
ub.AddParameter("max", max);
ub.AddParameter("order", order);
ub.AddParameter("tagged", tagged);
ub.AddParameter("nottagged", nottagged);
ub.AddParameter("inttitle", inttitle);
return CreateApiTask<Question>(ub, filterObj, "/similar");
}
开发者ID:RyannosaurusRex,项目名称:StacMan,代码行数:28,代码来源:StacManClient.SearchMethods.cs
示例7: ApiUrlBuilder
Task<StacManResponse<Error>> IErrorMethods.Simulate(int id, string filter)
{
var ub = new ApiUrlBuilder(Version, String.Format("/errors/{0}", id), useHttps: false);
ub.AddParameter("filter", filter);
return CreateApiTask<Error>(ub, HttpMethod.GET, "/errors/{id}");
}
开发者ID:RobTillie,项目名称:StacMan,代码行数:8,代码来源:StacManClient.ErrorMethods.cs
示例8: ValidateEnumerable
Task<StacManResponse<Filter>> IFilterMethods.Read(IEnumerable<string> filters, string filter)
{
ValidateEnumerable(filters, "filters");
var ub = new ApiUrlBuilder(Version, String.Format("/filters/{0}", String.Join(";", filters.Select(HttpUtility.UrlEncode))), useHttps: false);
ub.AddParameter("filter", filter);
return CreateApiTask<Filter>(ub, HttpMethod.GET, "/filters/{filters}");
}
开发者ID:RobTillie,项目名称:StacMan,代码行数:10,代码来源:StacManClient.FilterMethods.cs
示例9: ValidateAndGetFilter
Task<StacManResponse<Error>> IErrorMethods.Simulate(int id, string filter = null)
{
var filterObj = ValidateAndGetFilter(filter);
var ub = new ApiUrlBuilder(String.Format("/errors/{0}", id), useHttps: false);
ub.AddParameter("filter", filter);
return CreateApiTask<Error>(ub, filterObj, "/errors/{id}");
}
开发者ID:RyannosaurusRex,项目名称:StacMan,代码行数:11,代码来源:StacManClient.ErrorMethods.cs
示例10: ValidateString
Task<StacManResponse<Info>> IInfoMethods.Get(string site, string filter)
{
ValidateString(site, "site");
var ub = new ApiUrlBuilder(Version, "/info", useHttps: false);
ub.AddParameter("site", site);
ub.AddParameter("filter", filter);
return CreateApiTask<Info>(ub, HttpMethod.GET, "/info");
}
开发者ID:RobTillie,项目名称:StacMan,代码行数:11,代码来源:StacManClient.InfoMethods.cs
示例11: ApiUrlBuilder
Task<StacManResponse<Filter>> IFilterMethods.Create(string filter, IEnumerable<string> include, IEnumerable<string> exclude, string @base, bool? @unsafe)
{
var ub = new ApiUrlBuilder(Version, "/filters/create", useHttps: false);
ub.AddParameter("filter", filter);
ub.AddParameter("include", include);
ub.AddParameter("exclude", exclude);
ub.AddParameter("base", @base);
ub.AddParameter("unsafe", @unsafe);
return CreateApiTask<Filter>(ub, HttpMethod.GET, "/filters/create");
}
开发者ID:RobTillie,项目名称:StacMan,代码行数:12,代码来源:StacManClient.FilterMethods.cs
示例12: ValidateAndGetFilter
Task<StacManResponse<Filter>> IFilterMethods.Read(IEnumerable<string> filters, string filter = null)
{
var filterObj = ValidateAndGetFilter(filter);
ValidateEnumerable(filters, "filters");
var ub = new ApiUrlBuilder(String.Format("/filters/{0}", String.Join(";", filters)), useHttps: false);
ub.AddParameter("filter", filter);
return CreateApiTask<Filter>(ub, filterObj, "/filters/{filters}");
}
开发者ID:RyannosaurusRex,项目名称:StacMan,代码行数:12,代码来源:StacManClient.FilterMethods.cs
示例13: ValidatePaging
Task<StacManResponse<Error>> IErrorMethods.GetAll(string filter, int? page, int? pagesize)
{
ValidatePaging(page, pagesize);
var ub = new ApiUrlBuilder(Version, "/errors", useHttps: false);
ub.AddParameter("filter", filter);
ub.AddParameter("page", page);
ub.AddParameter("pagesize", pagesize);
return CreateApiTask<Error>(ub, HttpMethod.GET, "/errors");
}
开发者ID:RobTillie,项目名称:StacMan,代码行数:12,代码来源:StacManClient.ErrorMethods.cs
示例14: ValidateEnumerable
Task<StacManResponse<AccessToken>> IAccessTokenMethods.Invalidate(IEnumerable<string> accessTokens, string filter, int? page, int? pagesize)
{
ValidateEnumerable(accessTokens, "accessTokens");
ValidatePaging(page, pagesize);
var ub = new ApiUrlBuilder(Version, String.Format("/access-tokens/{0}/invalidate", String.Join(";", accessTokens.Select(HttpUtility.UrlEncode))), useHttps: false);
ub.AddParameter("filter", filter);
ub.AddParameter("page", page);
ub.AddParameter("pagesize", pagesize);
return CreateApiTask<AccessToken>(ub, HttpMethod.GET, "/access-tokens/{accessTokens}/invalidate");
}
开发者ID:RobTillie,项目名称:StacMan,代码行数:13,代码来源:StacManClient.AccessTokenMethods.cs
示例15: ValidateAndGetFilter
Task<StacManResponse<Site>> ISiteMethods.GetAll(string filter = null, int? page = null, int? pagesize = null)
{
var filterObj = ValidateAndGetFilter(filter);
ValidatePaging(page, pagesize);
var ub = new ApiUrlBuilder("/sites", useHttps: false);
ub.AddParameter("filter", filter);
ub.AddParameter("page", page);
ub.AddParameter("pagesize", pagesize);
return CreateApiTask<Site>(ub, filterObj, "/sites");
}
开发者ID:RyannosaurusRex,项目名称:StacMan,代码行数:14,代码来源:StacManClient.SiteMethods.cs
示例16: ValidateString
Task<StacManResponse<Privilege>> IPrivilegeMethods.GetAll(string site, string filter, int? page, int? pagesize)
{
ValidateString(site, "site");
ValidatePaging(page, pagesize);
var ub = new ApiUrlBuilder(Version, "/privileges", useHttps: false);
ub.AddParameter("site", site);
ub.AddParameter("filter", filter);
ub.AddParameter("page", page);
ub.AddParameter("pagesize", pagesize);
return CreateApiTask<Privilege>(ub, HttpMethod.GET, "/privileges");
}
开发者ID:RobTillie,项目名称:StacMan,代码行数:14,代码来源:StacManClient.PrivilegeMethods.cs
示例17: ValidateString
Task<StacManResponse<InboxItem>> IInboxMethods.Get(string access_token, string filter, int? page, int? pagesize)
{
ValidateString(access_token, "access_token");
ValidatePaging(page, pagesize);
var ub = new ApiUrlBuilder(Version, "/inbox", useHttps: true);
ub.AddParameter("access_token", access_token);
ub.AddParameter("filter", filter);
ub.AddParameter("page", page);
ub.AddParameter("pagesize", pagesize);
return CreateApiTask<InboxItem>(ub, HttpMethod.GET, "/inbox");
}
开发者ID:RobTillie,项目名称:StacMan,代码行数:14,代码来源:StacManClient.InboxMethods.cs
示例18: ValidateAndGetFilter
Task<StacManResponse<AccessToken>> IAccessTokenMethods.Get(IEnumerable<string> accessTokens, string filter = null, int? page = null, int? pagesize = null)
{
var filterObj = ValidateAndGetFilter(filter);
ValidateEnumerable(accessTokens, "accessTokens");
ValidatePaging(page, pagesize);
var ub = new ApiUrlBuilder(String.Format("/access-tokens/{0}", String.Join(";", accessTokens)), useHttps: false);
ub.AddParameter("filter", filter);
ub.AddParameter("page", page);
ub.AddParameter("pagesize", pagesize);
return CreateApiTask<AccessToken>(ub, filterObj, "/access-tokens/{accessTokens}");
}
开发者ID:RyannosaurusRex,项目名称:StacMan,代码行数:15,代码来源:StacManClient.AccessTokenMethods.cs
示例19: ValidateString
Task<StacManResponse<Notification>> INotificationMethods.GetUnread(string access_token, string filter, int? page, int? pagesize)
{
ValidateString(access_token, "access_token");
ValidateMinApiVersion("2.1");
ValidatePaging(page, pagesize);
var ub = new ApiUrlBuilder(Version, "/notifications/unread", useHttps: true);
ub.AddParameter("access_token", access_token);
ub.AddParameter("filter", filter);
ub.AddParameter("page", page);
ub.AddParameter("pagesize", pagesize);
return CreateApiTask<Notification>(ub, HttpMethod.GET, "/notifications/unread");
}
开发者ID:RobTillie,项目名称:StacMan,代码行数:15,代码来源:StacManClient.NotificationMethods.cs
示例20: ValidateString
Task<StacManResponse<Comment>> ICommentMethods.Delete(string site, string access_token, int id, string filter, bool? preview)
{
ValidateString(site, "site");
ValidateString(access_token, "access_token");
ValidateMinApiVersion("2.1");
var ub = new ApiUrlBuilder(Version, String.Format("/comments/{0}/delete", id), useHttps: true);
ub.AddParameter("site", site);
ub.AddParameter("access_token", access_token);
ub.AddParameter("filter", filter);
ub.AddParameter("preview", preview);
return CreateApiTask<Comment>(ub, HttpMethod.POST, "/comments/{id}/delete");
}
开发者ID:RobTillie,项目名称:StacMan,代码行数:15,代码来源:StacManClient.CommentMethods.cs
注:本文中的StackExchange.StacMan.ApiUrlBuilder类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论