internal new static RestChannelSubscription Create(BaseTwitchClient client, Model model) { var entity = new RestChannelSubscription(client, model.Id); entity.Update(model); return(entity); }
internal static RestSimpleTeam Create(BaseTwitchClient client, Model model) { var entity = new RestSimpleTeam(client, model.Id); entity.Update(model); return(entity); }
internal new static RestCommunity Create(BaseTwitchClient client, Model model) { var entity = new RestCommunity(client, model.Id); entity.Update(model); return(entity); }
internal static RestBlockedUser Create(BaseTwitchClient client, Model model) { var entity = new RestBlockedUser(client, model.Id); entity.Update(model); return(entity); }
internal static RestFeaturedStream Create(BaseTwitchClient client, Model model) { var entity = new RestFeaturedStream(); entity.Update(client, model); return(entity); }
internal new static RestChannelFollow Create(BaseTwitchClient client, Model model) { var entity = new RestChannelFollow(client); entity.Update(model); return(entity); }
internal new static RestSelfChannel Create(BaseTwitchClient client, Model model) { var entity = new RestSelfChannel(client, model.Id); entity.Update(model); return(entity); }
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)); }
// Videos public static async Task <RestVideo> GetVideoAsync(BaseTwitchClient client, string videoId, RequestOptions options = null) { var model = await client.ApiClient.GetVideoAsync(videoId, options).ConfigureAwait(false); if (model != null) { return(RestVideo.Create(client, model)); } return(null); }
// Streams public static async Task <RestStream> GetStreamAsync(BaseTwitchClient client, ulong channelId, StreamType type, RequestOptions options = null) { var model = await client.ApiClient.GetStreamAsync(channelId, type, options).ConfigureAwait(false); if (model.Stream != null) { return(RestStream.Create(client, model.Stream)); } return(null); }
// Ingests public static async Task <IReadOnlyCollection <RestIngest> > GetIngestsAsync(BaseTwitchClient client, RequestOptions options = null) { var model = await client.ApiClient.GetIngestsAsync(options).ConfigureAwait(false); if (model.Ingests != null) { return(model.Ingests.Select(x => RestIngest.Create(client, x)).ToArray()); } return(null); }
// Communities public static async Task <RestCommunity> GetCommunityAsync(BaseTwitchClient client, string communityId, bool isname, RequestOptions options = null) { var model = await client.ApiClient.GetCommunityAsync(communityId, isname, options).ConfigureAwait(false); if (model != null) { return(RestCommunity.Create(client, model)); } return(null); }
public static async Task <RestChannel> GetChannelAsync(BaseTwitchClient client, ulong channelId, RequestOptions options = null) { var model = await client.ApiClient.GetChannelAsync(channelId, options).ConfigureAwait(false); if (model != null) { return(RestChannel.Create(client, model)); } return(null); }
public static async Task <IReadOnlyCollection <RestUser> > GetUsersAsync(BaseTwitchClient client, string[] usernames, RequestOptions options = null) { var model = await client.ApiClient.GetUsersAsync(usernames, options).ConfigureAwait(false); if (model.Users != null) { return(model.Users.Select(x => RestUser.Create(client, x)).ToArray()); } return(null); }
// Users public static async Task <RestSelfUser> GetCurrentUserAsync(BaseTwitchClient client, RequestOptions options = null) { var model = await client.ApiClient.GetMyUserAsync(options).ConfigureAwait(false); if (model != null) { return(RestSelfUser.Create(client, model)); } return(null); }
public static async Task <RestTeam> GetTeamAsync(BaseTwitchClient client, string name, RequestOptions options = null) { var model = await client.ApiClient.GetTeamAsync(name, options).ConfigureAwait(false); if (model != null) { return(RestTeam.Create(client, model)); } return(null); }
public static async Task <IReadOnlyCollection <RestGame> > FindGamesAsync(BaseTwitchClient client, string query, bool islive, RequestOptions options = null) { var model = await client.ApiClient.FindGamesAsync(query, islive, options).ConfigureAwait(false); if (model.Games != null) { return(model.Games.Select(x => RestGame.Create(client, x)).ToArray()); } return(null); }
public static async Task <RestGameSummary> GetGameSummaryAsync(BaseTwitchClient client, string game, RequestOptions options = null) { var model = await client.ApiClient.GetStreamSummaryAsync(game, options).ConfigureAwait(false); if (model != null) { return(RestGameSummary.Create(model)); } return(null); }
// Tokens public static async Task <RestTokenInfo> GetTokenInfoAsync(BaseTwitchClient client, RequestOptions options = null) { var model = await client.ApiClient.ValidateTokenAsync(options).ConfigureAwait(false); if (model.Token != null) { return(RestTokenInfo.Create(client.ApiClient.AuthToken, model.Token)); } return(null); }
internal virtual void Update(BaseTwitchClient client, Model model) { Stream = new RestStream(client, model.Stream.Id); Stream.Update(model.Stream); Image = model.Image; Priority = model.Priority; Scheduled = model.Scheduled; Sponsored = model.Sponsored; Text = model.Text; Title = model.Title; }
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); }
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); }
internal RestSimpleTeam(BaseTwitchClient client, ulong id) : base(client, id) { }
internal RestSelfChannel(BaseTwitchClient client, ulong id) : base(client, id) { }
internal RestChannelFollow(BaseTwitchClient client) : base(client) { }
internal RestClip(BaseTwitchClient client, string id) : base(client, id) { }
// Videos public static async Task <IReadOnlyCollection <RestVideo> > GetVideosAsync(BaseTwitchClient client, ulong channelId, PageOptions paging = null, RequestOptions options = null) { var model = await client.ApiClient.GetChannelVideosAsync(channelId, paging, options).ConfigureAwait(false); return(model.Videos.Select(x => RestVideo.Create(client, x)).ToArray()); }
public static async Task <RestUserSubscription> GetSubscriberAsync(BaseTwitchClient client, ulong channelId, ulong userId, RequestOptions options = null) { var model = await client.ApiClient.GetChannelSubscriberAsync(channelId, userId, options).ConfigureAwait(false); return(RestUserSubscription.Create(client, model)); }
public static async Task <IReadOnlyCollection <RestUserSubscription> > GetSubscribersAsync(BaseTwitchClient client, ulong channelId, bool ascending, PageOptions paging = null, RequestOptions options = null) { var model = await client.ApiClient.GetChannelSubscribersAsync(channelId, ascending, paging, options).ConfigureAwait(false); return(model.Subscriptions.Select(x => RestUserSubscription.Create(client, x)).ToArray()); }
public static async Task <IReadOnlyCollection <RestUser> > GetEditorsAsync(BaseTwitchClient client, ulong channelId, RequestOptions options = null) { var model = await client.ApiClient.GetChannelEditorsAsync(channelId, options).ConfigureAwait(false); return(model.Users.Select(x => RestUser.Create(client, x)).ToArray()); }