/// <summary>
        /// List all of the audiences to which a user can share.
        /// Documentation https://developers.google.com/plusdomains/v1/reference/audiences/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 Plusdomains service.</param>
        /// <param name="userId">The ID of the user to get audiences for. The special value "me" can be used to indicate the authenticated user.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>AudiencesFeedResponse</returns>
        public static AudiencesFeed List(PlusdomainsService service, string userId, AudiencesListOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (userId == null)
                {
                    throw new ArgumentNullException(userId);
                }

                // Building the initial request.
                var request = service.Audiences.List(userId);

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

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Audiences.List failed.", ex);
            }
        }
示例#2
0
        /// <summary>
        /// Add a person to a circle. Google+ limits certain circle operations, including the number of circle adds. Learn More.
        /// Documentation https://developers.google.com/plusdomains/v1/reference/circles/addPeople
        /// 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 Plusdomains service.</param>
        /// <param name="circleId">The ID of the circle to add the person to.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>CircleResponse</returns>
        public static Circle AddPeople(PlusdomainsService service, string circleId, CirclesAddPeopleOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (circleId == null)
                {
                    throw new ArgumentNullException(circleId);
                }

                // Building the initial request.
                var request = service.Circles.AddPeople(circleId);

                // Applying optional parameters to the request.
                request = (CirclesResource.AddPeopleRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Circles.AddPeople failed.", ex);
            }
        }
        /// <summary>
        /// Add a new media item to an album. The current upload size limitations are 36MB for a photo and 1GB for a video. Uploads do not count against quota if photos are less than 2048 pixels on their longest side or videos are less than 15 minutes in length.
        /// Documentation https://developers.google.com/plusdomains/v1/reference/media/insert
        /// 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 Plusdomains service.</param>
        /// <param name="userId">The ID of the user to create the activity on behalf of.</param>
        /// <param name="collection">NA</param>
        /// <param name="body">A valid Plusdomains v1 body.</param>
        /// <returns>MediaResponse</returns>
        public static Media Insert(PlusdomainsService service, string userId, string collection, Media body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (userId == null)
                {
                    throw new ArgumentNullException(userId);
                }
                if (collection == null)
                {
                    throw new ArgumentNullException(collection);
                }

                // Make the request.
                return(service.Media.Insert(body, userId, collection).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Media.Insert failed.", ex);
            }
        }
        /// <summary>
        /// List all of the people in the specified collection for a particular activity.
        /// Documentation https://developers.google.com/plusdomains/v1/reference/people/listByActivity
        /// 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 Plusdomains service.</param>
        /// <param name="activityId">The ID of the activity to get the list of people for.</param>
        /// <param name="collection">The collection of people to list.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>PeopleFeedResponse</returns>
        public static PeopleFeed ListByActivity(PlusdomainsService service, string activityId, string collection, PeopleListByActivityOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (activityId == null)
                {
                    throw new ArgumentNullException(activityId);
                }
                if (collection == null)
                {
                    throw new ArgumentNullException(collection);
                }

                // Building the initial request.
                var request = service.People.ListByActivity(activityId, collection);

                // Applying optional parameters to the request.
                request = (PeopleResource.ListByActivityRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request People.ListByActivity failed.", ex);
            }
        }
示例#5
0
        /// <summary>
        /// Update a circle's description.
        /// Documentation https://developers.google.com/plusdomains/v1/reference/circles/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 Plusdomains service.</param>
        /// <param name="circleId">The ID of the circle to update.</param>
        /// <param name="body">A valid Plusdomains v1 body.</param>
        /// <returns>CircleResponse</returns>
        public static Circle Update(PlusdomainsService service, string circleId, Circle body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (circleId == null)
                {
                    throw new ArgumentNullException(circleId);
                }

                // Make the request.
                return(service.Circles.Update(body, circleId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Circles.Update failed.", ex);
            }
        }
示例#6
0
        /// <summary>
        /// Create a new comment in reply to an activity.
        /// Documentation https://developers.google.com/plusdomains/v1/reference/comments/insert
        /// 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 Plusdomains service.</param>
        /// <param name="activityId">The ID of the activity to reply to.</param>
        /// <param name="body">A valid Plusdomains v1 body.</param>
        /// <returns>CommentResponse</returns>
        public static Comment Insert(PlusdomainsService service, string activityId, Comment body)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (activityId == null)
                {
                    throw new ArgumentNullException(activityId);
                }

                // Make the request.
                return(service.Comments.Insert(body, activityId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Comments.Insert failed.", ex);
            }
        }
示例#7
0
        /// <summary>
        /// Delete a circle.
        /// Documentation https://developers.google.com/plusdomains/v1/reference/circles/remove
        /// 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 Plusdomains service.</param>
        /// <param name="circleId">The ID of the circle to delete.</param>
        public static void Remove(PlusdomainsService service, string circleId)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (circleId == null)
                {
                    throw new ArgumentNullException(circleId);
                }

                // Make the request.
                service.Circles.Remove(circleId).Execute();
            }
            catch (Exception ex)
            {
                throw new Exception("Request Circles.Remove failed.", ex);
            }
        }
        /// <summary>
        /// Get a person's profile.
        /// Documentation https://developers.google.com/plusdomains/v1/reference/people/get
        /// 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 Plusdomains service.</param>
        /// <param name="userId">The ID of the person to get the profile for. The special value "me" can be used to indicate the authenticated user.</param>
        /// <returns>PersonResponse</returns>
        public static Person Get(PlusdomainsService service, string userId)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (userId == null)
                {
                    throw new ArgumentNullException(userId);
                }

                // Make the request.
                return(service.People.Get(userId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request People.Get failed.", ex);
            }
        }
        /// <summary>
        /// Get an activity.
        /// Documentation https://developers.google.com/plusdomains/v1/reference/activities/get
        /// 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 Plusdomains service.</param>
        /// <param name="activityId">The ID of the activity to get.</param>
        /// <returns>ActivityResponse</returns>
        public static Activity Get(PlusdomainsService service, string activityId)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (activityId == null)
                {
                    throw new ArgumentNullException(activityId);
                }

                // Make the request.
                return(service.Activities.Get(activityId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Activities.Get failed.", ex);
            }
        }
示例#10
0
        /// <summary>
        /// Get a comment.
        /// Documentation https://developers.google.com/plusdomains/v1/reference/comments/get
        /// 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 Plusdomains service.</param>
        /// <param name="commentId">The ID of the comment to get.</param>
        /// <returns>CommentResponse</returns>
        public static Comment Get(PlusdomainsService service, string commentId)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (commentId == null)
                {
                    throw new ArgumentNullException(commentId);
                }

                // Make the request.
                return(service.Comments.Get(commentId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Comments.Get failed.", ex);
            }
        }