Exemplo n.º 1
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);
            }
        }
Exemplo n.º 2
0
        /// <summary>
        /// List all of the comments for an activity.
        /// Documentation https://developers.google.com/plusdomains/v1/reference/comments/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="activityId">The ID of the activity to get comments for.</param>
        /// <param name="optional">Optional paramaters.</param>        /// <returns>CommentFeedResponse</returns>
        public static CommentFeed List(plusDomainsService service, string activityId, CommentsListOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (activityId == null)
                {
                    throw new ArgumentNullException(activityId);
                }

                // Building the initial request.
                var request = service.Comments.List(activityId);

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

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Comments.List failed.", ex);
            }
        }
Exemplo n.º 3
0
        /// <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);
            }
        }
Exemplo n.º 4
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);
            }
        }
Exemplo n.º 5
0
        /// <summary>
        /// Update a circle's description. This method supports patch semantics.
        /// Documentation https://developers.google.com/plusdomains/v1/reference/circles/patch
        /// 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 Patch(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.Patch(body, circleId).Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Circles.Patch failed.", ex);
            }
        }
        /// <summary>
        /// Create a new activity for the authenticated user.
        /// Documentation https://developers.google.com/plusdomains/v1/reference/activities/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. Its value should be "me", to indicate the authenticated user.</param>
        /// <param name="body">A valid plusDomains v1 body.</param>
        /// <param name="optional">Optional paramaters.</param>        /// <returns>ActivityResponse</returns>
        public static Activity Insert(plusDomainsService service, string userId, Activity body, ActivitiesInsertOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (body == null)
                {
                    throw new ArgumentNullException("body");
                }
                if (userId == null)
                {
                    throw new ArgumentNullException(userId);
                }

                // Building the initial request.
                var request = service.Activities.Insert(body, userId);

                // Applying optional parameters to the request.
                request = (ActivitiesResource.InsertRequest)SampleHelpers.ApplyOptionalParms(request, optional);

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Activities.Insert failed.", ex);
            }
        }
Exemplo n.º 7
0
        /// <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);
            }
        }
Exemplo n.º 8
0
        /// <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);
            }
        }
Exemplo n.º 9
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);
            }
        }
        /// <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);
            }
        }