Example #1
0
        public async Task <IRestResponse <MultipleResult> > StickerTrendingAsync(TrendingParams trendingParams)
        {
            var request = new RequestBuilder()
                          .GetStickerTrendingRequest(trendingParams)
                          .WithApiKey(Config.ApiKey)
                          .Build();

            return(await RestClnt.ExecuteGetTaskAsync <MultipleResult>(request));
        }
        private static RequestBuilder GetTrendingRequest(this RequestBuilder builder, string resource, TrendingParams trendingParams)
        {
            builder.ForResource(TRENDING)
            .WithMethod(Method.GET);

            if (trendingParams.limit.HasValue)
            {
                builder.AddParameter(LIMIT, trendingParams.limit.Value, ParameterType.QueryString);
            }

            if (trendingParams.offset.HasValue)
            {
                builder.AddParameter(OFFSET, trendingParams.offset.Value, ParameterType.QueryString);
            }

            if (!string.IsNullOrEmpty(trendingParams.rating))
            {
                builder.AddParameter(RATING, trendingParams.rating, ParameterType.QueryString);
            }

            if (!string.IsNullOrEmpty(trendingParams.fmt))
            {
                builder.AddParameter(FMT, trendingParams.fmt, ParameterType.QueryString);
            }

            return(builder);
        }
 public static RequestBuilder GetStickerTrendingRequest(this RequestBuilder builder, TrendingParams trendingParams)
 {
     return(builder.GetTrendingRequest(STICKERS_TRENDING, trendingParams));
 }