Exemple #1
0
        // Teams
        public static async Task <IReadOnlyCollection <RestSimpleTeam> > GetTeamsAsync(BaseTwitchClient client, PageOptions paging = null, RequestOptions options = null)
        {
            var model = await client.ApiClient.GetTeamsAsync(paging, options).ConfigureAwait(false);

            if (model.Teams != null)
            {
                return(model.Teams.Select(x => RestSimpleTeam.Create(client, x)).ToArray());
            }
            return(null);
        }
Exemple #2
0
        public static async Task <IReadOnlyCollection <RestSimpleTeam> > GetTeamsAsync(BaseRestClient client, uint limit, uint offset)
        {
            var token = TokenHelper.GetSingleToken(client);
            var model = await client.RestClient.GetTeamsInternalAsync(token, limit, offset);

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

            var entity = model.Teams.Select(x => RestSimpleTeam.Create(client, x));

            return(entity.ToArray());
        }
Exemple #3
0
        // Teams
        public static async Task <IReadOnlyCollection <RestSimpleTeam> > GetTeamsAsync(BaseTwitchClient client, ulong channelId, RequestOptions options = null)
        {
            var model = await client.ApiClient.GetChannelTeamsAsync(channelId, options).ConfigureAwait(false);

            return(model.Teams.Select(x => RestSimpleTeam.Create(client, x)).ToArray());
        }