Exemplo n.º 1
0
        public static async Task <IReadOnlyCollection <RestClip> > GetTopClipsAsync(BaseTwitchClient client, Action <TopClipsParams> parameters, RequestOptions options = null)
        {
            var filledParams = new TopClipsParams();

            parameters.Invoke(filledParams);

            var model = await client.ApiClient.GetTopClipsAsync(filledParams, options).ConfigureAwait(false);

            if (model.Clips != null)
            {
                return(model.Clips.Select(x => RestClip.Create(client, x)).ToArray());
            }
            return(null);
        }
Exemplo n.º 2
0
        public static async Task <IReadOnlyCollection <RestClip> > GetTopClipsAsync(BaseRestClient client, Action <TopClipsParams> options)
        {
            var token = TokenHelper.GetSingleToken(client);

            var properties = new TopClipsParams();

            options.Invoke(properties);

            var model = await client.RestClient.GetTopClipsInternalAsync(token, properties);

            var entity = model.Clips.Select(x => RestClip.Create(client, x));

            return(entity.ToArray());
        }