Exemple #1
0
        /// <summary>
        /// Returns a collection of group items that match the API request parameters.
        /// Documentation https://developers.google.com/youtubeanalytics/v1beta1/reference/groupItems/list
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Youtubeanalytics service.</param>
        /// <param name="groupId">The id parameter specifies the unique ID of the group for which you want to retrieve group items.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>GroupItemListResponseResponse</returns>
        public static GroupItemListResponse List(YoutubeanalyticsService service, string groupId, GroupItemsListOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (groupId == null)
                {
                    throw new ArgumentNullException(groupId);
                }

                // Building the initial request.
                var request = service.GroupItems.List(groupId);

                // Applying optional parameters to the request.
                request = (GroupItemsResource.ListRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request GroupItems.List failed.", ex);
            }
        }
Exemple #2
0
        /// <summary>
        /// Removes an item from a group.
        /// Documentation https://developers.google.com/youtubeanalytics/v1beta1/reference/groupItems/delete
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Youtubeanalytics service.</param>
        /// <param name="id">The id parameter specifies the YouTube group item ID for the group that is being deleted.</param>
        /// <param name="optional">Optional paramaters.</param>
        public static void Delete(YoutubeanalyticsService service, string id, GroupItemsDeleteOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (id == null)
                {
                    throw new ArgumentNullException(id);
                }

                // Building the initial request.
                var request = service.GroupItems.Delete(id);

                // Applying optional parameters to the request.
                request = (GroupItemsResource.DeleteRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                request.Execute();
            }
            catch (Exception ex)
            {
                throw new Exception("Request GroupItems.Delete failed.", ex);
            }
        }
Exemple #3
0
        /// <summary>
        /// Modifies a group. For example, you could change a group's title.
        /// Documentation https://developers.google.com/youtubeanalytics/v1/reference/groups/update
        /// Generation Note: This does not always build corectly.  Google needs to standardise things I need to figuer out which ones are wrong.
        /// </summary>
        /// <param name="service">Authenticated Youtubeanalytics service.</param>
        /// <param name="body">A valid Youtubeanalytics v1 body.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>GroupResponse</returns>
        public static Group Update(YoutubeanalyticsService service, Group body, GroupsUpdateOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }

                // Building the initial request.
                var request = service.Groups.Update(body);

                // Applying optional parameters to the request.
                request = (GroupsResource.UpdateRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Groups.Update failed.", ex);
            }
        }