/// <summary>
        /// Returns a list of invitations that the requesting user is permitted toview, restricted to those that match the list request.*Note:* At least one of `user_id` or `course_id` must be supplied. Bothfields can be supplied.This method returns the following error codes:* `PERMISSION_DENIED` for access errors.
        /// Documentation https://developers.google.com/classroom/v1/reference/invitations/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 Classroom service.</param>
        /// <param name="optional">Optional paramaters.</param>
        /// <returns>ListInvitationsResponseResponse</returns>
        public static ListInvitationsResponse List(ClassroomService service, InvitationsListOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }

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

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

                // Requesting data.
                return(request.Execute());
            }
            catch (Exception ex)
            {
                throw new Exception("Request Invitations.List failed.", ex);
            }
        }
示例#2
0
        /// <param name="optional">Optional paramaters.</param>        /// <returns>ListClientUserInvitationsResponseResponse</returns>
        public static ListClientUserInvitationsResponse List(AdExchangeBuyerIIService service, string accountId, string clientAccountId, InvitationsListOptionalParms optional = null)
        {
            try
            {
                // Initial validation.
                if (service == null)
                {
                    throw new ArgumentNullException("service");
                }
                if (accountId == null)
                {
                    throw new ArgumentNullException(accountId);
                }
                if (clientAccountId == null)
                {
                    throw new ArgumentNullException(clientAccountId);
                }

                // Building the initial request.
                var request = service.Invitations.List(accountId, clientAccountId);

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

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