// 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); }
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()); }
// 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()); }