Ejemplo n.º 1
0
            public async static Task <Models.API.v3.Users.FollowedVideosResponse> GetFollowedVideosAsync(int limit = 25, int offset = 0, Enums.BroadcastType broadcastType = Enums.BroadcastType.All, string accessToken = null)
            {
                Shared.DynamicScopeValidation(Enums.AuthScopes.User_Read, accessToken);
                string paramsStr = $"?limit={limit}&offset={offset}";

                switch (broadcastType)
                {
                case Enums.BroadcastType.All:
                    paramsStr += "&broadcast_type=all";
                    break;

                case Enums.BroadcastType.Archive:
                    paramsStr += "&broadcast_type=archive";
                    break;

                case Enums.BroadcastType.Highlight:
                    paramsStr += "&broadcast_type=highlight";
                    break;
                }

                return(await Requests.GetGenericAsync <Models.API.v3.Users.FollowedVideosResponse>($"https://api.twitch.tv/kraken/videos/followed{paramsStr}", accessToken, Requests.API.v3));
            }
Ejemplo n.º 2
0
            public async Task <Models.API.v3.Users.FollowedVideosResponse> GetFollowedVideosAsync(int limit = 25, int offset = 0, Enums.BroadcastType broadcastType = Enums.BroadcastType.All, string accessToken = null)
            {
                Api.Settings.DynamicScopeValidation(Enums.AuthScopes.User_Read, accessToken);
                List <KeyValuePair <string, string> > getParams = new List <KeyValuePair <string, string> >()
                {
                    new KeyValuePair <string, string>("limit", limit.ToString()), new KeyValuePair <string, string>("offset", offset.ToString())
                };

                switch (broadcastType)
                {
                case Enums.BroadcastType.All:
                    getParams.Add(new KeyValuePair <string, string>("broadcast_type", "all"));
                    break;

                case Enums.BroadcastType.Archive:
                    getParams.Add(new KeyValuePair <string, string>("broadcast_type", "archive"));
                    break;

                case Enums.BroadcastType.Highlight:
                    getParams.Add(new KeyValuePair <string, string>("broadcast_type", "highlight"));
                    break;
                }

                return(await Api.GetGenericAsync <Models.API.v3.Users.FollowedVideosResponse>($"https://api.twitch.tv/kraken/videos/followed", getParams, accessToken, ApiVersion.v3).ConfigureAwait(false));
            }