Example #1
0
        public static async Task<ResponceData> ExecuteAsync(this VideosResource.ListRequest request, RequestData requestData)
        {
            request.OauthToken = requestData.OauthToken;
            request.PageToken = requestData.PageToken;
            request.MaxResults = requestData.ItemsCount;

            VideoListResponse response;

            while (true)
            {
                try
                {
                    response = await request.ExecuteAsync();
                    break;
                }
                catch (System.Exception e)
                {
                    Debug.WriteLine(e);
                }
            }
            var item = response.Items[0];

            var responceData = new ResponceData() { Items = response.Items, NextPageToken = response.NextPageToken, TotalResults = response.PageInfo.TotalResults.Value };

            return responceData;
        }
Example #2
0
        public static async Task<ResponceData> ExecuteAsync(this ActivitiesResource.ListRequest request, RequestData requestData)
        {
            request.PageToken = requestData.PageToken;
            request.MaxResults = requestData.ItemsCount;

            ActivityListResponse response;

            while (true)
            {
                try
                {
                    response = await request.ExecuteAsync();
                    break;
                }
                catch (System.Exception e)
                {
                    Debug.WriteLine(e);
                }
            }
            var item = response.Items[0];

            var responceData = new ResponceData() { Items = response.Items.Where(a => a.Snippet.Type == "upload"), NextPageToken = response.NextPageToken, TotalResults = response.PageInfo.TotalResults.Value };

            return responceData;
        }