Пример #1
0
        public static async Task <IReadOnlyCollection <RestStream> > GetStreamsAsync(BaseTwitchClient client, ulong[] channelIds, PageOptions paging = null, RequestOptions options = null)
        {
            var parameters = new GetStreamsParams()
            {
                ChannelIds = channelIds
            };

            return(await GetStreamsAsync(client, x => { x = parameters; }, paging, options));
        }
Пример #2
0
        public static async Task <IReadOnlyCollection <RestStream> > GetStreamsAsync(BaseTwitchClient client, Action <GetStreamsParams> parameters, PageOptions paging = null, RequestOptions options = null)
        {
            var filledParams = new GetStreamsParams();

            parameters.Invoke(filledParams);

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

            if (model.Streams != null)
            {
                return(model.Streams.Select(x => RestStream.Create(client, x)).ToArray());
            }
            return(null);
        }
Пример #3
0
        internal static async Task <IReadOnlyCollection <RestStream> > GetStreamsAsync(BaseRestClient client, Action <GetStreamsParams> options)
        {
            var token = TokenHelper.GetSingleToken(client);

            var changes = new GetStreamsParams();

            options.Invoke(changes);

            var model = await client.RestClient.GetStreamsInternalAsync(token, changes);

            if (model == null)
            {
                return(new List <RestStream>());
            }

            var entity = model.Streams.Select(x => RestStream.Create(client, x));

            return(entity.ToArray());
        }