...

Source file src/google.golang.org/api/classroom/v1/classroom-gen.go

Documentation: google.golang.org/api/classroom/v1

     1  // Copyright 2024 Google LLC.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  // Code generated file. DO NOT EDIT.
     6  
     7  // Package classroom provides access to the Google Classroom API.
     8  //
     9  // For product documentation, see: https://developers.google.com/classroom/
    10  //
    11  // # Library status
    12  //
    13  // These client libraries are officially supported by Google. However, this
    14  // library is considered complete and is in maintenance mode. This means
    15  // that we will address critical bugs and security issues but will not add
    16  // any new features.
    17  //
    18  // When possible, we recommend using our newer
    19  // [Cloud Client Libraries for Go](https://pkg.go.dev/cloud.google.com/go)
    20  // that are still actively being worked and iterated on.
    21  //
    22  // # Creating a client
    23  //
    24  // Usage example:
    25  //
    26  //	import "google.golang.org/api/classroom/v1"
    27  //	...
    28  //	ctx := context.Background()
    29  //	classroomService, err := classroom.NewService(ctx)
    30  //
    31  // In this example, Google Application Default Credentials are used for
    32  // authentication. For information on how to create and obtain Application
    33  // Default Credentials, see https://developers.google.com/identity/protocols/application-default-credentials.
    34  //
    35  // # Other authentication options
    36  //
    37  // By default, all available scopes (see "Constants") are used to authenticate.
    38  // To restrict scopes, use [google.golang.org/api/option.WithScopes]:
    39  //
    40  //	classroomService, err := classroom.NewService(ctx, option.WithScopes(classroom.ClassroomTopicsReadonlyScope))
    41  //
    42  // To use an API key for authentication (note: some APIs do not support API
    43  // keys), use [google.golang.org/api/option.WithAPIKey]:
    44  //
    45  //	classroomService, err := classroom.NewService(ctx, option.WithAPIKey("AIza..."))
    46  //
    47  // To use an OAuth token (e.g., a user token obtained via a three-legged OAuth
    48  // flow, use [google.golang.org/api/option.WithTokenSource]:
    49  //
    50  //	config := &oauth2.Config{...}
    51  //	// ...
    52  //	token, err := config.Exchange(ctx, ...)
    53  //	classroomService, err := classroom.NewService(ctx, option.WithTokenSource(config.TokenSource(ctx, token)))
    54  //
    55  // See [google.golang.org/api/option.ClientOption] for details on options.
    56  package classroom // import "google.golang.org/api/classroom/v1"
    57  
    58  import (
    59  	"bytes"
    60  	"context"
    61  	"encoding/json"
    62  	"errors"
    63  	"fmt"
    64  	"io"
    65  	"net/http"
    66  	"net/url"
    67  	"strconv"
    68  	"strings"
    69  
    70  	googleapi "google.golang.org/api/googleapi"
    71  	internal "google.golang.org/api/internal"
    72  	gensupport "google.golang.org/api/internal/gensupport"
    73  	option "google.golang.org/api/option"
    74  	internaloption "google.golang.org/api/option/internaloption"
    75  	htransport "google.golang.org/api/transport/http"
    76  )
    77  
    78  // Always reference these packages, just in case the auto-generated code
    79  // below doesn't.
    80  var _ = bytes.NewBuffer
    81  var _ = strconv.Itoa
    82  var _ = fmt.Sprintf
    83  var _ = json.NewDecoder
    84  var _ = io.Copy
    85  var _ = url.Parse
    86  var _ = gensupport.MarshalJSON
    87  var _ = googleapi.Version
    88  var _ = errors.New
    89  var _ = strings.Replace
    90  var _ = context.Canceled
    91  var _ = internaloption.WithDefaultEndpoint
    92  var _ = internal.Version
    93  
    94  const apiId = "classroom:v1"
    95  const apiName = "classroom"
    96  const apiVersion = "v1"
    97  const basePath = "https://classroom.googleapis.com/"
    98  const basePathTemplate = "https://classroom.UNIVERSE_DOMAIN/"
    99  const mtlsBasePath = "https://classroom.mtls.googleapis.com/"
   100  
   101  // OAuth2 scopes used by this API.
   102  const (
   103  	// View and manage announcements in Google Classroom
   104  	ClassroomAnnouncementsScope = "https://www.googleapis.com/auth/classroom.announcements"
   105  
   106  	// View announcements in Google Classroom
   107  	ClassroomAnnouncementsReadonlyScope = "https://www.googleapis.com/auth/classroom.announcements.readonly"
   108  
   109  	// See, edit, create, and permanently delete your Google Classroom classes
   110  	ClassroomCoursesScope = "https://www.googleapis.com/auth/classroom.courses"
   111  
   112  	// View your Google Classroom classes
   113  	ClassroomCoursesReadonlyScope = "https://www.googleapis.com/auth/classroom.courses.readonly"
   114  
   115  	// See, create and edit coursework items including assignments, questions, and
   116  	// grades
   117  	ClassroomCourseworkMeScope = "https://www.googleapis.com/auth/classroom.coursework.me"
   118  
   119  	// View your course work and grades in Google Classroom
   120  	ClassroomCourseworkMeReadonlyScope = "https://www.googleapis.com/auth/classroom.coursework.me.readonly"
   121  
   122  	// Manage course work and grades for students in the Google Classroom classes
   123  	// you teach and view the course work and grades for classes you administer
   124  	ClassroomCourseworkStudentsScope = "https://www.googleapis.com/auth/classroom.coursework.students"
   125  
   126  	// View course work and grades for students in the Google Classroom classes you
   127  	// teach or administer
   128  	ClassroomCourseworkStudentsReadonlyScope = "https://www.googleapis.com/auth/classroom.coursework.students.readonly"
   129  
   130  	// See, edit, and create classwork materials in Google Classroom
   131  	ClassroomCourseworkmaterialsScope = "https://www.googleapis.com/auth/classroom.courseworkmaterials"
   132  
   133  	// See all classwork materials for your Google Classroom classes
   134  	ClassroomCourseworkmaterialsReadonlyScope = "https://www.googleapis.com/auth/classroom.courseworkmaterials.readonly"
   135  
   136  	// View your Google Classroom guardians
   137  	ClassroomGuardianlinksMeReadonlyScope = "https://www.googleapis.com/auth/classroom.guardianlinks.me.readonly"
   138  
   139  	// View and manage guardians for students in your Google Classroom classes
   140  	ClassroomGuardianlinksStudentsScope = "https://www.googleapis.com/auth/classroom.guardianlinks.students"
   141  
   142  	// View guardians for students in your Google Classroom classes
   143  	ClassroomGuardianlinksStudentsReadonlyScope = "https://www.googleapis.com/auth/classroom.guardianlinks.students.readonly"
   144  
   145  	// View the email addresses of people in your classes
   146  	ClassroomProfileEmailsScope = "https://www.googleapis.com/auth/classroom.profile.emails"
   147  
   148  	// View the profile photos of people in your classes
   149  	ClassroomProfilePhotosScope = "https://www.googleapis.com/auth/classroom.profile.photos"
   150  
   151  	// Receive notifications about your Google Classroom data
   152  	ClassroomPushNotificationsScope = "https://www.googleapis.com/auth/classroom.push-notifications"
   153  
   154  	// Manage your Google Classroom class rosters
   155  	ClassroomRostersScope = "https://www.googleapis.com/auth/classroom.rosters"
   156  
   157  	// View your Google Classroom class rosters
   158  	ClassroomRostersReadonlyScope = "https://www.googleapis.com/auth/classroom.rosters.readonly"
   159  
   160  	// View your course work and grades in Google Classroom
   161  	ClassroomStudentSubmissionsMeReadonlyScope = "https://www.googleapis.com/auth/classroom.student-submissions.me.readonly"
   162  
   163  	// View course work and grades for students in the Google Classroom classes you
   164  	// teach or administer
   165  	ClassroomStudentSubmissionsStudentsReadonlyScope = "https://www.googleapis.com/auth/classroom.student-submissions.students.readonly"
   166  
   167  	// See, create, and edit topics in Google Classroom
   168  	ClassroomTopicsScope = "https://www.googleapis.com/auth/classroom.topics"
   169  
   170  	// View topics in Google Classroom
   171  	ClassroomTopicsReadonlyScope = "https://www.googleapis.com/auth/classroom.topics.readonly"
   172  )
   173  
   174  // NewService creates a new Service.
   175  func NewService(ctx context.Context, opts ...option.ClientOption) (*Service, error) {
   176  	scopesOption := internaloption.WithDefaultScopes(
   177  		"https://www.googleapis.com/auth/classroom.announcements",
   178  		"https://www.googleapis.com/auth/classroom.announcements.readonly",
   179  		"https://www.googleapis.com/auth/classroom.courses",
   180  		"https://www.googleapis.com/auth/classroom.courses.readonly",
   181  		"https://www.googleapis.com/auth/classroom.coursework.me",
   182  		"https://www.googleapis.com/auth/classroom.coursework.me.readonly",
   183  		"https://www.googleapis.com/auth/classroom.coursework.students",
   184  		"https://www.googleapis.com/auth/classroom.coursework.students.readonly",
   185  		"https://www.googleapis.com/auth/classroom.courseworkmaterials",
   186  		"https://www.googleapis.com/auth/classroom.courseworkmaterials.readonly",
   187  		"https://www.googleapis.com/auth/classroom.guardianlinks.me.readonly",
   188  		"https://www.googleapis.com/auth/classroom.guardianlinks.students",
   189  		"https://www.googleapis.com/auth/classroom.guardianlinks.students.readonly",
   190  		"https://www.googleapis.com/auth/classroom.profile.emails",
   191  		"https://www.googleapis.com/auth/classroom.profile.photos",
   192  		"https://www.googleapis.com/auth/classroom.push-notifications",
   193  		"https://www.googleapis.com/auth/classroom.rosters",
   194  		"https://www.googleapis.com/auth/classroom.rosters.readonly",
   195  		"https://www.googleapis.com/auth/classroom.student-submissions.me.readonly",
   196  		"https://www.googleapis.com/auth/classroom.student-submissions.students.readonly",
   197  		"https://www.googleapis.com/auth/classroom.topics",
   198  		"https://www.googleapis.com/auth/classroom.topics.readonly",
   199  	)
   200  	// NOTE: prepend, so we don't override user-specified scopes.
   201  	opts = append([]option.ClientOption{scopesOption}, opts...)
   202  	opts = append(opts, internaloption.WithDefaultEndpoint(basePath))
   203  	opts = append(opts, internaloption.WithDefaultEndpointTemplate(basePathTemplate))
   204  	opts = append(opts, internaloption.WithDefaultMTLSEndpoint(mtlsBasePath))
   205  	opts = append(opts, internaloption.EnableNewAuthLibrary())
   206  	client, endpoint, err := htransport.NewClient(ctx, opts...)
   207  	if err != nil {
   208  		return nil, err
   209  	}
   210  	s, err := New(client)
   211  	if err != nil {
   212  		return nil, err
   213  	}
   214  	if endpoint != "" {
   215  		s.BasePath = endpoint
   216  	}
   217  	return s, nil
   218  }
   219  
   220  // New creates a new Service. It uses the provided http.Client for requests.
   221  //
   222  // Deprecated: please use NewService instead.
   223  // To provide a custom HTTP client, use option.WithHTTPClient.
   224  // If you are using google.golang.org/api/googleapis/transport.APIKey, use option.WithAPIKey with NewService instead.
   225  func New(client *http.Client) (*Service, error) {
   226  	if client == nil {
   227  		return nil, errors.New("client is nil")
   228  	}
   229  	s := &Service{client: client, BasePath: basePath}
   230  	s.Courses = NewCoursesService(s)
   231  	s.Invitations = NewInvitationsService(s)
   232  	s.Registrations = NewRegistrationsService(s)
   233  	s.UserProfiles = NewUserProfilesService(s)
   234  	return s, nil
   235  }
   236  
   237  type Service struct {
   238  	client    *http.Client
   239  	BasePath  string // API endpoint base URL
   240  	UserAgent string // optional additional User-Agent fragment
   241  
   242  	Courses *CoursesService
   243  
   244  	Invitations *InvitationsService
   245  
   246  	Registrations *RegistrationsService
   247  
   248  	UserProfiles *UserProfilesService
   249  }
   250  
   251  func (s *Service) userAgent() string {
   252  	if s.UserAgent == "" {
   253  		return googleapi.UserAgent
   254  	}
   255  	return googleapi.UserAgent + " " + s.UserAgent
   256  }
   257  
   258  func NewCoursesService(s *Service) *CoursesService {
   259  	rs := &CoursesService{s: s}
   260  	rs.Aliases = NewCoursesAliasesService(s)
   261  	rs.Announcements = NewCoursesAnnouncementsService(s)
   262  	rs.CourseWork = NewCoursesCourseWorkService(s)
   263  	rs.CourseWorkMaterials = NewCoursesCourseWorkMaterialsService(s)
   264  	rs.Students = NewCoursesStudentsService(s)
   265  	rs.Teachers = NewCoursesTeachersService(s)
   266  	rs.Topics = NewCoursesTopicsService(s)
   267  	return rs
   268  }
   269  
   270  type CoursesService struct {
   271  	s *Service
   272  
   273  	Aliases *CoursesAliasesService
   274  
   275  	Announcements *CoursesAnnouncementsService
   276  
   277  	CourseWork *CoursesCourseWorkService
   278  
   279  	CourseWorkMaterials *CoursesCourseWorkMaterialsService
   280  
   281  	Students *CoursesStudentsService
   282  
   283  	Teachers *CoursesTeachersService
   284  
   285  	Topics *CoursesTopicsService
   286  }
   287  
   288  func NewCoursesAliasesService(s *Service) *CoursesAliasesService {
   289  	rs := &CoursesAliasesService{s: s}
   290  	return rs
   291  }
   292  
   293  type CoursesAliasesService struct {
   294  	s *Service
   295  }
   296  
   297  func NewCoursesAnnouncementsService(s *Service) *CoursesAnnouncementsService {
   298  	rs := &CoursesAnnouncementsService{s: s}
   299  	return rs
   300  }
   301  
   302  type CoursesAnnouncementsService struct {
   303  	s *Service
   304  }
   305  
   306  func NewCoursesCourseWorkService(s *Service) *CoursesCourseWorkService {
   307  	rs := &CoursesCourseWorkService{s: s}
   308  	rs.StudentSubmissions = NewCoursesCourseWorkStudentSubmissionsService(s)
   309  	return rs
   310  }
   311  
   312  type CoursesCourseWorkService struct {
   313  	s *Service
   314  
   315  	StudentSubmissions *CoursesCourseWorkStudentSubmissionsService
   316  }
   317  
   318  func NewCoursesCourseWorkStudentSubmissionsService(s *Service) *CoursesCourseWorkStudentSubmissionsService {
   319  	rs := &CoursesCourseWorkStudentSubmissionsService{s: s}
   320  	return rs
   321  }
   322  
   323  type CoursesCourseWorkStudentSubmissionsService struct {
   324  	s *Service
   325  }
   326  
   327  func NewCoursesCourseWorkMaterialsService(s *Service) *CoursesCourseWorkMaterialsService {
   328  	rs := &CoursesCourseWorkMaterialsService{s: s}
   329  	return rs
   330  }
   331  
   332  type CoursesCourseWorkMaterialsService struct {
   333  	s *Service
   334  }
   335  
   336  func NewCoursesStudentsService(s *Service) *CoursesStudentsService {
   337  	rs := &CoursesStudentsService{s: s}
   338  	return rs
   339  }
   340  
   341  type CoursesStudentsService struct {
   342  	s *Service
   343  }
   344  
   345  func NewCoursesTeachersService(s *Service) *CoursesTeachersService {
   346  	rs := &CoursesTeachersService{s: s}
   347  	return rs
   348  }
   349  
   350  type CoursesTeachersService struct {
   351  	s *Service
   352  }
   353  
   354  func NewCoursesTopicsService(s *Service) *CoursesTopicsService {
   355  	rs := &CoursesTopicsService{s: s}
   356  	return rs
   357  }
   358  
   359  type CoursesTopicsService struct {
   360  	s *Service
   361  }
   362  
   363  func NewInvitationsService(s *Service) *InvitationsService {
   364  	rs := &InvitationsService{s: s}
   365  	return rs
   366  }
   367  
   368  type InvitationsService struct {
   369  	s *Service
   370  }
   371  
   372  func NewRegistrationsService(s *Service) *RegistrationsService {
   373  	rs := &RegistrationsService{s: s}
   374  	return rs
   375  }
   376  
   377  type RegistrationsService struct {
   378  	s *Service
   379  }
   380  
   381  func NewUserProfilesService(s *Service) *UserProfilesService {
   382  	rs := &UserProfilesService{s: s}
   383  	rs.GuardianInvitations = NewUserProfilesGuardianInvitationsService(s)
   384  	rs.Guardians = NewUserProfilesGuardiansService(s)
   385  	return rs
   386  }
   387  
   388  type UserProfilesService struct {
   389  	s *Service
   390  
   391  	GuardianInvitations *UserProfilesGuardianInvitationsService
   392  
   393  	Guardians *UserProfilesGuardiansService
   394  }
   395  
   396  func NewUserProfilesGuardianInvitationsService(s *Service) *UserProfilesGuardianInvitationsService {
   397  	rs := &UserProfilesGuardianInvitationsService{s: s}
   398  	return rs
   399  }
   400  
   401  type UserProfilesGuardianInvitationsService struct {
   402  	s *Service
   403  }
   404  
   405  func NewUserProfilesGuardiansService(s *Service) *UserProfilesGuardiansService {
   406  	rs := &UserProfilesGuardiansService{s: s}
   407  	return rs
   408  }
   409  
   410  type UserProfilesGuardiansService struct {
   411  	s *Service
   412  }
   413  
   414  // Announcement: Announcement created by a teacher for students of the course
   415  type Announcement struct {
   416  	// AlternateLink: Absolute link to this announcement in the Classroom web UI.
   417  	// This is only populated if `state` is `PUBLISHED`. Read-only.
   418  	AlternateLink string `json:"alternateLink,omitempty"`
   419  	// AssigneeMode: Assignee mode of the announcement. If unspecified, the default
   420  	// value is `ALL_STUDENTS`.
   421  	//
   422  	// Possible values:
   423  	//   "ASSIGNEE_MODE_UNSPECIFIED" - No mode specified. This is never returned.
   424  	//   "ALL_STUDENTS" - All students can see the item. This is the default state.
   425  	//   "INDIVIDUAL_STUDENTS" - A subset of the students can see the item.
   426  	AssigneeMode string `json:"assigneeMode,omitempty"`
   427  	// CourseId: Identifier of the course. Read-only.
   428  	CourseId string `json:"courseId,omitempty"`
   429  	// CreationTime: Timestamp when this announcement was created. Read-only.
   430  	CreationTime string `json:"creationTime,omitempty"`
   431  	// CreatorUserId: Identifier for the user that created the announcement.
   432  	// Read-only.
   433  	CreatorUserId string `json:"creatorUserId,omitempty"`
   434  	// Id: Classroom-assigned identifier of this announcement, unique per course.
   435  	// Read-only.
   436  	Id string `json:"id,omitempty"`
   437  	// IndividualStudentsOptions: Identifiers of students with access to the
   438  	// announcement. This field is set only if `assigneeMode` is
   439  	// `INDIVIDUAL_STUDENTS`. If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then
   440  	// only students specified in this field can see the announcement.
   441  	IndividualStudentsOptions *IndividualStudentsOptions `json:"individualStudentsOptions,omitempty"`
   442  	// Materials: Additional materials. Announcements must have no more than 20
   443  	// material items.
   444  	Materials []*Material `json:"materials,omitempty"`
   445  	// ScheduledTime: Optional timestamp when this announcement is scheduled to be
   446  	// published.
   447  	ScheduledTime string `json:"scheduledTime,omitempty"`
   448  	// State: Status of this announcement. If unspecified, the default state is
   449  	// `DRAFT`.
   450  	//
   451  	// Possible values:
   452  	//   "ANNOUNCEMENT_STATE_UNSPECIFIED" - No state specified. This is never
   453  	// returned.
   454  	//   "PUBLISHED" - Status for announcement that has been published. This is the
   455  	// default state.
   456  	//   "DRAFT" - Status for an announcement that is not yet published.
   457  	// Announcement in this state is visible only to course teachers and domain
   458  	// administrators.
   459  	//   "DELETED" - Status for announcement that was published but is now deleted.
   460  	// Announcement in this state is visible only to course teachers and domain
   461  	// administrators. Announcement in this state is deleted after some time.
   462  	State string `json:"state,omitempty"`
   463  	// Text: Description of this announcement. The text must be a valid UTF-8
   464  	// string containing no more than 30,000 characters.
   465  	Text string `json:"text,omitempty"`
   466  	// UpdateTime: Timestamp of the most recent change to this announcement.
   467  	// Read-only.
   468  	UpdateTime string `json:"updateTime,omitempty"`
   469  
   470  	// ServerResponse contains the HTTP response code and headers from the server.
   471  	googleapi.ServerResponse `json:"-"`
   472  	// ForceSendFields is a list of field names (e.g. "AlternateLink") to
   473  	// unconditionally include in API requests. By default, fields with empty or
   474  	// default values are omitted from API requests. See
   475  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   476  	// details.
   477  	ForceSendFields []string `json:"-"`
   478  	// NullFields is a list of field names (e.g. "AlternateLink") to include in API
   479  	// requests with the JSON null value. By default, fields with empty values are
   480  	// omitted from API requests. See
   481  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   482  	NullFields []string `json:"-"`
   483  }
   484  
   485  func (s *Announcement) MarshalJSON() ([]byte, error) {
   486  	type NoMethod Announcement
   487  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   488  }
   489  
   490  // Assignment: Additional details for assignments.
   491  type Assignment struct {
   492  	// StudentWorkFolder: Drive folder where attachments from student submissions
   493  	// are placed. This is only populated for course teachers and administrators.
   494  	StudentWorkFolder *DriveFolder `json:"studentWorkFolder,omitempty"`
   495  	// ForceSendFields is a list of field names (e.g. "StudentWorkFolder") to
   496  	// unconditionally include in API requests. By default, fields with empty or
   497  	// default values are omitted from API requests. See
   498  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   499  	// details.
   500  	ForceSendFields []string `json:"-"`
   501  	// NullFields is a list of field names (e.g. "StudentWorkFolder") to include in
   502  	// API requests with the JSON null value. By default, fields with empty values
   503  	// are omitted from API requests. See
   504  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   505  	NullFields []string `json:"-"`
   506  }
   507  
   508  func (s *Assignment) MarshalJSON() ([]byte, error) {
   509  	type NoMethod Assignment
   510  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   511  }
   512  
   513  // AssignmentSubmission: Student work for an assignment.
   514  type AssignmentSubmission struct {
   515  	// Attachments: Attachments added by the student. Drive files that correspond
   516  	// to materials with a share mode of STUDENT_COPY may not exist yet if the
   517  	// student has not accessed the assignment in Classroom. Some attachment
   518  	// metadata is only populated if the requesting user has permission to access
   519  	// it. Identifier and alternate_link fields are always available, but others
   520  	// (for example, title) may not be.
   521  	Attachments []*Attachment `json:"attachments,omitempty"`
   522  	// ForceSendFields is a list of field names (e.g. "Attachments") to
   523  	// unconditionally include in API requests. By default, fields with empty or
   524  	// default values are omitted from API requests. See
   525  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   526  	// details.
   527  	ForceSendFields []string `json:"-"`
   528  	// NullFields is a list of field names (e.g. "Attachments") to include in API
   529  	// requests with the JSON null value. By default, fields with empty values are
   530  	// omitted from API requests. See
   531  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   532  	NullFields []string `json:"-"`
   533  }
   534  
   535  func (s *AssignmentSubmission) MarshalJSON() ([]byte, error) {
   536  	type NoMethod AssignmentSubmission
   537  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   538  }
   539  
   540  // Attachment: Attachment added to student assignment work. When creating
   541  // attachments, setting the `form` field is not supported.
   542  type Attachment struct {
   543  	// DriveFile: Google Drive file attachment.
   544  	DriveFile *DriveFile `json:"driveFile,omitempty"`
   545  	// Form: Google Forms attachment.
   546  	Form *Form `json:"form,omitempty"`
   547  	// Link: Link attachment.
   548  	Link *Link `json:"link,omitempty"`
   549  	// YouTubeVideo: Youtube video attachment.
   550  	YouTubeVideo *YouTubeVideo `json:"youTubeVideo,omitempty"`
   551  	// ForceSendFields is a list of field names (e.g. "DriveFile") to
   552  	// unconditionally include in API requests. By default, fields with empty or
   553  	// default values are omitted from API requests. See
   554  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   555  	// details.
   556  	ForceSendFields []string `json:"-"`
   557  	// NullFields is a list of field names (e.g. "DriveFile") to include in API
   558  	// requests with the JSON null value. By default, fields with empty values are
   559  	// omitted from API requests. See
   560  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   561  	NullFields []string `json:"-"`
   562  }
   563  
   564  func (s *Attachment) MarshalJSON() ([]byte, error) {
   565  	type NoMethod Attachment
   566  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   567  }
   568  
   569  // CloudPubsubTopic: A reference to a Cloud Pub/Sub topic. To register for
   570  // notifications, the owner of the topic must grant
   571  // `classroom-notifications@system.gserviceaccount.com` the
   572  // `projects.topics.publish` permission.
   573  type CloudPubsubTopic struct {
   574  	// TopicName: The `name` field of a Cloud Pub/Sub Topic
   575  	// (https://cloud.google.com/pubsub/docs/reference/rest/v1/projects.topics#Topic).
   576  	TopicName string `json:"topicName,omitempty"`
   577  	// ForceSendFields is a list of field names (e.g. "TopicName") to
   578  	// unconditionally include in API requests. By default, fields with empty or
   579  	// default values are omitted from API requests. See
   580  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   581  	// details.
   582  	ForceSendFields []string `json:"-"`
   583  	// NullFields is a list of field names (e.g. "TopicName") to include in API
   584  	// requests with the JSON null value. By default, fields with empty values are
   585  	// omitted from API requests. See
   586  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   587  	NullFields []string `json:"-"`
   588  }
   589  
   590  func (s *CloudPubsubTopic) MarshalJSON() ([]byte, error) {
   591  	type NoMethod CloudPubsubTopic
   592  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   593  }
   594  
   595  // Course: A Course in Classroom.
   596  type Course struct {
   597  	// AlternateLink: Absolute link to this course in the Classroom web UI.
   598  	// Read-only.
   599  	AlternateLink string `json:"alternateLink,omitempty"`
   600  	// CalendarId: The Calendar ID for a calendar that all course members can see,
   601  	// to which Classroom adds events for course work and announcements in the
   602  	// course. The Calendar for a course is created asynchronously when the course
   603  	// is set to `CourseState.ACTIVE` for the first time (at creation time or when
   604  	// it is updated to `ACTIVE` through the UI or the API). The Calendar ID will
   605  	// not be populated until the creation process is completed. Read-only.
   606  	CalendarId string `json:"calendarId,omitempty"`
   607  	// CourseGroupEmail: The email address of a Google group containing all members
   608  	// of the course. This group does not accept email and can only be used for
   609  	// permissions. Read-only.
   610  	CourseGroupEmail string `json:"courseGroupEmail,omitempty"`
   611  	// CourseMaterialSets: Sets of materials that appear on the "about" page of
   612  	// this course. Read-only.
   613  	CourseMaterialSets []*CourseMaterialSet `json:"courseMaterialSets,omitempty"`
   614  	// CourseState: State of the course. If unspecified, the default state is
   615  	// `PROVISIONED`.
   616  	//
   617  	// Possible values:
   618  	//   "COURSE_STATE_UNSPECIFIED" - No course state. No returned Course message
   619  	// will use this value.
   620  	//   "ACTIVE" - The course is active.
   621  	//   "ARCHIVED" - The course has been archived. You cannot modify it except to
   622  	// change it to a different state.
   623  	//   "PROVISIONED" - The course has been created, but not yet activated. It is
   624  	// accessible by the primary teacher and domain administrators, who may modify
   625  	// it or change it to the `ACTIVE` or `DECLINED` states. A course may only be
   626  	// changed to `PROVISIONED` if it is in the `DECLINED` state.
   627  	//   "DECLINED" - The course has been created, but declined. It is accessible
   628  	// by the course owner and domain administrators, though it will not be
   629  	// displayed in the web UI. You cannot modify the course except to change it to
   630  	// the `PROVISIONED` state. A course may only be changed to `DECLINED` if it is
   631  	// in the `PROVISIONED` state.
   632  	//   "SUSPENDED" - The course has been suspended. You cannot modify the course,
   633  	// and only the user identified by the `owner_id` can view the course. A course
   634  	// may be placed in this state if it potentially violates the Terms of Service.
   635  	CourseState string `json:"courseState,omitempty"`
   636  	// CreationTime: Creation time of the course. Specifying this field in a course
   637  	// update mask results in an error. Read-only.
   638  	CreationTime string `json:"creationTime,omitempty"`
   639  	// Description: Optional description. For example, "We'll be learning about the
   640  	// structure of living creatures from a combination of textbooks, guest
   641  	// lectures, and lab work. Expect to be excited!" If set, this field must be a
   642  	// valid UTF-8 string and no longer than 30,000 characters.
   643  	Description string `json:"description,omitempty"`
   644  	// DescriptionHeading: Optional heading for the description. For example,
   645  	// "Welcome to 10th Grade Biology." If set, this field must be a valid UTF-8
   646  	// string and no longer than 3600 characters.
   647  	DescriptionHeading string `json:"descriptionHeading,omitempty"`
   648  	// EnrollmentCode: Enrollment code to use when joining this course. Specifying
   649  	// this field in a course update mask results in an error. Read-only.
   650  	EnrollmentCode string `json:"enrollmentCode,omitempty"`
   651  	// GradebookSettings: The gradebook settings that specify how a student's
   652  	// overall grade for the course will be calculated and who it will be displayed
   653  	// to. Read-only
   654  	GradebookSettings *GradebookSettings `json:"gradebookSettings,omitempty"`
   655  	// GuardiansEnabled: Whether or not guardian notifications are enabled for this
   656  	// course. Read-only.
   657  	GuardiansEnabled bool `json:"guardiansEnabled,omitempty"`
   658  	// Id: Identifier for this course assigned by Classroom. When creating a
   659  	// course, you may optionally set this identifier to an alias string in the
   660  	// request to create a corresponding alias. The `id` is still assigned by
   661  	// Classroom and cannot be updated after the course is created. Specifying this
   662  	// field in a course update mask results in an error.
   663  	Id string `json:"id,omitempty"`
   664  	// Name: Name of the course. For example, "10th Grade Biology". The name is
   665  	// required. It must be between 1 and 750 characters and a valid UTF-8 string.
   666  	Name string `json:"name,omitempty"`
   667  	// OwnerId: The identifier of the owner of a course. When specified as a
   668  	// parameter of a create course request, this field is required. The identifier
   669  	// can be one of the following: * the numeric identifier for the user * the
   670  	// email address of the user * the string literal "me", indicating the
   671  	// requesting user This must be set in a create request. Admins can also
   672  	// specify this field in a patch course request to transfer ownership. In other
   673  	// contexts, it is read-only.
   674  	OwnerId string `json:"ownerId,omitempty"`
   675  	// Room: Optional room location. For example, "301". If set, this field must be
   676  	// a valid UTF-8 string and no longer than 650 characters.
   677  	Room string `json:"room,omitempty"`
   678  	// Section: Section of the course. For example, "Period 2". If set, this field
   679  	// must be a valid UTF-8 string and no longer than 2800 characters.
   680  	Section string `json:"section,omitempty"`
   681  	// TeacherFolder: Information about a Drive Folder that is shared with all
   682  	// teachers of the course. This field will only be set for teachers of the
   683  	// course and domain administrators. Read-only.
   684  	TeacherFolder *DriveFolder `json:"teacherFolder,omitempty"`
   685  	// TeacherGroupEmail: The email address of a Google group containing all
   686  	// teachers of the course. This group does not accept email and can only be
   687  	// used for permissions. Read-only.
   688  	TeacherGroupEmail string `json:"teacherGroupEmail,omitempty"`
   689  	// UpdateTime: Time of the most recent update to this course. Specifying this
   690  	// field in a course update mask results in an error. Read-only.
   691  	UpdateTime string `json:"updateTime,omitempty"`
   692  
   693  	// ServerResponse contains the HTTP response code and headers from the server.
   694  	googleapi.ServerResponse `json:"-"`
   695  	// ForceSendFields is a list of field names (e.g. "AlternateLink") to
   696  	// unconditionally include in API requests. By default, fields with empty or
   697  	// default values are omitted from API requests. See
   698  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   699  	// details.
   700  	ForceSendFields []string `json:"-"`
   701  	// NullFields is a list of field names (e.g. "AlternateLink") to include in API
   702  	// requests with the JSON null value. By default, fields with empty values are
   703  	// omitted from API requests. See
   704  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   705  	NullFields []string `json:"-"`
   706  }
   707  
   708  func (s *Course) MarshalJSON() ([]byte, error) {
   709  	type NoMethod Course
   710  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   711  }
   712  
   713  // CourseAlias: Alternative identifier for a course. An alias uniquely
   714  // identifies a course. It must be unique within one of the following scopes: *
   715  // domain: A domain-scoped alias is visible to all users within the alias
   716  // creator's domain and can be created only by a domain admin. A domain-scoped
   717  // alias is often used when a course has an identifier external to Classroom. *
   718  // project: A project-scoped alias is visible to any request from an
   719  // application using the Developer Console project ID that created the alias
   720  // and can be created by any project. A project-scoped alias is often used when
   721  // an application has alternative identifiers. A random value can also be used
   722  // to avoid duplicate courses in the event of transmission failures, as
   723  // retrying a request will return `ALREADY_EXISTS` if a previous one has
   724  // succeeded.
   725  type CourseAlias struct {
   726  	// Alias: Alias string. The format of the string indicates the desired alias
   727  	// scoping. * `d:` indicates a domain-scoped alias. Example: `d:math_101` *
   728  	// `p:` indicates a project-scoped alias. Example: `p:abc123` This field has a
   729  	// maximum length of 256 characters.
   730  	Alias string `json:"alias,omitempty"`
   731  
   732  	// ServerResponse contains the HTTP response code and headers from the server.
   733  	googleapi.ServerResponse `json:"-"`
   734  	// ForceSendFields is a list of field names (e.g. "Alias") to unconditionally
   735  	// include in API requests. By default, fields with empty or default values are
   736  	// omitted from API requests. See
   737  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   738  	// details.
   739  	ForceSendFields []string `json:"-"`
   740  	// NullFields is a list of field names (e.g. "Alias") to include in API
   741  	// requests with the JSON null value. By default, fields with empty values are
   742  	// omitted from API requests. See
   743  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   744  	NullFields []string `json:"-"`
   745  }
   746  
   747  func (s *CourseAlias) MarshalJSON() ([]byte, error) {
   748  	type NoMethod CourseAlias
   749  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   750  }
   751  
   752  // CourseMaterial: A material attached to a course as part of a material set.
   753  type CourseMaterial struct {
   754  	// DriveFile: Google Drive file attachment.
   755  	DriveFile *DriveFile `json:"driveFile,omitempty"`
   756  	// Form: Google Forms attachment.
   757  	Form *Form `json:"form,omitempty"`
   758  	// Link: Link atatchment.
   759  	Link *Link `json:"link,omitempty"`
   760  	// YouTubeVideo: Youtube video attachment.
   761  	YouTubeVideo *YouTubeVideo `json:"youTubeVideo,omitempty"`
   762  	// ForceSendFields is a list of field names (e.g. "DriveFile") to
   763  	// unconditionally include in API requests. By default, fields with empty or
   764  	// default values are omitted from API requests. See
   765  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   766  	// details.
   767  	ForceSendFields []string `json:"-"`
   768  	// NullFields is a list of field names (e.g. "DriveFile") to include in API
   769  	// requests with the JSON null value. By default, fields with empty values are
   770  	// omitted from API requests. See
   771  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   772  	NullFields []string `json:"-"`
   773  }
   774  
   775  func (s *CourseMaterial) MarshalJSON() ([]byte, error) {
   776  	type NoMethod CourseMaterial
   777  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   778  }
   779  
   780  // CourseMaterialSet: A set of materials that appears on the "About" page of
   781  // the course. These materials might include a syllabus, schedule, or other
   782  // background information relating to the course as a whole.
   783  type CourseMaterialSet struct {
   784  	// Materials: Materials attached to this set.
   785  	Materials []*CourseMaterial `json:"materials,omitempty"`
   786  	// Title: Title for this set.
   787  	Title string `json:"title,omitempty"`
   788  	// ForceSendFields is a list of field names (e.g. "Materials") to
   789  	// unconditionally include in API requests. By default, fields with empty or
   790  	// default values are omitted from API requests. See
   791  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   792  	// details.
   793  	ForceSendFields []string `json:"-"`
   794  	// NullFields is a list of field names (e.g. "Materials") to include in API
   795  	// requests with the JSON null value. By default, fields with empty values are
   796  	// omitted from API requests. See
   797  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   798  	NullFields []string `json:"-"`
   799  }
   800  
   801  func (s *CourseMaterialSet) MarshalJSON() ([]byte, error) {
   802  	type NoMethod CourseMaterialSet
   803  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   804  }
   805  
   806  // CourseRosterChangesInfo: Information about a `Feed` with a `feed_type` of
   807  // `COURSE_ROSTER_CHANGES`.
   808  type CourseRosterChangesInfo struct {
   809  	// CourseId: The `course_id` of the course to subscribe to roster changes for.
   810  	CourseId string `json:"courseId,omitempty"`
   811  	// ForceSendFields is a list of field names (e.g. "CourseId") to
   812  	// unconditionally include in API requests. By default, fields with empty or
   813  	// default values are omitted from API requests. See
   814  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   815  	// details.
   816  	ForceSendFields []string `json:"-"`
   817  	// NullFields is a list of field names (e.g. "CourseId") to include in API
   818  	// requests with the JSON null value. By default, fields with empty values are
   819  	// omitted from API requests. See
   820  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   821  	NullFields []string `json:"-"`
   822  }
   823  
   824  func (s *CourseRosterChangesInfo) MarshalJSON() ([]byte, error) {
   825  	type NoMethod CourseRosterChangesInfo
   826  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   827  }
   828  
   829  // CourseWork: Course work created by a teacher for students of the course.
   830  type CourseWork struct {
   831  	// AlternateLink: Absolute link to this course work in the Classroom web UI.
   832  	// This is only populated if `state` is `PUBLISHED`. Read-only.
   833  	AlternateLink string `json:"alternateLink,omitempty"`
   834  	// AssigneeMode: Assignee mode of the coursework. If unspecified, the default
   835  	// value is `ALL_STUDENTS`.
   836  	//
   837  	// Possible values:
   838  	//   "ASSIGNEE_MODE_UNSPECIFIED" - No mode specified. This is never returned.
   839  	//   "ALL_STUDENTS" - All students can see the item. This is the default state.
   840  	//   "INDIVIDUAL_STUDENTS" - A subset of the students can see the item.
   841  	AssigneeMode string `json:"assigneeMode,omitempty"`
   842  	// Assignment: Assignment details. This is populated only when `work_type` is
   843  	// `ASSIGNMENT`. Read-only.
   844  	Assignment *Assignment `json:"assignment,omitempty"`
   845  	// AssociatedWithDeveloper: Whether this course work item is associated with
   846  	// the Developer Console project making the request. See CreateCourseWork for
   847  	// more details. Read-only.
   848  	AssociatedWithDeveloper bool `json:"associatedWithDeveloper,omitempty"`
   849  	// CourseId: Identifier of the course. Read-only.
   850  	CourseId string `json:"courseId,omitempty"`
   851  	// CreationTime: Timestamp when this course work was created. Read-only.
   852  	CreationTime string `json:"creationTime,omitempty"`
   853  	// CreatorUserId: Identifier for the user that created the coursework.
   854  	// Read-only.
   855  	CreatorUserId string `json:"creatorUserId,omitempty"`
   856  	// Description: Optional description of this course work. If set, the
   857  	// description must be a valid UTF-8 string containing no more than 30,000
   858  	// characters.
   859  	Description string `json:"description,omitempty"`
   860  	// DueDate: Optional date, in UTC, that submissions for this course work are
   861  	// due. This must be specified if `due_time` is specified.
   862  	DueDate *Date `json:"dueDate,omitempty"`
   863  	// DueTime: Optional time of day, in UTC, that submissions for this course work
   864  	// are due. This must be specified if `due_date` is specified.
   865  	DueTime *TimeOfDay `json:"dueTime,omitempty"`
   866  	// GradeCategory: The category that this coursework's grade contributes to.
   867  	// Present only when a category has been chosen for the coursework. May be used
   868  	// in calculating the overall grade. Read-only.
   869  	GradeCategory *GradeCategory `json:"gradeCategory,omitempty"`
   870  	// Id: Classroom-assigned identifier of this course work, unique per course.
   871  	// Read-only.
   872  	Id string `json:"id,omitempty"`
   873  	// IndividualStudentsOptions: Identifiers of students with access to the
   874  	// coursework. This field is set only if `assigneeMode` is
   875  	// `INDIVIDUAL_STUDENTS`. If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then
   876  	// only students specified in this field are assigned the coursework.
   877  	IndividualStudentsOptions *IndividualStudentsOptions `json:"individualStudentsOptions,omitempty"`
   878  	// Materials: Additional materials. CourseWork must have no more than 20
   879  	// material items.
   880  	Materials []*Material `json:"materials,omitempty"`
   881  	// MaxPoints: Maximum grade for this course work. If zero or unspecified, this
   882  	// assignment is considered ungraded. This must be a non-negative integer
   883  	// value.
   884  	MaxPoints float64 `json:"maxPoints,omitempty"`
   885  	// MultipleChoiceQuestion: Multiple choice question details. For read
   886  	// operations, this field is populated only when `work_type` is
   887  	// `MULTIPLE_CHOICE_QUESTION`. For write operations, this field must be
   888  	// specified when creating course work with a `work_type` of
   889  	// `MULTIPLE_CHOICE_QUESTION`, and it must not be set otherwise.
   890  	MultipleChoiceQuestion *MultipleChoiceQuestion `json:"multipleChoiceQuestion,omitempty"`
   891  	// ScheduledTime: Optional timestamp when this course work is scheduled to be
   892  	// published.
   893  	ScheduledTime string `json:"scheduledTime,omitempty"`
   894  	// State: Status of this course work. If unspecified, the default state is
   895  	// `DRAFT`.
   896  	//
   897  	// Possible values:
   898  	//   "COURSE_WORK_STATE_UNSPECIFIED" - No state specified. This is never
   899  	// returned.
   900  	//   "PUBLISHED" - Status for work that has been published. This is the default
   901  	// state.
   902  	//   "DRAFT" - Status for work that is not yet published. Work in this state is
   903  	// visible only to course teachers and domain administrators.
   904  	//   "DELETED" - Status for work that was published but is now deleted. Work in
   905  	// this state is visible only to course teachers and domain administrators.
   906  	// Work in this state is deleted after some time.
   907  	State string `json:"state,omitempty"`
   908  	// SubmissionModificationMode: Setting to determine when students are allowed
   909  	// to modify submissions. If unspecified, the default value is
   910  	// `MODIFIABLE_UNTIL_TURNED_IN`.
   911  	//
   912  	// Possible values:
   913  	//   "SUBMISSION_MODIFICATION_MODE_UNSPECIFIED" - No modification mode
   914  	// specified. This is never returned.
   915  	//   "MODIFIABLE_UNTIL_TURNED_IN" - Submissions can be modified before being
   916  	// turned in.
   917  	//   "MODIFIABLE" - Submissions can be modified at any time.
   918  	SubmissionModificationMode string `json:"submissionModificationMode,omitempty"`
   919  	// Title: Title of this course work. The title must be a valid UTF-8 string
   920  	// containing between 1 and 3000 characters.
   921  	Title string `json:"title,omitempty"`
   922  	// TopicId: Identifier for the topic that this coursework is associated with.
   923  	// Must match an existing topic in the course.
   924  	TopicId string `json:"topicId,omitempty"`
   925  	// UpdateTime: Timestamp of the most recent change to this course work.
   926  	// Read-only.
   927  	UpdateTime string `json:"updateTime,omitempty"`
   928  	// WorkType: Type of this course work. The type is set when the course work is
   929  	// created and cannot be changed.
   930  	//
   931  	// Possible values:
   932  	//   "COURSE_WORK_TYPE_UNSPECIFIED" - No work type specified. This is never
   933  	// returned.
   934  	//   "ASSIGNMENT" - An assignment.
   935  	//   "SHORT_ANSWER_QUESTION" - A short answer question.
   936  	//   "MULTIPLE_CHOICE_QUESTION" - A multiple-choice question.
   937  	WorkType string `json:"workType,omitempty"`
   938  
   939  	// ServerResponse contains the HTTP response code and headers from the server.
   940  	googleapi.ServerResponse `json:"-"`
   941  	// ForceSendFields is a list of field names (e.g. "AlternateLink") to
   942  	// unconditionally include in API requests. By default, fields with empty or
   943  	// default values are omitted from API requests. See
   944  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   945  	// details.
   946  	ForceSendFields []string `json:"-"`
   947  	// NullFields is a list of field names (e.g. "AlternateLink") to include in API
   948  	// requests with the JSON null value. By default, fields with empty values are
   949  	// omitted from API requests. See
   950  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   951  	NullFields []string `json:"-"`
   952  }
   953  
   954  func (s *CourseWork) MarshalJSON() ([]byte, error) {
   955  	type NoMethod CourseWork
   956  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   957  }
   958  
   959  func (s *CourseWork) UnmarshalJSON(data []byte) error {
   960  	type NoMethod CourseWork
   961  	var s1 struct {
   962  		MaxPoints gensupport.JSONFloat64 `json:"maxPoints"`
   963  		*NoMethod
   964  	}
   965  	s1.NoMethod = (*NoMethod)(s)
   966  	if err := json.Unmarshal(data, &s1); err != nil {
   967  		return err
   968  	}
   969  	s.MaxPoints = float64(s1.MaxPoints)
   970  	return nil
   971  }
   972  
   973  // CourseWorkChangesInfo: Information about a `Feed` with a `feed_type` of
   974  // `COURSE_WORK_CHANGES`.
   975  type CourseWorkChangesInfo struct {
   976  	// CourseId: The `course_id` of the course to subscribe to work changes for.
   977  	CourseId string `json:"courseId,omitempty"`
   978  	// ForceSendFields is a list of field names (e.g. "CourseId") to
   979  	// unconditionally include in API requests. By default, fields with empty or
   980  	// default values are omitted from API requests. See
   981  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
   982  	// details.
   983  	ForceSendFields []string `json:"-"`
   984  	// NullFields is a list of field names (e.g. "CourseId") to include in API
   985  	// requests with the JSON null value. By default, fields with empty values are
   986  	// omitted from API requests. See
   987  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
   988  	NullFields []string `json:"-"`
   989  }
   990  
   991  func (s *CourseWorkChangesInfo) MarshalJSON() ([]byte, error) {
   992  	type NoMethod CourseWorkChangesInfo
   993  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
   994  }
   995  
   996  // CourseWorkMaterial: Course work material created by a teacher for students
   997  // of the course
   998  type CourseWorkMaterial struct {
   999  	// AlternateLink: Absolute link to this course work material in the Classroom
  1000  	// web UI. This is only populated if `state` is `PUBLISHED`. Read-only.
  1001  	AlternateLink string `json:"alternateLink,omitempty"`
  1002  	// AssigneeMode: Assignee mode of the course work material. If unspecified, the
  1003  	// default value is `ALL_STUDENTS`.
  1004  	//
  1005  	// Possible values:
  1006  	//   "ASSIGNEE_MODE_UNSPECIFIED" - No mode specified. This is never returned.
  1007  	//   "ALL_STUDENTS" - All students can see the item. This is the default state.
  1008  	//   "INDIVIDUAL_STUDENTS" - A subset of the students can see the item.
  1009  	AssigneeMode string `json:"assigneeMode,omitempty"`
  1010  	// CourseId: Identifier of the course. Read-only.
  1011  	CourseId string `json:"courseId,omitempty"`
  1012  	// CreationTime: Timestamp when this course work material was created.
  1013  	// Read-only.
  1014  	CreationTime string `json:"creationTime,omitempty"`
  1015  	// CreatorUserId: Identifier for the user that created the course work
  1016  	// material. Read-only.
  1017  	CreatorUserId string `json:"creatorUserId,omitempty"`
  1018  	// Description: Optional description of this course work material. The text
  1019  	// must be a valid UTF-8 string containing no more than 30,000 characters.
  1020  	Description string `json:"description,omitempty"`
  1021  	// Id: Classroom-assigned identifier of this course work material, unique per
  1022  	// course. Read-only.
  1023  	Id string `json:"id,omitempty"`
  1024  	// IndividualStudentsOptions: Identifiers of students with access to the course
  1025  	// work material. This field is set only if `assigneeMode` is
  1026  	// `INDIVIDUAL_STUDENTS`. If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then
  1027  	// only students specified in this field can see the course work material.
  1028  	IndividualStudentsOptions *IndividualStudentsOptions `json:"individualStudentsOptions,omitempty"`
  1029  	// Materials: Additional materials. A course work material must have no more
  1030  	// than 20 material items.
  1031  	Materials []*Material `json:"materials,omitempty"`
  1032  	// ScheduledTime: Optional timestamp when this course work material is
  1033  	// scheduled to be published.
  1034  	ScheduledTime string `json:"scheduledTime,omitempty"`
  1035  	// State: Status of this course work material. If unspecified, the default
  1036  	// state is `DRAFT`.
  1037  	//
  1038  	// Possible values:
  1039  	//   "COURSEWORK_MATERIAL_STATE_UNSPECIFIED" - No state specified. This is
  1040  	// never returned.
  1041  	//   "PUBLISHED" - Status for course work material that has been published.
  1042  	// This is the default state.
  1043  	//   "DRAFT" - Status for a course work material that is not yet published.
  1044  	// Course work material in this state is visible only to course teachers and
  1045  	// domain administrators.
  1046  	//   "DELETED" - Status for course work material that was published but is now
  1047  	// deleted. Course work material in this state is visible only to course
  1048  	// teachers and domain administrators. Course work material in this state is
  1049  	// deleted after some time.
  1050  	State string `json:"state,omitempty"`
  1051  	// Title: Title of this course work material. The title must be a valid UTF-8
  1052  	// string containing between 1 and 3000 characters.
  1053  	Title string `json:"title,omitempty"`
  1054  	// TopicId: Identifier for the topic that this course work material is
  1055  	// associated with. Must match an existing topic in the course.
  1056  	TopicId string `json:"topicId,omitempty"`
  1057  	// UpdateTime: Timestamp of the most recent change to this course work
  1058  	// material. Read-only.
  1059  	UpdateTime string `json:"updateTime,omitempty"`
  1060  
  1061  	// ServerResponse contains the HTTP response code and headers from the server.
  1062  	googleapi.ServerResponse `json:"-"`
  1063  	// ForceSendFields is a list of field names (e.g. "AlternateLink") to
  1064  	// unconditionally include in API requests. By default, fields with empty or
  1065  	// default values are omitted from API requests. See
  1066  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1067  	// details.
  1068  	ForceSendFields []string `json:"-"`
  1069  	// NullFields is a list of field names (e.g. "AlternateLink") to include in API
  1070  	// requests with the JSON null value. By default, fields with empty values are
  1071  	// omitted from API requests. See
  1072  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1073  	NullFields []string `json:"-"`
  1074  }
  1075  
  1076  func (s *CourseWorkMaterial) MarshalJSON() ([]byte, error) {
  1077  	type NoMethod CourseWorkMaterial
  1078  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1079  }
  1080  
  1081  // Date: Represents a whole or partial calendar date, such as a birthday. The
  1082  // time of day and time zone are either specified elsewhere or are
  1083  // insignificant. The date is relative to the Gregorian Calendar. This can
  1084  // represent one of the following: * A full date, with non-zero year, month,
  1085  // and day values. * A month and day, with a zero year (for example, an
  1086  // anniversary). * A year on its own, with a zero month and a zero day. * A
  1087  // year and month, with a zero day (for example, a credit card expiration
  1088  // date). Related types: * google.type.TimeOfDay * google.type.DateTime *
  1089  // google.protobuf.Timestamp
  1090  type Date struct {
  1091  	// Day: Day of a month. Must be from 1 to 31 and valid for the year and month,
  1092  	// or 0 to specify a year by itself or a year and month where the day isn't
  1093  	// significant.
  1094  	Day int64 `json:"day,omitempty"`
  1095  	// Month: Month of a year. Must be from 1 to 12, or 0 to specify a year without
  1096  	// a month and day.
  1097  	Month int64 `json:"month,omitempty"`
  1098  	// Year: Year of the date. Must be from 1 to 9999, or 0 to specify a date
  1099  	// without a year.
  1100  	Year int64 `json:"year,omitempty"`
  1101  	// ForceSendFields is a list of field names (e.g. "Day") to unconditionally
  1102  	// include in API requests. By default, fields with empty or default values are
  1103  	// omitted from API requests. See
  1104  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1105  	// details.
  1106  	ForceSendFields []string `json:"-"`
  1107  	// NullFields is a list of field names (e.g. "Day") to include in API requests
  1108  	// with the JSON null value. By default, fields with empty values are omitted
  1109  	// from API requests. See
  1110  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1111  	NullFields []string `json:"-"`
  1112  }
  1113  
  1114  func (s *Date) MarshalJSON() ([]byte, error) {
  1115  	type NoMethod Date
  1116  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1117  }
  1118  
  1119  // DriveFile: Representation of a Google Drive file.
  1120  type DriveFile struct {
  1121  	// AlternateLink: URL that can be used to access the Drive item. Read-only.
  1122  	AlternateLink string `json:"alternateLink,omitempty"`
  1123  	// Id: Drive API resource ID.
  1124  	Id string `json:"id,omitempty"`
  1125  	// ThumbnailUrl: URL of a thumbnail image of the Drive item. Read-only.
  1126  	ThumbnailUrl string `json:"thumbnailUrl,omitempty"`
  1127  	// Title: Title of the Drive item. Read-only.
  1128  	Title string `json:"title,omitempty"`
  1129  	// ForceSendFields is a list of field names (e.g. "AlternateLink") to
  1130  	// unconditionally include in API requests. By default, fields with empty or
  1131  	// default values are omitted from API requests. See
  1132  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1133  	// details.
  1134  	ForceSendFields []string `json:"-"`
  1135  	// NullFields is a list of field names (e.g. "AlternateLink") to include in API
  1136  	// requests with the JSON null value. By default, fields with empty values are
  1137  	// omitted from API requests. See
  1138  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1139  	NullFields []string `json:"-"`
  1140  }
  1141  
  1142  func (s *DriveFile) MarshalJSON() ([]byte, error) {
  1143  	type NoMethod DriveFile
  1144  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1145  }
  1146  
  1147  // DriveFolder: Representation of a Google Drive folder.
  1148  type DriveFolder struct {
  1149  	// AlternateLink: URL that can be used to access the Drive folder. Read-only.
  1150  	AlternateLink string `json:"alternateLink,omitempty"`
  1151  	// Id: Drive API resource ID.
  1152  	Id string `json:"id,omitempty"`
  1153  	// Title: Title of the Drive folder. Read-only.
  1154  	Title string `json:"title,omitempty"`
  1155  	// ForceSendFields is a list of field names (e.g. "AlternateLink") to
  1156  	// unconditionally include in API requests. By default, fields with empty or
  1157  	// default values are omitted from API requests. See
  1158  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1159  	// details.
  1160  	ForceSendFields []string `json:"-"`
  1161  	// NullFields is a list of field names (e.g. "AlternateLink") to include in API
  1162  	// requests with the JSON null value. By default, fields with empty values are
  1163  	// omitted from API requests. See
  1164  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1165  	NullFields []string `json:"-"`
  1166  }
  1167  
  1168  func (s *DriveFolder) MarshalJSON() ([]byte, error) {
  1169  	type NoMethod DriveFolder
  1170  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1171  }
  1172  
  1173  // Empty: A generic empty message that you can re-use to avoid defining
  1174  // duplicated empty messages in your APIs. A typical example is to use it as
  1175  // the request or the response type of an API method. For instance: service Foo
  1176  // { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); }
  1177  type Empty struct {
  1178  	// ServerResponse contains the HTTP response code and headers from the server.
  1179  	googleapi.ServerResponse `json:"-"`
  1180  }
  1181  
  1182  // Feed: A class of notifications that an application can register to receive.
  1183  // For example: "all roster changes for a domain".
  1184  type Feed struct {
  1185  	// CourseRosterChangesInfo: Information about a `Feed` with a `feed_type` of
  1186  	// `COURSE_ROSTER_CHANGES`. This field must be specified if `feed_type` is
  1187  	// `COURSE_ROSTER_CHANGES`.
  1188  	CourseRosterChangesInfo *CourseRosterChangesInfo `json:"courseRosterChangesInfo,omitempty"`
  1189  	// CourseWorkChangesInfo: Information about a `Feed` with a `feed_type` of
  1190  	// `COURSE_WORK_CHANGES`. This field must be specified if `feed_type` is
  1191  	// `COURSE_WORK_CHANGES`.
  1192  	CourseWorkChangesInfo *CourseWorkChangesInfo `json:"courseWorkChangesInfo,omitempty"`
  1193  	// FeedType: The type of feed.
  1194  	//
  1195  	// Possible values:
  1196  	//   "FEED_TYPE_UNSPECIFIED" - Should never be returned or provided.
  1197  	//   "DOMAIN_ROSTER_CHANGES" - All roster changes for a particular domain.
  1198  	// Notifications will be generated whenever a user joins or leaves a course. No
  1199  	// notifications will be generated when an invitation is created or deleted,
  1200  	// but notifications will be generated when a user joins a course by accepting
  1201  	// an invitation.
  1202  	//   "COURSE_ROSTER_CHANGES" - All roster changes for a particular course.
  1203  	// Notifications will be generated whenever a user joins or leaves a course. No
  1204  	// notifications will be generated when an invitation is created or deleted,
  1205  	// but notifications will be generated when a user joins a course by accepting
  1206  	// an invitation.
  1207  	//   "COURSE_WORK_CHANGES" - All course work activity for a particular course.
  1208  	// Notifications will be generated when a CourseWork or StudentSubmission
  1209  	// object is created or modified. No notification will be generated when a
  1210  	// StudentSubmission object is created in connection with the creation or
  1211  	// modification of its parent CourseWork object (but a notification will be
  1212  	// generated for that CourseWork object's creation or modification).
  1213  	FeedType string `json:"feedType,omitempty"`
  1214  	// ForceSendFields is a list of field names (e.g. "CourseRosterChangesInfo") to
  1215  	// unconditionally include in API requests. By default, fields with empty or
  1216  	// default values are omitted from API requests. See
  1217  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1218  	// details.
  1219  	ForceSendFields []string `json:"-"`
  1220  	// NullFields is a list of field names (e.g. "CourseRosterChangesInfo") to
  1221  	// include in API requests with the JSON null value. By default, fields with
  1222  	// empty values are omitted from API requests. See
  1223  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1224  	NullFields []string `json:"-"`
  1225  }
  1226  
  1227  func (s *Feed) MarshalJSON() ([]byte, error) {
  1228  	type NoMethod Feed
  1229  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1230  }
  1231  
  1232  // Form: Google Forms item.
  1233  type Form struct {
  1234  	// FormUrl: URL of the form.
  1235  	FormUrl string `json:"formUrl,omitempty"`
  1236  	// ResponseUrl: URL of the form responses document. Only set if responses have
  1237  	// been recorded and only when the requesting user is an editor of the form.
  1238  	// Read-only.
  1239  	ResponseUrl string `json:"responseUrl,omitempty"`
  1240  	// ThumbnailUrl: URL of a thumbnail image of the Form. Read-only.
  1241  	ThumbnailUrl string `json:"thumbnailUrl,omitempty"`
  1242  	// Title: Title of the Form. Read-only.
  1243  	Title string `json:"title,omitempty"`
  1244  	// ForceSendFields is a list of field names (e.g. "FormUrl") to unconditionally
  1245  	// include in API requests. By default, fields with empty or default values are
  1246  	// omitted from API requests. See
  1247  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1248  	// details.
  1249  	ForceSendFields []string `json:"-"`
  1250  	// NullFields is a list of field names (e.g. "FormUrl") to include in API
  1251  	// requests with the JSON null value. By default, fields with empty values are
  1252  	// omitted from API requests. See
  1253  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1254  	NullFields []string `json:"-"`
  1255  }
  1256  
  1257  func (s *Form) MarshalJSON() ([]byte, error) {
  1258  	type NoMethod Form
  1259  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1260  }
  1261  
  1262  // GlobalPermission: Global user permission description.
  1263  type GlobalPermission struct {
  1264  	// Permission: Permission value.
  1265  	//
  1266  	// Possible values:
  1267  	//   "PERMISSION_UNSPECIFIED" - No permission is specified. This is not
  1268  	// returned and is not a valid value.
  1269  	//   "CREATE_COURSE" - User is permitted to create a course.
  1270  	Permission string `json:"permission,omitempty"`
  1271  	// ForceSendFields is a list of field names (e.g. "Permission") to
  1272  	// unconditionally include in API requests. By default, fields with empty or
  1273  	// default values are omitted from API requests. See
  1274  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1275  	// details.
  1276  	ForceSendFields []string `json:"-"`
  1277  	// NullFields is a list of field names (e.g. "Permission") to include in API
  1278  	// requests with the JSON null value. By default, fields with empty values are
  1279  	// omitted from API requests. See
  1280  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1281  	NullFields []string `json:"-"`
  1282  }
  1283  
  1284  func (s *GlobalPermission) MarshalJSON() ([]byte, error) {
  1285  	type NoMethod GlobalPermission
  1286  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1287  }
  1288  
  1289  // GradeCategory: Details for a grade category in a course. Coursework may have
  1290  // zero or one grade category, and the category may be used in computing the
  1291  // overall grade. See the help center article
  1292  // (https://support.google.com/edu/classroom/answer/9184995) for details.
  1293  type GradeCategory struct {
  1294  	// DefaultGradeDenominator: Default value of denominator. Only applicable when
  1295  	// grade calculation type is TOTAL_POINTS.
  1296  	DefaultGradeDenominator int64 `json:"defaultGradeDenominator,omitempty"`
  1297  	// Id: ID of the grade category.
  1298  	Id string `json:"id,omitempty"`
  1299  	// Name: Name of the grade category.
  1300  	Name string `json:"name,omitempty"`
  1301  	// Weight: The weight of the category average as part of overall average. A
  1302  	// weight of 12.34% is represented as 123400 (100% is 1,000,000). The last two
  1303  	// digits should always be zero since we use two decimal precision. Only
  1304  	// applicable when grade calculation type is WEIGHTED_CATEGORIES.
  1305  	Weight int64 `json:"weight,omitempty"`
  1306  	// ForceSendFields is a list of field names (e.g. "DefaultGradeDenominator") to
  1307  	// unconditionally include in API requests. By default, fields with empty or
  1308  	// default values are omitted from API requests. See
  1309  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1310  	// details.
  1311  	ForceSendFields []string `json:"-"`
  1312  	// NullFields is a list of field names (e.g. "DefaultGradeDenominator") to
  1313  	// include in API requests with the JSON null value. By default, fields with
  1314  	// empty values are omitted from API requests. See
  1315  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1316  	NullFields []string `json:"-"`
  1317  }
  1318  
  1319  func (s *GradeCategory) MarshalJSON() ([]byte, error) {
  1320  	type NoMethod GradeCategory
  1321  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1322  }
  1323  
  1324  // GradeHistory: The history of each grade on this submission.
  1325  type GradeHistory struct {
  1326  	// ActorUserId: The teacher who made the grade change.
  1327  	ActorUserId string `json:"actorUserId,omitempty"`
  1328  	// GradeChangeType: The type of grade change at this time in the submission
  1329  	// grade history.
  1330  	//
  1331  	// Possible values:
  1332  	//   "UNKNOWN_GRADE_CHANGE_TYPE" - No grade change type specified. This should
  1333  	// never be returned.
  1334  	//   "DRAFT_GRADE_POINTS_EARNED_CHANGE" - A change in the numerator of the
  1335  	// draft grade.
  1336  	//   "ASSIGNED_GRADE_POINTS_EARNED_CHANGE" - A change in the numerator of the
  1337  	// assigned grade.
  1338  	//   "MAX_POINTS_CHANGE" - A change in the denominator of the grade.
  1339  	GradeChangeType string `json:"gradeChangeType,omitempty"`
  1340  	// GradeTimestamp: When the grade of the submission was changed.
  1341  	GradeTimestamp string `json:"gradeTimestamp,omitempty"`
  1342  	// MaxPoints: The denominator of the grade at this time in the submission grade
  1343  	// history.
  1344  	MaxPoints float64 `json:"maxPoints,omitempty"`
  1345  	// PointsEarned: The numerator of the grade at this time in the submission
  1346  	// grade history.
  1347  	PointsEarned float64 `json:"pointsEarned,omitempty"`
  1348  	// ForceSendFields is a list of field names (e.g. "ActorUserId") to
  1349  	// unconditionally include in API requests. By default, fields with empty or
  1350  	// default values are omitted from API requests. See
  1351  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1352  	// details.
  1353  	ForceSendFields []string `json:"-"`
  1354  	// NullFields is a list of field names (e.g. "ActorUserId") to include in API
  1355  	// requests with the JSON null value. By default, fields with empty values are
  1356  	// omitted from API requests. See
  1357  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1358  	NullFields []string `json:"-"`
  1359  }
  1360  
  1361  func (s *GradeHistory) MarshalJSON() ([]byte, error) {
  1362  	type NoMethod GradeHistory
  1363  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1364  }
  1365  
  1366  func (s *GradeHistory) UnmarshalJSON(data []byte) error {
  1367  	type NoMethod GradeHistory
  1368  	var s1 struct {
  1369  		MaxPoints    gensupport.JSONFloat64 `json:"maxPoints"`
  1370  		PointsEarned gensupport.JSONFloat64 `json:"pointsEarned"`
  1371  		*NoMethod
  1372  	}
  1373  	s1.NoMethod = (*NoMethod)(s)
  1374  	if err := json.Unmarshal(data, &s1); err != nil {
  1375  		return err
  1376  	}
  1377  	s.MaxPoints = float64(s1.MaxPoints)
  1378  	s.PointsEarned = float64(s1.PointsEarned)
  1379  	return nil
  1380  }
  1381  
  1382  // GradebookSettings: The gradebook settings for a course. See the help center
  1383  // article (https://support.google.com/edu/classroom/answer/9184995) for
  1384  // details.
  1385  type GradebookSettings struct {
  1386  	// CalculationType: Indicates how the overall grade is calculated.
  1387  	//
  1388  	// Possible values:
  1389  	//   "CALCULATION_TYPE_UNSPECIFIED" - No method specified. This is never
  1390  	// returned.
  1391  	//   "TOTAL_POINTS" - Overall grade is the sum of grades divided by the sum of
  1392  	// total points regardless of category.
  1393  	//   "WEIGHTED_CATEGORIES" - Overall grade is the weighted average by category.
  1394  	CalculationType string `json:"calculationType,omitempty"`
  1395  	// DisplaySetting: Indicates who can see the overall grade..
  1396  	//
  1397  	// Possible values:
  1398  	//   "DISPLAY_SETTING_UNSPECIFIED" - No setting specified. This is never
  1399  	// returned.
  1400  	//   "SHOW_OVERALL_GRADE" - Shows overall grade in the gradebook and student
  1401  	// profile to both teachers and students.
  1402  	//   "HIDE_OVERALL_GRADE" - Does not show overall grade in the gradebook or
  1403  	// student profile.
  1404  	//   "SHOW_TEACHERS_ONLY" - Shows the overall grade to teachers in the
  1405  	// gradebook and student profile. Hides from students in their student profile.
  1406  	DisplaySetting string `json:"displaySetting,omitempty"`
  1407  	// GradeCategories: Grade categories that are available for coursework in the
  1408  	// course.
  1409  	GradeCategories []*GradeCategory `json:"gradeCategories,omitempty"`
  1410  	// ForceSendFields is a list of field names (e.g. "CalculationType") to
  1411  	// unconditionally include in API requests. By default, fields with empty or
  1412  	// default values are omitted from API requests. See
  1413  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1414  	// details.
  1415  	ForceSendFields []string `json:"-"`
  1416  	// NullFields is a list of field names (e.g. "CalculationType") to include in
  1417  	// API requests with the JSON null value. By default, fields with empty values
  1418  	// are omitted from API requests. See
  1419  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1420  	NullFields []string `json:"-"`
  1421  }
  1422  
  1423  func (s *GradebookSettings) MarshalJSON() ([]byte, error) {
  1424  	type NoMethod GradebookSettings
  1425  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1426  }
  1427  
  1428  // Guardian: Association between a student and a guardian of that student. The
  1429  // guardian may receive information about the student's course work.
  1430  type Guardian struct {
  1431  	// GuardianId: Identifier for the guardian.
  1432  	GuardianId string `json:"guardianId,omitempty"`
  1433  	// GuardianProfile: User profile for the guardian.
  1434  	GuardianProfile *UserProfile `json:"guardianProfile,omitempty"`
  1435  	// InvitedEmailAddress: The email address to which the initial guardian
  1436  	// invitation was sent. This field is only visible to domain administrators.
  1437  	InvitedEmailAddress string `json:"invitedEmailAddress,omitempty"`
  1438  	// StudentId: Identifier for the student to whom the guardian relationship
  1439  	// applies.
  1440  	StudentId string `json:"studentId,omitempty"`
  1441  
  1442  	// ServerResponse contains the HTTP response code and headers from the server.
  1443  	googleapi.ServerResponse `json:"-"`
  1444  	// ForceSendFields is a list of field names (e.g. "GuardianId") to
  1445  	// unconditionally include in API requests. By default, fields with empty or
  1446  	// default values are omitted from API requests. See
  1447  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1448  	// details.
  1449  	ForceSendFields []string `json:"-"`
  1450  	// NullFields is a list of field names (e.g. "GuardianId") to include in API
  1451  	// requests with the JSON null value. By default, fields with empty values are
  1452  	// omitted from API requests. See
  1453  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1454  	NullFields []string `json:"-"`
  1455  }
  1456  
  1457  func (s *Guardian) MarshalJSON() ([]byte, error) {
  1458  	type NoMethod Guardian
  1459  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1460  }
  1461  
  1462  // GuardianInvitation: An invitation to become the guardian of a specified
  1463  // user, sent to a specified email address.
  1464  type GuardianInvitation struct {
  1465  	// CreationTime: The time that this invitation was created. Read-only.
  1466  	CreationTime string `json:"creationTime,omitempty"`
  1467  	// InvitationId: Unique identifier for this invitation. Read-only.
  1468  	InvitationId string `json:"invitationId,omitempty"`
  1469  	// InvitedEmailAddress: Email address that the invitation was sent to. This
  1470  	// field is only visible to domain administrators.
  1471  	InvitedEmailAddress string `json:"invitedEmailAddress,omitempty"`
  1472  	// State: The state that this invitation is in.
  1473  	//
  1474  	// Possible values:
  1475  	//   "GUARDIAN_INVITATION_STATE_UNSPECIFIED" - Should never be returned.
  1476  	//   "PENDING" - The invitation is active and awaiting a response.
  1477  	//   "COMPLETE" - The invitation is no longer active. It may have been
  1478  	// accepted, declined, withdrawn or it may have expired.
  1479  	State string `json:"state,omitempty"`
  1480  	// StudentId: ID of the student (in standard format)
  1481  	StudentId string `json:"studentId,omitempty"`
  1482  
  1483  	// ServerResponse contains the HTTP response code and headers from the server.
  1484  	googleapi.ServerResponse `json:"-"`
  1485  	// ForceSendFields is a list of field names (e.g. "CreationTime") to
  1486  	// unconditionally include in API requests. By default, fields with empty or
  1487  	// default values are omitted from API requests. See
  1488  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1489  	// details.
  1490  	ForceSendFields []string `json:"-"`
  1491  	// NullFields is a list of field names (e.g. "CreationTime") to include in API
  1492  	// requests with the JSON null value. By default, fields with empty values are
  1493  	// omitted from API requests. See
  1494  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1495  	NullFields []string `json:"-"`
  1496  }
  1497  
  1498  func (s *GuardianInvitation) MarshalJSON() ([]byte, error) {
  1499  	type NoMethod GuardianInvitation
  1500  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1501  }
  1502  
  1503  // IndividualStudentsOptions: Assignee details about a coursework/announcement.
  1504  // This field is set if and only if `assigneeMode` is `INDIVIDUAL_STUDENTS`.
  1505  type IndividualStudentsOptions struct {
  1506  	// StudentIds: Identifiers for the students that have access to the
  1507  	// coursework/announcement.
  1508  	StudentIds []string `json:"studentIds,omitempty"`
  1509  	// ForceSendFields is a list of field names (e.g. "StudentIds") to
  1510  	// unconditionally include in API requests. By default, fields with empty or
  1511  	// default values are omitted from API requests. See
  1512  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1513  	// details.
  1514  	ForceSendFields []string `json:"-"`
  1515  	// NullFields is a list of field names (e.g. "StudentIds") to include in API
  1516  	// requests with the JSON null value. By default, fields with empty values are
  1517  	// omitted from API requests. See
  1518  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1519  	NullFields []string `json:"-"`
  1520  }
  1521  
  1522  func (s *IndividualStudentsOptions) MarshalJSON() ([]byte, error) {
  1523  	type NoMethod IndividualStudentsOptions
  1524  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1525  }
  1526  
  1527  // Invitation: An invitation to join a course.
  1528  type Invitation struct {
  1529  	// CourseId: Identifier of the course to invite the user to.
  1530  	CourseId string `json:"courseId,omitempty"`
  1531  	// Id: Identifier assigned by Classroom. Read-only.
  1532  	Id string `json:"id,omitempty"`
  1533  	// Role: Role to invite the user to have. Must not be
  1534  	// `COURSE_ROLE_UNSPECIFIED`.
  1535  	//
  1536  	// Possible values:
  1537  	//   "COURSE_ROLE_UNSPECIFIED" - No course role.
  1538  	//   "STUDENT" - Student in the course.
  1539  	//   "TEACHER" - Teacher of the course.
  1540  	//   "OWNER" - Owner of the course.
  1541  	Role string `json:"role,omitempty"`
  1542  	// UserId: Identifier of the invited user. When specified as a parameter of a
  1543  	// request, this identifier can be set to one of the following: * the numeric
  1544  	// identifier for the user * the email address of the user * the string literal
  1545  	// "me", indicating the requesting user
  1546  	UserId string `json:"userId,omitempty"`
  1547  
  1548  	// ServerResponse contains the HTTP response code and headers from the server.
  1549  	googleapi.ServerResponse `json:"-"`
  1550  	// ForceSendFields is a list of field names (e.g. "CourseId") to
  1551  	// unconditionally include in API requests. By default, fields with empty or
  1552  	// default values are omitted from API requests. See
  1553  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1554  	// details.
  1555  	ForceSendFields []string `json:"-"`
  1556  	// NullFields is a list of field names (e.g. "CourseId") to include in API
  1557  	// requests with the JSON null value. By default, fields with empty values are
  1558  	// omitted from API requests. See
  1559  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1560  	NullFields []string `json:"-"`
  1561  }
  1562  
  1563  func (s *Invitation) MarshalJSON() ([]byte, error) {
  1564  	type NoMethod Invitation
  1565  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1566  }
  1567  
  1568  // Link: URL item.
  1569  type Link struct {
  1570  	// ThumbnailUrl: URL of a thumbnail image of the target URL. Read-only.
  1571  	ThumbnailUrl string `json:"thumbnailUrl,omitempty"`
  1572  	// Title: Title of the target of the URL. Read-only.
  1573  	Title string `json:"title,omitempty"`
  1574  	// Url: URL to link to. This must be a valid UTF-8 string containing between 1
  1575  	// and 2024 characters.
  1576  	Url string `json:"url,omitempty"`
  1577  	// ForceSendFields is a list of field names (e.g. "ThumbnailUrl") to
  1578  	// unconditionally include in API requests. By default, fields with empty or
  1579  	// default values are omitted from API requests. See
  1580  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1581  	// details.
  1582  	ForceSendFields []string `json:"-"`
  1583  	// NullFields is a list of field names (e.g. "ThumbnailUrl") to include in API
  1584  	// requests with the JSON null value. By default, fields with empty values are
  1585  	// omitted from API requests. See
  1586  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1587  	NullFields []string `json:"-"`
  1588  }
  1589  
  1590  func (s *Link) MarshalJSON() ([]byte, error) {
  1591  	type NoMethod Link
  1592  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1593  }
  1594  
  1595  // ListAnnouncementsResponse: Response when listing course work.
  1596  type ListAnnouncementsResponse struct {
  1597  	// Announcements: Announcement items that match the request.
  1598  	Announcements []*Announcement `json:"announcements,omitempty"`
  1599  	// NextPageToken: Token identifying the next page of results to return. If
  1600  	// empty, no further results are available.
  1601  	NextPageToken string `json:"nextPageToken,omitempty"`
  1602  
  1603  	// ServerResponse contains the HTTP response code and headers from the server.
  1604  	googleapi.ServerResponse `json:"-"`
  1605  	// ForceSendFields is a list of field names (e.g. "Announcements") to
  1606  	// unconditionally include in API requests. By default, fields with empty or
  1607  	// default values are omitted from API requests. See
  1608  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1609  	// details.
  1610  	ForceSendFields []string `json:"-"`
  1611  	// NullFields is a list of field names (e.g. "Announcements") to include in API
  1612  	// requests with the JSON null value. By default, fields with empty values are
  1613  	// omitted from API requests. See
  1614  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1615  	NullFields []string `json:"-"`
  1616  }
  1617  
  1618  func (s *ListAnnouncementsResponse) MarshalJSON() ([]byte, error) {
  1619  	type NoMethod ListAnnouncementsResponse
  1620  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1621  }
  1622  
  1623  // ListCourseAliasesResponse: Response when listing course aliases.
  1624  type ListCourseAliasesResponse struct {
  1625  	// Aliases: The course aliases.
  1626  	Aliases []*CourseAlias `json:"aliases,omitempty"`
  1627  	// NextPageToken: Token identifying the next page of results to return. If
  1628  	// empty, no further results are available.
  1629  	NextPageToken string `json:"nextPageToken,omitempty"`
  1630  
  1631  	// ServerResponse contains the HTTP response code and headers from the server.
  1632  	googleapi.ServerResponse `json:"-"`
  1633  	// ForceSendFields is a list of field names (e.g. "Aliases") to unconditionally
  1634  	// include in API requests. By default, fields with empty or default values are
  1635  	// omitted from API requests. See
  1636  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1637  	// details.
  1638  	ForceSendFields []string `json:"-"`
  1639  	// NullFields is a list of field names (e.g. "Aliases") to include in API
  1640  	// requests with the JSON null value. By default, fields with empty values are
  1641  	// omitted from API requests. See
  1642  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1643  	NullFields []string `json:"-"`
  1644  }
  1645  
  1646  func (s *ListCourseAliasesResponse) MarshalJSON() ([]byte, error) {
  1647  	type NoMethod ListCourseAliasesResponse
  1648  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1649  }
  1650  
  1651  // ListCourseWorkMaterialResponse: Response when listing course work material.
  1652  type ListCourseWorkMaterialResponse struct {
  1653  	// CourseWorkMaterial: Course work material items that match the request.
  1654  	CourseWorkMaterial []*CourseWorkMaterial `json:"courseWorkMaterial,omitempty"`
  1655  	// NextPageToken: Token identifying the next page of results to return. If
  1656  	// empty, no further results are available.
  1657  	NextPageToken string `json:"nextPageToken,omitempty"`
  1658  
  1659  	// ServerResponse contains the HTTP response code and headers from the server.
  1660  	googleapi.ServerResponse `json:"-"`
  1661  	// ForceSendFields is a list of field names (e.g. "CourseWorkMaterial") to
  1662  	// unconditionally include in API requests. By default, fields with empty or
  1663  	// default values are omitted from API requests. See
  1664  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1665  	// details.
  1666  	ForceSendFields []string `json:"-"`
  1667  	// NullFields is a list of field names (e.g. "CourseWorkMaterial") to include
  1668  	// in API requests with the JSON null value. By default, fields with empty
  1669  	// values are omitted from API requests. See
  1670  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1671  	NullFields []string `json:"-"`
  1672  }
  1673  
  1674  func (s *ListCourseWorkMaterialResponse) MarshalJSON() ([]byte, error) {
  1675  	type NoMethod ListCourseWorkMaterialResponse
  1676  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1677  }
  1678  
  1679  // ListCourseWorkResponse: Response when listing course work.
  1680  type ListCourseWorkResponse struct {
  1681  	// CourseWork: Course work items that match the request.
  1682  	CourseWork []*CourseWork `json:"courseWork,omitempty"`
  1683  	// NextPageToken: Token identifying the next page of results to return. If
  1684  	// empty, no further results are available.
  1685  	NextPageToken string `json:"nextPageToken,omitempty"`
  1686  
  1687  	// ServerResponse contains the HTTP response code and headers from the server.
  1688  	googleapi.ServerResponse `json:"-"`
  1689  	// ForceSendFields is a list of field names (e.g. "CourseWork") to
  1690  	// unconditionally include in API requests. By default, fields with empty or
  1691  	// default values are omitted from API requests. See
  1692  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1693  	// details.
  1694  	ForceSendFields []string `json:"-"`
  1695  	// NullFields is a list of field names (e.g. "CourseWork") to include in API
  1696  	// requests with the JSON null value. By default, fields with empty values are
  1697  	// omitted from API requests. See
  1698  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1699  	NullFields []string `json:"-"`
  1700  }
  1701  
  1702  func (s *ListCourseWorkResponse) MarshalJSON() ([]byte, error) {
  1703  	type NoMethod ListCourseWorkResponse
  1704  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1705  }
  1706  
  1707  // ListCoursesResponse: Response when listing courses.
  1708  type ListCoursesResponse struct {
  1709  	// Courses: Courses that match the list request.
  1710  	Courses []*Course `json:"courses,omitempty"`
  1711  	// NextPageToken: Token identifying the next page of results to return. If
  1712  	// empty, no further results are available.
  1713  	NextPageToken string `json:"nextPageToken,omitempty"`
  1714  
  1715  	// ServerResponse contains the HTTP response code and headers from the server.
  1716  	googleapi.ServerResponse `json:"-"`
  1717  	// ForceSendFields is a list of field names (e.g. "Courses") to unconditionally
  1718  	// include in API requests. By default, fields with empty or default values are
  1719  	// omitted from API requests. See
  1720  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1721  	// details.
  1722  	ForceSendFields []string `json:"-"`
  1723  	// NullFields is a list of field names (e.g. "Courses") to include in API
  1724  	// requests with the JSON null value. By default, fields with empty values are
  1725  	// omitted from API requests. See
  1726  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1727  	NullFields []string `json:"-"`
  1728  }
  1729  
  1730  func (s *ListCoursesResponse) MarshalJSON() ([]byte, error) {
  1731  	type NoMethod ListCoursesResponse
  1732  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1733  }
  1734  
  1735  // ListGuardianInvitationsResponse: Response when listing guardian invitations.
  1736  type ListGuardianInvitationsResponse struct {
  1737  	// GuardianInvitations: Guardian invitations that matched the list request.
  1738  	GuardianInvitations []*GuardianInvitation `json:"guardianInvitations,omitempty"`
  1739  	// NextPageToken: Token identifying the next page of results to return. If
  1740  	// empty, no further results are available.
  1741  	NextPageToken string `json:"nextPageToken,omitempty"`
  1742  
  1743  	// ServerResponse contains the HTTP response code and headers from the server.
  1744  	googleapi.ServerResponse `json:"-"`
  1745  	// ForceSendFields is a list of field names (e.g. "GuardianInvitations") to
  1746  	// unconditionally include in API requests. By default, fields with empty or
  1747  	// default values are omitted from API requests. See
  1748  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1749  	// details.
  1750  	ForceSendFields []string `json:"-"`
  1751  	// NullFields is a list of field names (e.g. "GuardianInvitations") to include
  1752  	// in API requests with the JSON null value. By default, fields with empty
  1753  	// values are omitted from API requests. See
  1754  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1755  	NullFields []string `json:"-"`
  1756  }
  1757  
  1758  func (s *ListGuardianInvitationsResponse) MarshalJSON() ([]byte, error) {
  1759  	type NoMethod ListGuardianInvitationsResponse
  1760  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1761  }
  1762  
  1763  // ListGuardiansResponse: Response when listing guardians.
  1764  type ListGuardiansResponse struct {
  1765  	// Guardians: Guardians on this page of results that met the criteria specified
  1766  	// in the request.
  1767  	Guardians []*Guardian `json:"guardians,omitempty"`
  1768  	// NextPageToken: Token identifying the next page of results to return. If
  1769  	// empty, no further results are available.
  1770  	NextPageToken string `json:"nextPageToken,omitempty"`
  1771  
  1772  	// ServerResponse contains the HTTP response code and headers from the server.
  1773  	googleapi.ServerResponse `json:"-"`
  1774  	// ForceSendFields is a list of field names (e.g. "Guardians") to
  1775  	// unconditionally include in API requests. By default, fields with empty or
  1776  	// default values are omitted from API requests. See
  1777  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1778  	// details.
  1779  	ForceSendFields []string `json:"-"`
  1780  	// NullFields is a list of field names (e.g. "Guardians") to include in API
  1781  	// requests with the JSON null value. By default, fields with empty values are
  1782  	// omitted from API requests. See
  1783  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1784  	NullFields []string `json:"-"`
  1785  }
  1786  
  1787  func (s *ListGuardiansResponse) MarshalJSON() ([]byte, error) {
  1788  	type NoMethod ListGuardiansResponse
  1789  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1790  }
  1791  
  1792  // ListInvitationsResponse: Response when listing invitations.
  1793  type ListInvitationsResponse struct {
  1794  	// Invitations: Invitations that match the list request.
  1795  	Invitations []*Invitation `json:"invitations,omitempty"`
  1796  	// NextPageToken: Token identifying the next page of results to return. If
  1797  	// empty, no further results are available.
  1798  	NextPageToken string `json:"nextPageToken,omitempty"`
  1799  
  1800  	// ServerResponse contains the HTTP response code and headers from the server.
  1801  	googleapi.ServerResponse `json:"-"`
  1802  	// ForceSendFields is a list of field names (e.g. "Invitations") to
  1803  	// unconditionally include in API requests. By default, fields with empty or
  1804  	// default values are omitted from API requests. See
  1805  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1806  	// details.
  1807  	ForceSendFields []string `json:"-"`
  1808  	// NullFields is a list of field names (e.g. "Invitations") to include in API
  1809  	// requests with the JSON null value. By default, fields with empty values are
  1810  	// omitted from API requests. See
  1811  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1812  	NullFields []string `json:"-"`
  1813  }
  1814  
  1815  func (s *ListInvitationsResponse) MarshalJSON() ([]byte, error) {
  1816  	type NoMethod ListInvitationsResponse
  1817  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1818  }
  1819  
  1820  // ListStudentSubmissionsResponse: Response when listing student submissions.
  1821  type ListStudentSubmissionsResponse struct {
  1822  	// NextPageToken: Token identifying the next page of results to return. If
  1823  	// empty, no further results are available.
  1824  	NextPageToken string `json:"nextPageToken,omitempty"`
  1825  	// StudentSubmissions: Student work that matches the request.
  1826  	StudentSubmissions []*StudentSubmission `json:"studentSubmissions,omitempty"`
  1827  
  1828  	// ServerResponse contains the HTTP response code and headers from the server.
  1829  	googleapi.ServerResponse `json:"-"`
  1830  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1831  	// unconditionally include in API requests. By default, fields with empty or
  1832  	// default values are omitted from API requests. See
  1833  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1834  	// details.
  1835  	ForceSendFields []string `json:"-"`
  1836  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
  1837  	// requests with the JSON null value. By default, fields with empty values are
  1838  	// omitted from API requests. See
  1839  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1840  	NullFields []string `json:"-"`
  1841  }
  1842  
  1843  func (s *ListStudentSubmissionsResponse) MarshalJSON() ([]byte, error) {
  1844  	type NoMethod ListStudentSubmissionsResponse
  1845  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1846  }
  1847  
  1848  // ListStudentsResponse: Response when listing students.
  1849  type ListStudentsResponse struct {
  1850  	// NextPageToken: Token identifying the next page of results to return. If
  1851  	// empty, no further results are available.
  1852  	NextPageToken string `json:"nextPageToken,omitempty"`
  1853  	// Students: Students who match the list request.
  1854  	Students []*Student `json:"students,omitempty"`
  1855  
  1856  	// ServerResponse contains the HTTP response code and headers from the server.
  1857  	googleapi.ServerResponse `json:"-"`
  1858  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1859  	// unconditionally include in API requests. By default, fields with empty or
  1860  	// default values are omitted from API requests. See
  1861  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1862  	// details.
  1863  	ForceSendFields []string `json:"-"`
  1864  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
  1865  	// requests with the JSON null value. By default, fields with empty values are
  1866  	// omitted from API requests. See
  1867  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1868  	NullFields []string `json:"-"`
  1869  }
  1870  
  1871  func (s *ListStudentsResponse) MarshalJSON() ([]byte, error) {
  1872  	type NoMethod ListStudentsResponse
  1873  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1874  }
  1875  
  1876  // ListTeachersResponse: Response when listing teachers.
  1877  type ListTeachersResponse struct {
  1878  	// NextPageToken: Token identifying the next page of results to return. If
  1879  	// empty, no further results are available.
  1880  	NextPageToken string `json:"nextPageToken,omitempty"`
  1881  	// Teachers: Teachers who match the list request.
  1882  	Teachers []*Teacher `json:"teachers,omitempty"`
  1883  
  1884  	// ServerResponse contains the HTTP response code and headers from the server.
  1885  	googleapi.ServerResponse `json:"-"`
  1886  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1887  	// unconditionally include in API requests. By default, fields with empty or
  1888  	// default values are omitted from API requests. See
  1889  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1890  	// details.
  1891  	ForceSendFields []string `json:"-"`
  1892  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
  1893  	// requests with the JSON null value. By default, fields with empty values are
  1894  	// omitted from API requests. See
  1895  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1896  	NullFields []string `json:"-"`
  1897  }
  1898  
  1899  func (s *ListTeachersResponse) MarshalJSON() ([]byte, error) {
  1900  	type NoMethod ListTeachersResponse
  1901  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1902  }
  1903  
  1904  // ListTopicResponse: Response when listing topics.
  1905  type ListTopicResponse struct {
  1906  	// NextPageToken: Token identifying the next page of results to return. If
  1907  	// empty, no further results are available.
  1908  	NextPageToken string `json:"nextPageToken,omitempty"`
  1909  	// Topic: Topic items that match the request.
  1910  	Topic []*Topic `json:"topic,omitempty"`
  1911  
  1912  	// ServerResponse contains the HTTP response code and headers from the server.
  1913  	googleapi.ServerResponse `json:"-"`
  1914  	// ForceSendFields is a list of field names (e.g. "NextPageToken") to
  1915  	// unconditionally include in API requests. By default, fields with empty or
  1916  	// default values are omitted from API requests. See
  1917  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1918  	// details.
  1919  	ForceSendFields []string `json:"-"`
  1920  	// NullFields is a list of field names (e.g. "NextPageToken") to include in API
  1921  	// requests with the JSON null value. By default, fields with empty values are
  1922  	// omitted from API requests. See
  1923  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1924  	NullFields []string `json:"-"`
  1925  }
  1926  
  1927  func (s *ListTopicResponse) MarshalJSON() ([]byte, error) {
  1928  	type NoMethod ListTopicResponse
  1929  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1930  }
  1931  
  1932  // Material: Material attached to course work. When creating attachments,
  1933  // setting the `form` field is not supported.
  1934  type Material struct {
  1935  	// DriveFile: Google Drive file material.
  1936  	DriveFile *SharedDriveFile `json:"driveFile,omitempty"`
  1937  	// Form: Google Forms material.
  1938  	Form *Form `json:"form,omitempty"`
  1939  	// Link: Link material. On creation, this is upgraded to a more appropriate
  1940  	// type if possible, and this is reflected in the response.
  1941  	Link *Link `json:"link,omitempty"`
  1942  	// YoutubeVideo: YouTube video material.
  1943  	YoutubeVideo *YouTubeVideo `json:"youtubeVideo,omitempty"`
  1944  	// ForceSendFields is a list of field names (e.g. "DriveFile") to
  1945  	// unconditionally include in API requests. By default, fields with empty or
  1946  	// default values are omitted from API requests. See
  1947  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1948  	// details.
  1949  	ForceSendFields []string `json:"-"`
  1950  	// NullFields is a list of field names (e.g. "DriveFile") to include in API
  1951  	// requests with the JSON null value. By default, fields with empty values are
  1952  	// omitted from API requests. See
  1953  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1954  	NullFields []string `json:"-"`
  1955  }
  1956  
  1957  func (s *Material) MarshalJSON() ([]byte, error) {
  1958  	type NoMethod Material
  1959  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1960  }
  1961  
  1962  // ModifyAnnouncementAssigneesRequest: Request to modify assignee mode and
  1963  // options of an announcement.
  1964  type ModifyAnnouncementAssigneesRequest struct {
  1965  	// AssigneeMode: Mode of the announcement describing whether it is accessible
  1966  	// by all students or specified individual students.
  1967  	//
  1968  	// Possible values:
  1969  	//   "ASSIGNEE_MODE_UNSPECIFIED" - No mode specified. This is never returned.
  1970  	//   "ALL_STUDENTS" - All students can see the item. This is the default state.
  1971  	//   "INDIVIDUAL_STUDENTS" - A subset of the students can see the item.
  1972  	AssigneeMode string `json:"assigneeMode,omitempty"`
  1973  	// ModifyIndividualStudentsOptions: Set which students can view or cannot view
  1974  	// the announcement. Must be specified only when `assigneeMode` is
  1975  	// `INDIVIDUAL_STUDENTS`.
  1976  	ModifyIndividualStudentsOptions *ModifyIndividualStudentsOptions `json:"modifyIndividualStudentsOptions,omitempty"`
  1977  	// ForceSendFields is a list of field names (e.g. "AssigneeMode") to
  1978  	// unconditionally include in API requests. By default, fields with empty or
  1979  	// default values are omitted from API requests. See
  1980  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  1981  	// details.
  1982  	ForceSendFields []string `json:"-"`
  1983  	// NullFields is a list of field names (e.g. "AssigneeMode") to include in API
  1984  	// requests with the JSON null value. By default, fields with empty values are
  1985  	// omitted from API requests. See
  1986  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  1987  	NullFields []string `json:"-"`
  1988  }
  1989  
  1990  func (s *ModifyAnnouncementAssigneesRequest) MarshalJSON() ([]byte, error) {
  1991  	type NoMethod ModifyAnnouncementAssigneesRequest
  1992  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  1993  }
  1994  
  1995  // ModifyAttachmentsRequest: Request to modify the attachments of a student
  1996  // submission.
  1997  type ModifyAttachmentsRequest struct {
  1998  	// AddAttachments: Attachments to add. A student submission may not have more
  1999  	// than 20 attachments. Form attachments are not supported.
  2000  	AddAttachments []*Attachment `json:"addAttachments,omitempty"`
  2001  	// ForceSendFields is a list of field names (e.g. "AddAttachments") to
  2002  	// unconditionally include in API requests. By default, fields with empty or
  2003  	// default values are omitted from API requests. See
  2004  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2005  	// details.
  2006  	ForceSendFields []string `json:"-"`
  2007  	// NullFields is a list of field names (e.g. "AddAttachments") to include in
  2008  	// API requests with the JSON null value. By default, fields with empty values
  2009  	// are omitted from API requests. See
  2010  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2011  	NullFields []string `json:"-"`
  2012  }
  2013  
  2014  func (s *ModifyAttachmentsRequest) MarshalJSON() ([]byte, error) {
  2015  	type NoMethod ModifyAttachmentsRequest
  2016  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2017  }
  2018  
  2019  // ModifyCourseWorkAssigneesRequest: Request to modify assignee mode and
  2020  // options of a coursework.
  2021  type ModifyCourseWorkAssigneesRequest struct {
  2022  	// AssigneeMode: Mode of the coursework describing whether it will be assigned
  2023  	// to all students or specified individual students.
  2024  	//
  2025  	// Possible values:
  2026  	//   "ASSIGNEE_MODE_UNSPECIFIED" - No mode specified. This is never returned.
  2027  	//   "ALL_STUDENTS" - All students can see the item. This is the default state.
  2028  	//   "INDIVIDUAL_STUDENTS" - A subset of the students can see the item.
  2029  	AssigneeMode string `json:"assigneeMode,omitempty"`
  2030  	// ModifyIndividualStudentsOptions: Set which students are assigned or not
  2031  	// assigned to the coursework. Must be specified only when `assigneeMode` is
  2032  	// `INDIVIDUAL_STUDENTS`.
  2033  	ModifyIndividualStudentsOptions *ModifyIndividualStudentsOptions `json:"modifyIndividualStudentsOptions,omitempty"`
  2034  	// ForceSendFields is a list of field names (e.g. "AssigneeMode") to
  2035  	// unconditionally include in API requests. By default, fields with empty or
  2036  	// default values are omitted from API requests. See
  2037  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2038  	// details.
  2039  	ForceSendFields []string `json:"-"`
  2040  	// NullFields is a list of field names (e.g. "AssigneeMode") to include in API
  2041  	// requests with the JSON null value. By default, fields with empty values are
  2042  	// omitted from API requests. See
  2043  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2044  	NullFields []string `json:"-"`
  2045  }
  2046  
  2047  func (s *ModifyCourseWorkAssigneesRequest) MarshalJSON() ([]byte, error) {
  2048  	type NoMethod ModifyCourseWorkAssigneesRequest
  2049  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2050  }
  2051  
  2052  // ModifyIndividualStudentsOptions: Contains fields to add or remove students
  2053  // from a course work or announcement where the `assigneeMode` is set to
  2054  // `INDIVIDUAL_STUDENTS`.
  2055  type ModifyIndividualStudentsOptions struct {
  2056  	// AddStudentIds: IDs of students to be added as having access to this
  2057  	// coursework/announcement.
  2058  	AddStudentIds []string `json:"addStudentIds,omitempty"`
  2059  	// RemoveStudentIds: IDs of students to be removed from having access to this
  2060  	// coursework/announcement.
  2061  	RemoveStudentIds []string `json:"removeStudentIds,omitempty"`
  2062  	// ForceSendFields is a list of field names (e.g. "AddStudentIds") to
  2063  	// unconditionally include in API requests. By default, fields with empty or
  2064  	// default values are omitted from API requests. See
  2065  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2066  	// details.
  2067  	ForceSendFields []string `json:"-"`
  2068  	// NullFields is a list of field names (e.g. "AddStudentIds") to include in API
  2069  	// requests with the JSON null value. By default, fields with empty values are
  2070  	// omitted from API requests. See
  2071  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2072  	NullFields []string `json:"-"`
  2073  }
  2074  
  2075  func (s *ModifyIndividualStudentsOptions) MarshalJSON() ([]byte, error) {
  2076  	type NoMethod ModifyIndividualStudentsOptions
  2077  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2078  }
  2079  
  2080  // MultipleChoiceQuestion: Additional details for multiple-choice questions.
  2081  type MultipleChoiceQuestion struct {
  2082  	// Choices: Possible choices.
  2083  	Choices []string `json:"choices,omitempty"`
  2084  	// ForceSendFields is a list of field names (e.g. "Choices") to unconditionally
  2085  	// include in API requests. By default, fields with empty or default values are
  2086  	// omitted from API requests. See
  2087  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2088  	// details.
  2089  	ForceSendFields []string `json:"-"`
  2090  	// NullFields is a list of field names (e.g. "Choices") to include in API
  2091  	// requests with the JSON null value. By default, fields with empty values are
  2092  	// omitted from API requests. See
  2093  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2094  	NullFields []string `json:"-"`
  2095  }
  2096  
  2097  func (s *MultipleChoiceQuestion) MarshalJSON() ([]byte, error) {
  2098  	type NoMethod MultipleChoiceQuestion
  2099  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2100  }
  2101  
  2102  // MultipleChoiceSubmission: Student work for a multiple-choice question.
  2103  type MultipleChoiceSubmission struct {
  2104  	// Answer: Student's select choice.
  2105  	Answer string `json:"answer,omitempty"`
  2106  	// ForceSendFields is a list of field names (e.g. "Answer") to unconditionally
  2107  	// include in API requests. By default, fields with empty or default values are
  2108  	// omitted from API requests. See
  2109  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2110  	// details.
  2111  	ForceSendFields []string `json:"-"`
  2112  	// NullFields is a list of field names (e.g. "Answer") to include in API
  2113  	// requests with the JSON null value. By default, fields with empty values are
  2114  	// omitted from API requests. See
  2115  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2116  	NullFields []string `json:"-"`
  2117  }
  2118  
  2119  func (s *MultipleChoiceSubmission) MarshalJSON() ([]byte, error) {
  2120  	type NoMethod MultipleChoiceSubmission
  2121  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2122  }
  2123  
  2124  // Name: Details of the user's name.
  2125  type Name struct {
  2126  	// FamilyName: The user's last name. Read-only.
  2127  	FamilyName string `json:"familyName,omitempty"`
  2128  	// FullName: The user's full name formed by concatenating the first and last
  2129  	// name values. Read-only.
  2130  	FullName string `json:"fullName,omitempty"`
  2131  	// GivenName: The user's first name. Read-only.
  2132  	GivenName string `json:"givenName,omitempty"`
  2133  	// ForceSendFields is a list of field names (e.g. "FamilyName") to
  2134  	// unconditionally include in API requests. By default, fields with empty or
  2135  	// default values are omitted from API requests. See
  2136  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2137  	// details.
  2138  	ForceSendFields []string `json:"-"`
  2139  	// NullFields is a list of field names (e.g. "FamilyName") to include in API
  2140  	// requests with the JSON null value. By default, fields with empty values are
  2141  	// omitted from API requests. See
  2142  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2143  	NullFields []string `json:"-"`
  2144  }
  2145  
  2146  func (s *Name) MarshalJSON() ([]byte, error) {
  2147  	type NoMethod Name
  2148  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2149  }
  2150  
  2151  // ReclaimStudentSubmissionRequest: Request to reclaim a student submission.
  2152  type ReclaimStudentSubmissionRequest struct {
  2153  }
  2154  
  2155  // Registration: An instruction to Classroom to send notifications from the
  2156  // `feed` to the provided destination.
  2157  type Registration struct {
  2158  	// CloudPubsubTopic: The Cloud Pub/Sub topic that notifications are to be sent
  2159  	// to.
  2160  	CloudPubsubTopic *CloudPubsubTopic `json:"cloudPubsubTopic,omitempty"`
  2161  	// ExpiryTime: The time until which the `Registration` is effective. This is a
  2162  	// read-only field assigned by the server.
  2163  	ExpiryTime string `json:"expiryTime,omitempty"`
  2164  	// Feed: Specification for the class of notifications that Classroom should
  2165  	// deliver to the destination.
  2166  	Feed *Feed `json:"feed,omitempty"`
  2167  	// RegistrationId: A server-generated unique identifier for this
  2168  	// `Registration`. Read-only.
  2169  	RegistrationId string `json:"registrationId,omitempty"`
  2170  
  2171  	// ServerResponse contains the HTTP response code and headers from the server.
  2172  	googleapi.ServerResponse `json:"-"`
  2173  	// ForceSendFields is a list of field names (e.g. "CloudPubsubTopic") to
  2174  	// unconditionally include in API requests. By default, fields with empty or
  2175  	// default values are omitted from API requests. See
  2176  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2177  	// details.
  2178  	ForceSendFields []string `json:"-"`
  2179  	// NullFields is a list of field names (e.g. "CloudPubsubTopic") to include in
  2180  	// API requests with the JSON null value. By default, fields with empty values
  2181  	// are omitted from API requests. See
  2182  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2183  	NullFields []string `json:"-"`
  2184  }
  2185  
  2186  func (s *Registration) MarshalJSON() ([]byte, error) {
  2187  	type NoMethod Registration
  2188  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2189  }
  2190  
  2191  // ReturnStudentSubmissionRequest: Request to return a student submission.
  2192  type ReturnStudentSubmissionRequest struct {
  2193  }
  2194  
  2195  // SharedDriveFile: Drive file that is used as material for course work.
  2196  type SharedDriveFile struct {
  2197  	// DriveFile: Drive file details.
  2198  	DriveFile *DriveFile `json:"driveFile,omitempty"`
  2199  	// ShareMode: Mechanism by which students access the Drive item.
  2200  	//
  2201  	// Possible values:
  2202  	//   "UNKNOWN_SHARE_MODE" - No sharing mode specified. This should never be
  2203  	// returned.
  2204  	//   "VIEW" - Students can view the shared file.
  2205  	//   "EDIT" - Students can edit the shared file.
  2206  	//   "STUDENT_COPY" - Students have a personal copy of the shared file.
  2207  	ShareMode string `json:"shareMode,omitempty"`
  2208  	// ForceSendFields is a list of field names (e.g. "DriveFile") to
  2209  	// unconditionally include in API requests. By default, fields with empty or
  2210  	// default values are omitted from API requests. See
  2211  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2212  	// details.
  2213  	ForceSendFields []string `json:"-"`
  2214  	// NullFields is a list of field names (e.g. "DriveFile") to include in API
  2215  	// requests with the JSON null value. By default, fields with empty values are
  2216  	// omitted from API requests. See
  2217  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2218  	NullFields []string `json:"-"`
  2219  }
  2220  
  2221  func (s *SharedDriveFile) MarshalJSON() ([]byte, error) {
  2222  	type NoMethod SharedDriveFile
  2223  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2224  }
  2225  
  2226  // ShortAnswerSubmission: Student work for a short answer question.
  2227  type ShortAnswerSubmission struct {
  2228  	// Answer: Student response to a short-answer question.
  2229  	Answer string `json:"answer,omitempty"`
  2230  	// ForceSendFields is a list of field names (e.g. "Answer") to unconditionally
  2231  	// include in API requests. By default, fields with empty or default values are
  2232  	// omitted from API requests. See
  2233  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2234  	// details.
  2235  	ForceSendFields []string `json:"-"`
  2236  	// NullFields is a list of field names (e.g. "Answer") to include in API
  2237  	// requests with the JSON null value. By default, fields with empty values are
  2238  	// omitted from API requests. See
  2239  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2240  	NullFields []string `json:"-"`
  2241  }
  2242  
  2243  func (s *ShortAnswerSubmission) MarshalJSON() ([]byte, error) {
  2244  	type NoMethod ShortAnswerSubmission
  2245  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2246  }
  2247  
  2248  // StateHistory: The history of each state this submission has been in.
  2249  type StateHistory struct {
  2250  	// ActorUserId: The teacher or student who made the change.
  2251  	ActorUserId string `json:"actorUserId,omitempty"`
  2252  	// State: The workflow pipeline stage.
  2253  	//
  2254  	// Possible values:
  2255  	//   "STATE_UNSPECIFIED" - No state specified. This should never be returned.
  2256  	//   "CREATED" - The Submission has been created.
  2257  	//   "TURNED_IN" - The student has turned in an assigned document, which may or
  2258  	// may not be a template.
  2259  	//   "RETURNED" - The teacher has returned the assigned document to the
  2260  	// student.
  2261  	//   "RECLAIMED_BY_STUDENT" - The student turned in the assigned document, and
  2262  	// then chose to "unsubmit" the assignment, giving the student control again as
  2263  	// the owner.
  2264  	//   "STUDENT_EDITED_AFTER_TURN_IN" - The student edited their submission after
  2265  	// turning it in. Currently, only used by Questions, when the student edits
  2266  	// their answer.
  2267  	State string `json:"state,omitempty"`
  2268  	// StateTimestamp: When the submission entered this state.
  2269  	StateTimestamp string `json:"stateTimestamp,omitempty"`
  2270  	// ForceSendFields is a list of field names (e.g. "ActorUserId") to
  2271  	// unconditionally include in API requests. By default, fields with empty or
  2272  	// default values are omitted from API requests. See
  2273  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2274  	// details.
  2275  	ForceSendFields []string `json:"-"`
  2276  	// NullFields is a list of field names (e.g. "ActorUserId") to include in API
  2277  	// requests with the JSON null value. By default, fields with empty values are
  2278  	// omitted from API requests. See
  2279  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2280  	NullFields []string `json:"-"`
  2281  }
  2282  
  2283  func (s *StateHistory) MarshalJSON() ([]byte, error) {
  2284  	type NoMethod StateHistory
  2285  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2286  }
  2287  
  2288  // Student: Student in a course.
  2289  type Student struct {
  2290  	// CourseId: Identifier of the course. Read-only.
  2291  	CourseId string `json:"courseId,omitempty"`
  2292  	// Profile: Global user information for the student. Read-only.
  2293  	Profile *UserProfile `json:"profile,omitempty"`
  2294  	// StudentWorkFolder: Information about a Drive Folder for this student's work
  2295  	// in this course. Only visible to the student and domain administrators.
  2296  	// Read-only.
  2297  	StudentWorkFolder *DriveFolder `json:"studentWorkFolder,omitempty"`
  2298  	// UserId: Identifier of the user. When specified as a parameter of a request,
  2299  	// this identifier can be one of the following: * the numeric identifier for
  2300  	// the user * the email address of the user * the string literal "me",
  2301  	// indicating the requesting user
  2302  	UserId string `json:"userId,omitempty"`
  2303  
  2304  	// ServerResponse contains the HTTP response code and headers from the server.
  2305  	googleapi.ServerResponse `json:"-"`
  2306  	// ForceSendFields is a list of field names (e.g. "CourseId") to
  2307  	// unconditionally include in API requests. By default, fields with empty or
  2308  	// default values are omitted from API requests. See
  2309  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2310  	// details.
  2311  	ForceSendFields []string `json:"-"`
  2312  	// NullFields is a list of field names (e.g. "CourseId") to include in API
  2313  	// requests with the JSON null value. By default, fields with empty values are
  2314  	// omitted from API requests. See
  2315  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2316  	NullFields []string `json:"-"`
  2317  }
  2318  
  2319  func (s *Student) MarshalJSON() ([]byte, error) {
  2320  	type NoMethod Student
  2321  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2322  }
  2323  
  2324  // StudentSubmission: Student submission for course work. `StudentSubmission`
  2325  // items are generated when a `CourseWork` item is created. Student submissions
  2326  // that have never been accessed (i.e. with `state` = NEW) may not have a
  2327  // creation time or update time.
  2328  type StudentSubmission struct {
  2329  	// AlternateLink: Absolute link to the submission in the Classroom web UI.
  2330  	// Read-only.
  2331  	AlternateLink string `json:"alternateLink,omitempty"`
  2332  	// AssignedGrade: Optional grade. If unset, no grade was set. This value must
  2333  	// be non-negative. Decimal (that is, non-integer) values are allowed, but are
  2334  	// rounded to two decimal places. This may be modified only by course teachers.
  2335  	AssignedGrade float64 `json:"assignedGrade,omitempty"`
  2336  	// AssignmentSubmission: Submission content when course_work_type is
  2337  	// ASSIGNMENT. Students can modify this content using ModifyAttachments.
  2338  	AssignmentSubmission *AssignmentSubmission `json:"assignmentSubmission,omitempty"`
  2339  	// AssociatedWithDeveloper: Whether this student submission is associated with
  2340  	// the Developer Console project making the request. See CreateCourseWork for
  2341  	// more details. Read-only.
  2342  	AssociatedWithDeveloper bool `json:"associatedWithDeveloper,omitempty"`
  2343  	// CourseId: Identifier of the course. Read-only.
  2344  	CourseId string `json:"courseId,omitempty"`
  2345  	// CourseWorkId: Identifier for the course work this corresponds to. Read-only.
  2346  	CourseWorkId string `json:"courseWorkId,omitempty"`
  2347  	// CourseWorkType: Type of course work this submission is for. Read-only.
  2348  	//
  2349  	// Possible values:
  2350  	//   "COURSE_WORK_TYPE_UNSPECIFIED" - No work type specified. This is never
  2351  	// returned.
  2352  	//   "ASSIGNMENT" - An assignment.
  2353  	//   "SHORT_ANSWER_QUESTION" - A short answer question.
  2354  	//   "MULTIPLE_CHOICE_QUESTION" - A multiple-choice question.
  2355  	CourseWorkType string `json:"courseWorkType,omitempty"`
  2356  	// CreationTime: Creation time of this submission. This may be unset if the
  2357  	// student has not accessed this item. Read-only.
  2358  	CreationTime string `json:"creationTime,omitempty"`
  2359  	// DraftGrade: Optional pending grade. If unset, no grade was set. This value
  2360  	// must be non-negative. Decimal (that is, non-integer) values are allowed, but
  2361  	// are rounded to two decimal places. This is only visible to and modifiable by
  2362  	// course teachers.
  2363  	DraftGrade float64 `json:"draftGrade,omitempty"`
  2364  	// Id: Classroom-assigned Identifier for the student submission. This is unique
  2365  	// among submissions for the relevant course work. Read-only.
  2366  	Id string `json:"id,omitempty"`
  2367  	// Late: Whether this submission is late. Read-only.
  2368  	Late bool `json:"late,omitempty"`
  2369  	// MultipleChoiceSubmission: Submission content when course_work_type is
  2370  	// MULTIPLE_CHOICE_QUESTION.
  2371  	MultipleChoiceSubmission *MultipleChoiceSubmission `json:"multipleChoiceSubmission,omitempty"`
  2372  	// ShortAnswerSubmission: Submission content when course_work_type is
  2373  	// SHORT_ANSWER_QUESTION.
  2374  	ShortAnswerSubmission *ShortAnswerSubmission `json:"shortAnswerSubmission,omitempty"`
  2375  	// State: State of this submission. Read-only.
  2376  	//
  2377  	// Possible values:
  2378  	//   "SUBMISSION_STATE_UNSPECIFIED" - No state specified. This should never be
  2379  	// returned.
  2380  	//   "NEW" - The student has never accessed this submission. Attachments are
  2381  	// not returned and timestamps is not set.
  2382  	//   "CREATED" - Has been created.
  2383  	//   "TURNED_IN" - Has been turned in to the teacher.
  2384  	//   "RETURNED" - Has been returned to the student.
  2385  	//   "RECLAIMED_BY_STUDENT" - Student chose to "unsubmit" the assignment.
  2386  	State string `json:"state,omitempty"`
  2387  	// SubmissionHistory: The history of the submission (includes state and grade
  2388  	// histories). Read-only.
  2389  	SubmissionHistory []*SubmissionHistory `json:"submissionHistory,omitempty"`
  2390  	// UpdateTime: Last update time of this submission. This may be unset if the
  2391  	// student has not accessed this item. Read-only.
  2392  	UpdateTime string `json:"updateTime,omitempty"`
  2393  	// UserId: Identifier for the student that owns this submission. Read-only.
  2394  	UserId string `json:"userId,omitempty"`
  2395  
  2396  	// ServerResponse contains the HTTP response code and headers from the server.
  2397  	googleapi.ServerResponse `json:"-"`
  2398  	// ForceSendFields is a list of field names (e.g. "AlternateLink") to
  2399  	// unconditionally include in API requests. By default, fields with empty or
  2400  	// default values are omitted from API requests. See
  2401  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2402  	// details.
  2403  	ForceSendFields []string `json:"-"`
  2404  	// NullFields is a list of field names (e.g. "AlternateLink") to include in API
  2405  	// requests with the JSON null value. By default, fields with empty values are
  2406  	// omitted from API requests. See
  2407  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2408  	NullFields []string `json:"-"`
  2409  }
  2410  
  2411  func (s *StudentSubmission) MarshalJSON() ([]byte, error) {
  2412  	type NoMethod StudentSubmission
  2413  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2414  }
  2415  
  2416  func (s *StudentSubmission) UnmarshalJSON(data []byte) error {
  2417  	type NoMethod StudentSubmission
  2418  	var s1 struct {
  2419  		AssignedGrade gensupport.JSONFloat64 `json:"assignedGrade"`
  2420  		DraftGrade    gensupport.JSONFloat64 `json:"draftGrade"`
  2421  		*NoMethod
  2422  	}
  2423  	s1.NoMethod = (*NoMethod)(s)
  2424  	if err := json.Unmarshal(data, &s1); err != nil {
  2425  		return err
  2426  	}
  2427  	s.AssignedGrade = float64(s1.AssignedGrade)
  2428  	s.DraftGrade = float64(s1.DraftGrade)
  2429  	return nil
  2430  }
  2431  
  2432  // SubmissionHistory: The history of the submission. This currently includes
  2433  // state and grade histories.
  2434  type SubmissionHistory struct {
  2435  	// GradeHistory: The grade history information of the submission, if present.
  2436  	GradeHistory *GradeHistory `json:"gradeHistory,omitempty"`
  2437  	// StateHistory: The state history information of the submission, if present.
  2438  	StateHistory *StateHistory `json:"stateHistory,omitempty"`
  2439  	// ForceSendFields is a list of field names (e.g. "GradeHistory") to
  2440  	// unconditionally include in API requests. By default, fields with empty or
  2441  	// default values are omitted from API requests. See
  2442  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2443  	// details.
  2444  	ForceSendFields []string `json:"-"`
  2445  	// NullFields is a list of field names (e.g. "GradeHistory") to include in API
  2446  	// requests with the JSON null value. By default, fields with empty values are
  2447  	// omitted from API requests. See
  2448  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2449  	NullFields []string `json:"-"`
  2450  }
  2451  
  2452  func (s *SubmissionHistory) MarshalJSON() ([]byte, error) {
  2453  	type NoMethod SubmissionHistory
  2454  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2455  }
  2456  
  2457  // Teacher: Teacher of a course.
  2458  type Teacher struct {
  2459  	// CourseId: Identifier of the course. Read-only.
  2460  	CourseId string `json:"courseId,omitempty"`
  2461  	// Profile: Global user information for the teacher. Read-only.
  2462  	Profile *UserProfile `json:"profile,omitempty"`
  2463  	// UserId: Identifier of the user. When specified as a parameter of a request,
  2464  	// this identifier can be one of the following: * the numeric identifier for
  2465  	// the user * the email address of the user * the string literal "me",
  2466  	// indicating the requesting user
  2467  	UserId string `json:"userId,omitempty"`
  2468  
  2469  	// ServerResponse contains the HTTP response code and headers from the server.
  2470  	googleapi.ServerResponse `json:"-"`
  2471  	// ForceSendFields is a list of field names (e.g. "CourseId") to
  2472  	// unconditionally include in API requests. By default, fields with empty or
  2473  	// default values are omitted from API requests. See
  2474  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2475  	// details.
  2476  	ForceSendFields []string `json:"-"`
  2477  	// NullFields is a list of field names (e.g. "CourseId") to include in API
  2478  	// requests with the JSON null value. By default, fields with empty values are
  2479  	// omitted from API requests. See
  2480  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2481  	NullFields []string `json:"-"`
  2482  }
  2483  
  2484  func (s *Teacher) MarshalJSON() ([]byte, error) {
  2485  	type NoMethod Teacher
  2486  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2487  }
  2488  
  2489  // TimeOfDay: Represents a time of day. The date and time zone are either not
  2490  // significant or are specified elsewhere. An API may choose to allow leap
  2491  // seconds. Related types are google.type.Date and `google.protobuf.Timestamp`.
  2492  type TimeOfDay struct {
  2493  	// Hours: Hours of day in 24 hour format. Should be from 0 to 23. An API may
  2494  	// choose to allow the value "24:00:00" for scenarios like business closing
  2495  	// time.
  2496  	Hours int64 `json:"hours,omitempty"`
  2497  	// Minutes: Minutes of hour of day. Must be from 0 to 59.
  2498  	Minutes int64 `json:"minutes,omitempty"`
  2499  	// Nanos: Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999.
  2500  	Nanos int64 `json:"nanos,omitempty"`
  2501  	// Seconds: Seconds of minutes of the time. Must normally be from 0 to 59. An
  2502  	// API may allow the value 60 if it allows leap-seconds.
  2503  	Seconds int64 `json:"seconds,omitempty"`
  2504  	// ForceSendFields is a list of field names (e.g. "Hours") to unconditionally
  2505  	// include in API requests. By default, fields with empty or default values are
  2506  	// omitted from API requests. See
  2507  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2508  	// details.
  2509  	ForceSendFields []string `json:"-"`
  2510  	// NullFields is a list of field names (e.g. "Hours") to include in API
  2511  	// requests with the JSON null value. By default, fields with empty values are
  2512  	// omitted from API requests. See
  2513  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2514  	NullFields []string `json:"-"`
  2515  }
  2516  
  2517  func (s *TimeOfDay) MarshalJSON() ([]byte, error) {
  2518  	type NoMethod TimeOfDay
  2519  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2520  }
  2521  
  2522  // Topic: Topic created by a teacher for the course
  2523  type Topic struct {
  2524  	// CourseId: Identifier of the course. Read-only.
  2525  	CourseId string `json:"courseId,omitempty"`
  2526  	// Name: The name of the topic, generated by the user. Leading and trailing
  2527  	// whitespaces, if any, are trimmed. Also, multiple consecutive whitespaces are
  2528  	// collapsed into one inside the name. The result must be a non-empty string.
  2529  	// Topic names are case sensitive, and must be no longer than 100 characters.
  2530  	Name string `json:"name,omitempty"`
  2531  	// TopicId: Unique identifier for the topic. Read-only.
  2532  	TopicId string `json:"topicId,omitempty"`
  2533  	// UpdateTime: The time the topic was last updated by the system. Read-only.
  2534  	UpdateTime string `json:"updateTime,omitempty"`
  2535  
  2536  	// ServerResponse contains the HTTP response code and headers from the server.
  2537  	googleapi.ServerResponse `json:"-"`
  2538  	// ForceSendFields is a list of field names (e.g. "CourseId") to
  2539  	// unconditionally include in API requests. By default, fields with empty or
  2540  	// default values are omitted from API requests. See
  2541  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2542  	// details.
  2543  	ForceSendFields []string `json:"-"`
  2544  	// NullFields is a list of field names (e.g. "CourseId") to include in API
  2545  	// requests with the JSON null value. By default, fields with empty values are
  2546  	// omitted from API requests. See
  2547  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2548  	NullFields []string `json:"-"`
  2549  }
  2550  
  2551  func (s *Topic) MarshalJSON() ([]byte, error) {
  2552  	type NoMethod Topic
  2553  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2554  }
  2555  
  2556  // TurnInStudentSubmissionRequest: Request to turn in a student submission.
  2557  type TurnInStudentSubmissionRequest struct {
  2558  }
  2559  
  2560  // UserProfile: Global information for a user.
  2561  type UserProfile struct {
  2562  	// EmailAddress: Email address of the user. Must request
  2563  	// `https://www.googleapis.com/auth/classroom.profile.emails` scope for this
  2564  	// field to be populated in a response body. Read-only.
  2565  	EmailAddress string `json:"emailAddress,omitempty"`
  2566  	// Id: Identifier of the user. Read-only.
  2567  	Id string `json:"id,omitempty"`
  2568  	// Name: Name of the user. Read-only.
  2569  	Name *Name `json:"name,omitempty"`
  2570  	// Permissions: Global permissions of the user. Read-only.
  2571  	Permissions []*GlobalPermission `json:"permissions,omitempty"`
  2572  	// PhotoUrl: URL of user's profile photo. Must request
  2573  	// `https://www.googleapis.com/auth/classroom.profile.photos` scope for this
  2574  	// field to be populated in a response body. Read-only.
  2575  	PhotoUrl string `json:"photoUrl,omitempty"`
  2576  	// VerifiedTeacher: Represents whether a Google Workspace for Education user's
  2577  	// domain administrator has explicitly verified them as being a teacher. This
  2578  	// field is always false if the user is not a member of a Google Workspace for
  2579  	// Education domain. Read-only
  2580  	VerifiedTeacher bool `json:"verifiedTeacher,omitempty"`
  2581  
  2582  	// ServerResponse contains the HTTP response code and headers from the server.
  2583  	googleapi.ServerResponse `json:"-"`
  2584  	// ForceSendFields is a list of field names (e.g. "EmailAddress") to
  2585  	// unconditionally include in API requests. By default, fields with empty or
  2586  	// default values are omitted from API requests. See
  2587  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2588  	// details.
  2589  	ForceSendFields []string `json:"-"`
  2590  	// NullFields is a list of field names (e.g. "EmailAddress") to include in API
  2591  	// requests with the JSON null value. By default, fields with empty values are
  2592  	// omitted from API requests. See
  2593  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2594  	NullFields []string `json:"-"`
  2595  }
  2596  
  2597  func (s *UserProfile) MarshalJSON() ([]byte, error) {
  2598  	type NoMethod UserProfile
  2599  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2600  }
  2601  
  2602  // YouTubeVideo: YouTube video item.
  2603  type YouTubeVideo struct {
  2604  	// AlternateLink: URL that can be used to view the YouTube video. Read-only.
  2605  	AlternateLink string `json:"alternateLink,omitempty"`
  2606  	// Id: YouTube API resource ID.
  2607  	Id string `json:"id,omitempty"`
  2608  	// ThumbnailUrl: URL of a thumbnail image of the YouTube video. Read-only.
  2609  	ThumbnailUrl string `json:"thumbnailUrl,omitempty"`
  2610  	// Title: Title of the YouTube video. Read-only.
  2611  	Title string `json:"title,omitempty"`
  2612  	// ForceSendFields is a list of field names (e.g. "AlternateLink") to
  2613  	// unconditionally include in API requests. By default, fields with empty or
  2614  	// default values are omitted from API requests. See
  2615  	// https://pkg.go.dev/google.golang.org/api#hdr-ForceSendFields for more
  2616  	// details.
  2617  	ForceSendFields []string `json:"-"`
  2618  	// NullFields is a list of field names (e.g. "AlternateLink") to include in API
  2619  	// requests with the JSON null value. By default, fields with empty values are
  2620  	// omitted from API requests. See
  2621  	// https://pkg.go.dev/google.golang.org/api#hdr-NullFields for more details.
  2622  	NullFields []string `json:"-"`
  2623  }
  2624  
  2625  func (s *YouTubeVideo) MarshalJSON() ([]byte, error) {
  2626  	type NoMethod YouTubeVideo
  2627  	return gensupport.MarshalJSON(NoMethod(*s), s.ForceSendFields, s.NullFields)
  2628  }
  2629  
  2630  type CoursesCreateCall struct {
  2631  	s          *Service
  2632  	course     *Course
  2633  	urlParams_ gensupport.URLParams
  2634  	ctx_       context.Context
  2635  	header_    http.Header
  2636  }
  2637  
  2638  // Create: Creates a course. The user specified in `ownerId` is the owner of
  2639  // the created course and added as a teacher. A non-admin requesting user can
  2640  // only create a course with themselves as the owner. Domain admins can create
  2641  // courses owned by any user within their domain. This method returns the
  2642  // following error codes: * `PERMISSION_DENIED` if the requesting user is not
  2643  // permitted to create courses or for access errors. * `NOT_FOUND` if the
  2644  // primary teacher is not a valid user. * `FAILED_PRECONDITION` if the course
  2645  // owner's account is disabled or for the following request errors: *
  2646  // UserCannotOwnCourse * UserGroupsMembershipLimitReached * `ALREADY_EXISTS` if
  2647  // an alias was specified in the `id` and already exists.
  2648  func (r *CoursesService) Create(course *Course) *CoursesCreateCall {
  2649  	c := &CoursesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2650  	c.course = course
  2651  	return c
  2652  }
  2653  
  2654  // Fields allows partial responses to be retrieved. See
  2655  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2656  // details.
  2657  func (c *CoursesCreateCall) Fields(s ...googleapi.Field) *CoursesCreateCall {
  2658  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2659  	return c
  2660  }
  2661  
  2662  // Context sets the context to be used in this call's Do method.
  2663  func (c *CoursesCreateCall) Context(ctx context.Context) *CoursesCreateCall {
  2664  	c.ctx_ = ctx
  2665  	return c
  2666  }
  2667  
  2668  // Header returns a http.Header that can be modified by the caller to add
  2669  // headers to the request.
  2670  func (c *CoursesCreateCall) Header() http.Header {
  2671  	if c.header_ == nil {
  2672  		c.header_ = make(http.Header)
  2673  	}
  2674  	return c.header_
  2675  }
  2676  
  2677  func (c *CoursesCreateCall) doRequest(alt string) (*http.Response, error) {
  2678  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  2679  	var body io.Reader = nil
  2680  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.course)
  2681  	if err != nil {
  2682  		return nil, err
  2683  	}
  2684  	c.urlParams_.Set("alt", alt)
  2685  	c.urlParams_.Set("prettyPrint", "false")
  2686  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses")
  2687  	urls += "?" + c.urlParams_.Encode()
  2688  	req, err := http.NewRequest("POST", urls, body)
  2689  	if err != nil {
  2690  		return nil, err
  2691  	}
  2692  	req.Header = reqHeaders
  2693  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2694  }
  2695  
  2696  // Do executes the "classroom.courses.create" call.
  2697  // Any non-2xx status code is an error. Response headers are in either
  2698  // *Course.ServerResponse.Header or (if a response was returned at all) in
  2699  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2700  // whether the returned error was because http.StatusNotModified was returned.
  2701  func (c *CoursesCreateCall) Do(opts ...googleapi.CallOption) (*Course, error) {
  2702  	gensupport.SetOptions(c.urlParams_, opts...)
  2703  	res, err := c.doRequest("json")
  2704  	if res != nil && res.StatusCode == http.StatusNotModified {
  2705  		if res.Body != nil {
  2706  			res.Body.Close()
  2707  		}
  2708  		return nil, gensupport.WrapError(&googleapi.Error{
  2709  			Code:   res.StatusCode,
  2710  			Header: res.Header,
  2711  		})
  2712  	}
  2713  	if err != nil {
  2714  		return nil, err
  2715  	}
  2716  	defer googleapi.CloseBody(res)
  2717  	if err := googleapi.CheckResponse(res); err != nil {
  2718  		return nil, gensupport.WrapError(err)
  2719  	}
  2720  	ret := &Course{
  2721  		ServerResponse: googleapi.ServerResponse{
  2722  			Header:         res.Header,
  2723  			HTTPStatusCode: res.StatusCode,
  2724  		},
  2725  	}
  2726  	target := &ret
  2727  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2728  		return nil, err
  2729  	}
  2730  	return ret, nil
  2731  }
  2732  
  2733  type CoursesDeleteCall struct {
  2734  	s          *Service
  2735  	id         string
  2736  	urlParams_ gensupport.URLParams
  2737  	ctx_       context.Context
  2738  	header_    http.Header
  2739  }
  2740  
  2741  // Delete: Deletes a course. This method returns the following error codes: *
  2742  // `PERMISSION_DENIED` if the requesting user is not permitted to delete the
  2743  // requested course or for access errors. * `NOT_FOUND` if no course exists
  2744  // with the requested ID.
  2745  //
  2746  //   - id: Identifier of the course to delete. This identifier can be either the
  2747  //     Classroom-assigned identifier or an alias.
  2748  func (r *CoursesService) Delete(id string) *CoursesDeleteCall {
  2749  	c := &CoursesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2750  	c.id = id
  2751  	return c
  2752  }
  2753  
  2754  // Fields allows partial responses to be retrieved. See
  2755  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2756  // details.
  2757  func (c *CoursesDeleteCall) Fields(s ...googleapi.Field) *CoursesDeleteCall {
  2758  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2759  	return c
  2760  }
  2761  
  2762  // Context sets the context to be used in this call's Do method.
  2763  func (c *CoursesDeleteCall) Context(ctx context.Context) *CoursesDeleteCall {
  2764  	c.ctx_ = ctx
  2765  	return c
  2766  }
  2767  
  2768  // Header returns a http.Header that can be modified by the caller to add
  2769  // headers to the request.
  2770  func (c *CoursesDeleteCall) Header() http.Header {
  2771  	if c.header_ == nil {
  2772  		c.header_ = make(http.Header)
  2773  	}
  2774  	return c.header_
  2775  }
  2776  
  2777  func (c *CoursesDeleteCall) doRequest(alt string) (*http.Response, error) {
  2778  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2779  	var body io.Reader = nil
  2780  	c.urlParams_.Set("alt", alt)
  2781  	c.urlParams_.Set("prettyPrint", "false")
  2782  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{id}")
  2783  	urls += "?" + c.urlParams_.Encode()
  2784  	req, err := http.NewRequest("DELETE", urls, body)
  2785  	if err != nil {
  2786  		return nil, err
  2787  	}
  2788  	req.Header = reqHeaders
  2789  	googleapi.Expand(req.URL, map[string]string{
  2790  		"id": c.id,
  2791  	})
  2792  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2793  }
  2794  
  2795  // Do executes the "classroom.courses.delete" call.
  2796  // Any non-2xx status code is an error. Response headers are in either
  2797  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  2798  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2799  // whether the returned error was because http.StatusNotModified was returned.
  2800  func (c *CoursesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  2801  	gensupport.SetOptions(c.urlParams_, opts...)
  2802  	res, err := c.doRequest("json")
  2803  	if res != nil && res.StatusCode == http.StatusNotModified {
  2804  		if res.Body != nil {
  2805  			res.Body.Close()
  2806  		}
  2807  		return nil, gensupport.WrapError(&googleapi.Error{
  2808  			Code:   res.StatusCode,
  2809  			Header: res.Header,
  2810  		})
  2811  	}
  2812  	if err != nil {
  2813  		return nil, err
  2814  	}
  2815  	defer googleapi.CloseBody(res)
  2816  	if err := googleapi.CheckResponse(res); err != nil {
  2817  		return nil, gensupport.WrapError(err)
  2818  	}
  2819  	ret := &Empty{
  2820  		ServerResponse: googleapi.ServerResponse{
  2821  			Header:         res.Header,
  2822  			HTTPStatusCode: res.StatusCode,
  2823  		},
  2824  	}
  2825  	target := &ret
  2826  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2827  		return nil, err
  2828  	}
  2829  	return ret, nil
  2830  }
  2831  
  2832  type CoursesGetCall struct {
  2833  	s            *Service
  2834  	id           string
  2835  	urlParams_   gensupport.URLParams
  2836  	ifNoneMatch_ string
  2837  	ctx_         context.Context
  2838  	header_      http.Header
  2839  }
  2840  
  2841  // Get: Returns a course. This method returns the following error codes: *
  2842  // `PERMISSION_DENIED` if the requesting user is not permitted to access the
  2843  // requested course or for access errors. * `NOT_FOUND` if no course exists
  2844  // with the requested ID.
  2845  //
  2846  //   - id: Identifier of the course to return. This identifier can be either the
  2847  //     Classroom-assigned identifier or an alias.
  2848  func (r *CoursesService) Get(id string) *CoursesGetCall {
  2849  	c := &CoursesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2850  	c.id = id
  2851  	return c
  2852  }
  2853  
  2854  // Fields allows partial responses to be retrieved. See
  2855  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  2856  // details.
  2857  func (c *CoursesGetCall) Fields(s ...googleapi.Field) *CoursesGetCall {
  2858  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  2859  	return c
  2860  }
  2861  
  2862  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  2863  // object's ETag matches the given value. This is useful for getting updates
  2864  // only after the object has changed since the last request.
  2865  func (c *CoursesGetCall) IfNoneMatch(entityTag string) *CoursesGetCall {
  2866  	c.ifNoneMatch_ = entityTag
  2867  	return c
  2868  }
  2869  
  2870  // Context sets the context to be used in this call's Do method.
  2871  func (c *CoursesGetCall) Context(ctx context.Context) *CoursesGetCall {
  2872  	c.ctx_ = ctx
  2873  	return c
  2874  }
  2875  
  2876  // Header returns a http.Header that can be modified by the caller to add
  2877  // headers to the request.
  2878  func (c *CoursesGetCall) Header() http.Header {
  2879  	if c.header_ == nil {
  2880  		c.header_ = make(http.Header)
  2881  	}
  2882  	return c.header_
  2883  }
  2884  
  2885  func (c *CoursesGetCall) doRequest(alt string) (*http.Response, error) {
  2886  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  2887  	if c.ifNoneMatch_ != "" {
  2888  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  2889  	}
  2890  	var body io.Reader = nil
  2891  	c.urlParams_.Set("alt", alt)
  2892  	c.urlParams_.Set("prettyPrint", "false")
  2893  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{id}")
  2894  	urls += "?" + c.urlParams_.Encode()
  2895  	req, err := http.NewRequest("GET", urls, body)
  2896  	if err != nil {
  2897  		return nil, err
  2898  	}
  2899  	req.Header = reqHeaders
  2900  	googleapi.Expand(req.URL, map[string]string{
  2901  		"id": c.id,
  2902  	})
  2903  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  2904  }
  2905  
  2906  // Do executes the "classroom.courses.get" call.
  2907  // Any non-2xx status code is an error. Response headers are in either
  2908  // *Course.ServerResponse.Header or (if a response was returned at all) in
  2909  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  2910  // whether the returned error was because http.StatusNotModified was returned.
  2911  func (c *CoursesGetCall) Do(opts ...googleapi.CallOption) (*Course, error) {
  2912  	gensupport.SetOptions(c.urlParams_, opts...)
  2913  	res, err := c.doRequest("json")
  2914  	if res != nil && res.StatusCode == http.StatusNotModified {
  2915  		if res.Body != nil {
  2916  			res.Body.Close()
  2917  		}
  2918  		return nil, gensupport.WrapError(&googleapi.Error{
  2919  			Code:   res.StatusCode,
  2920  			Header: res.Header,
  2921  		})
  2922  	}
  2923  	if err != nil {
  2924  		return nil, err
  2925  	}
  2926  	defer googleapi.CloseBody(res)
  2927  	if err := googleapi.CheckResponse(res); err != nil {
  2928  		return nil, gensupport.WrapError(err)
  2929  	}
  2930  	ret := &Course{
  2931  		ServerResponse: googleapi.ServerResponse{
  2932  			Header:         res.Header,
  2933  			HTTPStatusCode: res.StatusCode,
  2934  		},
  2935  	}
  2936  	target := &ret
  2937  	if err := gensupport.DecodeResponse(target, res); err != nil {
  2938  		return nil, err
  2939  	}
  2940  	return ret, nil
  2941  }
  2942  
  2943  type CoursesListCall struct {
  2944  	s            *Service
  2945  	urlParams_   gensupport.URLParams
  2946  	ifNoneMatch_ string
  2947  	ctx_         context.Context
  2948  	header_      http.Header
  2949  }
  2950  
  2951  // List: Returns a list of courses that the requesting user is permitted to
  2952  // view, restricted to those that match the request. Returned courses are
  2953  // ordered by creation time, with the most recently created coming first. This
  2954  // method returns the following error codes: * `PERMISSION_DENIED` for access
  2955  // errors. * `INVALID_ARGUMENT` if the query argument is malformed. *
  2956  // `NOT_FOUND` if any users specified in the query arguments do not exist.
  2957  func (r *CoursesService) List() *CoursesListCall {
  2958  	c := &CoursesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  2959  	return c
  2960  }
  2961  
  2962  // CourseStates sets the optional parameter "courseStates": Restricts returned
  2963  // courses to those in one of the specified states The default value is ACTIVE,
  2964  // ARCHIVED, PROVISIONED, DECLINED.
  2965  //
  2966  // Possible values:
  2967  //
  2968  //	"COURSE_STATE_UNSPECIFIED" - No course state. No returned Course message
  2969  //
  2970  // will use this value.
  2971  //
  2972  //	"ACTIVE" - The course is active.
  2973  //	"ARCHIVED" - The course has been archived. You cannot modify it except to
  2974  //
  2975  // change it to a different state.
  2976  //
  2977  //	"PROVISIONED" - The course has been created, but not yet activated. It is
  2978  //
  2979  // accessible by the primary teacher and domain administrators, who may modify
  2980  // it or change it to the `ACTIVE` or `DECLINED` states. A course may only be
  2981  // changed to `PROVISIONED` if it is in the `DECLINED` state.
  2982  //
  2983  //	"DECLINED" - The course has been created, but declined. It is accessible
  2984  //
  2985  // by the course owner and domain administrators, though it will not be
  2986  // displayed in the web UI. You cannot modify the course except to change it to
  2987  // the `PROVISIONED` state. A course may only be changed to `DECLINED` if it is
  2988  // in the `PROVISIONED` state.
  2989  //
  2990  //	"SUSPENDED" - The course has been suspended. You cannot modify the course,
  2991  //
  2992  // and only the user identified by the `owner_id` can view the course. A course
  2993  // may be placed in this state if it potentially violates the Terms of Service.
  2994  func (c *CoursesListCall) CourseStates(courseStates ...string) *CoursesListCall {
  2995  	c.urlParams_.SetMulti("courseStates", append([]string{}, courseStates...))
  2996  	return c
  2997  }
  2998  
  2999  // PageSize sets the optional parameter "pageSize": Maximum number of items to
  3000  // return. Zero or unspecified indicates that the server may assign a maximum.
  3001  // The server may return fewer than the specified number of results.
  3002  func (c *CoursesListCall) PageSize(pageSize int64) *CoursesListCall {
  3003  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3004  	return c
  3005  }
  3006  
  3007  // PageToken sets the optional parameter "pageToken": nextPageToken value
  3008  // returned from a previous list call, indicating that the subsequent page of
  3009  // results should be returned. The list request must be otherwise identical to
  3010  // the one that resulted in this token.
  3011  func (c *CoursesListCall) PageToken(pageToken string) *CoursesListCall {
  3012  	c.urlParams_.Set("pageToken", pageToken)
  3013  	return c
  3014  }
  3015  
  3016  // StudentId sets the optional parameter "studentId": Restricts returned
  3017  // courses to those having a student with the specified identifier. The
  3018  // identifier can be one of the following: * the numeric identifier for the
  3019  // user * the email address of the user * the string literal "me", indicating
  3020  // the requesting user
  3021  func (c *CoursesListCall) StudentId(studentId string) *CoursesListCall {
  3022  	c.urlParams_.Set("studentId", studentId)
  3023  	return c
  3024  }
  3025  
  3026  // TeacherId sets the optional parameter "teacherId": Restricts returned
  3027  // courses to those having a teacher with the specified identifier. The
  3028  // identifier can be one of the following: * the numeric identifier for the
  3029  // user * the email address of the user * the string literal "me", indicating
  3030  // the requesting user
  3031  func (c *CoursesListCall) TeacherId(teacherId string) *CoursesListCall {
  3032  	c.urlParams_.Set("teacherId", teacherId)
  3033  	return c
  3034  }
  3035  
  3036  // Fields allows partial responses to be retrieved. See
  3037  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3038  // details.
  3039  func (c *CoursesListCall) Fields(s ...googleapi.Field) *CoursesListCall {
  3040  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3041  	return c
  3042  }
  3043  
  3044  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3045  // object's ETag matches the given value. This is useful for getting updates
  3046  // only after the object has changed since the last request.
  3047  func (c *CoursesListCall) IfNoneMatch(entityTag string) *CoursesListCall {
  3048  	c.ifNoneMatch_ = entityTag
  3049  	return c
  3050  }
  3051  
  3052  // Context sets the context to be used in this call's Do method.
  3053  func (c *CoursesListCall) Context(ctx context.Context) *CoursesListCall {
  3054  	c.ctx_ = ctx
  3055  	return c
  3056  }
  3057  
  3058  // Header returns a http.Header that can be modified by the caller to add
  3059  // headers to the request.
  3060  func (c *CoursesListCall) Header() http.Header {
  3061  	if c.header_ == nil {
  3062  		c.header_ = make(http.Header)
  3063  	}
  3064  	return c.header_
  3065  }
  3066  
  3067  func (c *CoursesListCall) doRequest(alt string) (*http.Response, error) {
  3068  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3069  	if c.ifNoneMatch_ != "" {
  3070  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3071  	}
  3072  	var body io.Reader = nil
  3073  	c.urlParams_.Set("alt", alt)
  3074  	c.urlParams_.Set("prettyPrint", "false")
  3075  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses")
  3076  	urls += "?" + c.urlParams_.Encode()
  3077  	req, err := http.NewRequest("GET", urls, body)
  3078  	if err != nil {
  3079  		return nil, err
  3080  	}
  3081  	req.Header = reqHeaders
  3082  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3083  }
  3084  
  3085  // Do executes the "classroom.courses.list" call.
  3086  // Any non-2xx status code is an error. Response headers are in either
  3087  // *ListCoursesResponse.ServerResponse.Header or (if a response was returned at
  3088  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  3089  // check whether the returned error was because http.StatusNotModified was
  3090  // returned.
  3091  func (c *CoursesListCall) Do(opts ...googleapi.CallOption) (*ListCoursesResponse, error) {
  3092  	gensupport.SetOptions(c.urlParams_, opts...)
  3093  	res, err := c.doRequest("json")
  3094  	if res != nil && res.StatusCode == http.StatusNotModified {
  3095  		if res.Body != nil {
  3096  			res.Body.Close()
  3097  		}
  3098  		return nil, gensupport.WrapError(&googleapi.Error{
  3099  			Code:   res.StatusCode,
  3100  			Header: res.Header,
  3101  		})
  3102  	}
  3103  	if err != nil {
  3104  		return nil, err
  3105  	}
  3106  	defer googleapi.CloseBody(res)
  3107  	if err := googleapi.CheckResponse(res); err != nil {
  3108  		return nil, gensupport.WrapError(err)
  3109  	}
  3110  	ret := &ListCoursesResponse{
  3111  		ServerResponse: googleapi.ServerResponse{
  3112  			Header:         res.Header,
  3113  			HTTPStatusCode: res.StatusCode,
  3114  		},
  3115  	}
  3116  	target := &ret
  3117  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3118  		return nil, err
  3119  	}
  3120  	return ret, nil
  3121  }
  3122  
  3123  // Pages invokes f for each page of results.
  3124  // A non-nil error returned from f will halt the iteration.
  3125  // The provided context supersedes any context provided to the Context method.
  3126  func (c *CoursesListCall) Pages(ctx context.Context, f func(*ListCoursesResponse) error) error {
  3127  	c.ctx_ = ctx
  3128  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  3129  	for {
  3130  		x, err := c.Do()
  3131  		if err != nil {
  3132  			return err
  3133  		}
  3134  		if err := f(x); err != nil {
  3135  			return err
  3136  		}
  3137  		if x.NextPageToken == "" {
  3138  			return nil
  3139  		}
  3140  		c.PageToken(x.NextPageToken)
  3141  	}
  3142  }
  3143  
  3144  type CoursesPatchCall struct {
  3145  	s          *Service
  3146  	id         string
  3147  	course     *Course
  3148  	urlParams_ gensupport.URLParams
  3149  	ctx_       context.Context
  3150  	header_    http.Header
  3151  }
  3152  
  3153  // Patch: Updates one or more fields in a course. This method returns the
  3154  // following error codes: * `PERMISSION_DENIED` if the requesting user is not
  3155  // permitted to modify the requested course or for access errors. * `NOT_FOUND`
  3156  // if no course exists with the requested ID. * `INVALID_ARGUMENT` if invalid
  3157  // fields are specified in the update mask or if no update mask is supplied. *
  3158  // `FAILED_PRECONDITION` for the following request errors: *
  3159  // CourseNotModifiable * InactiveCourseOwner * IneligibleOwner
  3160  //
  3161  //   - id: Identifier of the course to update. This identifier can be either the
  3162  //     Classroom-assigned identifier or an alias.
  3163  func (r *CoursesService) Patch(id string, course *Course) *CoursesPatchCall {
  3164  	c := &CoursesPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3165  	c.id = id
  3166  	c.course = course
  3167  	return c
  3168  }
  3169  
  3170  // UpdateMask sets the optional parameter "updateMask": Mask that identifies
  3171  // which fields on the course to update. This field is required to do an
  3172  // update. The update will fail if invalid fields are specified. The following
  3173  // fields are valid: * `name` * `section` * `descriptionHeading` *
  3174  // `description` * `room` * `courseState` * `ownerId` Note: patches to ownerId
  3175  // are treated as being effective immediately, but in practice it may take some
  3176  // time for the ownership transfer of all affected resources to complete. When
  3177  // set in a query parameter, this field should be specified as
  3178  // `updateMask=,,...`
  3179  func (c *CoursesPatchCall) UpdateMask(updateMask string) *CoursesPatchCall {
  3180  	c.urlParams_.Set("updateMask", updateMask)
  3181  	return c
  3182  }
  3183  
  3184  // Fields allows partial responses to be retrieved. See
  3185  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3186  // details.
  3187  func (c *CoursesPatchCall) Fields(s ...googleapi.Field) *CoursesPatchCall {
  3188  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3189  	return c
  3190  }
  3191  
  3192  // Context sets the context to be used in this call's Do method.
  3193  func (c *CoursesPatchCall) Context(ctx context.Context) *CoursesPatchCall {
  3194  	c.ctx_ = ctx
  3195  	return c
  3196  }
  3197  
  3198  // Header returns a http.Header that can be modified by the caller to add
  3199  // headers to the request.
  3200  func (c *CoursesPatchCall) Header() http.Header {
  3201  	if c.header_ == nil {
  3202  		c.header_ = make(http.Header)
  3203  	}
  3204  	return c.header_
  3205  }
  3206  
  3207  func (c *CoursesPatchCall) doRequest(alt string) (*http.Response, error) {
  3208  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3209  	var body io.Reader = nil
  3210  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.course)
  3211  	if err != nil {
  3212  		return nil, err
  3213  	}
  3214  	c.urlParams_.Set("alt", alt)
  3215  	c.urlParams_.Set("prettyPrint", "false")
  3216  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{id}")
  3217  	urls += "?" + c.urlParams_.Encode()
  3218  	req, err := http.NewRequest("PATCH", urls, body)
  3219  	if err != nil {
  3220  		return nil, err
  3221  	}
  3222  	req.Header = reqHeaders
  3223  	googleapi.Expand(req.URL, map[string]string{
  3224  		"id": c.id,
  3225  	})
  3226  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3227  }
  3228  
  3229  // Do executes the "classroom.courses.patch" call.
  3230  // Any non-2xx status code is an error. Response headers are in either
  3231  // *Course.ServerResponse.Header or (if a response was returned at all) in
  3232  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3233  // whether the returned error was because http.StatusNotModified was returned.
  3234  func (c *CoursesPatchCall) Do(opts ...googleapi.CallOption) (*Course, error) {
  3235  	gensupport.SetOptions(c.urlParams_, opts...)
  3236  	res, err := c.doRequest("json")
  3237  	if res != nil && res.StatusCode == http.StatusNotModified {
  3238  		if res.Body != nil {
  3239  			res.Body.Close()
  3240  		}
  3241  		return nil, gensupport.WrapError(&googleapi.Error{
  3242  			Code:   res.StatusCode,
  3243  			Header: res.Header,
  3244  		})
  3245  	}
  3246  	if err != nil {
  3247  		return nil, err
  3248  	}
  3249  	defer googleapi.CloseBody(res)
  3250  	if err := googleapi.CheckResponse(res); err != nil {
  3251  		return nil, gensupport.WrapError(err)
  3252  	}
  3253  	ret := &Course{
  3254  		ServerResponse: googleapi.ServerResponse{
  3255  			Header:         res.Header,
  3256  			HTTPStatusCode: res.StatusCode,
  3257  		},
  3258  	}
  3259  	target := &ret
  3260  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3261  		return nil, err
  3262  	}
  3263  	return ret, nil
  3264  }
  3265  
  3266  type CoursesUpdateCall struct {
  3267  	s          *Service
  3268  	id         string
  3269  	course     *Course
  3270  	urlParams_ gensupport.URLParams
  3271  	ctx_       context.Context
  3272  	header_    http.Header
  3273  }
  3274  
  3275  // Update: Updates a course. This method returns the following error codes: *
  3276  // `PERMISSION_DENIED` if the requesting user is not permitted to modify the
  3277  // requested course or for access errors. * `NOT_FOUND` if no course exists
  3278  // with the requested ID. * `FAILED_PRECONDITION` for the following request
  3279  // errors: * CourseNotModifiable
  3280  //
  3281  //   - id: Identifier of the course to update. This identifier can be either the
  3282  //     Classroom-assigned identifier or an alias.
  3283  func (r *CoursesService) Update(id string, course *Course) *CoursesUpdateCall {
  3284  	c := &CoursesUpdateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3285  	c.id = id
  3286  	c.course = course
  3287  	return c
  3288  }
  3289  
  3290  // Fields allows partial responses to be retrieved. See
  3291  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3292  // details.
  3293  func (c *CoursesUpdateCall) Fields(s ...googleapi.Field) *CoursesUpdateCall {
  3294  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3295  	return c
  3296  }
  3297  
  3298  // Context sets the context to be used in this call's Do method.
  3299  func (c *CoursesUpdateCall) Context(ctx context.Context) *CoursesUpdateCall {
  3300  	c.ctx_ = ctx
  3301  	return c
  3302  }
  3303  
  3304  // Header returns a http.Header that can be modified by the caller to add
  3305  // headers to the request.
  3306  func (c *CoursesUpdateCall) Header() http.Header {
  3307  	if c.header_ == nil {
  3308  		c.header_ = make(http.Header)
  3309  	}
  3310  	return c.header_
  3311  }
  3312  
  3313  func (c *CoursesUpdateCall) doRequest(alt string) (*http.Response, error) {
  3314  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3315  	var body io.Reader = nil
  3316  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.course)
  3317  	if err != nil {
  3318  		return nil, err
  3319  	}
  3320  	c.urlParams_.Set("alt", alt)
  3321  	c.urlParams_.Set("prettyPrint", "false")
  3322  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{id}")
  3323  	urls += "?" + c.urlParams_.Encode()
  3324  	req, err := http.NewRequest("PUT", urls, body)
  3325  	if err != nil {
  3326  		return nil, err
  3327  	}
  3328  	req.Header = reqHeaders
  3329  	googleapi.Expand(req.URL, map[string]string{
  3330  		"id": c.id,
  3331  	})
  3332  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3333  }
  3334  
  3335  // Do executes the "classroom.courses.update" call.
  3336  // Any non-2xx status code is an error. Response headers are in either
  3337  // *Course.ServerResponse.Header or (if a response was returned at all) in
  3338  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3339  // whether the returned error was because http.StatusNotModified was returned.
  3340  func (c *CoursesUpdateCall) Do(opts ...googleapi.CallOption) (*Course, error) {
  3341  	gensupport.SetOptions(c.urlParams_, opts...)
  3342  	res, err := c.doRequest("json")
  3343  	if res != nil && res.StatusCode == http.StatusNotModified {
  3344  		if res.Body != nil {
  3345  			res.Body.Close()
  3346  		}
  3347  		return nil, gensupport.WrapError(&googleapi.Error{
  3348  			Code:   res.StatusCode,
  3349  			Header: res.Header,
  3350  		})
  3351  	}
  3352  	if err != nil {
  3353  		return nil, err
  3354  	}
  3355  	defer googleapi.CloseBody(res)
  3356  	if err := googleapi.CheckResponse(res); err != nil {
  3357  		return nil, gensupport.WrapError(err)
  3358  	}
  3359  	ret := &Course{
  3360  		ServerResponse: googleapi.ServerResponse{
  3361  			Header:         res.Header,
  3362  			HTTPStatusCode: res.StatusCode,
  3363  		},
  3364  	}
  3365  	target := &ret
  3366  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3367  		return nil, err
  3368  	}
  3369  	return ret, nil
  3370  }
  3371  
  3372  type CoursesAliasesCreateCall struct {
  3373  	s           *Service
  3374  	courseId    string
  3375  	coursealias *CourseAlias
  3376  	urlParams_  gensupport.URLParams
  3377  	ctx_        context.Context
  3378  	header_     http.Header
  3379  }
  3380  
  3381  // Create: Creates an alias for a course. This method returns the following
  3382  // error codes: * `PERMISSION_DENIED` if the requesting user is not permitted
  3383  // to create the alias or for access errors. * `NOT_FOUND` if the course does
  3384  // not exist. * `ALREADY_EXISTS` if the alias already exists. *
  3385  // `FAILED_PRECONDITION` if the alias requested does not make sense for the
  3386  // requesting user or course (for example, if a user not in a domain attempts
  3387  // to access a domain-scoped alias).
  3388  //
  3389  //   - courseId: Identifier of the course to alias. This identifier can be either
  3390  //     the Classroom-assigned identifier or an alias.
  3391  func (r *CoursesAliasesService) Create(courseId string, coursealias *CourseAlias) *CoursesAliasesCreateCall {
  3392  	c := &CoursesAliasesCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3393  	c.courseId = courseId
  3394  	c.coursealias = coursealias
  3395  	return c
  3396  }
  3397  
  3398  // Fields allows partial responses to be retrieved. See
  3399  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3400  // details.
  3401  func (c *CoursesAliasesCreateCall) Fields(s ...googleapi.Field) *CoursesAliasesCreateCall {
  3402  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3403  	return c
  3404  }
  3405  
  3406  // Context sets the context to be used in this call's Do method.
  3407  func (c *CoursesAliasesCreateCall) Context(ctx context.Context) *CoursesAliasesCreateCall {
  3408  	c.ctx_ = ctx
  3409  	return c
  3410  }
  3411  
  3412  // Header returns a http.Header that can be modified by the caller to add
  3413  // headers to the request.
  3414  func (c *CoursesAliasesCreateCall) Header() http.Header {
  3415  	if c.header_ == nil {
  3416  		c.header_ = make(http.Header)
  3417  	}
  3418  	return c.header_
  3419  }
  3420  
  3421  func (c *CoursesAliasesCreateCall) doRequest(alt string) (*http.Response, error) {
  3422  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3423  	var body io.Reader = nil
  3424  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.coursealias)
  3425  	if err != nil {
  3426  		return nil, err
  3427  	}
  3428  	c.urlParams_.Set("alt", alt)
  3429  	c.urlParams_.Set("prettyPrint", "false")
  3430  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/aliases")
  3431  	urls += "?" + c.urlParams_.Encode()
  3432  	req, err := http.NewRequest("POST", urls, body)
  3433  	if err != nil {
  3434  		return nil, err
  3435  	}
  3436  	req.Header = reqHeaders
  3437  	googleapi.Expand(req.URL, map[string]string{
  3438  		"courseId": c.courseId,
  3439  	})
  3440  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3441  }
  3442  
  3443  // Do executes the "classroom.courses.aliases.create" call.
  3444  // Any non-2xx status code is an error. Response headers are in either
  3445  // *CourseAlias.ServerResponse.Header or (if a response was returned at all) in
  3446  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3447  // whether the returned error was because http.StatusNotModified was returned.
  3448  func (c *CoursesAliasesCreateCall) Do(opts ...googleapi.CallOption) (*CourseAlias, error) {
  3449  	gensupport.SetOptions(c.urlParams_, opts...)
  3450  	res, err := c.doRequest("json")
  3451  	if res != nil && res.StatusCode == http.StatusNotModified {
  3452  		if res.Body != nil {
  3453  			res.Body.Close()
  3454  		}
  3455  		return nil, gensupport.WrapError(&googleapi.Error{
  3456  			Code:   res.StatusCode,
  3457  			Header: res.Header,
  3458  		})
  3459  	}
  3460  	if err != nil {
  3461  		return nil, err
  3462  	}
  3463  	defer googleapi.CloseBody(res)
  3464  	if err := googleapi.CheckResponse(res); err != nil {
  3465  		return nil, gensupport.WrapError(err)
  3466  	}
  3467  	ret := &CourseAlias{
  3468  		ServerResponse: googleapi.ServerResponse{
  3469  			Header:         res.Header,
  3470  			HTTPStatusCode: res.StatusCode,
  3471  		},
  3472  	}
  3473  	target := &ret
  3474  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3475  		return nil, err
  3476  	}
  3477  	return ret, nil
  3478  }
  3479  
  3480  type CoursesAliasesDeleteCall struct {
  3481  	s          *Service
  3482  	courseId   string
  3483  	aliasid    string
  3484  	urlParams_ gensupport.URLParams
  3485  	ctx_       context.Context
  3486  	header_    http.Header
  3487  }
  3488  
  3489  // Delete: Deletes an alias of a course. This method returns the following
  3490  // error codes: * `PERMISSION_DENIED` if the requesting user is not permitted
  3491  // to remove the alias or for access errors. * `NOT_FOUND` if the alias does
  3492  // not exist. * `FAILED_PRECONDITION` if the alias requested does not make
  3493  // sense for the requesting user or course (for example, if a user not in a
  3494  // domain attempts to delete a domain-scoped alias).
  3495  //
  3496  //   - alias: Alias to delete. This may not be the Classroom-assigned identifier.
  3497  //   - courseId: Identifier of the course whose alias should be deleted. This
  3498  //     identifier can be either the Classroom-assigned identifier or an alias.
  3499  func (r *CoursesAliasesService) Delete(courseId string, aliasid string) *CoursesAliasesDeleteCall {
  3500  	c := &CoursesAliasesDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3501  	c.courseId = courseId
  3502  	c.aliasid = aliasid
  3503  	return c
  3504  }
  3505  
  3506  // Fields allows partial responses to be retrieved. See
  3507  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3508  // details.
  3509  func (c *CoursesAliasesDeleteCall) Fields(s ...googleapi.Field) *CoursesAliasesDeleteCall {
  3510  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3511  	return c
  3512  }
  3513  
  3514  // Context sets the context to be used in this call's Do method.
  3515  func (c *CoursesAliasesDeleteCall) Context(ctx context.Context) *CoursesAliasesDeleteCall {
  3516  	c.ctx_ = ctx
  3517  	return c
  3518  }
  3519  
  3520  // Header returns a http.Header that can be modified by the caller to add
  3521  // headers to the request.
  3522  func (c *CoursesAliasesDeleteCall) Header() http.Header {
  3523  	if c.header_ == nil {
  3524  		c.header_ = make(http.Header)
  3525  	}
  3526  	return c.header_
  3527  }
  3528  
  3529  func (c *CoursesAliasesDeleteCall) doRequest(alt string) (*http.Response, error) {
  3530  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3531  	var body io.Reader = nil
  3532  	c.urlParams_.Set("alt", alt)
  3533  	c.urlParams_.Set("prettyPrint", "false")
  3534  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/aliases/{alias}")
  3535  	urls += "?" + c.urlParams_.Encode()
  3536  	req, err := http.NewRequest("DELETE", urls, body)
  3537  	if err != nil {
  3538  		return nil, err
  3539  	}
  3540  	req.Header = reqHeaders
  3541  	googleapi.Expand(req.URL, map[string]string{
  3542  		"courseId": c.courseId,
  3543  		"alias":    c.aliasid,
  3544  	})
  3545  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3546  }
  3547  
  3548  // Do executes the "classroom.courses.aliases.delete" call.
  3549  // Any non-2xx status code is an error. Response headers are in either
  3550  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  3551  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3552  // whether the returned error was because http.StatusNotModified was returned.
  3553  func (c *CoursesAliasesDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  3554  	gensupport.SetOptions(c.urlParams_, opts...)
  3555  	res, err := c.doRequest("json")
  3556  	if res != nil && res.StatusCode == http.StatusNotModified {
  3557  		if res.Body != nil {
  3558  			res.Body.Close()
  3559  		}
  3560  		return nil, gensupport.WrapError(&googleapi.Error{
  3561  			Code:   res.StatusCode,
  3562  			Header: res.Header,
  3563  		})
  3564  	}
  3565  	if err != nil {
  3566  		return nil, err
  3567  	}
  3568  	defer googleapi.CloseBody(res)
  3569  	if err := googleapi.CheckResponse(res); err != nil {
  3570  		return nil, gensupport.WrapError(err)
  3571  	}
  3572  	ret := &Empty{
  3573  		ServerResponse: googleapi.ServerResponse{
  3574  			Header:         res.Header,
  3575  			HTTPStatusCode: res.StatusCode,
  3576  		},
  3577  	}
  3578  	target := &ret
  3579  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3580  		return nil, err
  3581  	}
  3582  	return ret, nil
  3583  }
  3584  
  3585  type CoursesAliasesListCall struct {
  3586  	s            *Service
  3587  	courseId     string
  3588  	urlParams_   gensupport.URLParams
  3589  	ifNoneMatch_ string
  3590  	ctx_         context.Context
  3591  	header_      http.Header
  3592  }
  3593  
  3594  // List: Returns a list of aliases for a course. This method returns the
  3595  // following error codes: * `PERMISSION_DENIED` if the requesting user is not
  3596  // permitted to access the course or for access errors. * `NOT_FOUND` if the
  3597  // course does not exist.
  3598  //
  3599  //   - courseId: The identifier of the course. This identifier can be either the
  3600  //     Classroom-assigned identifier or an alias.
  3601  func (r *CoursesAliasesService) List(courseId string) *CoursesAliasesListCall {
  3602  	c := &CoursesAliasesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3603  	c.courseId = courseId
  3604  	return c
  3605  }
  3606  
  3607  // PageSize sets the optional parameter "pageSize": Maximum number of items to
  3608  // return. Zero or unspecified indicates that the server may assign a maximum.
  3609  // The server may return fewer than the specified number of results.
  3610  func (c *CoursesAliasesListCall) PageSize(pageSize int64) *CoursesAliasesListCall {
  3611  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  3612  	return c
  3613  }
  3614  
  3615  // PageToken sets the optional parameter "pageToken": nextPageToken value
  3616  // returned from a previous list call, indicating that the subsequent page of
  3617  // results should be returned. The list request must be otherwise identical to
  3618  // the one that resulted in this token.
  3619  func (c *CoursesAliasesListCall) PageToken(pageToken string) *CoursesAliasesListCall {
  3620  	c.urlParams_.Set("pageToken", pageToken)
  3621  	return c
  3622  }
  3623  
  3624  // Fields allows partial responses to be retrieved. See
  3625  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3626  // details.
  3627  func (c *CoursesAliasesListCall) Fields(s ...googleapi.Field) *CoursesAliasesListCall {
  3628  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3629  	return c
  3630  }
  3631  
  3632  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3633  // object's ETag matches the given value. This is useful for getting updates
  3634  // only after the object has changed since the last request.
  3635  func (c *CoursesAliasesListCall) IfNoneMatch(entityTag string) *CoursesAliasesListCall {
  3636  	c.ifNoneMatch_ = entityTag
  3637  	return c
  3638  }
  3639  
  3640  // Context sets the context to be used in this call's Do method.
  3641  func (c *CoursesAliasesListCall) Context(ctx context.Context) *CoursesAliasesListCall {
  3642  	c.ctx_ = ctx
  3643  	return c
  3644  }
  3645  
  3646  // Header returns a http.Header that can be modified by the caller to add
  3647  // headers to the request.
  3648  func (c *CoursesAliasesListCall) Header() http.Header {
  3649  	if c.header_ == nil {
  3650  		c.header_ = make(http.Header)
  3651  	}
  3652  	return c.header_
  3653  }
  3654  
  3655  func (c *CoursesAliasesListCall) doRequest(alt string) (*http.Response, error) {
  3656  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3657  	if c.ifNoneMatch_ != "" {
  3658  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  3659  	}
  3660  	var body io.Reader = nil
  3661  	c.urlParams_.Set("alt", alt)
  3662  	c.urlParams_.Set("prettyPrint", "false")
  3663  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/aliases")
  3664  	urls += "?" + c.urlParams_.Encode()
  3665  	req, err := http.NewRequest("GET", urls, body)
  3666  	if err != nil {
  3667  		return nil, err
  3668  	}
  3669  	req.Header = reqHeaders
  3670  	googleapi.Expand(req.URL, map[string]string{
  3671  		"courseId": c.courseId,
  3672  	})
  3673  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3674  }
  3675  
  3676  // Do executes the "classroom.courses.aliases.list" call.
  3677  // Any non-2xx status code is an error. Response headers are in either
  3678  // *ListCourseAliasesResponse.ServerResponse.Header or (if a response was
  3679  // returned at all) in error.(*googleapi.Error).Header. Use
  3680  // googleapi.IsNotModified to check whether the returned error was because
  3681  // http.StatusNotModified was returned.
  3682  func (c *CoursesAliasesListCall) Do(opts ...googleapi.CallOption) (*ListCourseAliasesResponse, error) {
  3683  	gensupport.SetOptions(c.urlParams_, opts...)
  3684  	res, err := c.doRequest("json")
  3685  	if res != nil && res.StatusCode == http.StatusNotModified {
  3686  		if res.Body != nil {
  3687  			res.Body.Close()
  3688  		}
  3689  		return nil, gensupport.WrapError(&googleapi.Error{
  3690  			Code:   res.StatusCode,
  3691  			Header: res.Header,
  3692  		})
  3693  	}
  3694  	if err != nil {
  3695  		return nil, err
  3696  	}
  3697  	defer googleapi.CloseBody(res)
  3698  	if err := googleapi.CheckResponse(res); err != nil {
  3699  		return nil, gensupport.WrapError(err)
  3700  	}
  3701  	ret := &ListCourseAliasesResponse{
  3702  		ServerResponse: googleapi.ServerResponse{
  3703  			Header:         res.Header,
  3704  			HTTPStatusCode: res.StatusCode,
  3705  		},
  3706  	}
  3707  	target := &ret
  3708  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3709  		return nil, err
  3710  	}
  3711  	return ret, nil
  3712  }
  3713  
  3714  // Pages invokes f for each page of results.
  3715  // A non-nil error returned from f will halt the iteration.
  3716  // The provided context supersedes any context provided to the Context method.
  3717  func (c *CoursesAliasesListCall) Pages(ctx context.Context, f func(*ListCourseAliasesResponse) error) error {
  3718  	c.ctx_ = ctx
  3719  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  3720  	for {
  3721  		x, err := c.Do()
  3722  		if err != nil {
  3723  			return err
  3724  		}
  3725  		if err := f(x); err != nil {
  3726  			return err
  3727  		}
  3728  		if x.NextPageToken == "" {
  3729  			return nil
  3730  		}
  3731  		c.PageToken(x.NextPageToken)
  3732  	}
  3733  }
  3734  
  3735  type CoursesAnnouncementsCreateCall struct {
  3736  	s            *Service
  3737  	courseId     string
  3738  	announcement *Announcement
  3739  	urlParams_   gensupport.URLParams
  3740  	ctx_         context.Context
  3741  	header_      http.Header
  3742  }
  3743  
  3744  // Create: Creates an announcement. This method returns the following error
  3745  // codes: * `PERMISSION_DENIED` if the requesting user is not permitted to
  3746  // access the requested course, create announcements in the requested course,
  3747  // share a Drive attachment, or for access errors. * `INVALID_ARGUMENT` if the
  3748  // request is malformed. * `NOT_FOUND` if the requested course does not exist.
  3749  // * `FAILED_PRECONDITION` for the following request error: *
  3750  // AttachmentNotVisible
  3751  //
  3752  //   - courseId: Identifier of the course. This identifier can be either the
  3753  //     Classroom-assigned identifier or an alias.
  3754  func (r *CoursesAnnouncementsService) Create(courseId string, announcement *Announcement) *CoursesAnnouncementsCreateCall {
  3755  	c := &CoursesAnnouncementsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3756  	c.courseId = courseId
  3757  	c.announcement = announcement
  3758  	return c
  3759  }
  3760  
  3761  // Fields allows partial responses to be retrieved. See
  3762  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3763  // details.
  3764  func (c *CoursesAnnouncementsCreateCall) Fields(s ...googleapi.Field) *CoursesAnnouncementsCreateCall {
  3765  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3766  	return c
  3767  }
  3768  
  3769  // Context sets the context to be used in this call's Do method.
  3770  func (c *CoursesAnnouncementsCreateCall) Context(ctx context.Context) *CoursesAnnouncementsCreateCall {
  3771  	c.ctx_ = ctx
  3772  	return c
  3773  }
  3774  
  3775  // Header returns a http.Header that can be modified by the caller to add
  3776  // headers to the request.
  3777  func (c *CoursesAnnouncementsCreateCall) Header() http.Header {
  3778  	if c.header_ == nil {
  3779  		c.header_ = make(http.Header)
  3780  	}
  3781  	return c.header_
  3782  }
  3783  
  3784  func (c *CoursesAnnouncementsCreateCall) doRequest(alt string) (*http.Response, error) {
  3785  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  3786  	var body io.Reader = nil
  3787  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.announcement)
  3788  	if err != nil {
  3789  		return nil, err
  3790  	}
  3791  	c.urlParams_.Set("alt", alt)
  3792  	c.urlParams_.Set("prettyPrint", "false")
  3793  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/announcements")
  3794  	urls += "?" + c.urlParams_.Encode()
  3795  	req, err := http.NewRequest("POST", urls, body)
  3796  	if err != nil {
  3797  		return nil, err
  3798  	}
  3799  	req.Header = reqHeaders
  3800  	googleapi.Expand(req.URL, map[string]string{
  3801  		"courseId": c.courseId,
  3802  	})
  3803  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3804  }
  3805  
  3806  // Do executes the "classroom.courses.announcements.create" call.
  3807  // Any non-2xx status code is an error. Response headers are in either
  3808  // *Announcement.ServerResponse.Header or (if a response was returned at all)
  3809  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3810  // whether the returned error was because http.StatusNotModified was returned.
  3811  func (c *CoursesAnnouncementsCreateCall) Do(opts ...googleapi.CallOption) (*Announcement, error) {
  3812  	gensupport.SetOptions(c.urlParams_, opts...)
  3813  	res, err := c.doRequest("json")
  3814  	if res != nil && res.StatusCode == http.StatusNotModified {
  3815  		if res.Body != nil {
  3816  			res.Body.Close()
  3817  		}
  3818  		return nil, gensupport.WrapError(&googleapi.Error{
  3819  			Code:   res.StatusCode,
  3820  			Header: res.Header,
  3821  		})
  3822  	}
  3823  	if err != nil {
  3824  		return nil, err
  3825  	}
  3826  	defer googleapi.CloseBody(res)
  3827  	if err := googleapi.CheckResponse(res); err != nil {
  3828  		return nil, gensupport.WrapError(err)
  3829  	}
  3830  	ret := &Announcement{
  3831  		ServerResponse: googleapi.ServerResponse{
  3832  			Header:         res.Header,
  3833  			HTTPStatusCode: res.StatusCode,
  3834  		},
  3835  	}
  3836  	target := &ret
  3837  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3838  		return nil, err
  3839  	}
  3840  	return ret, nil
  3841  }
  3842  
  3843  type CoursesAnnouncementsDeleteCall struct {
  3844  	s          *Service
  3845  	courseId   string
  3846  	id         string
  3847  	urlParams_ gensupport.URLParams
  3848  	ctx_       context.Context
  3849  	header_    http.Header
  3850  }
  3851  
  3852  // Delete: Deletes an announcement. This request must be made by the Developer
  3853  // Console project of the OAuth client ID
  3854  // (https://support.google.com/cloud/answer/6158849) used to create the
  3855  // corresponding announcement item. This method returns the following error
  3856  // codes: * `PERMISSION_DENIED` if the requesting developer project did not
  3857  // create the corresponding announcement, if the requesting user is not
  3858  // permitted to delete the requested course or for access errors. *
  3859  // `FAILED_PRECONDITION` if the requested announcement has already been
  3860  // deleted. * `NOT_FOUND` if no course exists with the requested ID.
  3861  //
  3862  //   - courseId: Identifier of the course. This identifier can be either the
  3863  //     Classroom-assigned identifier or an alias.
  3864  //   - id: Identifier of the announcement to delete. This identifier is a
  3865  //     Classroom-assigned identifier.
  3866  func (r *CoursesAnnouncementsService) Delete(courseId string, id string) *CoursesAnnouncementsDeleteCall {
  3867  	c := &CoursesAnnouncementsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3868  	c.courseId = courseId
  3869  	c.id = id
  3870  	return c
  3871  }
  3872  
  3873  // Fields allows partial responses to be retrieved. See
  3874  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3875  // details.
  3876  func (c *CoursesAnnouncementsDeleteCall) Fields(s ...googleapi.Field) *CoursesAnnouncementsDeleteCall {
  3877  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3878  	return c
  3879  }
  3880  
  3881  // Context sets the context to be used in this call's Do method.
  3882  func (c *CoursesAnnouncementsDeleteCall) Context(ctx context.Context) *CoursesAnnouncementsDeleteCall {
  3883  	c.ctx_ = ctx
  3884  	return c
  3885  }
  3886  
  3887  // Header returns a http.Header that can be modified by the caller to add
  3888  // headers to the request.
  3889  func (c *CoursesAnnouncementsDeleteCall) Header() http.Header {
  3890  	if c.header_ == nil {
  3891  		c.header_ = make(http.Header)
  3892  	}
  3893  	return c.header_
  3894  }
  3895  
  3896  func (c *CoursesAnnouncementsDeleteCall) doRequest(alt string) (*http.Response, error) {
  3897  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  3898  	var body io.Reader = nil
  3899  	c.urlParams_.Set("alt", alt)
  3900  	c.urlParams_.Set("prettyPrint", "false")
  3901  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/announcements/{id}")
  3902  	urls += "?" + c.urlParams_.Encode()
  3903  	req, err := http.NewRequest("DELETE", urls, body)
  3904  	if err != nil {
  3905  		return nil, err
  3906  	}
  3907  	req.Header = reqHeaders
  3908  	googleapi.Expand(req.URL, map[string]string{
  3909  		"courseId": c.courseId,
  3910  		"id":       c.id,
  3911  	})
  3912  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  3913  }
  3914  
  3915  // Do executes the "classroom.courses.announcements.delete" call.
  3916  // Any non-2xx status code is an error. Response headers are in either
  3917  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  3918  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  3919  // whether the returned error was because http.StatusNotModified was returned.
  3920  func (c *CoursesAnnouncementsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  3921  	gensupport.SetOptions(c.urlParams_, opts...)
  3922  	res, err := c.doRequest("json")
  3923  	if res != nil && res.StatusCode == http.StatusNotModified {
  3924  		if res.Body != nil {
  3925  			res.Body.Close()
  3926  		}
  3927  		return nil, gensupport.WrapError(&googleapi.Error{
  3928  			Code:   res.StatusCode,
  3929  			Header: res.Header,
  3930  		})
  3931  	}
  3932  	if err != nil {
  3933  		return nil, err
  3934  	}
  3935  	defer googleapi.CloseBody(res)
  3936  	if err := googleapi.CheckResponse(res); err != nil {
  3937  		return nil, gensupport.WrapError(err)
  3938  	}
  3939  	ret := &Empty{
  3940  		ServerResponse: googleapi.ServerResponse{
  3941  			Header:         res.Header,
  3942  			HTTPStatusCode: res.StatusCode,
  3943  		},
  3944  	}
  3945  	target := &ret
  3946  	if err := gensupport.DecodeResponse(target, res); err != nil {
  3947  		return nil, err
  3948  	}
  3949  	return ret, nil
  3950  }
  3951  
  3952  type CoursesAnnouncementsGetCall struct {
  3953  	s            *Service
  3954  	courseId     string
  3955  	id           string
  3956  	urlParams_   gensupport.URLParams
  3957  	ifNoneMatch_ string
  3958  	ctx_         context.Context
  3959  	header_      http.Header
  3960  }
  3961  
  3962  // Get: Returns an announcement. This method returns the following error codes:
  3963  // * `PERMISSION_DENIED` if the requesting user is not permitted to access the
  3964  // requested course or announcement, or for access errors. * `INVALID_ARGUMENT`
  3965  // if the request is malformed. * `NOT_FOUND` if the requested course or
  3966  // announcement does not exist.
  3967  //
  3968  //   - courseId: Identifier of the course. This identifier can be either the
  3969  //     Classroom-assigned identifier or an alias.
  3970  //   - id: Identifier of the announcement.
  3971  func (r *CoursesAnnouncementsService) Get(courseId string, id string) *CoursesAnnouncementsGetCall {
  3972  	c := &CoursesAnnouncementsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  3973  	c.courseId = courseId
  3974  	c.id = id
  3975  	return c
  3976  }
  3977  
  3978  // Fields allows partial responses to be retrieved. See
  3979  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  3980  // details.
  3981  func (c *CoursesAnnouncementsGetCall) Fields(s ...googleapi.Field) *CoursesAnnouncementsGetCall {
  3982  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  3983  	return c
  3984  }
  3985  
  3986  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  3987  // object's ETag matches the given value. This is useful for getting updates
  3988  // only after the object has changed since the last request.
  3989  func (c *CoursesAnnouncementsGetCall) IfNoneMatch(entityTag string) *CoursesAnnouncementsGetCall {
  3990  	c.ifNoneMatch_ = entityTag
  3991  	return c
  3992  }
  3993  
  3994  // Context sets the context to be used in this call's Do method.
  3995  func (c *CoursesAnnouncementsGetCall) Context(ctx context.Context) *CoursesAnnouncementsGetCall {
  3996  	c.ctx_ = ctx
  3997  	return c
  3998  }
  3999  
  4000  // Header returns a http.Header that can be modified by the caller to add
  4001  // headers to the request.
  4002  func (c *CoursesAnnouncementsGetCall) Header() http.Header {
  4003  	if c.header_ == nil {
  4004  		c.header_ = make(http.Header)
  4005  	}
  4006  	return c.header_
  4007  }
  4008  
  4009  func (c *CoursesAnnouncementsGetCall) doRequest(alt string) (*http.Response, error) {
  4010  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4011  	if c.ifNoneMatch_ != "" {
  4012  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4013  	}
  4014  	var body io.Reader = nil
  4015  	c.urlParams_.Set("alt", alt)
  4016  	c.urlParams_.Set("prettyPrint", "false")
  4017  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/announcements/{id}")
  4018  	urls += "?" + c.urlParams_.Encode()
  4019  	req, err := http.NewRequest("GET", urls, body)
  4020  	if err != nil {
  4021  		return nil, err
  4022  	}
  4023  	req.Header = reqHeaders
  4024  	googleapi.Expand(req.URL, map[string]string{
  4025  		"courseId": c.courseId,
  4026  		"id":       c.id,
  4027  	})
  4028  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4029  }
  4030  
  4031  // Do executes the "classroom.courses.announcements.get" call.
  4032  // Any non-2xx status code is an error. Response headers are in either
  4033  // *Announcement.ServerResponse.Header or (if a response was returned at all)
  4034  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4035  // whether the returned error was because http.StatusNotModified was returned.
  4036  func (c *CoursesAnnouncementsGetCall) Do(opts ...googleapi.CallOption) (*Announcement, error) {
  4037  	gensupport.SetOptions(c.urlParams_, opts...)
  4038  	res, err := c.doRequest("json")
  4039  	if res != nil && res.StatusCode == http.StatusNotModified {
  4040  		if res.Body != nil {
  4041  			res.Body.Close()
  4042  		}
  4043  		return nil, gensupport.WrapError(&googleapi.Error{
  4044  			Code:   res.StatusCode,
  4045  			Header: res.Header,
  4046  		})
  4047  	}
  4048  	if err != nil {
  4049  		return nil, err
  4050  	}
  4051  	defer googleapi.CloseBody(res)
  4052  	if err := googleapi.CheckResponse(res); err != nil {
  4053  		return nil, gensupport.WrapError(err)
  4054  	}
  4055  	ret := &Announcement{
  4056  		ServerResponse: googleapi.ServerResponse{
  4057  			Header:         res.Header,
  4058  			HTTPStatusCode: res.StatusCode,
  4059  		},
  4060  	}
  4061  	target := &ret
  4062  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4063  		return nil, err
  4064  	}
  4065  	return ret, nil
  4066  }
  4067  
  4068  type CoursesAnnouncementsListCall struct {
  4069  	s            *Service
  4070  	courseId     string
  4071  	urlParams_   gensupport.URLParams
  4072  	ifNoneMatch_ string
  4073  	ctx_         context.Context
  4074  	header_      http.Header
  4075  }
  4076  
  4077  // List: Returns a list of announcements that the requester is permitted to
  4078  // view. Course students may only view `PUBLISHED` announcements. Course
  4079  // teachers and domain administrators may view all announcements. This method
  4080  // returns the following error codes: * `PERMISSION_DENIED` if the requesting
  4081  // user is not permitted to access the requested course or for access errors. *
  4082  // `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the
  4083  // requested course does not exist.
  4084  //
  4085  //   - courseId: Identifier of the course. This identifier can be either the
  4086  //     Classroom-assigned identifier or an alias.
  4087  func (r *CoursesAnnouncementsService) List(courseId string) *CoursesAnnouncementsListCall {
  4088  	c := &CoursesAnnouncementsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4089  	c.courseId = courseId
  4090  	return c
  4091  }
  4092  
  4093  // AnnouncementStates sets the optional parameter "announcementStates":
  4094  // Restriction on the `state` of announcements returned. If this argument is
  4095  // left unspecified, the default value is `PUBLISHED`.
  4096  //
  4097  // Possible values:
  4098  //
  4099  //	"ANNOUNCEMENT_STATE_UNSPECIFIED" - No state specified. This is never
  4100  //
  4101  // returned.
  4102  //
  4103  //	"PUBLISHED" - Status for announcement that has been published. This is the
  4104  //
  4105  // default state.
  4106  //
  4107  //	"DRAFT" - Status for an announcement that is not yet published.
  4108  //
  4109  // Announcement in this state is visible only to course teachers and domain
  4110  // administrators.
  4111  //
  4112  //	"DELETED" - Status for announcement that was published but is now deleted.
  4113  //
  4114  // Announcement in this state is visible only to course teachers and domain
  4115  // administrators. Announcement in this state is deleted after some time.
  4116  func (c *CoursesAnnouncementsListCall) AnnouncementStates(announcementStates ...string) *CoursesAnnouncementsListCall {
  4117  	c.urlParams_.SetMulti("announcementStates", append([]string{}, announcementStates...))
  4118  	return c
  4119  }
  4120  
  4121  // OrderBy sets the optional parameter "orderBy": Optional sort ordering for
  4122  // results. A comma-separated list of fields with an optional sort direction
  4123  // keyword. Supported field is `updateTime`. Supported direction keywords are
  4124  // `asc` and `desc`. If not specified, `updateTime desc` is the default
  4125  // behavior. Examples: `updateTime asc`, `updateTime`
  4126  func (c *CoursesAnnouncementsListCall) OrderBy(orderBy string) *CoursesAnnouncementsListCall {
  4127  	c.urlParams_.Set("orderBy", orderBy)
  4128  	return c
  4129  }
  4130  
  4131  // PageSize sets the optional parameter "pageSize": Maximum number of items to
  4132  // return. Zero or unspecified indicates that the server may assign a maximum.
  4133  // The server may return fewer than the specified number of results.
  4134  func (c *CoursesAnnouncementsListCall) PageSize(pageSize int64) *CoursesAnnouncementsListCall {
  4135  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4136  	return c
  4137  }
  4138  
  4139  // PageToken sets the optional parameter "pageToken": nextPageToken value
  4140  // returned from a previous list call, indicating that the subsequent page of
  4141  // results should be returned. The list request must be otherwise identical to
  4142  // the one that resulted in this token.
  4143  func (c *CoursesAnnouncementsListCall) PageToken(pageToken string) *CoursesAnnouncementsListCall {
  4144  	c.urlParams_.Set("pageToken", pageToken)
  4145  	return c
  4146  }
  4147  
  4148  // Fields allows partial responses to be retrieved. See
  4149  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4150  // details.
  4151  func (c *CoursesAnnouncementsListCall) Fields(s ...googleapi.Field) *CoursesAnnouncementsListCall {
  4152  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4153  	return c
  4154  }
  4155  
  4156  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4157  // object's ETag matches the given value. This is useful for getting updates
  4158  // only after the object has changed since the last request.
  4159  func (c *CoursesAnnouncementsListCall) IfNoneMatch(entityTag string) *CoursesAnnouncementsListCall {
  4160  	c.ifNoneMatch_ = entityTag
  4161  	return c
  4162  }
  4163  
  4164  // Context sets the context to be used in this call's Do method.
  4165  func (c *CoursesAnnouncementsListCall) Context(ctx context.Context) *CoursesAnnouncementsListCall {
  4166  	c.ctx_ = ctx
  4167  	return c
  4168  }
  4169  
  4170  // Header returns a http.Header that can be modified by the caller to add
  4171  // headers to the request.
  4172  func (c *CoursesAnnouncementsListCall) Header() http.Header {
  4173  	if c.header_ == nil {
  4174  		c.header_ = make(http.Header)
  4175  	}
  4176  	return c.header_
  4177  }
  4178  
  4179  func (c *CoursesAnnouncementsListCall) doRequest(alt string) (*http.Response, error) {
  4180  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4181  	if c.ifNoneMatch_ != "" {
  4182  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4183  	}
  4184  	var body io.Reader = nil
  4185  	c.urlParams_.Set("alt", alt)
  4186  	c.urlParams_.Set("prettyPrint", "false")
  4187  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/announcements")
  4188  	urls += "?" + c.urlParams_.Encode()
  4189  	req, err := http.NewRequest("GET", urls, body)
  4190  	if err != nil {
  4191  		return nil, err
  4192  	}
  4193  	req.Header = reqHeaders
  4194  	googleapi.Expand(req.URL, map[string]string{
  4195  		"courseId": c.courseId,
  4196  	})
  4197  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4198  }
  4199  
  4200  // Do executes the "classroom.courses.announcements.list" call.
  4201  // Any non-2xx status code is an error. Response headers are in either
  4202  // *ListAnnouncementsResponse.ServerResponse.Header or (if a response was
  4203  // returned at all) in error.(*googleapi.Error).Header. Use
  4204  // googleapi.IsNotModified to check whether the returned error was because
  4205  // http.StatusNotModified was returned.
  4206  func (c *CoursesAnnouncementsListCall) Do(opts ...googleapi.CallOption) (*ListAnnouncementsResponse, error) {
  4207  	gensupport.SetOptions(c.urlParams_, opts...)
  4208  	res, err := c.doRequest("json")
  4209  	if res != nil && res.StatusCode == http.StatusNotModified {
  4210  		if res.Body != nil {
  4211  			res.Body.Close()
  4212  		}
  4213  		return nil, gensupport.WrapError(&googleapi.Error{
  4214  			Code:   res.StatusCode,
  4215  			Header: res.Header,
  4216  		})
  4217  	}
  4218  	if err != nil {
  4219  		return nil, err
  4220  	}
  4221  	defer googleapi.CloseBody(res)
  4222  	if err := googleapi.CheckResponse(res); err != nil {
  4223  		return nil, gensupport.WrapError(err)
  4224  	}
  4225  	ret := &ListAnnouncementsResponse{
  4226  		ServerResponse: googleapi.ServerResponse{
  4227  			Header:         res.Header,
  4228  			HTTPStatusCode: res.StatusCode,
  4229  		},
  4230  	}
  4231  	target := &ret
  4232  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4233  		return nil, err
  4234  	}
  4235  	return ret, nil
  4236  }
  4237  
  4238  // Pages invokes f for each page of results.
  4239  // A non-nil error returned from f will halt the iteration.
  4240  // The provided context supersedes any context provided to the Context method.
  4241  func (c *CoursesAnnouncementsListCall) Pages(ctx context.Context, f func(*ListAnnouncementsResponse) error) error {
  4242  	c.ctx_ = ctx
  4243  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  4244  	for {
  4245  		x, err := c.Do()
  4246  		if err != nil {
  4247  			return err
  4248  		}
  4249  		if err := f(x); err != nil {
  4250  			return err
  4251  		}
  4252  		if x.NextPageToken == "" {
  4253  			return nil
  4254  		}
  4255  		c.PageToken(x.NextPageToken)
  4256  	}
  4257  }
  4258  
  4259  type CoursesAnnouncementsModifyAssigneesCall struct {
  4260  	s                                  *Service
  4261  	courseId                           string
  4262  	id                                 string
  4263  	modifyannouncementassigneesrequest *ModifyAnnouncementAssigneesRequest
  4264  	urlParams_                         gensupport.URLParams
  4265  	ctx_                               context.Context
  4266  	header_                            http.Header
  4267  }
  4268  
  4269  // ModifyAssignees: Modifies assignee mode and options of an announcement. Only
  4270  // a teacher of the course that contains the announcement may call this method.
  4271  // This method returns the following error codes: * `PERMISSION_DENIED` if the
  4272  // requesting user is not permitted to access the requested course or course
  4273  // work or for access errors. * `INVALID_ARGUMENT` if the request is malformed.
  4274  // * `NOT_FOUND` if the requested course or course work does not exist.
  4275  //
  4276  //   - courseId: Identifier of the course. This identifier can be either the
  4277  //     Classroom-assigned identifier or an alias.
  4278  //   - id: Identifier of the announcement.
  4279  func (r *CoursesAnnouncementsService) ModifyAssignees(courseId string, id string, modifyannouncementassigneesrequest *ModifyAnnouncementAssigneesRequest) *CoursesAnnouncementsModifyAssigneesCall {
  4280  	c := &CoursesAnnouncementsModifyAssigneesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4281  	c.courseId = courseId
  4282  	c.id = id
  4283  	c.modifyannouncementassigneesrequest = modifyannouncementassigneesrequest
  4284  	return c
  4285  }
  4286  
  4287  // Fields allows partial responses to be retrieved. See
  4288  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4289  // details.
  4290  func (c *CoursesAnnouncementsModifyAssigneesCall) Fields(s ...googleapi.Field) *CoursesAnnouncementsModifyAssigneesCall {
  4291  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4292  	return c
  4293  }
  4294  
  4295  // Context sets the context to be used in this call's Do method.
  4296  func (c *CoursesAnnouncementsModifyAssigneesCall) Context(ctx context.Context) *CoursesAnnouncementsModifyAssigneesCall {
  4297  	c.ctx_ = ctx
  4298  	return c
  4299  }
  4300  
  4301  // Header returns a http.Header that can be modified by the caller to add
  4302  // headers to the request.
  4303  func (c *CoursesAnnouncementsModifyAssigneesCall) Header() http.Header {
  4304  	if c.header_ == nil {
  4305  		c.header_ = make(http.Header)
  4306  	}
  4307  	return c.header_
  4308  }
  4309  
  4310  func (c *CoursesAnnouncementsModifyAssigneesCall) doRequest(alt string) (*http.Response, error) {
  4311  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4312  	var body io.Reader = nil
  4313  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifyannouncementassigneesrequest)
  4314  	if err != nil {
  4315  		return nil, err
  4316  	}
  4317  	c.urlParams_.Set("alt", alt)
  4318  	c.urlParams_.Set("prettyPrint", "false")
  4319  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/announcements/{id}:modifyAssignees")
  4320  	urls += "?" + c.urlParams_.Encode()
  4321  	req, err := http.NewRequest("POST", urls, body)
  4322  	if err != nil {
  4323  		return nil, err
  4324  	}
  4325  	req.Header = reqHeaders
  4326  	googleapi.Expand(req.URL, map[string]string{
  4327  		"courseId": c.courseId,
  4328  		"id":       c.id,
  4329  	})
  4330  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4331  }
  4332  
  4333  // Do executes the "classroom.courses.announcements.modifyAssignees" call.
  4334  // Any non-2xx status code is an error. Response headers are in either
  4335  // *Announcement.ServerResponse.Header or (if a response was returned at all)
  4336  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4337  // whether the returned error was because http.StatusNotModified was returned.
  4338  func (c *CoursesAnnouncementsModifyAssigneesCall) Do(opts ...googleapi.CallOption) (*Announcement, error) {
  4339  	gensupport.SetOptions(c.urlParams_, opts...)
  4340  	res, err := c.doRequest("json")
  4341  	if res != nil && res.StatusCode == http.StatusNotModified {
  4342  		if res.Body != nil {
  4343  			res.Body.Close()
  4344  		}
  4345  		return nil, gensupport.WrapError(&googleapi.Error{
  4346  			Code:   res.StatusCode,
  4347  			Header: res.Header,
  4348  		})
  4349  	}
  4350  	if err != nil {
  4351  		return nil, err
  4352  	}
  4353  	defer googleapi.CloseBody(res)
  4354  	if err := googleapi.CheckResponse(res); err != nil {
  4355  		return nil, gensupport.WrapError(err)
  4356  	}
  4357  	ret := &Announcement{
  4358  		ServerResponse: googleapi.ServerResponse{
  4359  			Header:         res.Header,
  4360  			HTTPStatusCode: res.StatusCode,
  4361  		},
  4362  	}
  4363  	target := &ret
  4364  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4365  		return nil, err
  4366  	}
  4367  	return ret, nil
  4368  }
  4369  
  4370  type CoursesAnnouncementsPatchCall struct {
  4371  	s            *Service
  4372  	courseId     string
  4373  	id           string
  4374  	announcement *Announcement
  4375  	urlParams_   gensupport.URLParams
  4376  	ctx_         context.Context
  4377  	header_      http.Header
  4378  }
  4379  
  4380  // Patch: Updates one or more fields of an announcement. This method returns
  4381  // the following error codes: * `PERMISSION_DENIED` if the requesting developer
  4382  // project did not create the corresponding announcement or for access errors.
  4383  // * `INVALID_ARGUMENT` if the request is malformed. * `FAILED_PRECONDITION` if
  4384  // the requested announcement has already been deleted. * `NOT_FOUND` if the
  4385  // requested course or announcement does not exist
  4386  //
  4387  //   - courseId: Identifier of the course. This identifier can be either the
  4388  //     Classroom-assigned identifier or an alias.
  4389  //   - id: Identifier of the announcement.
  4390  func (r *CoursesAnnouncementsService) Patch(courseId string, id string, announcement *Announcement) *CoursesAnnouncementsPatchCall {
  4391  	c := &CoursesAnnouncementsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4392  	c.courseId = courseId
  4393  	c.id = id
  4394  	c.announcement = announcement
  4395  	return c
  4396  }
  4397  
  4398  // UpdateMask sets the optional parameter "updateMask": Mask that identifies
  4399  // which fields on the announcement to update. This field is required to do an
  4400  // update. The update fails if invalid fields are specified. If a field
  4401  // supports empty values, it can be cleared by specifying it in the update mask
  4402  // and not in the Announcement object. If a field that does not support empty
  4403  // values is included in the update mask and not set in the Announcement
  4404  // object, an `INVALID_ARGUMENT` error is returned. The following fields may be
  4405  // specified by teachers: * `text` * `state` * `scheduled_time`
  4406  func (c *CoursesAnnouncementsPatchCall) UpdateMask(updateMask string) *CoursesAnnouncementsPatchCall {
  4407  	c.urlParams_.Set("updateMask", updateMask)
  4408  	return c
  4409  }
  4410  
  4411  // Fields allows partial responses to be retrieved. See
  4412  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4413  // details.
  4414  func (c *CoursesAnnouncementsPatchCall) Fields(s ...googleapi.Field) *CoursesAnnouncementsPatchCall {
  4415  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4416  	return c
  4417  }
  4418  
  4419  // Context sets the context to be used in this call's Do method.
  4420  func (c *CoursesAnnouncementsPatchCall) Context(ctx context.Context) *CoursesAnnouncementsPatchCall {
  4421  	c.ctx_ = ctx
  4422  	return c
  4423  }
  4424  
  4425  // Header returns a http.Header that can be modified by the caller to add
  4426  // headers to the request.
  4427  func (c *CoursesAnnouncementsPatchCall) Header() http.Header {
  4428  	if c.header_ == nil {
  4429  		c.header_ = make(http.Header)
  4430  	}
  4431  	return c.header_
  4432  }
  4433  
  4434  func (c *CoursesAnnouncementsPatchCall) doRequest(alt string) (*http.Response, error) {
  4435  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4436  	var body io.Reader = nil
  4437  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.announcement)
  4438  	if err != nil {
  4439  		return nil, err
  4440  	}
  4441  	c.urlParams_.Set("alt", alt)
  4442  	c.urlParams_.Set("prettyPrint", "false")
  4443  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/announcements/{id}")
  4444  	urls += "?" + c.urlParams_.Encode()
  4445  	req, err := http.NewRequest("PATCH", urls, body)
  4446  	if err != nil {
  4447  		return nil, err
  4448  	}
  4449  	req.Header = reqHeaders
  4450  	googleapi.Expand(req.URL, map[string]string{
  4451  		"courseId": c.courseId,
  4452  		"id":       c.id,
  4453  	})
  4454  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4455  }
  4456  
  4457  // Do executes the "classroom.courses.announcements.patch" call.
  4458  // Any non-2xx status code is an error. Response headers are in either
  4459  // *Announcement.ServerResponse.Header or (if a response was returned at all)
  4460  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4461  // whether the returned error was because http.StatusNotModified was returned.
  4462  func (c *CoursesAnnouncementsPatchCall) Do(opts ...googleapi.CallOption) (*Announcement, error) {
  4463  	gensupport.SetOptions(c.urlParams_, opts...)
  4464  	res, err := c.doRequest("json")
  4465  	if res != nil && res.StatusCode == http.StatusNotModified {
  4466  		if res.Body != nil {
  4467  			res.Body.Close()
  4468  		}
  4469  		return nil, gensupport.WrapError(&googleapi.Error{
  4470  			Code:   res.StatusCode,
  4471  			Header: res.Header,
  4472  		})
  4473  	}
  4474  	if err != nil {
  4475  		return nil, err
  4476  	}
  4477  	defer googleapi.CloseBody(res)
  4478  	if err := googleapi.CheckResponse(res); err != nil {
  4479  		return nil, gensupport.WrapError(err)
  4480  	}
  4481  	ret := &Announcement{
  4482  		ServerResponse: googleapi.ServerResponse{
  4483  			Header:         res.Header,
  4484  			HTTPStatusCode: res.StatusCode,
  4485  		},
  4486  	}
  4487  	target := &ret
  4488  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4489  		return nil, err
  4490  	}
  4491  	return ret, nil
  4492  }
  4493  
  4494  type CoursesCourseWorkCreateCall struct {
  4495  	s          *Service
  4496  	courseId   string
  4497  	coursework *CourseWork
  4498  	urlParams_ gensupport.URLParams
  4499  	ctx_       context.Context
  4500  	header_    http.Header
  4501  }
  4502  
  4503  // Create: Creates course work. The resulting course work (and corresponding
  4504  // student submissions) are associated with the Developer Console project of
  4505  // the OAuth client ID (https://support.google.com/cloud/answer/6158849) used
  4506  // to make the request. Classroom API requests to modify course work and
  4507  // student submissions must be made with an OAuth client ID from the associated
  4508  // Developer Console project. This method returns the following error codes: *
  4509  // `PERMISSION_DENIED` if the requesting user is not permitted to access the
  4510  // requested course, create course work in the requested course, share a Drive
  4511  // attachment, or for access errors. * `INVALID_ARGUMENT` if the request is
  4512  // malformed. * `NOT_FOUND` if the requested course does not exist. *
  4513  // `FAILED_PRECONDITION` for the following request error: *
  4514  // AttachmentNotVisible
  4515  //
  4516  //   - courseId: Identifier of the course. This identifier can be either the
  4517  //     Classroom-assigned identifier or an alias.
  4518  func (r *CoursesCourseWorkService) Create(courseId string, coursework *CourseWork) *CoursesCourseWorkCreateCall {
  4519  	c := &CoursesCourseWorkCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4520  	c.courseId = courseId
  4521  	c.coursework = coursework
  4522  	return c
  4523  }
  4524  
  4525  // Fields allows partial responses to be retrieved. See
  4526  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4527  // details.
  4528  func (c *CoursesCourseWorkCreateCall) Fields(s ...googleapi.Field) *CoursesCourseWorkCreateCall {
  4529  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4530  	return c
  4531  }
  4532  
  4533  // Context sets the context to be used in this call's Do method.
  4534  func (c *CoursesCourseWorkCreateCall) Context(ctx context.Context) *CoursesCourseWorkCreateCall {
  4535  	c.ctx_ = ctx
  4536  	return c
  4537  }
  4538  
  4539  // Header returns a http.Header that can be modified by the caller to add
  4540  // headers to the request.
  4541  func (c *CoursesCourseWorkCreateCall) Header() http.Header {
  4542  	if c.header_ == nil {
  4543  		c.header_ = make(http.Header)
  4544  	}
  4545  	return c.header_
  4546  }
  4547  
  4548  func (c *CoursesCourseWorkCreateCall) doRequest(alt string) (*http.Response, error) {
  4549  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  4550  	var body io.Reader = nil
  4551  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.coursework)
  4552  	if err != nil {
  4553  		return nil, err
  4554  	}
  4555  	c.urlParams_.Set("alt", alt)
  4556  	c.urlParams_.Set("prettyPrint", "false")
  4557  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork")
  4558  	urls += "?" + c.urlParams_.Encode()
  4559  	req, err := http.NewRequest("POST", urls, body)
  4560  	if err != nil {
  4561  		return nil, err
  4562  	}
  4563  	req.Header = reqHeaders
  4564  	googleapi.Expand(req.URL, map[string]string{
  4565  		"courseId": c.courseId,
  4566  	})
  4567  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4568  }
  4569  
  4570  // Do executes the "classroom.courses.courseWork.create" call.
  4571  // Any non-2xx status code is an error. Response headers are in either
  4572  // *CourseWork.ServerResponse.Header or (if a response was returned at all) in
  4573  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4574  // whether the returned error was because http.StatusNotModified was returned.
  4575  func (c *CoursesCourseWorkCreateCall) Do(opts ...googleapi.CallOption) (*CourseWork, error) {
  4576  	gensupport.SetOptions(c.urlParams_, opts...)
  4577  	res, err := c.doRequest("json")
  4578  	if res != nil && res.StatusCode == http.StatusNotModified {
  4579  		if res.Body != nil {
  4580  			res.Body.Close()
  4581  		}
  4582  		return nil, gensupport.WrapError(&googleapi.Error{
  4583  			Code:   res.StatusCode,
  4584  			Header: res.Header,
  4585  		})
  4586  	}
  4587  	if err != nil {
  4588  		return nil, err
  4589  	}
  4590  	defer googleapi.CloseBody(res)
  4591  	if err := googleapi.CheckResponse(res); err != nil {
  4592  		return nil, gensupport.WrapError(err)
  4593  	}
  4594  	ret := &CourseWork{
  4595  		ServerResponse: googleapi.ServerResponse{
  4596  			Header:         res.Header,
  4597  			HTTPStatusCode: res.StatusCode,
  4598  		},
  4599  	}
  4600  	target := &ret
  4601  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4602  		return nil, err
  4603  	}
  4604  	return ret, nil
  4605  }
  4606  
  4607  type CoursesCourseWorkDeleteCall struct {
  4608  	s          *Service
  4609  	courseId   string
  4610  	id         string
  4611  	urlParams_ gensupport.URLParams
  4612  	ctx_       context.Context
  4613  	header_    http.Header
  4614  }
  4615  
  4616  // Delete: Deletes a course work. This request must be made by the Developer
  4617  // Console project of the OAuth client ID
  4618  // (https://support.google.com/cloud/answer/6158849) used to create the
  4619  // corresponding course work item. This method returns the following error
  4620  // codes: * `PERMISSION_DENIED` if the requesting developer project did not
  4621  // create the corresponding course work, if the requesting user is not
  4622  // permitted to delete the requested course or for access errors. *
  4623  // `FAILED_PRECONDITION` if the requested course work has already been deleted.
  4624  // * `NOT_FOUND` if no course exists with the requested ID.
  4625  //
  4626  //   - courseId: Identifier of the course. This identifier can be either the
  4627  //     Classroom-assigned identifier or an alias.
  4628  //   - id: Identifier of the course work to delete. This identifier is a
  4629  //     Classroom-assigned identifier.
  4630  func (r *CoursesCourseWorkService) Delete(courseId string, id string) *CoursesCourseWorkDeleteCall {
  4631  	c := &CoursesCourseWorkDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4632  	c.courseId = courseId
  4633  	c.id = id
  4634  	return c
  4635  }
  4636  
  4637  // Fields allows partial responses to be retrieved. See
  4638  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4639  // details.
  4640  func (c *CoursesCourseWorkDeleteCall) Fields(s ...googleapi.Field) *CoursesCourseWorkDeleteCall {
  4641  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4642  	return c
  4643  }
  4644  
  4645  // Context sets the context to be used in this call's Do method.
  4646  func (c *CoursesCourseWorkDeleteCall) Context(ctx context.Context) *CoursesCourseWorkDeleteCall {
  4647  	c.ctx_ = ctx
  4648  	return c
  4649  }
  4650  
  4651  // Header returns a http.Header that can be modified by the caller to add
  4652  // headers to the request.
  4653  func (c *CoursesCourseWorkDeleteCall) Header() http.Header {
  4654  	if c.header_ == nil {
  4655  		c.header_ = make(http.Header)
  4656  	}
  4657  	return c.header_
  4658  }
  4659  
  4660  func (c *CoursesCourseWorkDeleteCall) doRequest(alt string) (*http.Response, error) {
  4661  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4662  	var body io.Reader = nil
  4663  	c.urlParams_.Set("alt", alt)
  4664  	c.urlParams_.Set("prettyPrint", "false")
  4665  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{id}")
  4666  	urls += "?" + c.urlParams_.Encode()
  4667  	req, err := http.NewRequest("DELETE", urls, body)
  4668  	if err != nil {
  4669  		return nil, err
  4670  	}
  4671  	req.Header = reqHeaders
  4672  	googleapi.Expand(req.URL, map[string]string{
  4673  		"courseId": c.courseId,
  4674  		"id":       c.id,
  4675  	})
  4676  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4677  }
  4678  
  4679  // Do executes the "classroom.courses.courseWork.delete" call.
  4680  // Any non-2xx status code is an error. Response headers are in either
  4681  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  4682  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4683  // whether the returned error was because http.StatusNotModified was returned.
  4684  func (c *CoursesCourseWorkDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  4685  	gensupport.SetOptions(c.urlParams_, opts...)
  4686  	res, err := c.doRequest("json")
  4687  	if res != nil && res.StatusCode == http.StatusNotModified {
  4688  		if res.Body != nil {
  4689  			res.Body.Close()
  4690  		}
  4691  		return nil, gensupport.WrapError(&googleapi.Error{
  4692  			Code:   res.StatusCode,
  4693  			Header: res.Header,
  4694  		})
  4695  	}
  4696  	if err != nil {
  4697  		return nil, err
  4698  	}
  4699  	defer googleapi.CloseBody(res)
  4700  	if err := googleapi.CheckResponse(res); err != nil {
  4701  		return nil, gensupport.WrapError(err)
  4702  	}
  4703  	ret := &Empty{
  4704  		ServerResponse: googleapi.ServerResponse{
  4705  			Header:         res.Header,
  4706  			HTTPStatusCode: res.StatusCode,
  4707  		},
  4708  	}
  4709  	target := &ret
  4710  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4711  		return nil, err
  4712  	}
  4713  	return ret, nil
  4714  }
  4715  
  4716  type CoursesCourseWorkGetCall struct {
  4717  	s            *Service
  4718  	courseId     string
  4719  	id           string
  4720  	urlParams_   gensupport.URLParams
  4721  	ifNoneMatch_ string
  4722  	ctx_         context.Context
  4723  	header_      http.Header
  4724  }
  4725  
  4726  // Get: Returns course work. This method returns the following error codes: *
  4727  // `PERMISSION_DENIED` if the requesting user is not permitted to access the
  4728  // requested course or course work, or for access errors. * `INVALID_ARGUMENT`
  4729  // if the request is malformed. * `NOT_FOUND` if the requested course or course
  4730  // work does not exist.
  4731  //
  4732  //   - courseId: Identifier of the course. This identifier can be either the
  4733  //     Classroom-assigned identifier or an alias.
  4734  //   - id: Identifier of the course work.
  4735  func (r *CoursesCourseWorkService) Get(courseId string, id string) *CoursesCourseWorkGetCall {
  4736  	c := &CoursesCourseWorkGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4737  	c.courseId = courseId
  4738  	c.id = id
  4739  	return c
  4740  }
  4741  
  4742  // Fields allows partial responses to be retrieved. See
  4743  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4744  // details.
  4745  func (c *CoursesCourseWorkGetCall) Fields(s ...googleapi.Field) *CoursesCourseWorkGetCall {
  4746  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4747  	return c
  4748  }
  4749  
  4750  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4751  // object's ETag matches the given value. This is useful for getting updates
  4752  // only after the object has changed since the last request.
  4753  func (c *CoursesCourseWorkGetCall) IfNoneMatch(entityTag string) *CoursesCourseWorkGetCall {
  4754  	c.ifNoneMatch_ = entityTag
  4755  	return c
  4756  }
  4757  
  4758  // Context sets the context to be used in this call's Do method.
  4759  func (c *CoursesCourseWorkGetCall) Context(ctx context.Context) *CoursesCourseWorkGetCall {
  4760  	c.ctx_ = ctx
  4761  	return c
  4762  }
  4763  
  4764  // Header returns a http.Header that can be modified by the caller to add
  4765  // headers to the request.
  4766  func (c *CoursesCourseWorkGetCall) Header() http.Header {
  4767  	if c.header_ == nil {
  4768  		c.header_ = make(http.Header)
  4769  	}
  4770  	return c.header_
  4771  }
  4772  
  4773  func (c *CoursesCourseWorkGetCall) doRequest(alt string) (*http.Response, error) {
  4774  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4775  	if c.ifNoneMatch_ != "" {
  4776  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4777  	}
  4778  	var body io.Reader = nil
  4779  	c.urlParams_.Set("alt", alt)
  4780  	c.urlParams_.Set("prettyPrint", "false")
  4781  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{id}")
  4782  	urls += "?" + c.urlParams_.Encode()
  4783  	req, err := http.NewRequest("GET", urls, body)
  4784  	if err != nil {
  4785  		return nil, err
  4786  	}
  4787  	req.Header = reqHeaders
  4788  	googleapi.Expand(req.URL, map[string]string{
  4789  		"courseId": c.courseId,
  4790  		"id":       c.id,
  4791  	})
  4792  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4793  }
  4794  
  4795  // Do executes the "classroom.courses.courseWork.get" call.
  4796  // Any non-2xx status code is an error. Response headers are in either
  4797  // *CourseWork.ServerResponse.Header or (if a response was returned at all) in
  4798  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  4799  // whether the returned error was because http.StatusNotModified was returned.
  4800  func (c *CoursesCourseWorkGetCall) Do(opts ...googleapi.CallOption) (*CourseWork, error) {
  4801  	gensupport.SetOptions(c.urlParams_, opts...)
  4802  	res, err := c.doRequest("json")
  4803  	if res != nil && res.StatusCode == http.StatusNotModified {
  4804  		if res.Body != nil {
  4805  			res.Body.Close()
  4806  		}
  4807  		return nil, gensupport.WrapError(&googleapi.Error{
  4808  			Code:   res.StatusCode,
  4809  			Header: res.Header,
  4810  		})
  4811  	}
  4812  	if err != nil {
  4813  		return nil, err
  4814  	}
  4815  	defer googleapi.CloseBody(res)
  4816  	if err := googleapi.CheckResponse(res); err != nil {
  4817  		return nil, gensupport.WrapError(err)
  4818  	}
  4819  	ret := &CourseWork{
  4820  		ServerResponse: googleapi.ServerResponse{
  4821  			Header:         res.Header,
  4822  			HTTPStatusCode: res.StatusCode,
  4823  		},
  4824  	}
  4825  	target := &ret
  4826  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4827  		return nil, err
  4828  	}
  4829  	return ret, nil
  4830  }
  4831  
  4832  type CoursesCourseWorkListCall struct {
  4833  	s            *Service
  4834  	courseId     string
  4835  	urlParams_   gensupport.URLParams
  4836  	ifNoneMatch_ string
  4837  	ctx_         context.Context
  4838  	header_      http.Header
  4839  }
  4840  
  4841  // List: Returns a list of course work that the requester is permitted to view.
  4842  // Course students may only view `PUBLISHED` course work. Course teachers and
  4843  // domain administrators may view all course work. This method returns the
  4844  // following error codes: * `PERMISSION_DENIED` if the requesting user is not
  4845  // permitted to access the requested course or for access errors. *
  4846  // `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the
  4847  // requested course does not exist.
  4848  //
  4849  //   - courseId: Identifier of the course. This identifier can be either the
  4850  //     Classroom-assigned identifier or an alias.
  4851  func (r *CoursesCourseWorkService) List(courseId string) *CoursesCourseWorkListCall {
  4852  	c := &CoursesCourseWorkListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  4853  	c.courseId = courseId
  4854  	return c
  4855  }
  4856  
  4857  // CourseWorkStates sets the optional parameter "courseWorkStates": Restriction
  4858  // on the work status to return. Only courseWork that matches is returned. If
  4859  // unspecified, items with a work status of `PUBLISHED` is returned.
  4860  //
  4861  // Possible values:
  4862  //
  4863  //	"COURSE_WORK_STATE_UNSPECIFIED" - No state specified. This is never
  4864  //
  4865  // returned.
  4866  //
  4867  //	"PUBLISHED" - Status for work that has been published. This is the default
  4868  //
  4869  // state.
  4870  //
  4871  //	"DRAFT" - Status for work that is not yet published. Work in this state is
  4872  //
  4873  // visible only to course teachers and domain administrators.
  4874  //
  4875  //	"DELETED" - Status for work that was published but is now deleted. Work in
  4876  //
  4877  // this state is visible only to course teachers and domain administrators.
  4878  // Work in this state is deleted after some time.
  4879  func (c *CoursesCourseWorkListCall) CourseWorkStates(courseWorkStates ...string) *CoursesCourseWorkListCall {
  4880  	c.urlParams_.SetMulti("courseWorkStates", append([]string{}, courseWorkStates...))
  4881  	return c
  4882  }
  4883  
  4884  // OrderBy sets the optional parameter "orderBy": Optional sort ordering for
  4885  // results. A comma-separated list of fields with an optional sort direction
  4886  // keyword. Supported fields are `updateTime` and `dueDate`. Supported
  4887  // direction keywords are `asc` and `desc`. If not specified, `updateTime desc`
  4888  // is the default behavior. Examples: `dueDate asc,updateTime desc`,
  4889  // `updateTime,dueDate desc`
  4890  func (c *CoursesCourseWorkListCall) OrderBy(orderBy string) *CoursesCourseWorkListCall {
  4891  	c.urlParams_.Set("orderBy", orderBy)
  4892  	return c
  4893  }
  4894  
  4895  // PageSize sets the optional parameter "pageSize": Maximum number of items to
  4896  // return. Zero or unspecified indicates that the server may assign a maximum.
  4897  // The server may return fewer than the specified number of results.
  4898  func (c *CoursesCourseWorkListCall) PageSize(pageSize int64) *CoursesCourseWorkListCall {
  4899  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  4900  	return c
  4901  }
  4902  
  4903  // PageToken sets the optional parameter "pageToken": nextPageToken value
  4904  // returned from a previous list call, indicating that the subsequent page of
  4905  // results should be returned. The list request must be otherwise identical to
  4906  // the one that resulted in this token.
  4907  func (c *CoursesCourseWorkListCall) PageToken(pageToken string) *CoursesCourseWorkListCall {
  4908  	c.urlParams_.Set("pageToken", pageToken)
  4909  	return c
  4910  }
  4911  
  4912  // Fields allows partial responses to be retrieved. See
  4913  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  4914  // details.
  4915  func (c *CoursesCourseWorkListCall) Fields(s ...googleapi.Field) *CoursesCourseWorkListCall {
  4916  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  4917  	return c
  4918  }
  4919  
  4920  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  4921  // object's ETag matches the given value. This is useful for getting updates
  4922  // only after the object has changed since the last request.
  4923  func (c *CoursesCourseWorkListCall) IfNoneMatch(entityTag string) *CoursesCourseWorkListCall {
  4924  	c.ifNoneMatch_ = entityTag
  4925  	return c
  4926  }
  4927  
  4928  // Context sets the context to be used in this call's Do method.
  4929  func (c *CoursesCourseWorkListCall) Context(ctx context.Context) *CoursesCourseWorkListCall {
  4930  	c.ctx_ = ctx
  4931  	return c
  4932  }
  4933  
  4934  // Header returns a http.Header that can be modified by the caller to add
  4935  // headers to the request.
  4936  func (c *CoursesCourseWorkListCall) Header() http.Header {
  4937  	if c.header_ == nil {
  4938  		c.header_ = make(http.Header)
  4939  	}
  4940  	return c.header_
  4941  }
  4942  
  4943  func (c *CoursesCourseWorkListCall) doRequest(alt string) (*http.Response, error) {
  4944  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  4945  	if c.ifNoneMatch_ != "" {
  4946  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  4947  	}
  4948  	var body io.Reader = nil
  4949  	c.urlParams_.Set("alt", alt)
  4950  	c.urlParams_.Set("prettyPrint", "false")
  4951  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork")
  4952  	urls += "?" + c.urlParams_.Encode()
  4953  	req, err := http.NewRequest("GET", urls, body)
  4954  	if err != nil {
  4955  		return nil, err
  4956  	}
  4957  	req.Header = reqHeaders
  4958  	googleapi.Expand(req.URL, map[string]string{
  4959  		"courseId": c.courseId,
  4960  	})
  4961  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  4962  }
  4963  
  4964  // Do executes the "classroom.courses.courseWork.list" call.
  4965  // Any non-2xx status code is an error. Response headers are in either
  4966  // *ListCourseWorkResponse.ServerResponse.Header or (if a response was returned
  4967  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  4968  // check whether the returned error was because http.StatusNotModified was
  4969  // returned.
  4970  func (c *CoursesCourseWorkListCall) Do(opts ...googleapi.CallOption) (*ListCourseWorkResponse, error) {
  4971  	gensupport.SetOptions(c.urlParams_, opts...)
  4972  	res, err := c.doRequest("json")
  4973  	if res != nil && res.StatusCode == http.StatusNotModified {
  4974  		if res.Body != nil {
  4975  			res.Body.Close()
  4976  		}
  4977  		return nil, gensupport.WrapError(&googleapi.Error{
  4978  			Code:   res.StatusCode,
  4979  			Header: res.Header,
  4980  		})
  4981  	}
  4982  	if err != nil {
  4983  		return nil, err
  4984  	}
  4985  	defer googleapi.CloseBody(res)
  4986  	if err := googleapi.CheckResponse(res); err != nil {
  4987  		return nil, gensupport.WrapError(err)
  4988  	}
  4989  	ret := &ListCourseWorkResponse{
  4990  		ServerResponse: googleapi.ServerResponse{
  4991  			Header:         res.Header,
  4992  			HTTPStatusCode: res.StatusCode,
  4993  		},
  4994  	}
  4995  	target := &ret
  4996  	if err := gensupport.DecodeResponse(target, res); err != nil {
  4997  		return nil, err
  4998  	}
  4999  	return ret, nil
  5000  }
  5001  
  5002  // Pages invokes f for each page of results.
  5003  // A non-nil error returned from f will halt the iteration.
  5004  // The provided context supersedes any context provided to the Context method.
  5005  func (c *CoursesCourseWorkListCall) Pages(ctx context.Context, f func(*ListCourseWorkResponse) error) error {
  5006  	c.ctx_ = ctx
  5007  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  5008  	for {
  5009  		x, err := c.Do()
  5010  		if err != nil {
  5011  			return err
  5012  		}
  5013  		if err := f(x); err != nil {
  5014  			return err
  5015  		}
  5016  		if x.NextPageToken == "" {
  5017  			return nil
  5018  		}
  5019  		c.PageToken(x.NextPageToken)
  5020  	}
  5021  }
  5022  
  5023  type CoursesCourseWorkModifyAssigneesCall struct {
  5024  	s                                *Service
  5025  	courseId                         string
  5026  	id                               string
  5027  	modifycourseworkassigneesrequest *ModifyCourseWorkAssigneesRequest
  5028  	urlParams_                       gensupport.URLParams
  5029  	ctx_                             context.Context
  5030  	header_                          http.Header
  5031  }
  5032  
  5033  // ModifyAssignees: Modifies assignee mode and options of a coursework. Only a
  5034  // teacher of the course that contains the coursework may call this method.
  5035  // This method returns the following error codes: * `PERMISSION_DENIED` if the
  5036  // requesting user is not permitted to access the requested course or course
  5037  // work or for access errors. * `INVALID_ARGUMENT` if the request is malformed.
  5038  // * `NOT_FOUND` if the requested course or course work does not exist.
  5039  //
  5040  //   - courseId: Identifier of the course. This identifier can be either the
  5041  //     Classroom-assigned identifier or an alias.
  5042  //   - id: Identifier of the coursework.
  5043  func (r *CoursesCourseWorkService) ModifyAssignees(courseId string, id string, modifycourseworkassigneesrequest *ModifyCourseWorkAssigneesRequest) *CoursesCourseWorkModifyAssigneesCall {
  5044  	c := &CoursesCourseWorkModifyAssigneesCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5045  	c.courseId = courseId
  5046  	c.id = id
  5047  	c.modifycourseworkassigneesrequest = modifycourseworkassigneesrequest
  5048  	return c
  5049  }
  5050  
  5051  // Fields allows partial responses to be retrieved. See
  5052  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5053  // details.
  5054  func (c *CoursesCourseWorkModifyAssigneesCall) Fields(s ...googleapi.Field) *CoursesCourseWorkModifyAssigneesCall {
  5055  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5056  	return c
  5057  }
  5058  
  5059  // Context sets the context to be used in this call's Do method.
  5060  func (c *CoursesCourseWorkModifyAssigneesCall) Context(ctx context.Context) *CoursesCourseWorkModifyAssigneesCall {
  5061  	c.ctx_ = ctx
  5062  	return c
  5063  }
  5064  
  5065  // Header returns a http.Header that can be modified by the caller to add
  5066  // headers to the request.
  5067  func (c *CoursesCourseWorkModifyAssigneesCall) Header() http.Header {
  5068  	if c.header_ == nil {
  5069  		c.header_ = make(http.Header)
  5070  	}
  5071  	return c.header_
  5072  }
  5073  
  5074  func (c *CoursesCourseWorkModifyAssigneesCall) doRequest(alt string) (*http.Response, error) {
  5075  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5076  	var body io.Reader = nil
  5077  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifycourseworkassigneesrequest)
  5078  	if err != nil {
  5079  		return nil, err
  5080  	}
  5081  	c.urlParams_.Set("alt", alt)
  5082  	c.urlParams_.Set("prettyPrint", "false")
  5083  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{id}:modifyAssignees")
  5084  	urls += "?" + c.urlParams_.Encode()
  5085  	req, err := http.NewRequest("POST", urls, body)
  5086  	if err != nil {
  5087  		return nil, err
  5088  	}
  5089  	req.Header = reqHeaders
  5090  	googleapi.Expand(req.URL, map[string]string{
  5091  		"courseId": c.courseId,
  5092  		"id":       c.id,
  5093  	})
  5094  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5095  }
  5096  
  5097  // Do executes the "classroom.courses.courseWork.modifyAssignees" call.
  5098  // Any non-2xx status code is an error. Response headers are in either
  5099  // *CourseWork.ServerResponse.Header or (if a response was returned at all) in
  5100  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5101  // whether the returned error was because http.StatusNotModified was returned.
  5102  func (c *CoursesCourseWorkModifyAssigneesCall) Do(opts ...googleapi.CallOption) (*CourseWork, error) {
  5103  	gensupport.SetOptions(c.urlParams_, opts...)
  5104  	res, err := c.doRequest("json")
  5105  	if res != nil && res.StatusCode == http.StatusNotModified {
  5106  		if res.Body != nil {
  5107  			res.Body.Close()
  5108  		}
  5109  		return nil, gensupport.WrapError(&googleapi.Error{
  5110  			Code:   res.StatusCode,
  5111  			Header: res.Header,
  5112  		})
  5113  	}
  5114  	if err != nil {
  5115  		return nil, err
  5116  	}
  5117  	defer googleapi.CloseBody(res)
  5118  	if err := googleapi.CheckResponse(res); err != nil {
  5119  		return nil, gensupport.WrapError(err)
  5120  	}
  5121  	ret := &CourseWork{
  5122  		ServerResponse: googleapi.ServerResponse{
  5123  			Header:         res.Header,
  5124  			HTTPStatusCode: res.StatusCode,
  5125  		},
  5126  	}
  5127  	target := &ret
  5128  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5129  		return nil, err
  5130  	}
  5131  	return ret, nil
  5132  }
  5133  
  5134  type CoursesCourseWorkPatchCall struct {
  5135  	s          *Service
  5136  	courseId   string
  5137  	id         string
  5138  	coursework *CourseWork
  5139  	urlParams_ gensupport.URLParams
  5140  	ctx_       context.Context
  5141  	header_    http.Header
  5142  }
  5143  
  5144  // Patch: Updates one or more fields of a course work. See
  5145  // google.classroom.v1.CourseWork for details of which fields may be updated
  5146  // and who may change them. This request must be made by the Developer Console
  5147  // project of the OAuth client ID
  5148  // (https://support.google.com/cloud/answer/6158849) used to create the
  5149  // corresponding course work item. This method returns the following error
  5150  // codes: * `PERMISSION_DENIED` if the requesting developer project did not
  5151  // create the corresponding course work, if the user is not permitted to make
  5152  // the requested modification to the student submission, or for access errors.
  5153  // * `INVALID_ARGUMENT` if the request is malformed. * `FAILED_PRECONDITION` if
  5154  // the requested course work has already been deleted. * `NOT_FOUND` if the
  5155  // requested course, course work, or student submission does not exist.
  5156  //
  5157  //   - courseId: Identifier of the course. This identifier can be either the
  5158  //     Classroom-assigned identifier or an alias.
  5159  //   - id: Identifier of the course work.
  5160  func (r *CoursesCourseWorkService) Patch(courseId string, id string, coursework *CourseWork) *CoursesCourseWorkPatchCall {
  5161  	c := &CoursesCourseWorkPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5162  	c.courseId = courseId
  5163  	c.id = id
  5164  	c.coursework = coursework
  5165  	return c
  5166  }
  5167  
  5168  // UpdateMask sets the optional parameter "updateMask": Mask that identifies
  5169  // which fields on the course work to update. This field is required to do an
  5170  // update. The update fails if invalid fields are specified. If a field
  5171  // supports empty values, it can be cleared by specifying it in the update mask
  5172  // and not in the `CourseWork` object. If a field that does not support empty
  5173  // values is included in the update mask and not set in the `CourseWork`
  5174  // object, an `INVALID_ARGUMENT` error is returned. The following fields may be
  5175  // specified by teachers: * `title` * `description` * `state` * `due_date` *
  5176  // `due_time` * `max_points` * `scheduled_time` *
  5177  // `submission_modification_mode` * `topic_id`
  5178  func (c *CoursesCourseWorkPatchCall) UpdateMask(updateMask string) *CoursesCourseWorkPatchCall {
  5179  	c.urlParams_.Set("updateMask", updateMask)
  5180  	return c
  5181  }
  5182  
  5183  // Fields allows partial responses to be retrieved. See
  5184  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5185  // details.
  5186  func (c *CoursesCourseWorkPatchCall) Fields(s ...googleapi.Field) *CoursesCourseWorkPatchCall {
  5187  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5188  	return c
  5189  }
  5190  
  5191  // Context sets the context to be used in this call's Do method.
  5192  func (c *CoursesCourseWorkPatchCall) Context(ctx context.Context) *CoursesCourseWorkPatchCall {
  5193  	c.ctx_ = ctx
  5194  	return c
  5195  }
  5196  
  5197  // Header returns a http.Header that can be modified by the caller to add
  5198  // headers to the request.
  5199  func (c *CoursesCourseWorkPatchCall) Header() http.Header {
  5200  	if c.header_ == nil {
  5201  		c.header_ = make(http.Header)
  5202  	}
  5203  	return c.header_
  5204  }
  5205  
  5206  func (c *CoursesCourseWorkPatchCall) doRequest(alt string) (*http.Response, error) {
  5207  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5208  	var body io.Reader = nil
  5209  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.coursework)
  5210  	if err != nil {
  5211  		return nil, err
  5212  	}
  5213  	c.urlParams_.Set("alt", alt)
  5214  	c.urlParams_.Set("prettyPrint", "false")
  5215  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{id}")
  5216  	urls += "?" + c.urlParams_.Encode()
  5217  	req, err := http.NewRequest("PATCH", urls, body)
  5218  	if err != nil {
  5219  		return nil, err
  5220  	}
  5221  	req.Header = reqHeaders
  5222  	googleapi.Expand(req.URL, map[string]string{
  5223  		"courseId": c.courseId,
  5224  		"id":       c.id,
  5225  	})
  5226  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5227  }
  5228  
  5229  // Do executes the "classroom.courses.courseWork.patch" call.
  5230  // Any non-2xx status code is an error. Response headers are in either
  5231  // *CourseWork.ServerResponse.Header or (if a response was returned at all) in
  5232  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5233  // whether the returned error was because http.StatusNotModified was returned.
  5234  func (c *CoursesCourseWorkPatchCall) Do(opts ...googleapi.CallOption) (*CourseWork, error) {
  5235  	gensupport.SetOptions(c.urlParams_, opts...)
  5236  	res, err := c.doRequest("json")
  5237  	if res != nil && res.StatusCode == http.StatusNotModified {
  5238  		if res.Body != nil {
  5239  			res.Body.Close()
  5240  		}
  5241  		return nil, gensupport.WrapError(&googleapi.Error{
  5242  			Code:   res.StatusCode,
  5243  			Header: res.Header,
  5244  		})
  5245  	}
  5246  	if err != nil {
  5247  		return nil, err
  5248  	}
  5249  	defer googleapi.CloseBody(res)
  5250  	if err := googleapi.CheckResponse(res); err != nil {
  5251  		return nil, gensupport.WrapError(err)
  5252  	}
  5253  	ret := &CourseWork{
  5254  		ServerResponse: googleapi.ServerResponse{
  5255  			Header:         res.Header,
  5256  			HTTPStatusCode: res.StatusCode,
  5257  		},
  5258  	}
  5259  	target := &ret
  5260  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5261  		return nil, err
  5262  	}
  5263  	return ret, nil
  5264  }
  5265  
  5266  type CoursesCourseWorkStudentSubmissionsGetCall struct {
  5267  	s            *Service
  5268  	courseId     string
  5269  	courseWorkId string
  5270  	id           string
  5271  	urlParams_   gensupport.URLParams
  5272  	ifNoneMatch_ string
  5273  	ctx_         context.Context
  5274  	header_      http.Header
  5275  }
  5276  
  5277  // Get: Returns a student submission. * `PERMISSION_DENIED` if the requesting
  5278  // user is not permitted to access the requested course, course work, or
  5279  // student submission or for access errors. * `INVALID_ARGUMENT` if the request
  5280  // is malformed. * `NOT_FOUND` if the requested course, course work, or student
  5281  // submission does not exist.
  5282  //
  5283  //   - courseId: Identifier of the course. This identifier can be either the
  5284  //     Classroom-assigned identifier or an alias.
  5285  //   - courseWorkId: Identifier of the course work.
  5286  //   - id: Identifier of the student submission.
  5287  func (r *CoursesCourseWorkStudentSubmissionsService) Get(courseId string, courseWorkId string, id string) *CoursesCourseWorkStudentSubmissionsGetCall {
  5288  	c := &CoursesCourseWorkStudentSubmissionsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5289  	c.courseId = courseId
  5290  	c.courseWorkId = courseWorkId
  5291  	c.id = id
  5292  	return c
  5293  }
  5294  
  5295  // Fields allows partial responses to be retrieved. See
  5296  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5297  // details.
  5298  func (c *CoursesCourseWorkStudentSubmissionsGetCall) Fields(s ...googleapi.Field) *CoursesCourseWorkStudentSubmissionsGetCall {
  5299  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5300  	return c
  5301  }
  5302  
  5303  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  5304  // object's ETag matches the given value. This is useful for getting updates
  5305  // only after the object has changed since the last request.
  5306  func (c *CoursesCourseWorkStudentSubmissionsGetCall) IfNoneMatch(entityTag string) *CoursesCourseWorkStudentSubmissionsGetCall {
  5307  	c.ifNoneMatch_ = entityTag
  5308  	return c
  5309  }
  5310  
  5311  // Context sets the context to be used in this call's Do method.
  5312  func (c *CoursesCourseWorkStudentSubmissionsGetCall) Context(ctx context.Context) *CoursesCourseWorkStudentSubmissionsGetCall {
  5313  	c.ctx_ = ctx
  5314  	return c
  5315  }
  5316  
  5317  // Header returns a http.Header that can be modified by the caller to add
  5318  // headers to the request.
  5319  func (c *CoursesCourseWorkStudentSubmissionsGetCall) Header() http.Header {
  5320  	if c.header_ == nil {
  5321  		c.header_ = make(http.Header)
  5322  	}
  5323  	return c.header_
  5324  }
  5325  
  5326  func (c *CoursesCourseWorkStudentSubmissionsGetCall) doRequest(alt string) (*http.Response, error) {
  5327  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  5328  	if c.ifNoneMatch_ != "" {
  5329  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5330  	}
  5331  	var body io.Reader = nil
  5332  	c.urlParams_.Set("alt", alt)
  5333  	c.urlParams_.Set("prettyPrint", "false")
  5334  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}")
  5335  	urls += "?" + c.urlParams_.Encode()
  5336  	req, err := http.NewRequest("GET", urls, body)
  5337  	if err != nil {
  5338  		return nil, err
  5339  	}
  5340  	req.Header = reqHeaders
  5341  	googleapi.Expand(req.URL, map[string]string{
  5342  		"courseId":     c.courseId,
  5343  		"courseWorkId": c.courseWorkId,
  5344  		"id":           c.id,
  5345  	})
  5346  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5347  }
  5348  
  5349  // Do executes the "classroom.courses.courseWork.studentSubmissions.get" call.
  5350  // Any non-2xx status code is an error. Response headers are in either
  5351  // *StudentSubmission.ServerResponse.Header or (if a response was returned at
  5352  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5353  // check whether the returned error was because http.StatusNotModified was
  5354  // returned.
  5355  func (c *CoursesCourseWorkStudentSubmissionsGetCall) Do(opts ...googleapi.CallOption) (*StudentSubmission, error) {
  5356  	gensupport.SetOptions(c.urlParams_, opts...)
  5357  	res, err := c.doRequest("json")
  5358  	if res != nil && res.StatusCode == http.StatusNotModified {
  5359  		if res.Body != nil {
  5360  			res.Body.Close()
  5361  		}
  5362  		return nil, gensupport.WrapError(&googleapi.Error{
  5363  			Code:   res.StatusCode,
  5364  			Header: res.Header,
  5365  		})
  5366  	}
  5367  	if err != nil {
  5368  		return nil, err
  5369  	}
  5370  	defer googleapi.CloseBody(res)
  5371  	if err := googleapi.CheckResponse(res); err != nil {
  5372  		return nil, gensupport.WrapError(err)
  5373  	}
  5374  	ret := &StudentSubmission{
  5375  		ServerResponse: googleapi.ServerResponse{
  5376  			Header:         res.Header,
  5377  			HTTPStatusCode: res.StatusCode,
  5378  		},
  5379  	}
  5380  	target := &ret
  5381  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5382  		return nil, err
  5383  	}
  5384  	return ret, nil
  5385  }
  5386  
  5387  type CoursesCourseWorkStudentSubmissionsListCall struct {
  5388  	s            *Service
  5389  	courseId     string
  5390  	courseWorkId string
  5391  	urlParams_   gensupport.URLParams
  5392  	ifNoneMatch_ string
  5393  	ctx_         context.Context
  5394  	header_      http.Header
  5395  }
  5396  
  5397  // List: Returns a list of student submissions that the requester is permitted
  5398  // to view, factoring in the OAuth scopes of the request. `-` may be specified
  5399  // as the `course_work_id` to include student submissions for multiple course
  5400  // work items. Course students may only view their own work. Course teachers
  5401  // and domain administrators may view all student submissions. This method
  5402  // returns the following error codes: * `PERMISSION_DENIED` if the requesting
  5403  // user is not permitted to access the requested course or course work, or for
  5404  // access errors. * `INVALID_ARGUMENT` if the request is malformed. *
  5405  // `NOT_FOUND` if the requested course does not exist.
  5406  //
  5407  //   - courseId: Identifier of the course. This identifier can be either the
  5408  //     Classroom-assigned identifier or an alias.
  5409  //   - courseWorkId: Identifier of the student work to request. This may be set
  5410  //     to the string literal "-" to request student work for all course work in
  5411  //     the specified course.
  5412  func (r *CoursesCourseWorkStudentSubmissionsService) List(courseId string, courseWorkId string) *CoursesCourseWorkStudentSubmissionsListCall {
  5413  	c := &CoursesCourseWorkStudentSubmissionsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5414  	c.courseId = courseId
  5415  	c.courseWorkId = courseWorkId
  5416  	return c
  5417  }
  5418  
  5419  // Late sets the optional parameter "late": Requested lateness value. If
  5420  // specified, returned student submissions are restricted by the requested
  5421  // value. If unspecified, submissions are returned regardless of `late` value.
  5422  //
  5423  // Possible values:
  5424  //
  5425  //	"LATE_VALUES_UNSPECIFIED" - No restriction on submission late values
  5426  //
  5427  // specified.
  5428  //
  5429  //	"LATE_ONLY" - Return StudentSubmissions where late is true.
  5430  //	"NOT_LATE_ONLY" - Return StudentSubmissions where late is false.
  5431  func (c *CoursesCourseWorkStudentSubmissionsListCall) Late(late string) *CoursesCourseWorkStudentSubmissionsListCall {
  5432  	c.urlParams_.Set("late", late)
  5433  	return c
  5434  }
  5435  
  5436  // PageSize sets the optional parameter "pageSize": Maximum number of items to
  5437  // return. Zero or unspecified indicates that the server may assign a maximum.
  5438  // The server may return fewer than the specified number of results.
  5439  func (c *CoursesCourseWorkStudentSubmissionsListCall) PageSize(pageSize int64) *CoursesCourseWorkStudentSubmissionsListCall {
  5440  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  5441  	return c
  5442  }
  5443  
  5444  // PageToken sets the optional parameter "pageToken": nextPageToken value
  5445  // returned from a previous list call, indicating that the subsequent page of
  5446  // results should be returned. The list request must be otherwise identical to
  5447  // the one that resulted in this token.
  5448  func (c *CoursesCourseWorkStudentSubmissionsListCall) PageToken(pageToken string) *CoursesCourseWorkStudentSubmissionsListCall {
  5449  	c.urlParams_.Set("pageToken", pageToken)
  5450  	return c
  5451  }
  5452  
  5453  // States sets the optional parameter "states": Requested submission states. If
  5454  // specified, returned student submissions match one of the specified
  5455  // submission states.
  5456  //
  5457  // Possible values:
  5458  //
  5459  //	"SUBMISSION_STATE_UNSPECIFIED" - No state specified. This should never be
  5460  //
  5461  // returned.
  5462  //
  5463  //	"NEW" - The student has never accessed this submission. Attachments are
  5464  //
  5465  // not returned and timestamps is not set.
  5466  //
  5467  //	"CREATED" - Has been created.
  5468  //	"TURNED_IN" - Has been turned in to the teacher.
  5469  //	"RETURNED" - Has been returned to the student.
  5470  //	"RECLAIMED_BY_STUDENT" - Student chose to "unsubmit" the assignment.
  5471  func (c *CoursesCourseWorkStudentSubmissionsListCall) States(states ...string) *CoursesCourseWorkStudentSubmissionsListCall {
  5472  	c.urlParams_.SetMulti("states", append([]string{}, states...))
  5473  	return c
  5474  }
  5475  
  5476  // UserId sets the optional parameter "userId": Optional argument to restrict
  5477  // returned student work to those owned by the student with the specified
  5478  // identifier. The identifier can be one of the following: * the numeric
  5479  // identifier for the user * the email address of the user * the string literal
  5480  // "me", indicating the requesting user
  5481  func (c *CoursesCourseWorkStudentSubmissionsListCall) UserId(userId string) *CoursesCourseWorkStudentSubmissionsListCall {
  5482  	c.urlParams_.Set("userId", userId)
  5483  	return c
  5484  }
  5485  
  5486  // Fields allows partial responses to be retrieved. See
  5487  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5488  // details.
  5489  func (c *CoursesCourseWorkStudentSubmissionsListCall) Fields(s ...googleapi.Field) *CoursesCourseWorkStudentSubmissionsListCall {
  5490  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5491  	return c
  5492  }
  5493  
  5494  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  5495  // object's ETag matches the given value. This is useful for getting updates
  5496  // only after the object has changed since the last request.
  5497  func (c *CoursesCourseWorkStudentSubmissionsListCall) IfNoneMatch(entityTag string) *CoursesCourseWorkStudentSubmissionsListCall {
  5498  	c.ifNoneMatch_ = entityTag
  5499  	return c
  5500  }
  5501  
  5502  // Context sets the context to be used in this call's Do method.
  5503  func (c *CoursesCourseWorkStudentSubmissionsListCall) Context(ctx context.Context) *CoursesCourseWorkStudentSubmissionsListCall {
  5504  	c.ctx_ = ctx
  5505  	return c
  5506  }
  5507  
  5508  // Header returns a http.Header that can be modified by the caller to add
  5509  // headers to the request.
  5510  func (c *CoursesCourseWorkStudentSubmissionsListCall) Header() http.Header {
  5511  	if c.header_ == nil {
  5512  		c.header_ = make(http.Header)
  5513  	}
  5514  	return c.header_
  5515  }
  5516  
  5517  func (c *CoursesCourseWorkStudentSubmissionsListCall) doRequest(alt string) (*http.Response, error) {
  5518  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  5519  	if c.ifNoneMatch_ != "" {
  5520  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  5521  	}
  5522  	var body io.Reader = nil
  5523  	c.urlParams_.Set("alt", alt)
  5524  	c.urlParams_.Set("prettyPrint", "false")
  5525  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions")
  5526  	urls += "?" + c.urlParams_.Encode()
  5527  	req, err := http.NewRequest("GET", urls, body)
  5528  	if err != nil {
  5529  		return nil, err
  5530  	}
  5531  	req.Header = reqHeaders
  5532  	googleapi.Expand(req.URL, map[string]string{
  5533  		"courseId":     c.courseId,
  5534  		"courseWorkId": c.courseWorkId,
  5535  	})
  5536  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5537  }
  5538  
  5539  // Do executes the "classroom.courses.courseWork.studentSubmissions.list" call.
  5540  // Any non-2xx status code is an error. Response headers are in either
  5541  // *ListStudentSubmissionsResponse.ServerResponse.Header or (if a response was
  5542  // returned at all) in error.(*googleapi.Error).Header. Use
  5543  // googleapi.IsNotModified to check whether the returned error was because
  5544  // http.StatusNotModified was returned.
  5545  func (c *CoursesCourseWorkStudentSubmissionsListCall) Do(opts ...googleapi.CallOption) (*ListStudentSubmissionsResponse, error) {
  5546  	gensupport.SetOptions(c.urlParams_, opts...)
  5547  	res, err := c.doRequest("json")
  5548  	if res != nil && res.StatusCode == http.StatusNotModified {
  5549  		if res.Body != nil {
  5550  			res.Body.Close()
  5551  		}
  5552  		return nil, gensupport.WrapError(&googleapi.Error{
  5553  			Code:   res.StatusCode,
  5554  			Header: res.Header,
  5555  		})
  5556  	}
  5557  	if err != nil {
  5558  		return nil, err
  5559  	}
  5560  	defer googleapi.CloseBody(res)
  5561  	if err := googleapi.CheckResponse(res); err != nil {
  5562  		return nil, gensupport.WrapError(err)
  5563  	}
  5564  	ret := &ListStudentSubmissionsResponse{
  5565  		ServerResponse: googleapi.ServerResponse{
  5566  			Header:         res.Header,
  5567  			HTTPStatusCode: res.StatusCode,
  5568  		},
  5569  	}
  5570  	target := &ret
  5571  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5572  		return nil, err
  5573  	}
  5574  	return ret, nil
  5575  }
  5576  
  5577  // Pages invokes f for each page of results.
  5578  // A non-nil error returned from f will halt the iteration.
  5579  // The provided context supersedes any context provided to the Context method.
  5580  func (c *CoursesCourseWorkStudentSubmissionsListCall) Pages(ctx context.Context, f func(*ListStudentSubmissionsResponse) error) error {
  5581  	c.ctx_ = ctx
  5582  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  5583  	for {
  5584  		x, err := c.Do()
  5585  		if err != nil {
  5586  			return err
  5587  		}
  5588  		if err := f(x); err != nil {
  5589  			return err
  5590  		}
  5591  		if x.NextPageToken == "" {
  5592  			return nil
  5593  		}
  5594  		c.PageToken(x.NextPageToken)
  5595  	}
  5596  }
  5597  
  5598  type CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall struct {
  5599  	s                        *Service
  5600  	courseId                 string
  5601  	courseWorkId             string
  5602  	id                       string
  5603  	modifyattachmentsrequest *ModifyAttachmentsRequest
  5604  	urlParams_               gensupport.URLParams
  5605  	ctx_                     context.Context
  5606  	header_                  http.Header
  5607  }
  5608  
  5609  // ModifyAttachments: Modifies attachments of student submission. Attachments
  5610  // may only be added to student submissions belonging to course work objects
  5611  // with a `workType` of `ASSIGNMENT`. This request must be made by the
  5612  // Developer Console project of the OAuth client ID
  5613  // (https://support.google.com/cloud/answer/6158849) used to create the
  5614  // corresponding course work item. This method returns the following error
  5615  // codes: * `PERMISSION_DENIED` if the requesting user is not permitted to
  5616  // access the requested course or course work, if the user is not permitted to
  5617  // modify attachments on the requested student submission, or for access
  5618  // errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if
  5619  // the requested course, course work, or student submission does not exist.
  5620  //
  5621  //   - courseId: Identifier of the course. This identifier can be either the
  5622  //     Classroom-assigned identifier or an alias.
  5623  //   - courseWorkId: Identifier of the course work.
  5624  //   - id: Identifier of the student submission.
  5625  func (r *CoursesCourseWorkStudentSubmissionsService) ModifyAttachments(courseId string, courseWorkId string, id string, modifyattachmentsrequest *ModifyAttachmentsRequest) *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall {
  5626  	c := &CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5627  	c.courseId = courseId
  5628  	c.courseWorkId = courseWorkId
  5629  	c.id = id
  5630  	c.modifyattachmentsrequest = modifyattachmentsrequest
  5631  	return c
  5632  }
  5633  
  5634  // Fields allows partial responses to be retrieved. See
  5635  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5636  // details.
  5637  func (c *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall) Fields(s ...googleapi.Field) *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall {
  5638  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5639  	return c
  5640  }
  5641  
  5642  // Context sets the context to be used in this call's Do method.
  5643  func (c *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall) Context(ctx context.Context) *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall {
  5644  	c.ctx_ = ctx
  5645  	return c
  5646  }
  5647  
  5648  // Header returns a http.Header that can be modified by the caller to add
  5649  // headers to the request.
  5650  func (c *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall) Header() http.Header {
  5651  	if c.header_ == nil {
  5652  		c.header_ = make(http.Header)
  5653  	}
  5654  	return c.header_
  5655  }
  5656  
  5657  func (c *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall) doRequest(alt string) (*http.Response, error) {
  5658  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5659  	var body io.Reader = nil
  5660  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.modifyattachmentsrequest)
  5661  	if err != nil {
  5662  		return nil, err
  5663  	}
  5664  	c.urlParams_.Set("alt", alt)
  5665  	c.urlParams_.Set("prettyPrint", "false")
  5666  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:modifyAttachments")
  5667  	urls += "?" + c.urlParams_.Encode()
  5668  	req, err := http.NewRequest("POST", urls, body)
  5669  	if err != nil {
  5670  		return nil, err
  5671  	}
  5672  	req.Header = reqHeaders
  5673  	googleapi.Expand(req.URL, map[string]string{
  5674  		"courseId":     c.courseId,
  5675  		"courseWorkId": c.courseWorkId,
  5676  		"id":           c.id,
  5677  	})
  5678  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5679  }
  5680  
  5681  // Do executes the "classroom.courses.courseWork.studentSubmissions.modifyAttachments" call.
  5682  // Any non-2xx status code is an error. Response headers are in either
  5683  // *StudentSubmission.ServerResponse.Header or (if a response was returned at
  5684  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5685  // check whether the returned error was because http.StatusNotModified was
  5686  // returned.
  5687  func (c *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall) Do(opts ...googleapi.CallOption) (*StudentSubmission, error) {
  5688  	gensupport.SetOptions(c.urlParams_, opts...)
  5689  	res, err := c.doRequest("json")
  5690  	if res != nil && res.StatusCode == http.StatusNotModified {
  5691  		if res.Body != nil {
  5692  			res.Body.Close()
  5693  		}
  5694  		return nil, gensupport.WrapError(&googleapi.Error{
  5695  			Code:   res.StatusCode,
  5696  			Header: res.Header,
  5697  		})
  5698  	}
  5699  	if err != nil {
  5700  		return nil, err
  5701  	}
  5702  	defer googleapi.CloseBody(res)
  5703  	if err := googleapi.CheckResponse(res); err != nil {
  5704  		return nil, gensupport.WrapError(err)
  5705  	}
  5706  	ret := &StudentSubmission{
  5707  		ServerResponse: googleapi.ServerResponse{
  5708  			Header:         res.Header,
  5709  			HTTPStatusCode: res.StatusCode,
  5710  		},
  5711  	}
  5712  	target := &ret
  5713  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5714  		return nil, err
  5715  	}
  5716  	return ret, nil
  5717  }
  5718  
  5719  type CoursesCourseWorkStudentSubmissionsPatchCall struct {
  5720  	s                 *Service
  5721  	courseId          string
  5722  	courseWorkId      string
  5723  	id                string
  5724  	studentsubmission *StudentSubmission
  5725  	urlParams_        gensupport.URLParams
  5726  	ctx_              context.Context
  5727  	header_           http.Header
  5728  }
  5729  
  5730  // Patch: Updates one or more fields of a student submission. See
  5731  // google.classroom.v1.StudentSubmission for details of which fields may be
  5732  // updated and who may change them. This request must be made by the Developer
  5733  // Console project of the OAuth client ID
  5734  // (https://support.google.com/cloud/answer/6158849) used to create the
  5735  // corresponding course work item. This method returns the following error
  5736  // codes: * `PERMISSION_DENIED` if the requesting developer project did not
  5737  // create the corresponding course work, if the user is not permitted to make
  5738  // the requested modification to the student submission, or for access errors.
  5739  // * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the
  5740  // requested course, course work, or student submission does not exist.
  5741  //
  5742  //   - courseId: Identifier of the course. This identifier can be either the
  5743  //     Classroom-assigned identifier or an alias.
  5744  //   - courseWorkId: Identifier of the course work.
  5745  //   - id: Identifier of the student submission.
  5746  func (r *CoursesCourseWorkStudentSubmissionsService) Patch(courseId string, courseWorkId string, id string, studentsubmission *StudentSubmission) *CoursesCourseWorkStudentSubmissionsPatchCall {
  5747  	c := &CoursesCourseWorkStudentSubmissionsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5748  	c.courseId = courseId
  5749  	c.courseWorkId = courseWorkId
  5750  	c.id = id
  5751  	c.studentsubmission = studentsubmission
  5752  	return c
  5753  }
  5754  
  5755  // UpdateMask sets the optional parameter "updateMask": Mask that identifies
  5756  // which fields on the student submission to update. This field is required to
  5757  // do an update. The update fails if invalid fields are specified. The
  5758  // following fields may be specified by teachers: * `draft_grade` *
  5759  // `assigned_grade`
  5760  func (c *CoursesCourseWorkStudentSubmissionsPatchCall) UpdateMask(updateMask string) *CoursesCourseWorkStudentSubmissionsPatchCall {
  5761  	c.urlParams_.Set("updateMask", updateMask)
  5762  	return c
  5763  }
  5764  
  5765  // Fields allows partial responses to be retrieved. See
  5766  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5767  // details.
  5768  func (c *CoursesCourseWorkStudentSubmissionsPatchCall) Fields(s ...googleapi.Field) *CoursesCourseWorkStudentSubmissionsPatchCall {
  5769  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5770  	return c
  5771  }
  5772  
  5773  // Context sets the context to be used in this call's Do method.
  5774  func (c *CoursesCourseWorkStudentSubmissionsPatchCall) Context(ctx context.Context) *CoursesCourseWorkStudentSubmissionsPatchCall {
  5775  	c.ctx_ = ctx
  5776  	return c
  5777  }
  5778  
  5779  // Header returns a http.Header that can be modified by the caller to add
  5780  // headers to the request.
  5781  func (c *CoursesCourseWorkStudentSubmissionsPatchCall) Header() http.Header {
  5782  	if c.header_ == nil {
  5783  		c.header_ = make(http.Header)
  5784  	}
  5785  	return c.header_
  5786  }
  5787  
  5788  func (c *CoursesCourseWorkStudentSubmissionsPatchCall) doRequest(alt string) (*http.Response, error) {
  5789  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5790  	var body io.Reader = nil
  5791  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.studentsubmission)
  5792  	if err != nil {
  5793  		return nil, err
  5794  	}
  5795  	c.urlParams_.Set("alt", alt)
  5796  	c.urlParams_.Set("prettyPrint", "false")
  5797  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}")
  5798  	urls += "?" + c.urlParams_.Encode()
  5799  	req, err := http.NewRequest("PATCH", urls, body)
  5800  	if err != nil {
  5801  		return nil, err
  5802  	}
  5803  	req.Header = reqHeaders
  5804  	googleapi.Expand(req.URL, map[string]string{
  5805  		"courseId":     c.courseId,
  5806  		"courseWorkId": c.courseWorkId,
  5807  		"id":           c.id,
  5808  	})
  5809  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5810  }
  5811  
  5812  // Do executes the "classroom.courses.courseWork.studentSubmissions.patch" call.
  5813  // Any non-2xx status code is an error. Response headers are in either
  5814  // *StudentSubmission.ServerResponse.Header or (if a response was returned at
  5815  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  5816  // check whether the returned error was because http.StatusNotModified was
  5817  // returned.
  5818  func (c *CoursesCourseWorkStudentSubmissionsPatchCall) Do(opts ...googleapi.CallOption) (*StudentSubmission, error) {
  5819  	gensupport.SetOptions(c.urlParams_, opts...)
  5820  	res, err := c.doRequest("json")
  5821  	if res != nil && res.StatusCode == http.StatusNotModified {
  5822  		if res.Body != nil {
  5823  			res.Body.Close()
  5824  		}
  5825  		return nil, gensupport.WrapError(&googleapi.Error{
  5826  			Code:   res.StatusCode,
  5827  			Header: res.Header,
  5828  		})
  5829  	}
  5830  	if err != nil {
  5831  		return nil, err
  5832  	}
  5833  	defer googleapi.CloseBody(res)
  5834  	if err := googleapi.CheckResponse(res); err != nil {
  5835  		return nil, gensupport.WrapError(err)
  5836  	}
  5837  	ret := &StudentSubmission{
  5838  		ServerResponse: googleapi.ServerResponse{
  5839  			Header:         res.Header,
  5840  			HTTPStatusCode: res.StatusCode,
  5841  		},
  5842  	}
  5843  	target := &ret
  5844  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5845  		return nil, err
  5846  	}
  5847  	return ret, nil
  5848  }
  5849  
  5850  type CoursesCourseWorkStudentSubmissionsReclaimCall struct {
  5851  	s                               *Service
  5852  	courseId                        string
  5853  	courseWorkId                    string
  5854  	id                              string
  5855  	reclaimstudentsubmissionrequest *ReclaimStudentSubmissionRequest
  5856  	urlParams_                      gensupport.URLParams
  5857  	ctx_                            context.Context
  5858  	header_                         http.Header
  5859  }
  5860  
  5861  // Reclaim: Reclaims a student submission on behalf of the student that owns
  5862  // it. Reclaiming a student submission transfers ownership of attached Drive
  5863  // files to the student and updates the submission state. Only the student that
  5864  // owns the requested student submission may call this method, and only for a
  5865  // student submission that has been turned in. This request must be made by the
  5866  // Developer Console project of the OAuth client ID
  5867  // (https://support.google.com/cloud/answer/6158849) used to create the
  5868  // corresponding course work item. This method returns the following error
  5869  // codes: * `PERMISSION_DENIED` if the requesting user is not permitted to
  5870  // access the requested course or course work, unsubmit the requested student
  5871  // submission, or for access errors. * `FAILED_PRECONDITION` if the student
  5872  // submission has not been turned in. * `INVALID_ARGUMENT` if the request is
  5873  // malformed. * `NOT_FOUND` if the requested course, course work, or student
  5874  // submission does not exist.
  5875  //
  5876  //   - courseId: Identifier of the course. This identifier can be either the
  5877  //     Classroom-assigned identifier or an alias.
  5878  //   - courseWorkId: Identifier of the course work.
  5879  //   - id: Identifier of the student submission.
  5880  func (r *CoursesCourseWorkStudentSubmissionsService) Reclaim(courseId string, courseWorkId string, id string, reclaimstudentsubmissionrequest *ReclaimStudentSubmissionRequest) *CoursesCourseWorkStudentSubmissionsReclaimCall {
  5881  	c := &CoursesCourseWorkStudentSubmissionsReclaimCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  5882  	c.courseId = courseId
  5883  	c.courseWorkId = courseWorkId
  5884  	c.id = id
  5885  	c.reclaimstudentsubmissionrequest = reclaimstudentsubmissionrequest
  5886  	return c
  5887  }
  5888  
  5889  // Fields allows partial responses to be retrieved. See
  5890  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  5891  // details.
  5892  func (c *CoursesCourseWorkStudentSubmissionsReclaimCall) Fields(s ...googleapi.Field) *CoursesCourseWorkStudentSubmissionsReclaimCall {
  5893  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  5894  	return c
  5895  }
  5896  
  5897  // Context sets the context to be used in this call's Do method.
  5898  func (c *CoursesCourseWorkStudentSubmissionsReclaimCall) Context(ctx context.Context) *CoursesCourseWorkStudentSubmissionsReclaimCall {
  5899  	c.ctx_ = ctx
  5900  	return c
  5901  }
  5902  
  5903  // Header returns a http.Header that can be modified by the caller to add
  5904  // headers to the request.
  5905  func (c *CoursesCourseWorkStudentSubmissionsReclaimCall) Header() http.Header {
  5906  	if c.header_ == nil {
  5907  		c.header_ = make(http.Header)
  5908  	}
  5909  	return c.header_
  5910  }
  5911  
  5912  func (c *CoursesCourseWorkStudentSubmissionsReclaimCall) doRequest(alt string) (*http.Response, error) {
  5913  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  5914  	var body io.Reader = nil
  5915  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.reclaimstudentsubmissionrequest)
  5916  	if err != nil {
  5917  		return nil, err
  5918  	}
  5919  	c.urlParams_.Set("alt", alt)
  5920  	c.urlParams_.Set("prettyPrint", "false")
  5921  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:reclaim")
  5922  	urls += "?" + c.urlParams_.Encode()
  5923  	req, err := http.NewRequest("POST", urls, body)
  5924  	if err != nil {
  5925  		return nil, err
  5926  	}
  5927  	req.Header = reqHeaders
  5928  	googleapi.Expand(req.URL, map[string]string{
  5929  		"courseId":     c.courseId,
  5930  		"courseWorkId": c.courseWorkId,
  5931  		"id":           c.id,
  5932  	})
  5933  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  5934  }
  5935  
  5936  // Do executes the "classroom.courses.courseWork.studentSubmissions.reclaim" call.
  5937  // Any non-2xx status code is an error. Response headers are in either
  5938  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  5939  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  5940  // whether the returned error was because http.StatusNotModified was returned.
  5941  func (c *CoursesCourseWorkStudentSubmissionsReclaimCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  5942  	gensupport.SetOptions(c.urlParams_, opts...)
  5943  	res, err := c.doRequest("json")
  5944  	if res != nil && res.StatusCode == http.StatusNotModified {
  5945  		if res.Body != nil {
  5946  			res.Body.Close()
  5947  		}
  5948  		return nil, gensupport.WrapError(&googleapi.Error{
  5949  			Code:   res.StatusCode,
  5950  			Header: res.Header,
  5951  		})
  5952  	}
  5953  	if err != nil {
  5954  		return nil, err
  5955  	}
  5956  	defer googleapi.CloseBody(res)
  5957  	if err := googleapi.CheckResponse(res); err != nil {
  5958  		return nil, gensupport.WrapError(err)
  5959  	}
  5960  	ret := &Empty{
  5961  		ServerResponse: googleapi.ServerResponse{
  5962  			Header:         res.Header,
  5963  			HTTPStatusCode: res.StatusCode,
  5964  		},
  5965  	}
  5966  	target := &ret
  5967  	if err := gensupport.DecodeResponse(target, res); err != nil {
  5968  		return nil, err
  5969  	}
  5970  	return ret, nil
  5971  }
  5972  
  5973  type CoursesCourseWorkStudentSubmissionsReturnCall struct {
  5974  	s                              *Service
  5975  	courseId                       string
  5976  	courseWorkId                   string
  5977  	id                             string
  5978  	returnstudentsubmissionrequest *ReturnStudentSubmissionRequest
  5979  	urlParams_                     gensupport.URLParams
  5980  	ctx_                           context.Context
  5981  	header_                        http.Header
  5982  }
  5983  
  5984  // Return: Returns a student submission. Returning a student submission
  5985  // transfers ownership of attached Drive files to the student and may also
  5986  // update the submission state. Unlike the Classroom application, returning a
  5987  // student submission does not set assignedGrade to the draftGrade value. Only
  5988  // a teacher of the course that contains the requested student submission may
  5989  // call this method. This request must be made by the Developer Console project
  5990  // of the OAuth client ID (https://support.google.com/cloud/answer/6158849)
  5991  // used to create the corresponding course work item. This method returns the
  5992  // following error codes: * `PERMISSION_DENIED` if the requesting user is not
  5993  // permitted to access the requested course or course work, return the
  5994  // requested student submission, or for access errors. * `INVALID_ARGUMENT` if
  5995  // the request is malformed. * `NOT_FOUND` if the requested course, course
  5996  // work, or student submission does not exist.
  5997  //
  5998  //   - courseId: Identifier of the course. This identifier can be either the
  5999  //     Classroom-assigned identifier or an alias.
  6000  //   - courseWorkId: Identifier of the course work.
  6001  //   - id: Identifier of the student submission.
  6002  func (r *CoursesCourseWorkStudentSubmissionsService) Return(courseId string, courseWorkId string, id string, returnstudentsubmissionrequest *ReturnStudentSubmissionRequest) *CoursesCourseWorkStudentSubmissionsReturnCall {
  6003  	c := &CoursesCourseWorkStudentSubmissionsReturnCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6004  	c.courseId = courseId
  6005  	c.courseWorkId = courseWorkId
  6006  	c.id = id
  6007  	c.returnstudentsubmissionrequest = returnstudentsubmissionrequest
  6008  	return c
  6009  }
  6010  
  6011  // Fields allows partial responses to be retrieved. See
  6012  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6013  // details.
  6014  func (c *CoursesCourseWorkStudentSubmissionsReturnCall) Fields(s ...googleapi.Field) *CoursesCourseWorkStudentSubmissionsReturnCall {
  6015  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6016  	return c
  6017  }
  6018  
  6019  // Context sets the context to be used in this call's Do method.
  6020  func (c *CoursesCourseWorkStudentSubmissionsReturnCall) Context(ctx context.Context) *CoursesCourseWorkStudentSubmissionsReturnCall {
  6021  	c.ctx_ = ctx
  6022  	return c
  6023  }
  6024  
  6025  // Header returns a http.Header that can be modified by the caller to add
  6026  // headers to the request.
  6027  func (c *CoursesCourseWorkStudentSubmissionsReturnCall) Header() http.Header {
  6028  	if c.header_ == nil {
  6029  		c.header_ = make(http.Header)
  6030  	}
  6031  	return c.header_
  6032  }
  6033  
  6034  func (c *CoursesCourseWorkStudentSubmissionsReturnCall) doRequest(alt string) (*http.Response, error) {
  6035  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  6036  	var body io.Reader = nil
  6037  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.returnstudentsubmissionrequest)
  6038  	if err != nil {
  6039  		return nil, err
  6040  	}
  6041  	c.urlParams_.Set("alt", alt)
  6042  	c.urlParams_.Set("prettyPrint", "false")
  6043  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:return")
  6044  	urls += "?" + c.urlParams_.Encode()
  6045  	req, err := http.NewRequest("POST", urls, body)
  6046  	if err != nil {
  6047  		return nil, err
  6048  	}
  6049  	req.Header = reqHeaders
  6050  	googleapi.Expand(req.URL, map[string]string{
  6051  		"courseId":     c.courseId,
  6052  		"courseWorkId": c.courseWorkId,
  6053  		"id":           c.id,
  6054  	})
  6055  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6056  }
  6057  
  6058  // Do executes the "classroom.courses.courseWork.studentSubmissions.return" call.
  6059  // Any non-2xx status code is an error. Response headers are in either
  6060  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  6061  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6062  // whether the returned error was because http.StatusNotModified was returned.
  6063  func (c *CoursesCourseWorkStudentSubmissionsReturnCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  6064  	gensupport.SetOptions(c.urlParams_, opts...)
  6065  	res, err := c.doRequest("json")
  6066  	if res != nil && res.StatusCode == http.StatusNotModified {
  6067  		if res.Body != nil {
  6068  			res.Body.Close()
  6069  		}
  6070  		return nil, gensupport.WrapError(&googleapi.Error{
  6071  			Code:   res.StatusCode,
  6072  			Header: res.Header,
  6073  		})
  6074  	}
  6075  	if err != nil {
  6076  		return nil, err
  6077  	}
  6078  	defer googleapi.CloseBody(res)
  6079  	if err := googleapi.CheckResponse(res); err != nil {
  6080  		return nil, gensupport.WrapError(err)
  6081  	}
  6082  	ret := &Empty{
  6083  		ServerResponse: googleapi.ServerResponse{
  6084  			Header:         res.Header,
  6085  			HTTPStatusCode: res.StatusCode,
  6086  		},
  6087  	}
  6088  	target := &ret
  6089  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6090  		return nil, err
  6091  	}
  6092  	return ret, nil
  6093  }
  6094  
  6095  type CoursesCourseWorkStudentSubmissionsTurnInCall struct {
  6096  	s                              *Service
  6097  	courseId                       string
  6098  	courseWorkId                   string
  6099  	id                             string
  6100  	turninstudentsubmissionrequest *TurnInStudentSubmissionRequest
  6101  	urlParams_                     gensupport.URLParams
  6102  	ctx_                           context.Context
  6103  	header_                        http.Header
  6104  }
  6105  
  6106  // TurnIn: Turns in a student submission. Turning in a student submission
  6107  // transfers ownership of attached Drive files to the teacher and may also
  6108  // update the submission state. This may only be called by the student that
  6109  // owns the specified student submission. This request must be made by the
  6110  // Developer Console project of the OAuth client ID
  6111  // (https://support.google.com/cloud/answer/6158849) used to create the
  6112  // corresponding course work item. This method returns the following error
  6113  // codes: * `PERMISSION_DENIED` if the requesting user is not permitted to
  6114  // access the requested course or course work, turn in the requested student
  6115  // submission, or for access errors. * `INVALID_ARGUMENT` if the request is
  6116  // malformed. * `NOT_FOUND` if the requested course, course work, or student
  6117  // submission does not exist.
  6118  //
  6119  //   - courseId: Identifier of the course. This identifier can be either the
  6120  //     Classroom-assigned identifier or an alias.
  6121  //   - courseWorkId: Identifier of the course work.
  6122  //   - id: Identifier of the student submission.
  6123  func (r *CoursesCourseWorkStudentSubmissionsService) TurnIn(courseId string, courseWorkId string, id string, turninstudentsubmissionrequest *TurnInStudentSubmissionRequest) *CoursesCourseWorkStudentSubmissionsTurnInCall {
  6124  	c := &CoursesCourseWorkStudentSubmissionsTurnInCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6125  	c.courseId = courseId
  6126  	c.courseWorkId = courseWorkId
  6127  	c.id = id
  6128  	c.turninstudentsubmissionrequest = turninstudentsubmissionrequest
  6129  	return c
  6130  }
  6131  
  6132  // Fields allows partial responses to be retrieved. See
  6133  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6134  // details.
  6135  func (c *CoursesCourseWorkStudentSubmissionsTurnInCall) Fields(s ...googleapi.Field) *CoursesCourseWorkStudentSubmissionsTurnInCall {
  6136  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6137  	return c
  6138  }
  6139  
  6140  // Context sets the context to be used in this call's Do method.
  6141  func (c *CoursesCourseWorkStudentSubmissionsTurnInCall) Context(ctx context.Context) *CoursesCourseWorkStudentSubmissionsTurnInCall {
  6142  	c.ctx_ = ctx
  6143  	return c
  6144  }
  6145  
  6146  // Header returns a http.Header that can be modified by the caller to add
  6147  // headers to the request.
  6148  func (c *CoursesCourseWorkStudentSubmissionsTurnInCall) Header() http.Header {
  6149  	if c.header_ == nil {
  6150  		c.header_ = make(http.Header)
  6151  	}
  6152  	return c.header_
  6153  }
  6154  
  6155  func (c *CoursesCourseWorkStudentSubmissionsTurnInCall) doRequest(alt string) (*http.Response, error) {
  6156  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  6157  	var body io.Reader = nil
  6158  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.turninstudentsubmissionrequest)
  6159  	if err != nil {
  6160  		return nil, err
  6161  	}
  6162  	c.urlParams_.Set("alt", alt)
  6163  	c.urlParams_.Set("prettyPrint", "false")
  6164  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWork/{courseWorkId}/studentSubmissions/{id}:turnIn")
  6165  	urls += "?" + c.urlParams_.Encode()
  6166  	req, err := http.NewRequest("POST", urls, body)
  6167  	if err != nil {
  6168  		return nil, err
  6169  	}
  6170  	req.Header = reqHeaders
  6171  	googleapi.Expand(req.URL, map[string]string{
  6172  		"courseId":     c.courseId,
  6173  		"courseWorkId": c.courseWorkId,
  6174  		"id":           c.id,
  6175  	})
  6176  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6177  }
  6178  
  6179  // Do executes the "classroom.courses.courseWork.studentSubmissions.turnIn" call.
  6180  // Any non-2xx status code is an error. Response headers are in either
  6181  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  6182  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6183  // whether the returned error was because http.StatusNotModified was returned.
  6184  func (c *CoursesCourseWorkStudentSubmissionsTurnInCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  6185  	gensupport.SetOptions(c.urlParams_, opts...)
  6186  	res, err := c.doRequest("json")
  6187  	if res != nil && res.StatusCode == http.StatusNotModified {
  6188  		if res.Body != nil {
  6189  			res.Body.Close()
  6190  		}
  6191  		return nil, gensupport.WrapError(&googleapi.Error{
  6192  			Code:   res.StatusCode,
  6193  			Header: res.Header,
  6194  		})
  6195  	}
  6196  	if err != nil {
  6197  		return nil, err
  6198  	}
  6199  	defer googleapi.CloseBody(res)
  6200  	if err := googleapi.CheckResponse(res); err != nil {
  6201  		return nil, gensupport.WrapError(err)
  6202  	}
  6203  	ret := &Empty{
  6204  		ServerResponse: googleapi.ServerResponse{
  6205  			Header:         res.Header,
  6206  			HTTPStatusCode: res.StatusCode,
  6207  		},
  6208  	}
  6209  	target := &ret
  6210  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6211  		return nil, err
  6212  	}
  6213  	return ret, nil
  6214  }
  6215  
  6216  type CoursesCourseWorkMaterialsCreateCall struct {
  6217  	s                  *Service
  6218  	courseId           string
  6219  	courseworkmaterial *CourseWorkMaterial
  6220  	urlParams_         gensupport.URLParams
  6221  	ctx_               context.Context
  6222  	header_            http.Header
  6223  }
  6224  
  6225  // Create: Creates a course work material. This method returns the following
  6226  // error codes: * `PERMISSION_DENIED` if the requesting user is not permitted
  6227  // to access the requested course, create course work material in the requested
  6228  // course, share a Drive attachment, or for access errors. * `INVALID_ARGUMENT`
  6229  // if the request is malformed or if more than 20 * materials are provided. *
  6230  // `NOT_FOUND` if the requested course does not exist. * `FAILED_PRECONDITION`
  6231  // for the following request error: * AttachmentNotVisible
  6232  //
  6233  //   - courseId: Identifier of the course. This identifier can be either the
  6234  //     Classroom-assigned identifier or an alias.
  6235  func (r *CoursesCourseWorkMaterialsService) Create(courseId string, courseworkmaterial *CourseWorkMaterial) *CoursesCourseWorkMaterialsCreateCall {
  6236  	c := &CoursesCourseWorkMaterialsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6237  	c.courseId = courseId
  6238  	c.courseworkmaterial = courseworkmaterial
  6239  	return c
  6240  }
  6241  
  6242  // Fields allows partial responses to be retrieved. See
  6243  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6244  // details.
  6245  func (c *CoursesCourseWorkMaterialsCreateCall) Fields(s ...googleapi.Field) *CoursesCourseWorkMaterialsCreateCall {
  6246  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6247  	return c
  6248  }
  6249  
  6250  // Context sets the context to be used in this call's Do method.
  6251  func (c *CoursesCourseWorkMaterialsCreateCall) Context(ctx context.Context) *CoursesCourseWorkMaterialsCreateCall {
  6252  	c.ctx_ = ctx
  6253  	return c
  6254  }
  6255  
  6256  // Header returns a http.Header that can be modified by the caller to add
  6257  // headers to the request.
  6258  func (c *CoursesCourseWorkMaterialsCreateCall) Header() http.Header {
  6259  	if c.header_ == nil {
  6260  		c.header_ = make(http.Header)
  6261  	}
  6262  	return c.header_
  6263  }
  6264  
  6265  func (c *CoursesCourseWorkMaterialsCreateCall) doRequest(alt string) (*http.Response, error) {
  6266  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  6267  	var body io.Reader = nil
  6268  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.courseworkmaterial)
  6269  	if err != nil {
  6270  		return nil, err
  6271  	}
  6272  	c.urlParams_.Set("alt", alt)
  6273  	c.urlParams_.Set("prettyPrint", "false")
  6274  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWorkMaterials")
  6275  	urls += "?" + c.urlParams_.Encode()
  6276  	req, err := http.NewRequest("POST", urls, body)
  6277  	if err != nil {
  6278  		return nil, err
  6279  	}
  6280  	req.Header = reqHeaders
  6281  	googleapi.Expand(req.URL, map[string]string{
  6282  		"courseId": c.courseId,
  6283  	})
  6284  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6285  }
  6286  
  6287  // Do executes the "classroom.courses.courseWorkMaterials.create" call.
  6288  // Any non-2xx status code is an error. Response headers are in either
  6289  // *CourseWorkMaterial.ServerResponse.Header or (if a response was returned at
  6290  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6291  // check whether the returned error was because http.StatusNotModified was
  6292  // returned.
  6293  func (c *CoursesCourseWorkMaterialsCreateCall) Do(opts ...googleapi.CallOption) (*CourseWorkMaterial, error) {
  6294  	gensupport.SetOptions(c.urlParams_, opts...)
  6295  	res, err := c.doRequest("json")
  6296  	if res != nil && res.StatusCode == http.StatusNotModified {
  6297  		if res.Body != nil {
  6298  			res.Body.Close()
  6299  		}
  6300  		return nil, gensupport.WrapError(&googleapi.Error{
  6301  			Code:   res.StatusCode,
  6302  			Header: res.Header,
  6303  		})
  6304  	}
  6305  	if err != nil {
  6306  		return nil, err
  6307  	}
  6308  	defer googleapi.CloseBody(res)
  6309  	if err := googleapi.CheckResponse(res); err != nil {
  6310  		return nil, gensupport.WrapError(err)
  6311  	}
  6312  	ret := &CourseWorkMaterial{
  6313  		ServerResponse: googleapi.ServerResponse{
  6314  			Header:         res.Header,
  6315  			HTTPStatusCode: res.StatusCode,
  6316  		},
  6317  	}
  6318  	target := &ret
  6319  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6320  		return nil, err
  6321  	}
  6322  	return ret, nil
  6323  }
  6324  
  6325  type CoursesCourseWorkMaterialsDeleteCall struct {
  6326  	s          *Service
  6327  	courseId   string
  6328  	id         string
  6329  	urlParams_ gensupport.URLParams
  6330  	ctx_       context.Context
  6331  	header_    http.Header
  6332  }
  6333  
  6334  // Delete: Deletes a course work material. This request must be made by the
  6335  // Developer Console project of the OAuth client ID
  6336  // (https://support.google.com/cloud/answer/6158849) used to create the
  6337  // corresponding course work material item. This method returns the following
  6338  // error codes: * `PERMISSION_DENIED` if the requesting developer project did
  6339  // not create the corresponding course work material, if the requesting user is
  6340  // not permitted to delete the requested course or for access errors. *
  6341  // `FAILED_PRECONDITION` if the requested course work material has already been
  6342  // deleted. * `NOT_FOUND` if no course exists with the requested ID.
  6343  //
  6344  //   - courseId: Identifier of the course. This identifier can be either the
  6345  //     Classroom-assigned identifier or an alias.
  6346  //   - id: Identifier of the course work material to delete. This identifier is a
  6347  //     Classroom-assigned identifier.
  6348  func (r *CoursesCourseWorkMaterialsService) Delete(courseId string, id string) *CoursesCourseWorkMaterialsDeleteCall {
  6349  	c := &CoursesCourseWorkMaterialsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6350  	c.courseId = courseId
  6351  	c.id = id
  6352  	return c
  6353  }
  6354  
  6355  // Fields allows partial responses to be retrieved. See
  6356  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6357  // details.
  6358  func (c *CoursesCourseWorkMaterialsDeleteCall) Fields(s ...googleapi.Field) *CoursesCourseWorkMaterialsDeleteCall {
  6359  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6360  	return c
  6361  }
  6362  
  6363  // Context sets the context to be used in this call's Do method.
  6364  func (c *CoursesCourseWorkMaterialsDeleteCall) Context(ctx context.Context) *CoursesCourseWorkMaterialsDeleteCall {
  6365  	c.ctx_ = ctx
  6366  	return c
  6367  }
  6368  
  6369  // Header returns a http.Header that can be modified by the caller to add
  6370  // headers to the request.
  6371  func (c *CoursesCourseWorkMaterialsDeleteCall) Header() http.Header {
  6372  	if c.header_ == nil {
  6373  		c.header_ = make(http.Header)
  6374  	}
  6375  	return c.header_
  6376  }
  6377  
  6378  func (c *CoursesCourseWorkMaterialsDeleteCall) doRequest(alt string) (*http.Response, error) {
  6379  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  6380  	var body io.Reader = nil
  6381  	c.urlParams_.Set("alt", alt)
  6382  	c.urlParams_.Set("prettyPrint", "false")
  6383  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWorkMaterials/{id}")
  6384  	urls += "?" + c.urlParams_.Encode()
  6385  	req, err := http.NewRequest("DELETE", urls, body)
  6386  	if err != nil {
  6387  		return nil, err
  6388  	}
  6389  	req.Header = reqHeaders
  6390  	googleapi.Expand(req.URL, map[string]string{
  6391  		"courseId": c.courseId,
  6392  		"id":       c.id,
  6393  	})
  6394  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6395  }
  6396  
  6397  // Do executes the "classroom.courses.courseWorkMaterials.delete" call.
  6398  // Any non-2xx status code is an error. Response headers are in either
  6399  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  6400  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6401  // whether the returned error was because http.StatusNotModified was returned.
  6402  func (c *CoursesCourseWorkMaterialsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  6403  	gensupport.SetOptions(c.urlParams_, opts...)
  6404  	res, err := c.doRequest("json")
  6405  	if res != nil && res.StatusCode == http.StatusNotModified {
  6406  		if res.Body != nil {
  6407  			res.Body.Close()
  6408  		}
  6409  		return nil, gensupport.WrapError(&googleapi.Error{
  6410  			Code:   res.StatusCode,
  6411  			Header: res.Header,
  6412  		})
  6413  	}
  6414  	if err != nil {
  6415  		return nil, err
  6416  	}
  6417  	defer googleapi.CloseBody(res)
  6418  	if err := googleapi.CheckResponse(res); err != nil {
  6419  		return nil, gensupport.WrapError(err)
  6420  	}
  6421  	ret := &Empty{
  6422  		ServerResponse: googleapi.ServerResponse{
  6423  			Header:         res.Header,
  6424  			HTTPStatusCode: res.StatusCode,
  6425  		},
  6426  	}
  6427  	target := &ret
  6428  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6429  		return nil, err
  6430  	}
  6431  	return ret, nil
  6432  }
  6433  
  6434  type CoursesCourseWorkMaterialsGetCall struct {
  6435  	s            *Service
  6436  	courseId     string
  6437  	id           string
  6438  	urlParams_   gensupport.URLParams
  6439  	ifNoneMatch_ string
  6440  	ctx_         context.Context
  6441  	header_      http.Header
  6442  }
  6443  
  6444  // Get: Returns a course work material. This method returns the following error
  6445  // codes: * `PERMISSION_DENIED` if the requesting user is not permitted to
  6446  // access the requested course or course work material, or for access errors. *
  6447  // `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the
  6448  // requested course or course work material does not exist.
  6449  //
  6450  //   - courseId: Identifier of the course. This identifier can be either the
  6451  //     Classroom-assigned identifier or an alias.
  6452  //   - id: Identifier of the course work material.
  6453  func (r *CoursesCourseWorkMaterialsService) Get(courseId string, id string) *CoursesCourseWorkMaterialsGetCall {
  6454  	c := &CoursesCourseWorkMaterialsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6455  	c.courseId = courseId
  6456  	c.id = id
  6457  	return c
  6458  }
  6459  
  6460  // Fields allows partial responses to be retrieved. See
  6461  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6462  // details.
  6463  func (c *CoursesCourseWorkMaterialsGetCall) Fields(s ...googleapi.Field) *CoursesCourseWorkMaterialsGetCall {
  6464  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6465  	return c
  6466  }
  6467  
  6468  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  6469  // object's ETag matches the given value. This is useful for getting updates
  6470  // only after the object has changed since the last request.
  6471  func (c *CoursesCourseWorkMaterialsGetCall) IfNoneMatch(entityTag string) *CoursesCourseWorkMaterialsGetCall {
  6472  	c.ifNoneMatch_ = entityTag
  6473  	return c
  6474  }
  6475  
  6476  // Context sets the context to be used in this call's Do method.
  6477  func (c *CoursesCourseWorkMaterialsGetCall) Context(ctx context.Context) *CoursesCourseWorkMaterialsGetCall {
  6478  	c.ctx_ = ctx
  6479  	return c
  6480  }
  6481  
  6482  // Header returns a http.Header that can be modified by the caller to add
  6483  // headers to the request.
  6484  func (c *CoursesCourseWorkMaterialsGetCall) Header() http.Header {
  6485  	if c.header_ == nil {
  6486  		c.header_ = make(http.Header)
  6487  	}
  6488  	return c.header_
  6489  }
  6490  
  6491  func (c *CoursesCourseWorkMaterialsGetCall) doRequest(alt string) (*http.Response, error) {
  6492  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  6493  	if c.ifNoneMatch_ != "" {
  6494  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6495  	}
  6496  	var body io.Reader = nil
  6497  	c.urlParams_.Set("alt", alt)
  6498  	c.urlParams_.Set("prettyPrint", "false")
  6499  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWorkMaterials/{id}")
  6500  	urls += "?" + c.urlParams_.Encode()
  6501  	req, err := http.NewRequest("GET", urls, body)
  6502  	if err != nil {
  6503  		return nil, err
  6504  	}
  6505  	req.Header = reqHeaders
  6506  	googleapi.Expand(req.URL, map[string]string{
  6507  		"courseId": c.courseId,
  6508  		"id":       c.id,
  6509  	})
  6510  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6511  }
  6512  
  6513  // Do executes the "classroom.courses.courseWorkMaterials.get" call.
  6514  // Any non-2xx status code is an error. Response headers are in either
  6515  // *CourseWorkMaterial.ServerResponse.Header or (if a response was returned at
  6516  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6517  // check whether the returned error was because http.StatusNotModified was
  6518  // returned.
  6519  func (c *CoursesCourseWorkMaterialsGetCall) Do(opts ...googleapi.CallOption) (*CourseWorkMaterial, error) {
  6520  	gensupport.SetOptions(c.urlParams_, opts...)
  6521  	res, err := c.doRequest("json")
  6522  	if res != nil && res.StatusCode == http.StatusNotModified {
  6523  		if res.Body != nil {
  6524  			res.Body.Close()
  6525  		}
  6526  		return nil, gensupport.WrapError(&googleapi.Error{
  6527  			Code:   res.StatusCode,
  6528  			Header: res.Header,
  6529  		})
  6530  	}
  6531  	if err != nil {
  6532  		return nil, err
  6533  	}
  6534  	defer googleapi.CloseBody(res)
  6535  	if err := googleapi.CheckResponse(res); err != nil {
  6536  		return nil, gensupport.WrapError(err)
  6537  	}
  6538  	ret := &CourseWorkMaterial{
  6539  		ServerResponse: googleapi.ServerResponse{
  6540  			Header:         res.Header,
  6541  			HTTPStatusCode: res.StatusCode,
  6542  		},
  6543  	}
  6544  	target := &ret
  6545  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6546  		return nil, err
  6547  	}
  6548  	return ret, nil
  6549  }
  6550  
  6551  type CoursesCourseWorkMaterialsListCall struct {
  6552  	s            *Service
  6553  	courseId     string
  6554  	urlParams_   gensupport.URLParams
  6555  	ifNoneMatch_ string
  6556  	ctx_         context.Context
  6557  	header_      http.Header
  6558  }
  6559  
  6560  // List: Returns a list of course work material that the requester is permitted
  6561  // to view. Course students may only view `PUBLISHED` course work material.
  6562  // Course teachers and domain administrators may view all course work material.
  6563  // This method returns the following error codes: * `PERMISSION_DENIED` if the
  6564  // requesting user is not permitted to access the requested course or for
  6565  // access errors. * `INVALID_ARGUMENT` if the request is malformed. *
  6566  // `NOT_FOUND` if the requested course does not exist.
  6567  //
  6568  //   - courseId: Identifier of the course. This identifier can be either the
  6569  //     Classroom-assigned identifier or an alias.
  6570  func (r *CoursesCourseWorkMaterialsService) List(courseId string) *CoursesCourseWorkMaterialsListCall {
  6571  	c := &CoursesCourseWorkMaterialsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6572  	c.courseId = courseId
  6573  	return c
  6574  }
  6575  
  6576  // CourseWorkMaterialStates sets the optional parameter
  6577  // "courseWorkMaterialStates": Restriction on the work status to return. Only
  6578  // course work material that matches is returned. If unspecified, items with a
  6579  // work status of `PUBLISHED` is returned.
  6580  //
  6581  // Possible values:
  6582  //
  6583  //	"COURSEWORK_MATERIAL_STATE_UNSPECIFIED" - No state specified. This is
  6584  //
  6585  // never returned.
  6586  //
  6587  //	"PUBLISHED" - Status for course work material that has been published.
  6588  //
  6589  // This is the default state.
  6590  //
  6591  //	"DRAFT" - Status for a course work material that is not yet published.
  6592  //
  6593  // Course work material in this state is visible only to course teachers and
  6594  // domain administrators.
  6595  //
  6596  //	"DELETED" - Status for course work material that was published but is now
  6597  //
  6598  // deleted. Course work material in this state is visible only to course
  6599  // teachers and domain administrators. Course work material in this state is
  6600  // deleted after some time.
  6601  func (c *CoursesCourseWorkMaterialsListCall) CourseWorkMaterialStates(courseWorkMaterialStates ...string) *CoursesCourseWorkMaterialsListCall {
  6602  	c.urlParams_.SetMulti("courseWorkMaterialStates", append([]string{}, courseWorkMaterialStates...))
  6603  	return c
  6604  }
  6605  
  6606  // MaterialDriveId sets the optional parameter "materialDriveId": Optional
  6607  // filtering for course work material with at least one Drive material whose ID
  6608  // matches the provided string. If `material_link` is also specified, course
  6609  // work material must have materials matching both filters.
  6610  func (c *CoursesCourseWorkMaterialsListCall) MaterialDriveId(materialDriveId string) *CoursesCourseWorkMaterialsListCall {
  6611  	c.urlParams_.Set("materialDriveId", materialDriveId)
  6612  	return c
  6613  }
  6614  
  6615  // MaterialLink sets the optional parameter "materialLink": Optional filtering
  6616  // for course work material with at least one link material whose URL partially
  6617  // matches the provided string.
  6618  func (c *CoursesCourseWorkMaterialsListCall) MaterialLink(materialLink string) *CoursesCourseWorkMaterialsListCall {
  6619  	c.urlParams_.Set("materialLink", materialLink)
  6620  	return c
  6621  }
  6622  
  6623  // OrderBy sets the optional parameter "orderBy": Optional sort ordering for
  6624  // results. A comma-separated list of fields with an optional sort direction
  6625  // keyword. Supported field is `updateTime`. Supported direction keywords are
  6626  // `asc` and `desc`. If not specified, `updateTime desc` is the default
  6627  // behavior. Examples: `updateTime asc`, `updateTime`
  6628  func (c *CoursesCourseWorkMaterialsListCall) OrderBy(orderBy string) *CoursesCourseWorkMaterialsListCall {
  6629  	c.urlParams_.Set("orderBy", orderBy)
  6630  	return c
  6631  }
  6632  
  6633  // PageSize sets the optional parameter "pageSize": Maximum number of items to
  6634  // return. Zero or unspecified indicates that the server may assign a maximum.
  6635  // The server may return fewer than the specified number of results.
  6636  func (c *CoursesCourseWorkMaterialsListCall) PageSize(pageSize int64) *CoursesCourseWorkMaterialsListCall {
  6637  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  6638  	return c
  6639  }
  6640  
  6641  // PageToken sets the optional parameter "pageToken": nextPageToken value
  6642  // returned from a previous list call, indicating that the subsequent page of
  6643  // results should be returned. The list request must be otherwise identical to
  6644  // the one that resulted in this token.
  6645  func (c *CoursesCourseWorkMaterialsListCall) PageToken(pageToken string) *CoursesCourseWorkMaterialsListCall {
  6646  	c.urlParams_.Set("pageToken", pageToken)
  6647  	return c
  6648  }
  6649  
  6650  // Fields allows partial responses to be retrieved. See
  6651  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6652  // details.
  6653  func (c *CoursesCourseWorkMaterialsListCall) Fields(s ...googleapi.Field) *CoursesCourseWorkMaterialsListCall {
  6654  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6655  	return c
  6656  }
  6657  
  6658  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  6659  // object's ETag matches the given value. This is useful for getting updates
  6660  // only after the object has changed since the last request.
  6661  func (c *CoursesCourseWorkMaterialsListCall) IfNoneMatch(entityTag string) *CoursesCourseWorkMaterialsListCall {
  6662  	c.ifNoneMatch_ = entityTag
  6663  	return c
  6664  }
  6665  
  6666  // Context sets the context to be used in this call's Do method.
  6667  func (c *CoursesCourseWorkMaterialsListCall) Context(ctx context.Context) *CoursesCourseWorkMaterialsListCall {
  6668  	c.ctx_ = ctx
  6669  	return c
  6670  }
  6671  
  6672  // Header returns a http.Header that can be modified by the caller to add
  6673  // headers to the request.
  6674  func (c *CoursesCourseWorkMaterialsListCall) Header() http.Header {
  6675  	if c.header_ == nil {
  6676  		c.header_ = make(http.Header)
  6677  	}
  6678  	return c.header_
  6679  }
  6680  
  6681  func (c *CoursesCourseWorkMaterialsListCall) doRequest(alt string) (*http.Response, error) {
  6682  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  6683  	if c.ifNoneMatch_ != "" {
  6684  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  6685  	}
  6686  	var body io.Reader = nil
  6687  	c.urlParams_.Set("alt", alt)
  6688  	c.urlParams_.Set("prettyPrint", "false")
  6689  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWorkMaterials")
  6690  	urls += "?" + c.urlParams_.Encode()
  6691  	req, err := http.NewRequest("GET", urls, body)
  6692  	if err != nil {
  6693  		return nil, err
  6694  	}
  6695  	req.Header = reqHeaders
  6696  	googleapi.Expand(req.URL, map[string]string{
  6697  		"courseId": c.courseId,
  6698  	})
  6699  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6700  }
  6701  
  6702  // Do executes the "classroom.courses.courseWorkMaterials.list" call.
  6703  // Any non-2xx status code is an error. Response headers are in either
  6704  // *ListCourseWorkMaterialResponse.ServerResponse.Header or (if a response was
  6705  // returned at all) in error.(*googleapi.Error).Header. Use
  6706  // googleapi.IsNotModified to check whether the returned error was because
  6707  // http.StatusNotModified was returned.
  6708  func (c *CoursesCourseWorkMaterialsListCall) Do(opts ...googleapi.CallOption) (*ListCourseWorkMaterialResponse, error) {
  6709  	gensupport.SetOptions(c.urlParams_, opts...)
  6710  	res, err := c.doRequest("json")
  6711  	if res != nil && res.StatusCode == http.StatusNotModified {
  6712  		if res.Body != nil {
  6713  			res.Body.Close()
  6714  		}
  6715  		return nil, gensupport.WrapError(&googleapi.Error{
  6716  			Code:   res.StatusCode,
  6717  			Header: res.Header,
  6718  		})
  6719  	}
  6720  	if err != nil {
  6721  		return nil, err
  6722  	}
  6723  	defer googleapi.CloseBody(res)
  6724  	if err := googleapi.CheckResponse(res); err != nil {
  6725  		return nil, gensupport.WrapError(err)
  6726  	}
  6727  	ret := &ListCourseWorkMaterialResponse{
  6728  		ServerResponse: googleapi.ServerResponse{
  6729  			Header:         res.Header,
  6730  			HTTPStatusCode: res.StatusCode,
  6731  		},
  6732  	}
  6733  	target := &ret
  6734  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6735  		return nil, err
  6736  	}
  6737  	return ret, nil
  6738  }
  6739  
  6740  // Pages invokes f for each page of results.
  6741  // A non-nil error returned from f will halt the iteration.
  6742  // The provided context supersedes any context provided to the Context method.
  6743  func (c *CoursesCourseWorkMaterialsListCall) Pages(ctx context.Context, f func(*ListCourseWorkMaterialResponse) error) error {
  6744  	c.ctx_ = ctx
  6745  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  6746  	for {
  6747  		x, err := c.Do()
  6748  		if err != nil {
  6749  			return err
  6750  		}
  6751  		if err := f(x); err != nil {
  6752  			return err
  6753  		}
  6754  		if x.NextPageToken == "" {
  6755  			return nil
  6756  		}
  6757  		c.PageToken(x.NextPageToken)
  6758  	}
  6759  }
  6760  
  6761  type CoursesCourseWorkMaterialsPatchCall struct {
  6762  	s                  *Service
  6763  	courseId           string
  6764  	id                 string
  6765  	courseworkmaterial *CourseWorkMaterial
  6766  	urlParams_         gensupport.URLParams
  6767  	ctx_               context.Context
  6768  	header_            http.Header
  6769  }
  6770  
  6771  // Patch: Updates one or more fields of a course work material. This method
  6772  // returns the following error codes: * `PERMISSION_DENIED` if the requesting
  6773  // developer project for access errors. * `INVALID_ARGUMENT` if the request is
  6774  // malformed. * `FAILED_PRECONDITION` if the requested course work material has
  6775  // already been deleted. * `NOT_FOUND` if the requested course or course work
  6776  // material does not exist
  6777  //
  6778  //   - courseId: Identifier of the course. This identifier can be either the
  6779  //     Classroom-assigned identifier or an alias.
  6780  //   - id: Identifier of the course work material.
  6781  func (r *CoursesCourseWorkMaterialsService) Patch(courseId string, id string, courseworkmaterial *CourseWorkMaterial) *CoursesCourseWorkMaterialsPatchCall {
  6782  	c := &CoursesCourseWorkMaterialsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6783  	c.courseId = courseId
  6784  	c.id = id
  6785  	c.courseworkmaterial = courseworkmaterial
  6786  	return c
  6787  }
  6788  
  6789  // UpdateMask sets the optional parameter "updateMask": Mask that identifies
  6790  // which fields on the course work material to update. This field is required
  6791  // to do an update. The update fails if invalid fields are specified. If a
  6792  // field supports empty values, it can be cleared by specifying it in the
  6793  // update mask and not in the course work material object. If a field that does
  6794  // not support empty values is included in the update mask and not set in the
  6795  // course work material object, an `INVALID_ARGUMENT` error is returned. The
  6796  // following fields may be specified by teachers: * `title` * `description` *
  6797  // `state` * `scheduled_time` * `topic_id`
  6798  func (c *CoursesCourseWorkMaterialsPatchCall) UpdateMask(updateMask string) *CoursesCourseWorkMaterialsPatchCall {
  6799  	c.urlParams_.Set("updateMask", updateMask)
  6800  	return c
  6801  }
  6802  
  6803  // Fields allows partial responses to be retrieved. See
  6804  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6805  // details.
  6806  func (c *CoursesCourseWorkMaterialsPatchCall) Fields(s ...googleapi.Field) *CoursesCourseWorkMaterialsPatchCall {
  6807  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6808  	return c
  6809  }
  6810  
  6811  // Context sets the context to be used in this call's Do method.
  6812  func (c *CoursesCourseWorkMaterialsPatchCall) Context(ctx context.Context) *CoursesCourseWorkMaterialsPatchCall {
  6813  	c.ctx_ = ctx
  6814  	return c
  6815  }
  6816  
  6817  // Header returns a http.Header that can be modified by the caller to add
  6818  // headers to the request.
  6819  func (c *CoursesCourseWorkMaterialsPatchCall) Header() http.Header {
  6820  	if c.header_ == nil {
  6821  		c.header_ = make(http.Header)
  6822  	}
  6823  	return c.header_
  6824  }
  6825  
  6826  func (c *CoursesCourseWorkMaterialsPatchCall) doRequest(alt string) (*http.Response, error) {
  6827  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  6828  	var body io.Reader = nil
  6829  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.courseworkmaterial)
  6830  	if err != nil {
  6831  		return nil, err
  6832  	}
  6833  	c.urlParams_.Set("alt", alt)
  6834  	c.urlParams_.Set("prettyPrint", "false")
  6835  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/courseWorkMaterials/{id}")
  6836  	urls += "?" + c.urlParams_.Encode()
  6837  	req, err := http.NewRequest("PATCH", urls, body)
  6838  	if err != nil {
  6839  		return nil, err
  6840  	}
  6841  	req.Header = reqHeaders
  6842  	googleapi.Expand(req.URL, map[string]string{
  6843  		"courseId": c.courseId,
  6844  		"id":       c.id,
  6845  	})
  6846  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6847  }
  6848  
  6849  // Do executes the "classroom.courses.courseWorkMaterials.patch" call.
  6850  // Any non-2xx status code is an error. Response headers are in either
  6851  // *CourseWorkMaterial.ServerResponse.Header or (if a response was returned at
  6852  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  6853  // check whether the returned error was because http.StatusNotModified was
  6854  // returned.
  6855  func (c *CoursesCourseWorkMaterialsPatchCall) Do(opts ...googleapi.CallOption) (*CourseWorkMaterial, error) {
  6856  	gensupport.SetOptions(c.urlParams_, opts...)
  6857  	res, err := c.doRequest("json")
  6858  	if res != nil && res.StatusCode == http.StatusNotModified {
  6859  		if res.Body != nil {
  6860  			res.Body.Close()
  6861  		}
  6862  		return nil, gensupport.WrapError(&googleapi.Error{
  6863  			Code:   res.StatusCode,
  6864  			Header: res.Header,
  6865  		})
  6866  	}
  6867  	if err != nil {
  6868  		return nil, err
  6869  	}
  6870  	defer googleapi.CloseBody(res)
  6871  	if err := googleapi.CheckResponse(res); err != nil {
  6872  		return nil, gensupport.WrapError(err)
  6873  	}
  6874  	ret := &CourseWorkMaterial{
  6875  		ServerResponse: googleapi.ServerResponse{
  6876  			Header:         res.Header,
  6877  			HTTPStatusCode: res.StatusCode,
  6878  		},
  6879  	}
  6880  	target := &ret
  6881  	if err := gensupport.DecodeResponse(target, res); err != nil {
  6882  		return nil, err
  6883  	}
  6884  	return ret, nil
  6885  }
  6886  
  6887  type CoursesStudentsCreateCall struct {
  6888  	s          *Service
  6889  	courseId   string
  6890  	student    *Student
  6891  	urlParams_ gensupport.URLParams
  6892  	ctx_       context.Context
  6893  	header_    http.Header
  6894  }
  6895  
  6896  // Create: Adds a user as a student of a course. Domain administrators are
  6897  // permitted to directly add
  6898  // (https://developers.google.com/classroom/guides/manage-users) users within
  6899  // their domain as students to courses within their domain. Students are
  6900  // permitted to add themselves to a course using an enrollment code. This
  6901  // method returns the following error codes: * `PERMISSION_DENIED` if the
  6902  // requesting user is not permitted to create students in this course or for
  6903  // access errors. * `NOT_FOUND` if the requested course ID does not exist. *
  6904  // `FAILED_PRECONDITION` if the requested user's account is disabled, for the
  6905  // following request errors: * CourseMemberLimitReached * CourseNotModifiable *
  6906  // UserGroupsMembershipLimitReached * InactiveCourseOwner * `ALREADY_EXISTS` if
  6907  // the user is already a student or teacher in the course.
  6908  //
  6909  //   - courseId: Identifier of the course to create the student in. This
  6910  //     identifier can be either the Classroom-assigned identifier or an alias.
  6911  func (r *CoursesStudentsService) Create(courseId string, student *Student) *CoursesStudentsCreateCall {
  6912  	c := &CoursesStudentsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  6913  	c.courseId = courseId
  6914  	c.student = student
  6915  	return c
  6916  }
  6917  
  6918  // EnrollmentCode sets the optional parameter "enrollmentCode": Enrollment code
  6919  // of the course to create the student in. This code is required if userId
  6920  // corresponds to the requesting user; it may be omitted if the requesting user
  6921  // has administrative permissions to create students for any user.
  6922  func (c *CoursesStudentsCreateCall) EnrollmentCode(enrollmentCode string) *CoursesStudentsCreateCall {
  6923  	c.urlParams_.Set("enrollmentCode", enrollmentCode)
  6924  	return c
  6925  }
  6926  
  6927  // Fields allows partial responses to be retrieved. See
  6928  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  6929  // details.
  6930  func (c *CoursesStudentsCreateCall) Fields(s ...googleapi.Field) *CoursesStudentsCreateCall {
  6931  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  6932  	return c
  6933  }
  6934  
  6935  // Context sets the context to be used in this call's Do method.
  6936  func (c *CoursesStudentsCreateCall) Context(ctx context.Context) *CoursesStudentsCreateCall {
  6937  	c.ctx_ = ctx
  6938  	return c
  6939  }
  6940  
  6941  // Header returns a http.Header that can be modified by the caller to add
  6942  // headers to the request.
  6943  func (c *CoursesStudentsCreateCall) Header() http.Header {
  6944  	if c.header_ == nil {
  6945  		c.header_ = make(http.Header)
  6946  	}
  6947  	return c.header_
  6948  }
  6949  
  6950  func (c *CoursesStudentsCreateCall) doRequest(alt string) (*http.Response, error) {
  6951  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  6952  	var body io.Reader = nil
  6953  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.student)
  6954  	if err != nil {
  6955  		return nil, err
  6956  	}
  6957  	c.urlParams_.Set("alt", alt)
  6958  	c.urlParams_.Set("prettyPrint", "false")
  6959  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/students")
  6960  	urls += "?" + c.urlParams_.Encode()
  6961  	req, err := http.NewRequest("POST", urls, body)
  6962  	if err != nil {
  6963  		return nil, err
  6964  	}
  6965  	req.Header = reqHeaders
  6966  	googleapi.Expand(req.URL, map[string]string{
  6967  		"courseId": c.courseId,
  6968  	})
  6969  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  6970  }
  6971  
  6972  // Do executes the "classroom.courses.students.create" call.
  6973  // Any non-2xx status code is an error. Response headers are in either
  6974  // *Student.ServerResponse.Header or (if a response was returned at all) in
  6975  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  6976  // whether the returned error was because http.StatusNotModified was returned.
  6977  func (c *CoursesStudentsCreateCall) Do(opts ...googleapi.CallOption) (*Student, error) {
  6978  	gensupport.SetOptions(c.urlParams_, opts...)
  6979  	res, err := c.doRequest("json")
  6980  	if res != nil && res.StatusCode == http.StatusNotModified {
  6981  		if res.Body != nil {
  6982  			res.Body.Close()
  6983  		}
  6984  		return nil, gensupport.WrapError(&googleapi.Error{
  6985  			Code:   res.StatusCode,
  6986  			Header: res.Header,
  6987  		})
  6988  	}
  6989  	if err != nil {
  6990  		return nil, err
  6991  	}
  6992  	defer googleapi.CloseBody(res)
  6993  	if err := googleapi.CheckResponse(res); err != nil {
  6994  		return nil, gensupport.WrapError(err)
  6995  	}
  6996  	ret := &Student{
  6997  		ServerResponse: googleapi.ServerResponse{
  6998  			Header:         res.Header,
  6999  			HTTPStatusCode: res.StatusCode,
  7000  		},
  7001  	}
  7002  	target := &ret
  7003  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7004  		return nil, err
  7005  	}
  7006  	return ret, nil
  7007  }
  7008  
  7009  type CoursesStudentsDeleteCall struct {
  7010  	s          *Service
  7011  	courseId   string
  7012  	userId     string
  7013  	urlParams_ gensupport.URLParams
  7014  	ctx_       context.Context
  7015  	header_    http.Header
  7016  }
  7017  
  7018  // Delete: Deletes a student of a course. This method returns the following
  7019  // error codes: * `PERMISSION_DENIED` if the requesting user is not permitted
  7020  // to delete students of this course or for access errors. * `NOT_FOUND` if no
  7021  // student of this course has the requested ID or if the course does not exist.
  7022  //
  7023  //   - courseId: Identifier of the course. This identifier can be either the
  7024  //     Classroom-assigned identifier or an alias.
  7025  //   - userId: Identifier of the student to delete. The identifier can be one of
  7026  //     the following: * the numeric identifier for the user * the email address
  7027  //     of the user * the string literal "me", indicating the requesting user.
  7028  func (r *CoursesStudentsService) Delete(courseId string, userId string) *CoursesStudentsDeleteCall {
  7029  	c := &CoursesStudentsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7030  	c.courseId = courseId
  7031  	c.userId = userId
  7032  	return c
  7033  }
  7034  
  7035  // Fields allows partial responses to be retrieved. See
  7036  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7037  // details.
  7038  func (c *CoursesStudentsDeleteCall) Fields(s ...googleapi.Field) *CoursesStudentsDeleteCall {
  7039  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7040  	return c
  7041  }
  7042  
  7043  // Context sets the context to be used in this call's Do method.
  7044  func (c *CoursesStudentsDeleteCall) Context(ctx context.Context) *CoursesStudentsDeleteCall {
  7045  	c.ctx_ = ctx
  7046  	return c
  7047  }
  7048  
  7049  // Header returns a http.Header that can be modified by the caller to add
  7050  // headers to the request.
  7051  func (c *CoursesStudentsDeleteCall) Header() http.Header {
  7052  	if c.header_ == nil {
  7053  		c.header_ = make(http.Header)
  7054  	}
  7055  	return c.header_
  7056  }
  7057  
  7058  func (c *CoursesStudentsDeleteCall) doRequest(alt string) (*http.Response, error) {
  7059  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  7060  	var body io.Reader = nil
  7061  	c.urlParams_.Set("alt", alt)
  7062  	c.urlParams_.Set("prettyPrint", "false")
  7063  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/students/{userId}")
  7064  	urls += "?" + c.urlParams_.Encode()
  7065  	req, err := http.NewRequest("DELETE", urls, body)
  7066  	if err != nil {
  7067  		return nil, err
  7068  	}
  7069  	req.Header = reqHeaders
  7070  	googleapi.Expand(req.URL, map[string]string{
  7071  		"courseId": c.courseId,
  7072  		"userId":   c.userId,
  7073  	})
  7074  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7075  }
  7076  
  7077  // Do executes the "classroom.courses.students.delete" call.
  7078  // Any non-2xx status code is an error. Response headers are in either
  7079  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  7080  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7081  // whether the returned error was because http.StatusNotModified was returned.
  7082  func (c *CoursesStudentsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  7083  	gensupport.SetOptions(c.urlParams_, opts...)
  7084  	res, err := c.doRequest("json")
  7085  	if res != nil && res.StatusCode == http.StatusNotModified {
  7086  		if res.Body != nil {
  7087  			res.Body.Close()
  7088  		}
  7089  		return nil, gensupport.WrapError(&googleapi.Error{
  7090  			Code:   res.StatusCode,
  7091  			Header: res.Header,
  7092  		})
  7093  	}
  7094  	if err != nil {
  7095  		return nil, err
  7096  	}
  7097  	defer googleapi.CloseBody(res)
  7098  	if err := googleapi.CheckResponse(res); err != nil {
  7099  		return nil, gensupport.WrapError(err)
  7100  	}
  7101  	ret := &Empty{
  7102  		ServerResponse: googleapi.ServerResponse{
  7103  			Header:         res.Header,
  7104  			HTTPStatusCode: res.StatusCode,
  7105  		},
  7106  	}
  7107  	target := &ret
  7108  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7109  		return nil, err
  7110  	}
  7111  	return ret, nil
  7112  }
  7113  
  7114  type CoursesStudentsGetCall struct {
  7115  	s            *Service
  7116  	courseId     string
  7117  	userId       string
  7118  	urlParams_   gensupport.URLParams
  7119  	ifNoneMatch_ string
  7120  	ctx_         context.Context
  7121  	header_      http.Header
  7122  }
  7123  
  7124  // Get: Returns a student of a course. This method returns the following error
  7125  // codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view
  7126  // students of this course or for access errors. * `NOT_FOUND` if no student of
  7127  // this course has the requested ID or if the course does not exist.
  7128  //
  7129  //   - courseId: Identifier of the course. This identifier can be either the
  7130  //     Classroom-assigned identifier or an alias.
  7131  //   - userId: Identifier of the student to return. The identifier can be one of
  7132  //     the following: * the numeric identifier for the user * the email address
  7133  //     of the user * the string literal "me", indicating the requesting user.
  7134  func (r *CoursesStudentsService) Get(courseId string, userId string) *CoursesStudentsGetCall {
  7135  	c := &CoursesStudentsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7136  	c.courseId = courseId
  7137  	c.userId = userId
  7138  	return c
  7139  }
  7140  
  7141  // Fields allows partial responses to be retrieved. See
  7142  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7143  // details.
  7144  func (c *CoursesStudentsGetCall) Fields(s ...googleapi.Field) *CoursesStudentsGetCall {
  7145  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7146  	return c
  7147  }
  7148  
  7149  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  7150  // object's ETag matches the given value. This is useful for getting updates
  7151  // only after the object has changed since the last request.
  7152  func (c *CoursesStudentsGetCall) IfNoneMatch(entityTag string) *CoursesStudentsGetCall {
  7153  	c.ifNoneMatch_ = entityTag
  7154  	return c
  7155  }
  7156  
  7157  // Context sets the context to be used in this call's Do method.
  7158  func (c *CoursesStudentsGetCall) Context(ctx context.Context) *CoursesStudentsGetCall {
  7159  	c.ctx_ = ctx
  7160  	return c
  7161  }
  7162  
  7163  // Header returns a http.Header that can be modified by the caller to add
  7164  // headers to the request.
  7165  func (c *CoursesStudentsGetCall) Header() http.Header {
  7166  	if c.header_ == nil {
  7167  		c.header_ = make(http.Header)
  7168  	}
  7169  	return c.header_
  7170  }
  7171  
  7172  func (c *CoursesStudentsGetCall) doRequest(alt string) (*http.Response, error) {
  7173  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  7174  	if c.ifNoneMatch_ != "" {
  7175  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7176  	}
  7177  	var body io.Reader = nil
  7178  	c.urlParams_.Set("alt", alt)
  7179  	c.urlParams_.Set("prettyPrint", "false")
  7180  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/students/{userId}")
  7181  	urls += "?" + c.urlParams_.Encode()
  7182  	req, err := http.NewRequest("GET", urls, body)
  7183  	if err != nil {
  7184  		return nil, err
  7185  	}
  7186  	req.Header = reqHeaders
  7187  	googleapi.Expand(req.URL, map[string]string{
  7188  		"courseId": c.courseId,
  7189  		"userId":   c.userId,
  7190  	})
  7191  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7192  }
  7193  
  7194  // Do executes the "classroom.courses.students.get" call.
  7195  // Any non-2xx status code is an error. Response headers are in either
  7196  // *Student.ServerResponse.Header or (if a response was returned at all) in
  7197  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7198  // whether the returned error was because http.StatusNotModified was returned.
  7199  func (c *CoursesStudentsGetCall) Do(opts ...googleapi.CallOption) (*Student, error) {
  7200  	gensupport.SetOptions(c.urlParams_, opts...)
  7201  	res, err := c.doRequest("json")
  7202  	if res != nil && res.StatusCode == http.StatusNotModified {
  7203  		if res.Body != nil {
  7204  			res.Body.Close()
  7205  		}
  7206  		return nil, gensupport.WrapError(&googleapi.Error{
  7207  			Code:   res.StatusCode,
  7208  			Header: res.Header,
  7209  		})
  7210  	}
  7211  	if err != nil {
  7212  		return nil, err
  7213  	}
  7214  	defer googleapi.CloseBody(res)
  7215  	if err := googleapi.CheckResponse(res); err != nil {
  7216  		return nil, gensupport.WrapError(err)
  7217  	}
  7218  	ret := &Student{
  7219  		ServerResponse: googleapi.ServerResponse{
  7220  			Header:         res.Header,
  7221  			HTTPStatusCode: res.StatusCode,
  7222  		},
  7223  	}
  7224  	target := &ret
  7225  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7226  		return nil, err
  7227  	}
  7228  	return ret, nil
  7229  }
  7230  
  7231  type CoursesStudentsListCall struct {
  7232  	s            *Service
  7233  	courseId     string
  7234  	urlParams_   gensupport.URLParams
  7235  	ifNoneMatch_ string
  7236  	ctx_         context.Context
  7237  	header_      http.Header
  7238  }
  7239  
  7240  // List: Returns a list of students of this course that the requester is
  7241  // permitted to view. This method returns the following error codes: *
  7242  // `NOT_FOUND` if the course does not exist. * `PERMISSION_DENIED` for access
  7243  // errors.
  7244  //
  7245  //   - courseId: Identifier of the course. This identifier can be either the
  7246  //     Classroom-assigned identifier or an alias.
  7247  func (r *CoursesStudentsService) List(courseId string) *CoursesStudentsListCall {
  7248  	c := &CoursesStudentsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7249  	c.courseId = courseId
  7250  	return c
  7251  }
  7252  
  7253  // PageSize sets the optional parameter "pageSize": Maximum number of items to
  7254  // return. The default is 30 if unspecified or `0`. The server may return fewer
  7255  // than the specified number of results.
  7256  func (c *CoursesStudentsListCall) PageSize(pageSize int64) *CoursesStudentsListCall {
  7257  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7258  	return c
  7259  }
  7260  
  7261  // PageToken sets the optional parameter "pageToken": nextPageToken value
  7262  // returned from a previous list call, indicating that the subsequent page of
  7263  // results should be returned. The list request must be otherwise identical to
  7264  // the one that resulted in this token.
  7265  func (c *CoursesStudentsListCall) PageToken(pageToken string) *CoursesStudentsListCall {
  7266  	c.urlParams_.Set("pageToken", pageToken)
  7267  	return c
  7268  }
  7269  
  7270  // Fields allows partial responses to be retrieved. See
  7271  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7272  // details.
  7273  func (c *CoursesStudentsListCall) Fields(s ...googleapi.Field) *CoursesStudentsListCall {
  7274  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7275  	return c
  7276  }
  7277  
  7278  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  7279  // object's ETag matches the given value. This is useful for getting updates
  7280  // only after the object has changed since the last request.
  7281  func (c *CoursesStudentsListCall) IfNoneMatch(entityTag string) *CoursesStudentsListCall {
  7282  	c.ifNoneMatch_ = entityTag
  7283  	return c
  7284  }
  7285  
  7286  // Context sets the context to be used in this call's Do method.
  7287  func (c *CoursesStudentsListCall) Context(ctx context.Context) *CoursesStudentsListCall {
  7288  	c.ctx_ = ctx
  7289  	return c
  7290  }
  7291  
  7292  // Header returns a http.Header that can be modified by the caller to add
  7293  // headers to the request.
  7294  func (c *CoursesStudentsListCall) Header() http.Header {
  7295  	if c.header_ == nil {
  7296  		c.header_ = make(http.Header)
  7297  	}
  7298  	return c.header_
  7299  }
  7300  
  7301  func (c *CoursesStudentsListCall) doRequest(alt string) (*http.Response, error) {
  7302  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  7303  	if c.ifNoneMatch_ != "" {
  7304  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7305  	}
  7306  	var body io.Reader = nil
  7307  	c.urlParams_.Set("alt", alt)
  7308  	c.urlParams_.Set("prettyPrint", "false")
  7309  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/students")
  7310  	urls += "?" + c.urlParams_.Encode()
  7311  	req, err := http.NewRequest("GET", urls, body)
  7312  	if err != nil {
  7313  		return nil, err
  7314  	}
  7315  	req.Header = reqHeaders
  7316  	googleapi.Expand(req.URL, map[string]string{
  7317  		"courseId": c.courseId,
  7318  	})
  7319  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7320  }
  7321  
  7322  // Do executes the "classroom.courses.students.list" call.
  7323  // Any non-2xx status code is an error. Response headers are in either
  7324  // *ListStudentsResponse.ServerResponse.Header or (if a response was returned
  7325  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7326  // check whether the returned error was because http.StatusNotModified was
  7327  // returned.
  7328  func (c *CoursesStudentsListCall) Do(opts ...googleapi.CallOption) (*ListStudentsResponse, error) {
  7329  	gensupport.SetOptions(c.urlParams_, opts...)
  7330  	res, err := c.doRequest("json")
  7331  	if res != nil && res.StatusCode == http.StatusNotModified {
  7332  		if res.Body != nil {
  7333  			res.Body.Close()
  7334  		}
  7335  		return nil, gensupport.WrapError(&googleapi.Error{
  7336  			Code:   res.StatusCode,
  7337  			Header: res.Header,
  7338  		})
  7339  	}
  7340  	if err != nil {
  7341  		return nil, err
  7342  	}
  7343  	defer googleapi.CloseBody(res)
  7344  	if err := googleapi.CheckResponse(res); err != nil {
  7345  		return nil, gensupport.WrapError(err)
  7346  	}
  7347  	ret := &ListStudentsResponse{
  7348  		ServerResponse: googleapi.ServerResponse{
  7349  			Header:         res.Header,
  7350  			HTTPStatusCode: res.StatusCode,
  7351  		},
  7352  	}
  7353  	target := &ret
  7354  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7355  		return nil, err
  7356  	}
  7357  	return ret, nil
  7358  }
  7359  
  7360  // Pages invokes f for each page of results.
  7361  // A non-nil error returned from f will halt the iteration.
  7362  // The provided context supersedes any context provided to the Context method.
  7363  func (c *CoursesStudentsListCall) Pages(ctx context.Context, f func(*ListStudentsResponse) error) error {
  7364  	c.ctx_ = ctx
  7365  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  7366  	for {
  7367  		x, err := c.Do()
  7368  		if err != nil {
  7369  			return err
  7370  		}
  7371  		if err := f(x); err != nil {
  7372  			return err
  7373  		}
  7374  		if x.NextPageToken == "" {
  7375  			return nil
  7376  		}
  7377  		c.PageToken(x.NextPageToken)
  7378  	}
  7379  }
  7380  
  7381  type CoursesTeachersCreateCall struct {
  7382  	s          *Service
  7383  	courseId   string
  7384  	teacher    *Teacher
  7385  	urlParams_ gensupport.URLParams
  7386  	ctx_       context.Context
  7387  	header_    http.Header
  7388  }
  7389  
  7390  // Create: Creates a teacher of a course. Domain administrators are permitted
  7391  // to directly add
  7392  // (https://developers.google.com/classroom/guides/manage-users) users within
  7393  // their domain as teachers to courses within their domain. Non-admin users
  7394  // should send an Invitation instead. This method returns the following error
  7395  // codes: * `PERMISSION_DENIED` if the requesting user is not permitted to
  7396  // create teachers in this course or for access errors. * `NOT_FOUND` if the
  7397  // requested course ID does not exist. * `FAILED_PRECONDITION` if the requested
  7398  // user's account is disabled, for the following request errors: *
  7399  // CourseMemberLimitReached * CourseNotModifiable * CourseTeacherLimitReached *
  7400  // UserGroupsMembershipLimitReached * InactiveCourseOwner * `ALREADY_EXISTS` if
  7401  // the user is already a teacher or student in the course.
  7402  //
  7403  //   - courseId: Identifier of the course. This identifier can be either the
  7404  //     Classroom-assigned identifier or an alias.
  7405  func (r *CoursesTeachersService) Create(courseId string, teacher *Teacher) *CoursesTeachersCreateCall {
  7406  	c := &CoursesTeachersCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7407  	c.courseId = courseId
  7408  	c.teacher = teacher
  7409  	return c
  7410  }
  7411  
  7412  // Fields allows partial responses to be retrieved. See
  7413  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7414  // details.
  7415  func (c *CoursesTeachersCreateCall) Fields(s ...googleapi.Field) *CoursesTeachersCreateCall {
  7416  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7417  	return c
  7418  }
  7419  
  7420  // Context sets the context to be used in this call's Do method.
  7421  func (c *CoursesTeachersCreateCall) Context(ctx context.Context) *CoursesTeachersCreateCall {
  7422  	c.ctx_ = ctx
  7423  	return c
  7424  }
  7425  
  7426  // Header returns a http.Header that can be modified by the caller to add
  7427  // headers to the request.
  7428  func (c *CoursesTeachersCreateCall) Header() http.Header {
  7429  	if c.header_ == nil {
  7430  		c.header_ = make(http.Header)
  7431  	}
  7432  	return c.header_
  7433  }
  7434  
  7435  func (c *CoursesTeachersCreateCall) doRequest(alt string) (*http.Response, error) {
  7436  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  7437  	var body io.Reader = nil
  7438  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.teacher)
  7439  	if err != nil {
  7440  		return nil, err
  7441  	}
  7442  	c.urlParams_.Set("alt", alt)
  7443  	c.urlParams_.Set("prettyPrint", "false")
  7444  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/teachers")
  7445  	urls += "?" + c.urlParams_.Encode()
  7446  	req, err := http.NewRequest("POST", urls, body)
  7447  	if err != nil {
  7448  		return nil, err
  7449  	}
  7450  	req.Header = reqHeaders
  7451  	googleapi.Expand(req.URL, map[string]string{
  7452  		"courseId": c.courseId,
  7453  	})
  7454  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7455  }
  7456  
  7457  // Do executes the "classroom.courses.teachers.create" call.
  7458  // Any non-2xx status code is an error. Response headers are in either
  7459  // *Teacher.ServerResponse.Header or (if a response was returned at all) in
  7460  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7461  // whether the returned error was because http.StatusNotModified was returned.
  7462  func (c *CoursesTeachersCreateCall) Do(opts ...googleapi.CallOption) (*Teacher, error) {
  7463  	gensupport.SetOptions(c.urlParams_, opts...)
  7464  	res, err := c.doRequest("json")
  7465  	if res != nil && res.StatusCode == http.StatusNotModified {
  7466  		if res.Body != nil {
  7467  			res.Body.Close()
  7468  		}
  7469  		return nil, gensupport.WrapError(&googleapi.Error{
  7470  			Code:   res.StatusCode,
  7471  			Header: res.Header,
  7472  		})
  7473  	}
  7474  	if err != nil {
  7475  		return nil, err
  7476  	}
  7477  	defer googleapi.CloseBody(res)
  7478  	if err := googleapi.CheckResponse(res); err != nil {
  7479  		return nil, gensupport.WrapError(err)
  7480  	}
  7481  	ret := &Teacher{
  7482  		ServerResponse: googleapi.ServerResponse{
  7483  			Header:         res.Header,
  7484  			HTTPStatusCode: res.StatusCode,
  7485  		},
  7486  	}
  7487  	target := &ret
  7488  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7489  		return nil, err
  7490  	}
  7491  	return ret, nil
  7492  }
  7493  
  7494  type CoursesTeachersDeleteCall struct {
  7495  	s          *Service
  7496  	courseId   string
  7497  	userId     string
  7498  	urlParams_ gensupport.URLParams
  7499  	ctx_       context.Context
  7500  	header_    http.Header
  7501  }
  7502  
  7503  // Delete: Removes the specified teacher from the specified course. This method
  7504  // returns the following error codes: * `PERMISSION_DENIED` if the requesting
  7505  // user is not permitted to delete teachers of this course or for access
  7506  // errors. * `NOT_FOUND` if no teacher of this course has the requested ID or
  7507  // if the course does not exist. * `FAILED_PRECONDITION` if the requested ID
  7508  // belongs to the primary teacher of this course. * `FAILED_PRECONDITION` if
  7509  // the requested ID belongs to the owner of the course Drive folder. *
  7510  // `FAILED_PRECONDITION` if the course no longer has an active owner.
  7511  //
  7512  //   - courseId: Identifier of the course. This identifier can be either the
  7513  //     Classroom-assigned identifier or an alias.
  7514  //   - userId: Identifier of the teacher to delete. The identifier can be one of
  7515  //     the following: * the numeric identifier for the user * the email address
  7516  //     of the user * the string literal "me", indicating the requesting user.
  7517  func (r *CoursesTeachersService) Delete(courseId string, userId string) *CoursesTeachersDeleteCall {
  7518  	c := &CoursesTeachersDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7519  	c.courseId = courseId
  7520  	c.userId = userId
  7521  	return c
  7522  }
  7523  
  7524  // Fields allows partial responses to be retrieved. See
  7525  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7526  // details.
  7527  func (c *CoursesTeachersDeleteCall) Fields(s ...googleapi.Field) *CoursesTeachersDeleteCall {
  7528  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7529  	return c
  7530  }
  7531  
  7532  // Context sets the context to be used in this call's Do method.
  7533  func (c *CoursesTeachersDeleteCall) Context(ctx context.Context) *CoursesTeachersDeleteCall {
  7534  	c.ctx_ = ctx
  7535  	return c
  7536  }
  7537  
  7538  // Header returns a http.Header that can be modified by the caller to add
  7539  // headers to the request.
  7540  func (c *CoursesTeachersDeleteCall) Header() http.Header {
  7541  	if c.header_ == nil {
  7542  		c.header_ = make(http.Header)
  7543  	}
  7544  	return c.header_
  7545  }
  7546  
  7547  func (c *CoursesTeachersDeleteCall) doRequest(alt string) (*http.Response, error) {
  7548  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  7549  	var body io.Reader = nil
  7550  	c.urlParams_.Set("alt", alt)
  7551  	c.urlParams_.Set("prettyPrint", "false")
  7552  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/teachers/{userId}")
  7553  	urls += "?" + c.urlParams_.Encode()
  7554  	req, err := http.NewRequest("DELETE", urls, body)
  7555  	if err != nil {
  7556  		return nil, err
  7557  	}
  7558  	req.Header = reqHeaders
  7559  	googleapi.Expand(req.URL, map[string]string{
  7560  		"courseId": c.courseId,
  7561  		"userId":   c.userId,
  7562  	})
  7563  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7564  }
  7565  
  7566  // Do executes the "classroom.courses.teachers.delete" call.
  7567  // Any non-2xx status code is an error. Response headers are in either
  7568  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  7569  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7570  // whether the returned error was because http.StatusNotModified was returned.
  7571  func (c *CoursesTeachersDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  7572  	gensupport.SetOptions(c.urlParams_, opts...)
  7573  	res, err := c.doRequest("json")
  7574  	if res != nil && res.StatusCode == http.StatusNotModified {
  7575  		if res.Body != nil {
  7576  			res.Body.Close()
  7577  		}
  7578  		return nil, gensupport.WrapError(&googleapi.Error{
  7579  			Code:   res.StatusCode,
  7580  			Header: res.Header,
  7581  		})
  7582  	}
  7583  	if err != nil {
  7584  		return nil, err
  7585  	}
  7586  	defer googleapi.CloseBody(res)
  7587  	if err := googleapi.CheckResponse(res); err != nil {
  7588  		return nil, gensupport.WrapError(err)
  7589  	}
  7590  	ret := &Empty{
  7591  		ServerResponse: googleapi.ServerResponse{
  7592  			Header:         res.Header,
  7593  			HTTPStatusCode: res.StatusCode,
  7594  		},
  7595  	}
  7596  	target := &ret
  7597  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7598  		return nil, err
  7599  	}
  7600  	return ret, nil
  7601  }
  7602  
  7603  type CoursesTeachersGetCall struct {
  7604  	s            *Service
  7605  	courseId     string
  7606  	userId       string
  7607  	urlParams_   gensupport.URLParams
  7608  	ifNoneMatch_ string
  7609  	ctx_         context.Context
  7610  	header_      http.Header
  7611  }
  7612  
  7613  // Get: Returns a teacher of a course. This method returns the following error
  7614  // codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view
  7615  // teachers of this course or for access errors. * `NOT_FOUND` if no teacher of
  7616  // this course has the requested ID or if the course does not exist.
  7617  //
  7618  //   - courseId: Identifier of the course. This identifier can be either the
  7619  //     Classroom-assigned identifier or an alias.
  7620  //   - userId: Identifier of the teacher to return. The identifier can be one of
  7621  //     the following: * the numeric identifier for the user * the email address
  7622  //     of the user * the string literal "me", indicating the requesting user.
  7623  func (r *CoursesTeachersService) Get(courseId string, userId string) *CoursesTeachersGetCall {
  7624  	c := &CoursesTeachersGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7625  	c.courseId = courseId
  7626  	c.userId = userId
  7627  	return c
  7628  }
  7629  
  7630  // Fields allows partial responses to be retrieved. See
  7631  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7632  // details.
  7633  func (c *CoursesTeachersGetCall) Fields(s ...googleapi.Field) *CoursesTeachersGetCall {
  7634  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7635  	return c
  7636  }
  7637  
  7638  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  7639  // object's ETag matches the given value. This is useful for getting updates
  7640  // only after the object has changed since the last request.
  7641  func (c *CoursesTeachersGetCall) IfNoneMatch(entityTag string) *CoursesTeachersGetCall {
  7642  	c.ifNoneMatch_ = entityTag
  7643  	return c
  7644  }
  7645  
  7646  // Context sets the context to be used in this call's Do method.
  7647  func (c *CoursesTeachersGetCall) Context(ctx context.Context) *CoursesTeachersGetCall {
  7648  	c.ctx_ = ctx
  7649  	return c
  7650  }
  7651  
  7652  // Header returns a http.Header that can be modified by the caller to add
  7653  // headers to the request.
  7654  func (c *CoursesTeachersGetCall) Header() http.Header {
  7655  	if c.header_ == nil {
  7656  		c.header_ = make(http.Header)
  7657  	}
  7658  	return c.header_
  7659  }
  7660  
  7661  func (c *CoursesTeachersGetCall) doRequest(alt string) (*http.Response, error) {
  7662  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  7663  	if c.ifNoneMatch_ != "" {
  7664  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7665  	}
  7666  	var body io.Reader = nil
  7667  	c.urlParams_.Set("alt", alt)
  7668  	c.urlParams_.Set("prettyPrint", "false")
  7669  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/teachers/{userId}")
  7670  	urls += "?" + c.urlParams_.Encode()
  7671  	req, err := http.NewRequest("GET", urls, body)
  7672  	if err != nil {
  7673  		return nil, err
  7674  	}
  7675  	req.Header = reqHeaders
  7676  	googleapi.Expand(req.URL, map[string]string{
  7677  		"courseId": c.courseId,
  7678  		"userId":   c.userId,
  7679  	})
  7680  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7681  }
  7682  
  7683  // Do executes the "classroom.courses.teachers.get" call.
  7684  // Any non-2xx status code is an error. Response headers are in either
  7685  // *Teacher.ServerResponse.Header or (if a response was returned at all) in
  7686  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7687  // whether the returned error was because http.StatusNotModified was returned.
  7688  func (c *CoursesTeachersGetCall) Do(opts ...googleapi.CallOption) (*Teacher, error) {
  7689  	gensupport.SetOptions(c.urlParams_, opts...)
  7690  	res, err := c.doRequest("json")
  7691  	if res != nil && res.StatusCode == http.StatusNotModified {
  7692  		if res.Body != nil {
  7693  			res.Body.Close()
  7694  		}
  7695  		return nil, gensupport.WrapError(&googleapi.Error{
  7696  			Code:   res.StatusCode,
  7697  			Header: res.Header,
  7698  		})
  7699  	}
  7700  	if err != nil {
  7701  		return nil, err
  7702  	}
  7703  	defer googleapi.CloseBody(res)
  7704  	if err := googleapi.CheckResponse(res); err != nil {
  7705  		return nil, gensupport.WrapError(err)
  7706  	}
  7707  	ret := &Teacher{
  7708  		ServerResponse: googleapi.ServerResponse{
  7709  			Header:         res.Header,
  7710  			HTTPStatusCode: res.StatusCode,
  7711  		},
  7712  	}
  7713  	target := &ret
  7714  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7715  		return nil, err
  7716  	}
  7717  	return ret, nil
  7718  }
  7719  
  7720  type CoursesTeachersListCall struct {
  7721  	s            *Service
  7722  	courseId     string
  7723  	urlParams_   gensupport.URLParams
  7724  	ifNoneMatch_ string
  7725  	ctx_         context.Context
  7726  	header_      http.Header
  7727  }
  7728  
  7729  // List: Returns a list of teachers of this course that the requester is
  7730  // permitted to view. This method returns the following error codes: *
  7731  // `NOT_FOUND` if the course does not exist. * `PERMISSION_DENIED` for access
  7732  // errors.
  7733  //
  7734  //   - courseId: Identifier of the course. This identifier can be either the
  7735  //     Classroom-assigned identifier or an alias.
  7736  func (r *CoursesTeachersService) List(courseId string) *CoursesTeachersListCall {
  7737  	c := &CoursesTeachersListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7738  	c.courseId = courseId
  7739  	return c
  7740  }
  7741  
  7742  // PageSize sets the optional parameter "pageSize": Maximum number of items to
  7743  // return. The default is 30 if unspecified or `0`. The server may return fewer
  7744  // than the specified number of results.
  7745  func (c *CoursesTeachersListCall) PageSize(pageSize int64) *CoursesTeachersListCall {
  7746  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  7747  	return c
  7748  }
  7749  
  7750  // PageToken sets the optional parameter "pageToken": nextPageToken value
  7751  // returned from a previous list call, indicating that the subsequent page of
  7752  // results should be returned. The list request must be otherwise identical to
  7753  // the one that resulted in this token.
  7754  func (c *CoursesTeachersListCall) PageToken(pageToken string) *CoursesTeachersListCall {
  7755  	c.urlParams_.Set("pageToken", pageToken)
  7756  	return c
  7757  }
  7758  
  7759  // Fields allows partial responses to be retrieved. See
  7760  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7761  // details.
  7762  func (c *CoursesTeachersListCall) Fields(s ...googleapi.Field) *CoursesTeachersListCall {
  7763  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7764  	return c
  7765  }
  7766  
  7767  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  7768  // object's ETag matches the given value. This is useful for getting updates
  7769  // only after the object has changed since the last request.
  7770  func (c *CoursesTeachersListCall) IfNoneMatch(entityTag string) *CoursesTeachersListCall {
  7771  	c.ifNoneMatch_ = entityTag
  7772  	return c
  7773  }
  7774  
  7775  // Context sets the context to be used in this call's Do method.
  7776  func (c *CoursesTeachersListCall) Context(ctx context.Context) *CoursesTeachersListCall {
  7777  	c.ctx_ = ctx
  7778  	return c
  7779  }
  7780  
  7781  // Header returns a http.Header that can be modified by the caller to add
  7782  // headers to the request.
  7783  func (c *CoursesTeachersListCall) Header() http.Header {
  7784  	if c.header_ == nil {
  7785  		c.header_ = make(http.Header)
  7786  	}
  7787  	return c.header_
  7788  }
  7789  
  7790  func (c *CoursesTeachersListCall) doRequest(alt string) (*http.Response, error) {
  7791  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  7792  	if c.ifNoneMatch_ != "" {
  7793  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  7794  	}
  7795  	var body io.Reader = nil
  7796  	c.urlParams_.Set("alt", alt)
  7797  	c.urlParams_.Set("prettyPrint", "false")
  7798  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/teachers")
  7799  	urls += "?" + c.urlParams_.Encode()
  7800  	req, err := http.NewRequest("GET", urls, body)
  7801  	if err != nil {
  7802  		return nil, err
  7803  	}
  7804  	req.Header = reqHeaders
  7805  	googleapi.Expand(req.URL, map[string]string{
  7806  		"courseId": c.courseId,
  7807  	})
  7808  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7809  }
  7810  
  7811  // Do executes the "classroom.courses.teachers.list" call.
  7812  // Any non-2xx status code is an error. Response headers are in either
  7813  // *ListTeachersResponse.ServerResponse.Header or (if a response was returned
  7814  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  7815  // check whether the returned error was because http.StatusNotModified was
  7816  // returned.
  7817  func (c *CoursesTeachersListCall) Do(opts ...googleapi.CallOption) (*ListTeachersResponse, error) {
  7818  	gensupport.SetOptions(c.urlParams_, opts...)
  7819  	res, err := c.doRequest("json")
  7820  	if res != nil && res.StatusCode == http.StatusNotModified {
  7821  		if res.Body != nil {
  7822  			res.Body.Close()
  7823  		}
  7824  		return nil, gensupport.WrapError(&googleapi.Error{
  7825  			Code:   res.StatusCode,
  7826  			Header: res.Header,
  7827  		})
  7828  	}
  7829  	if err != nil {
  7830  		return nil, err
  7831  	}
  7832  	defer googleapi.CloseBody(res)
  7833  	if err := googleapi.CheckResponse(res); err != nil {
  7834  		return nil, gensupport.WrapError(err)
  7835  	}
  7836  	ret := &ListTeachersResponse{
  7837  		ServerResponse: googleapi.ServerResponse{
  7838  			Header:         res.Header,
  7839  			HTTPStatusCode: res.StatusCode,
  7840  		},
  7841  	}
  7842  	target := &ret
  7843  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7844  		return nil, err
  7845  	}
  7846  	return ret, nil
  7847  }
  7848  
  7849  // Pages invokes f for each page of results.
  7850  // A non-nil error returned from f will halt the iteration.
  7851  // The provided context supersedes any context provided to the Context method.
  7852  func (c *CoursesTeachersListCall) Pages(ctx context.Context, f func(*ListTeachersResponse) error) error {
  7853  	c.ctx_ = ctx
  7854  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  7855  	for {
  7856  		x, err := c.Do()
  7857  		if err != nil {
  7858  			return err
  7859  		}
  7860  		if err := f(x); err != nil {
  7861  			return err
  7862  		}
  7863  		if x.NextPageToken == "" {
  7864  			return nil
  7865  		}
  7866  		c.PageToken(x.NextPageToken)
  7867  	}
  7868  }
  7869  
  7870  type CoursesTopicsCreateCall struct {
  7871  	s          *Service
  7872  	courseId   string
  7873  	topic      *Topic
  7874  	urlParams_ gensupport.URLParams
  7875  	ctx_       context.Context
  7876  	header_    http.Header
  7877  }
  7878  
  7879  // Create: Creates a topic. This method returns the following error codes: *
  7880  // `PERMISSION_DENIED` if the requesting user is not permitted to access the
  7881  // requested course, create a topic in the requested course, or for access
  7882  // errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if
  7883  // the requested course does not exist.
  7884  //
  7885  //   - courseId: Identifier of the course. This identifier can be either the
  7886  //     Classroom-assigned identifier or an alias.
  7887  func (r *CoursesTopicsService) Create(courseId string, topic *Topic) *CoursesTopicsCreateCall {
  7888  	c := &CoursesTopicsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7889  	c.courseId = courseId
  7890  	c.topic = topic
  7891  	return c
  7892  }
  7893  
  7894  // Fields allows partial responses to be retrieved. See
  7895  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  7896  // details.
  7897  func (c *CoursesTopicsCreateCall) Fields(s ...googleapi.Field) *CoursesTopicsCreateCall {
  7898  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  7899  	return c
  7900  }
  7901  
  7902  // Context sets the context to be used in this call's Do method.
  7903  func (c *CoursesTopicsCreateCall) Context(ctx context.Context) *CoursesTopicsCreateCall {
  7904  	c.ctx_ = ctx
  7905  	return c
  7906  }
  7907  
  7908  // Header returns a http.Header that can be modified by the caller to add
  7909  // headers to the request.
  7910  func (c *CoursesTopicsCreateCall) Header() http.Header {
  7911  	if c.header_ == nil {
  7912  		c.header_ = make(http.Header)
  7913  	}
  7914  	return c.header_
  7915  }
  7916  
  7917  func (c *CoursesTopicsCreateCall) doRequest(alt string) (*http.Response, error) {
  7918  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  7919  	var body io.Reader = nil
  7920  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.topic)
  7921  	if err != nil {
  7922  		return nil, err
  7923  	}
  7924  	c.urlParams_.Set("alt", alt)
  7925  	c.urlParams_.Set("prettyPrint", "false")
  7926  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/topics")
  7927  	urls += "?" + c.urlParams_.Encode()
  7928  	req, err := http.NewRequest("POST", urls, body)
  7929  	if err != nil {
  7930  		return nil, err
  7931  	}
  7932  	req.Header = reqHeaders
  7933  	googleapi.Expand(req.URL, map[string]string{
  7934  		"courseId": c.courseId,
  7935  	})
  7936  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  7937  }
  7938  
  7939  // Do executes the "classroom.courses.topics.create" call.
  7940  // Any non-2xx status code is an error. Response headers are in either
  7941  // *Topic.ServerResponse.Header or (if a response was returned at all) in
  7942  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  7943  // whether the returned error was because http.StatusNotModified was returned.
  7944  func (c *CoursesTopicsCreateCall) Do(opts ...googleapi.CallOption) (*Topic, error) {
  7945  	gensupport.SetOptions(c.urlParams_, opts...)
  7946  	res, err := c.doRequest("json")
  7947  	if res != nil && res.StatusCode == http.StatusNotModified {
  7948  		if res.Body != nil {
  7949  			res.Body.Close()
  7950  		}
  7951  		return nil, gensupport.WrapError(&googleapi.Error{
  7952  			Code:   res.StatusCode,
  7953  			Header: res.Header,
  7954  		})
  7955  	}
  7956  	if err != nil {
  7957  		return nil, err
  7958  	}
  7959  	defer googleapi.CloseBody(res)
  7960  	if err := googleapi.CheckResponse(res); err != nil {
  7961  		return nil, gensupport.WrapError(err)
  7962  	}
  7963  	ret := &Topic{
  7964  		ServerResponse: googleapi.ServerResponse{
  7965  			Header:         res.Header,
  7966  			HTTPStatusCode: res.StatusCode,
  7967  		},
  7968  	}
  7969  	target := &ret
  7970  	if err := gensupport.DecodeResponse(target, res); err != nil {
  7971  		return nil, err
  7972  	}
  7973  	return ret, nil
  7974  }
  7975  
  7976  type CoursesTopicsDeleteCall struct {
  7977  	s          *Service
  7978  	courseId   string
  7979  	id         string
  7980  	urlParams_ gensupport.URLParams
  7981  	ctx_       context.Context
  7982  	header_    http.Header
  7983  }
  7984  
  7985  // Delete: Deletes a topic. This method returns the following error codes: *
  7986  // `PERMISSION_DENIED` if the requesting user is not allowed to delete the
  7987  // requested topic or for access errors. * `FAILED_PRECONDITION` if the
  7988  // requested topic has already been deleted. * `NOT_FOUND` if no course or
  7989  // topic exists with the requested ID.
  7990  //
  7991  //   - courseId: Identifier of the course. This identifier can be either the
  7992  //     Classroom-assigned identifier or an alias.
  7993  //   - id: Identifier of the topic to delete.
  7994  func (r *CoursesTopicsService) Delete(courseId string, id string) *CoursesTopicsDeleteCall {
  7995  	c := &CoursesTopicsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  7996  	c.courseId = courseId
  7997  	c.id = id
  7998  	return c
  7999  }
  8000  
  8001  // Fields allows partial responses to be retrieved. See
  8002  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  8003  // details.
  8004  func (c *CoursesTopicsDeleteCall) Fields(s ...googleapi.Field) *CoursesTopicsDeleteCall {
  8005  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8006  	return c
  8007  }
  8008  
  8009  // Context sets the context to be used in this call's Do method.
  8010  func (c *CoursesTopicsDeleteCall) Context(ctx context.Context) *CoursesTopicsDeleteCall {
  8011  	c.ctx_ = ctx
  8012  	return c
  8013  }
  8014  
  8015  // Header returns a http.Header that can be modified by the caller to add
  8016  // headers to the request.
  8017  func (c *CoursesTopicsDeleteCall) Header() http.Header {
  8018  	if c.header_ == nil {
  8019  		c.header_ = make(http.Header)
  8020  	}
  8021  	return c.header_
  8022  }
  8023  
  8024  func (c *CoursesTopicsDeleteCall) doRequest(alt string) (*http.Response, error) {
  8025  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  8026  	var body io.Reader = nil
  8027  	c.urlParams_.Set("alt", alt)
  8028  	c.urlParams_.Set("prettyPrint", "false")
  8029  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/topics/{id}")
  8030  	urls += "?" + c.urlParams_.Encode()
  8031  	req, err := http.NewRequest("DELETE", urls, body)
  8032  	if err != nil {
  8033  		return nil, err
  8034  	}
  8035  	req.Header = reqHeaders
  8036  	googleapi.Expand(req.URL, map[string]string{
  8037  		"courseId": c.courseId,
  8038  		"id":       c.id,
  8039  	})
  8040  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8041  }
  8042  
  8043  // Do executes the "classroom.courses.topics.delete" call.
  8044  // Any non-2xx status code is an error. Response headers are in either
  8045  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  8046  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8047  // whether the returned error was because http.StatusNotModified was returned.
  8048  func (c *CoursesTopicsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  8049  	gensupport.SetOptions(c.urlParams_, opts...)
  8050  	res, err := c.doRequest("json")
  8051  	if res != nil && res.StatusCode == http.StatusNotModified {
  8052  		if res.Body != nil {
  8053  			res.Body.Close()
  8054  		}
  8055  		return nil, gensupport.WrapError(&googleapi.Error{
  8056  			Code:   res.StatusCode,
  8057  			Header: res.Header,
  8058  		})
  8059  	}
  8060  	if err != nil {
  8061  		return nil, err
  8062  	}
  8063  	defer googleapi.CloseBody(res)
  8064  	if err := googleapi.CheckResponse(res); err != nil {
  8065  		return nil, gensupport.WrapError(err)
  8066  	}
  8067  	ret := &Empty{
  8068  		ServerResponse: googleapi.ServerResponse{
  8069  			Header:         res.Header,
  8070  			HTTPStatusCode: res.StatusCode,
  8071  		},
  8072  	}
  8073  	target := &ret
  8074  	if err := gensupport.DecodeResponse(target, res); err != nil {
  8075  		return nil, err
  8076  	}
  8077  	return ret, nil
  8078  }
  8079  
  8080  type CoursesTopicsGetCall struct {
  8081  	s            *Service
  8082  	courseId     string
  8083  	id           string
  8084  	urlParams_   gensupport.URLParams
  8085  	ifNoneMatch_ string
  8086  	ctx_         context.Context
  8087  	header_      http.Header
  8088  }
  8089  
  8090  // Get: Returns a topic. This method returns the following error codes: *
  8091  // `PERMISSION_DENIED` if the requesting user is not permitted to access the
  8092  // requested course or topic, or for access errors. * `INVALID_ARGUMENT` if the
  8093  // request is malformed. * `NOT_FOUND` if the requested course or topic does
  8094  // not exist.
  8095  //
  8096  // - courseId: Identifier of the course.
  8097  // - id: Identifier of the topic.
  8098  func (r *CoursesTopicsService) Get(courseId string, id string) *CoursesTopicsGetCall {
  8099  	c := &CoursesTopicsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8100  	c.courseId = courseId
  8101  	c.id = id
  8102  	return c
  8103  }
  8104  
  8105  // Fields allows partial responses to be retrieved. See
  8106  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  8107  // details.
  8108  func (c *CoursesTopicsGetCall) Fields(s ...googleapi.Field) *CoursesTopicsGetCall {
  8109  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8110  	return c
  8111  }
  8112  
  8113  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  8114  // object's ETag matches the given value. This is useful for getting updates
  8115  // only after the object has changed since the last request.
  8116  func (c *CoursesTopicsGetCall) IfNoneMatch(entityTag string) *CoursesTopicsGetCall {
  8117  	c.ifNoneMatch_ = entityTag
  8118  	return c
  8119  }
  8120  
  8121  // Context sets the context to be used in this call's Do method.
  8122  func (c *CoursesTopicsGetCall) Context(ctx context.Context) *CoursesTopicsGetCall {
  8123  	c.ctx_ = ctx
  8124  	return c
  8125  }
  8126  
  8127  // Header returns a http.Header that can be modified by the caller to add
  8128  // headers to the request.
  8129  func (c *CoursesTopicsGetCall) Header() http.Header {
  8130  	if c.header_ == nil {
  8131  		c.header_ = make(http.Header)
  8132  	}
  8133  	return c.header_
  8134  }
  8135  
  8136  func (c *CoursesTopicsGetCall) doRequest(alt string) (*http.Response, error) {
  8137  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  8138  	if c.ifNoneMatch_ != "" {
  8139  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8140  	}
  8141  	var body io.Reader = nil
  8142  	c.urlParams_.Set("alt", alt)
  8143  	c.urlParams_.Set("prettyPrint", "false")
  8144  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/topics/{id}")
  8145  	urls += "?" + c.urlParams_.Encode()
  8146  	req, err := http.NewRequest("GET", urls, body)
  8147  	if err != nil {
  8148  		return nil, err
  8149  	}
  8150  	req.Header = reqHeaders
  8151  	googleapi.Expand(req.URL, map[string]string{
  8152  		"courseId": c.courseId,
  8153  		"id":       c.id,
  8154  	})
  8155  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8156  }
  8157  
  8158  // Do executes the "classroom.courses.topics.get" call.
  8159  // Any non-2xx status code is an error. Response headers are in either
  8160  // *Topic.ServerResponse.Header or (if a response was returned at all) in
  8161  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8162  // whether the returned error was because http.StatusNotModified was returned.
  8163  func (c *CoursesTopicsGetCall) Do(opts ...googleapi.CallOption) (*Topic, error) {
  8164  	gensupport.SetOptions(c.urlParams_, opts...)
  8165  	res, err := c.doRequest("json")
  8166  	if res != nil && res.StatusCode == http.StatusNotModified {
  8167  		if res.Body != nil {
  8168  			res.Body.Close()
  8169  		}
  8170  		return nil, gensupport.WrapError(&googleapi.Error{
  8171  			Code:   res.StatusCode,
  8172  			Header: res.Header,
  8173  		})
  8174  	}
  8175  	if err != nil {
  8176  		return nil, err
  8177  	}
  8178  	defer googleapi.CloseBody(res)
  8179  	if err := googleapi.CheckResponse(res); err != nil {
  8180  		return nil, gensupport.WrapError(err)
  8181  	}
  8182  	ret := &Topic{
  8183  		ServerResponse: googleapi.ServerResponse{
  8184  			Header:         res.Header,
  8185  			HTTPStatusCode: res.StatusCode,
  8186  		},
  8187  	}
  8188  	target := &ret
  8189  	if err := gensupport.DecodeResponse(target, res); err != nil {
  8190  		return nil, err
  8191  	}
  8192  	return ret, nil
  8193  }
  8194  
  8195  type CoursesTopicsListCall struct {
  8196  	s            *Service
  8197  	courseId     string
  8198  	urlParams_   gensupport.URLParams
  8199  	ifNoneMatch_ string
  8200  	ctx_         context.Context
  8201  	header_      http.Header
  8202  }
  8203  
  8204  // List: Returns the list of topics that the requester is permitted to view.
  8205  // This method returns the following error codes: * `PERMISSION_DENIED` if the
  8206  // requesting user is not permitted to access the requested course or for
  8207  // access errors. * `INVALID_ARGUMENT` if the request is malformed. *
  8208  // `NOT_FOUND` if the requested course does not exist.
  8209  //
  8210  //   - courseId: Identifier of the course. This identifier can be either the
  8211  //     Classroom-assigned identifier or an alias.
  8212  func (r *CoursesTopicsService) List(courseId string) *CoursesTopicsListCall {
  8213  	c := &CoursesTopicsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8214  	c.courseId = courseId
  8215  	return c
  8216  }
  8217  
  8218  // PageSize sets the optional parameter "pageSize": Maximum number of items to
  8219  // return. Zero or unspecified indicates that the server may assign a maximum.
  8220  // The server may return fewer than the specified number of results.
  8221  func (c *CoursesTopicsListCall) PageSize(pageSize int64) *CoursesTopicsListCall {
  8222  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  8223  	return c
  8224  }
  8225  
  8226  // PageToken sets the optional parameter "pageToken": nextPageToken value
  8227  // returned from a previous list call, indicating that the subsequent page of
  8228  // results should be returned. The list request must be otherwise identical to
  8229  // the one that resulted in this token.
  8230  func (c *CoursesTopicsListCall) PageToken(pageToken string) *CoursesTopicsListCall {
  8231  	c.urlParams_.Set("pageToken", pageToken)
  8232  	return c
  8233  }
  8234  
  8235  // Fields allows partial responses to be retrieved. See
  8236  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  8237  // details.
  8238  func (c *CoursesTopicsListCall) Fields(s ...googleapi.Field) *CoursesTopicsListCall {
  8239  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8240  	return c
  8241  }
  8242  
  8243  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  8244  // object's ETag matches the given value. This is useful for getting updates
  8245  // only after the object has changed since the last request.
  8246  func (c *CoursesTopicsListCall) IfNoneMatch(entityTag string) *CoursesTopicsListCall {
  8247  	c.ifNoneMatch_ = entityTag
  8248  	return c
  8249  }
  8250  
  8251  // Context sets the context to be used in this call's Do method.
  8252  func (c *CoursesTopicsListCall) Context(ctx context.Context) *CoursesTopicsListCall {
  8253  	c.ctx_ = ctx
  8254  	return c
  8255  }
  8256  
  8257  // Header returns a http.Header that can be modified by the caller to add
  8258  // headers to the request.
  8259  func (c *CoursesTopicsListCall) Header() http.Header {
  8260  	if c.header_ == nil {
  8261  		c.header_ = make(http.Header)
  8262  	}
  8263  	return c.header_
  8264  }
  8265  
  8266  func (c *CoursesTopicsListCall) doRequest(alt string) (*http.Response, error) {
  8267  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  8268  	if c.ifNoneMatch_ != "" {
  8269  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8270  	}
  8271  	var body io.Reader = nil
  8272  	c.urlParams_.Set("alt", alt)
  8273  	c.urlParams_.Set("prettyPrint", "false")
  8274  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/topics")
  8275  	urls += "?" + c.urlParams_.Encode()
  8276  	req, err := http.NewRequest("GET", urls, body)
  8277  	if err != nil {
  8278  		return nil, err
  8279  	}
  8280  	req.Header = reqHeaders
  8281  	googleapi.Expand(req.URL, map[string]string{
  8282  		"courseId": c.courseId,
  8283  	})
  8284  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8285  }
  8286  
  8287  // Do executes the "classroom.courses.topics.list" call.
  8288  // Any non-2xx status code is an error. Response headers are in either
  8289  // *ListTopicResponse.ServerResponse.Header or (if a response was returned at
  8290  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  8291  // check whether the returned error was because http.StatusNotModified was
  8292  // returned.
  8293  func (c *CoursesTopicsListCall) Do(opts ...googleapi.CallOption) (*ListTopicResponse, error) {
  8294  	gensupport.SetOptions(c.urlParams_, opts...)
  8295  	res, err := c.doRequest("json")
  8296  	if res != nil && res.StatusCode == http.StatusNotModified {
  8297  		if res.Body != nil {
  8298  			res.Body.Close()
  8299  		}
  8300  		return nil, gensupport.WrapError(&googleapi.Error{
  8301  			Code:   res.StatusCode,
  8302  			Header: res.Header,
  8303  		})
  8304  	}
  8305  	if err != nil {
  8306  		return nil, err
  8307  	}
  8308  	defer googleapi.CloseBody(res)
  8309  	if err := googleapi.CheckResponse(res); err != nil {
  8310  		return nil, gensupport.WrapError(err)
  8311  	}
  8312  	ret := &ListTopicResponse{
  8313  		ServerResponse: googleapi.ServerResponse{
  8314  			Header:         res.Header,
  8315  			HTTPStatusCode: res.StatusCode,
  8316  		},
  8317  	}
  8318  	target := &ret
  8319  	if err := gensupport.DecodeResponse(target, res); err != nil {
  8320  		return nil, err
  8321  	}
  8322  	return ret, nil
  8323  }
  8324  
  8325  // Pages invokes f for each page of results.
  8326  // A non-nil error returned from f will halt the iteration.
  8327  // The provided context supersedes any context provided to the Context method.
  8328  func (c *CoursesTopicsListCall) Pages(ctx context.Context, f func(*ListTopicResponse) error) error {
  8329  	c.ctx_ = ctx
  8330  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  8331  	for {
  8332  		x, err := c.Do()
  8333  		if err != nil {
  8334  			return err
  8335  		}
  8336  		if err := f(x); err != nil {
  8337  			return err
  8338  		}
  8339  		if x.NextPageToken == "" {
  8340  			return nil
  8341  		}
  8342  		c.PageToken(x.NextPageToken)
  8343  	}
  8344  }
  8345  
  8346  type CoursesTopicsPatchCall struct {
  8347  	s          *Service
  8348  	courseId   string
  8349  	id         string
  8350  	topic      *Topic
  8351  	urlParams_ gensupport.URLParams
  8352  	ctx_       context.Context
  8353  	header_    http.Header
  8354  }
  8355  
  8356  // Patch: Updates one or more fields of a topic. This method returns the
  8357  // following error codes: * `PERMISSION_DENIED` if the requesting developer
  8358  // project did not create the corresponding topic or for access errors. *
  8359  // `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the
  8360  // requested course or topic does not exist
  8361  //
  8362  //   - courseId: Identifier of the course. This identifier can be either the
  8363  //     Classroom-assigned identifier or an alias.
  8364  //   - id: Identifier of the topic.
  8365  func (r *CoursesTopicsService) Patch(courseId string, id string, topic *Topic) *CoursesTopicsPatchCall {
  8366  	c := &CoursesTopicsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8367  	c.courseId = courseId
  8368  	c.id = id
  8369  	c.topic = topic
  8370  	return c
  8371  }
  8372  
  8373  // UpdateMask sets the optional parameter "updateMask": Mask that identifies
  8374  // which fields on the topic to update. This field is required to do an update.
  8375  // The update fails if invalid fields are specified. If a field supports empty
  8376  // values, it can be cleared by specifying it in the update mask and not in the
  8377  // Topic object. If a field that does not support empty values is included in
  8378  // the update mask and not set in the Topic object, an `INVALID_ARGUMENT` error
  8379  // is returned. The following fields may be specified: * `name`
  8380  func (c *CoursesTopicsPatchCall) UpdateMask(updateMask string) *CoursesTopicsPatchCall {
  8381  	c.urlParams_.Set("updateMask", updateMask)
  8382  	return c
  8383  }
  8384  
  8385  // Fields allows partial responses to be retrieved. See
  8386  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  8387  // details.
  8388  func (c *CoursesTopicsPatchCall) Fields(s ...googleapi.Field) *CoursesTopicsPatchCall {
  8389  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8390  	return c
  8391  }
  8392  
  8393  // Context sets the context to be used in this call's Do method.
  8394  func (c *CoursesTopicsPatchCall) Context(ctx context.Context) *CoursesTopicsPatchCall {
  8395  	c.ctx_ = ctx
  8396  	return c
  8397  }
  8398  
  8399  // Header returns a http.Header that can be modified by the caller to add
  8400  // headers to the request.
  8401  func (c *CoursesTopicsPatchCall) Header() http.Header {
  8402  	if c.header_ == nil {
  8403  		c.header_ = make(http.Header)
  8404  	}
  8405  	return c.header_
  8406  }
  8407  
  8408  func (c *CoursesTopicsPatchCall) doRequest(alt string) (*http.Response, error) {
  8409  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  8410  	var body io.Reader = nil
  8411  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.topic)
  8412  	if err != nil {
  8413  		return nil, err
  8414  	}
  8415  	c.urlParams_.Set("alt", alt)
  8416  	c.urlParams_.Set("prettyPrint", "false")
  8417  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/courses/{courseId}/topics/{id}")
  8418  	urls += "?" + c.urlParams_.Encode()
  8419  	req, err := http.NewRequest("PATCH", urls, body)
  8420  	if err != nil {
  8421  		return nil, err
  8422  	}
  8423  	req.Header = reqHeaders
  8424  	googleapi.Expand(req.URL, map[string]string{
  8425  		"courseId": c.courseId,
  8426  		"id":       c.id,
  8427  	})
  8428  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8429  }
  8430  
  8431  // Do executes the "classroom.courses.topics.patch" call.
  8432  // Any non-2xx status code is an error. Response headers are in either
  8433  // *Topic.ServerResponse.Header or (if a response was returned at all) in
  8434  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8435  // whether the returned error was because http.StatusNotModified was returned.
  8436  func (c *CoursesTopicsPatchCall) Do(opts ...googleapi.CallOption) (*Topic, error) {
  8437  	gensupport.SetOptions(c.urlParams_, opts...)
  8438  	res, err := c.doRequest("json")
  8439  	if res != nil && res.StatusCode == http.StatusNotModified {
  8440  		if res.Body != nil {
  8441  			res.Body.Close()
  8442  		}
  8443  		return nil, gensupport.WrapError(&googleapi.Error{
  8444  			Code:   res.StatusCode,
  8445  			Header: res.Header,
  8446  		})
  8447  	}
  8448  	if err != nil {
  8449  		return nil, err
  8450  	}
  8451  	defer googleapi.CloseBody(res)
  8452  	if err := googleapi.CheckResponse(res); err != nil {
  8453  		return nil, gensupport.WrapError(err)
  8454  	}
  8455  	ret := &Topic{
  8456  		ServerResponse: googleapi.ServerResponse{
  8457  			Header:         res.Header,
  8458  			HTTPStatusCode: res.StatusCode,
  8459  		},
  8460  	}
  8461  	target := &ret
  8462  	if err := gensupport.DecodeResponse(target, res); err != nil {
  8463  		return nil, err
  8464  	}
  8465  	return ret, nil
  8466  }
  8467  
  8468  type InvitationsAcceptCall struct {
  8469  	s          *Service
  8470  	id         string
  8471  	urlParams_ gensupport.URLParams
  8472  	ctx_       context.Context
  8473  	header_    http.Header
  8474  }
  8475  
  8476  // Accept: Accepts an invitation, removing it and adding the invited user to
  8477  // the teachers or students (as appropriate) of the specified course. Only the
  8478  // invited user may accept an invitation. This method returns the following
  8479  // error codes: * `PERMISSION_DENIED` if the requesting user is not permitted
  8480  // to accept the requested invitation or for access errors. *
  8481  // `FAILED_PRECONDITION` for the following request errors: *
  8482  // CourseMemberLimitReached * CourseNotModifiable * CourseTeacherLimitReached *
  8483  // UserGroupsMembershipLimitReached * `NOT_FOUND` if no invitation exists with
  8484  // the requested ID.
  8485  //
  8486  // - id: Identifier of the invitation to accept.
  8487  func (r *InvitationsService) Accept(id string) *InvitationsAcceptCall {
  8488  	c := &InvitationsAcceptCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8489  	c.id = id
  8490  	return c
  8491  }
  8492  
  8493  // Fields allows partial responses to be retrieved. See
  8494  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  8495  // details.
  8496  func (c *InvitationsAcceptCall) Fields(s ...googleapi.Field) *InvitationsAcceptCall {
  8497  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8498  	return c
  8499  }
  8500  
  8501  // Context sets the context to be used in this call's Do method.
  8502  func (c *InvitationsAcceptCall) Context(ctx context.Context) *InvitationsAcceptCall {
  8503  	c.ctx_ = ctx
  8504  	return c
  8505  }
  8506  
  8507  // Header returns a http.Header that can be modified by the caller to add
  8508  // headers to the request.
  8509  func (c *InvitationsAcceptCall) Header() http.Header {
  8510  	if c.header_ == nil {
  8511  		c.header_ = make(http.Header)
  8512  	}
  8513  	return c.header_
  8514  }
  8515  
  8516  func (c *InvitationsAcceptCall) doRequest(alt string) (*http.Response, error) {
  8517  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  8518  	var body io.Reader = nil
  8519  	c.urlParams_.Set("alt", alt)
  8520  	c.urlParams_.Set("prettyPrint", "false")
  8521  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/invitations/{id}:accept")
  8522  	urls += "?" + c.urlParams_.Encode()
  8523  	req, err := http.NewRequest("POST", urls, body)
  8524  	if err != nil {
  8525  		return nil, err
  8526  	}
  8527  	req.Header = reqHeaders
  8528  	googleapi.Expand(req.URL, map[string]string{
  8529  		"id": c.id,
  8530  	})
  8531  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8532  }
  8533  
  8534  // Do executes the "classroom.invitations.accept" call.
  8535  // Any non-2xx status code is an error. Response headers are in either
  8536  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  8537  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8538  // whether the returned error was because http.StatusNotModified was returned.
  8539  func (c *InvitationsAcceptCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  8540  	gensupport.SetOptions(c.urlParams_, opts...)
  8541  	res, err := c.doRequest("json")
  8542  	if res != nil && res.StatusCode == http.StatusNotModified {
  8543  		if res.Body != nil {
  8544  			res.Body.Close()
  8545  		}
  8546  		return nil, gensupport.WrapError(&googleapi.Error{
  8547  			Code:   res.StatusCode,
  8548  			Header: res.Header,
  8549  		})
  8550  	}
  8551  	if err != nil {
  8552  		return nil, err
  8553  	}
  8554  	defer googleapi.CloseBody(res)
  8555  	if err := googleapi.CheckResponse(res); err != nil {
  8556  		return nil, gensupport.WrapError(err)
  8557  	}
  8558  	ret := &Empty{
  8559  		ServerResponse: googleapi.ServerResponse{
  8560  			Header:         res.Header,
  8561  			HTTPStatusCode: res.StatusCode,
  8562  		},
  8563  	}
  8564  	target := &ret
  8565  	if err := gensupport.DecodeResponse(target, res); err != nil {
  8566  		return nil, err
  8567  	}
  8568  	return ret, nil
  8569  }
  8570  
  8571  type InvitationsCreateCall struct {
  8572  	s          *Service
  8573  	invitation *Invitation
  8574  	urlParams_ gensupport.URLParams
  8575  	ctx_       context.Context
  8576  	header_    http.Header
  8577  }
  8578  
  8579  // Create: Creates an invitation. Only one invitation for a user and course may
  8580  // exist at a time. Delete and re-create an invitation to make changes. This
  8581  // method returns the following error codes: * `PERMISSION_DENIED` if the
  8582  // requesting user is not permitted to create invitations for this course or
  8583  // for access errors. * `NOT_FOUND` if the course or the user does not exist. *
  8584  // `FAILED_PRECONDITION`: * if the requested user's account is disabled. * if
  8585  // the user already has this role or a role with greater permissions. * for the
  8586  // following request errors: * IneligibleOwner * `ALREADY_EXISTS` if an
  8587  // invitation for the specified user and course already exists.
  8588  func (r *InvitationsService) Create(invitation *Invitation) *InvitationsCreateCall {
  8589  	c := &InvitationsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8590  	c.invitation = invitation
  8591  	return c
  8592  }
  8593  
  8594  // Fields allows partial responses to be retrieved. See
  8595  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  8596  // details.
  8597  func (c *InvitationsCreateCall) Fields(s ...googleapi.Field) *InvitationsCreateCall {
  8598  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8599  	return c
  8600  }
  8601  
  8602  // Context sets the context to be used in this call's Do method.
  8603  func (c *InvitationsCreateCall) Context(ctx context.Context) *InvitationsCreateCall {
  8604  	c.ctx_ = ctx
  8605  	return c
  8606  }
  8607  
  8608  // Header returns a http.Header that can be modified by the caller to add
  8609  // headers to the request.
  8610  func (c *InvitationsCreateCall) Header() http.Header {
  8611  	if c.header_ == nil {
  8612  		c.header_ = make(http.Header)
  8613  	}
  8614  	return c.header_
  8615  }
  8616  
  8617  func (c *InvitationsCreateCall) doRequest(alt string) (*http.Response, error) {
  8618  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  8619  	var body io.Reader = nil
  8620  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.invitation)
  8621  	if err != nil {
  8622  		return nil, err
  8623  	}
  8624  	c.urlParams_.Set("alt", alt)
  8625  	c.urlParams_.Set("prettyPrint", "false")
  8626  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/invitations")
  8627  	urls += "?" + c.urlParams_.Encode()
  8628  	req, err := http.NewRequest("POST", urls, body)
  8629  	if err != nil {
  8630  		return nil, err
  8631  	}
  8632  	req.Header = reqHeaders
  8633  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8634  }
  8635  
  8636  // Do executes the "classroom.invitations.create" call.
  8637  // Any non-2xx status code is an error. Response headers are in either
  8638  // *Invitation.ServerResponse.Header or (if a response was returned at all) in
  8639  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8640  // whether the returned error was because http.StatusNotModified was returned.
  8641  func (c *InvitationsCreateCall) Do(opts ...googleapi.CallOption) (*Invitation, error) {
  8642  	gensupport.SetOptions(c.urlParams_, opts...)
  8643  	res, err := c.doRequest("json")
  8644  	if res != nil && res.StatusCode == http.StatusNotModified {
  8645  		if res.Body != nil {
  8646  			res.Body.Close()
  8647  		}
  8648  		return nil, gensupport.WrapError(&googleapi.Error{
  8649  			Code:   res.StatusCode,
  8650  			Header: res.Header,
  8651  		})
  8652  	}
  8653  	if err != nil {
  8654  		return nil, err
  8655  	}
  8656  	defer googleapi.CloseBody(res)
  8657  	if err := googleapi.CheckResponse(res); err != nil {
  8658  		return nil, gensupport.WrapError(err)
  8659  	}
  8660  	ret := &Invitation{
  8661  		ServerResponse: googleapi.ServerResponse{
  8662  			Header:         res.Header,
  8663  			HTTPStatusCode: res.StatusCode,
  8664  		},
  8665  	}
  8666  	target := &ret
  8667  	if err := gensupport.DecodeResponse(target, res); err != nil {
  8668  		return nil, err
  8669  	}
  8670  	return ret, nil
  8671  }
  8672  
  8673  type InvitationsDeleteCall struct {
  8674  	s          *Service
  8675  	id         string
  8676  	urlParams_ gensupport.URLParams
  8677  	ctx_       context.Context
  8678  	header_    http.Header
  8679  }
  8680  
  8681  // Delete: Deletes an invitation. This method returns the following error
  8682  // codes: * `PERMISSION_DENIED` if the requesting user is not permitted to
  8683  // delete the requested invitation or for access errors. * `NOT_FOUND` if no
  8684  // invitation exists with the requested ID.
  8685  //
  8686  // - id: Identifier of the invitation to delete.
  8687  func (r *InvitationsService) Delete(id string) *InvitationsDeleteCall {
  8688  	c := &InvitationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8689  	c.id = id
  8690  	return c
  8691  }
  8692  
  8693  // Fields allows partial responses to be retrieved. See
  8694  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  8695  // details.
  8696  func (c *InvitationsDeleteCall) Fields(s ...googleapi.Field) *InvitationsDeleteCall {
  8697  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8698  	return c
  8699  }
  8700  
  8701  // Context sets the context to be used in this call's Do method.
  8702  func (c *InvitationsDeleteCall) Context(ctx context.Context) *InvitationsDeleteCall {
  8703  	c.ctx_ = ctx
  8704  	return c
  8705  }
  8706  
  8707  // Header returns a http.Header that can be modified by the caller to add
  8708  // headers to the request.
  8709  func (c *InvitationsDeleteCall) Header() http.Header {
  8710  	if c.header_ == nil {
  8711  		c.header_ = make(http.Header)
  8712  	}
  8713  	return c.header_
  8714  }
  8715  
  8716  func (c *InvitationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  8717  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  8718  	var body io.Reader = nil
  8719  	c.urlParams_.Set("alt", alt)
  8720  	c.urlParams_.Set("prettyPrint", "false")
  8721  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/invitations/{id}")
  8722  	urls += "?" + c.urlParams_.Encode()
  8723  	req, err := http.NewRequest("DELETE", urls, body)
  8724  	if err != nil {
  8725  		return nil, err
  8726  	}
  8727  	req.Header = reqHeaders
  8728  	googleapi.Expand(req.URL, map[string]string{
  8729  		"id": c.id,
  8730  	})
  8731  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8732  }
  8733  
  8734  // Do executes the "classroom.invitations.delete" call.
  8735  // Any non-2xx status code is an error. Response headers are in either
  8736  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  8737  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8738  // whether the returned error was because http.StatusNotModified was returned.
  8739  func (c *InvitationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  8740  	gensupport.SetOptions(c.urlParams_, opts...)
  8741  	res, err := c.doRequest("json")
  8742  	if res != nil && res.StatusCode == http.StatusNotModified {
  8743  		if res.Body != nil {
  8744  			res.Body.Close()
  8745  		}
  8746  		return nil, gensupport.WrapError(&googleapi.Error{
  8747  			Code:   res.StatusCode,
  8748  			Header: res.Header,
  8749  		})
  8750  	}
  8751  	if err != nil {
  8752  		return nil, err
  8753  	}
  8754  	defer googleapi.CloseBody(res)
  8755  	if err := googleapi.CheckResponse(res); err != nil {
  8756  		return nil, gensupport.WrapError(err)
  8757  	}
  8758  	ret := &Empty{
  8759  		ServerResponse: googleapi.ServerResponse{
  8760  			Header:         res.Header,
  8761  			HTTPStatusCode: res.StatusCode,
  8762  		},
  8763  	}
  8764  	target := &ret
  8765  	if err := gensupport.DecodeResponse(target, res); err != nil {
  8766  		return nil, err
  8767  	}
  8768  	return ret, nil
  8769  }
  8770  
  8771  type InvitationsGetCall struct {
  8772  	s            *Service
  8773  	id           string
  8774  	urlParams_   gensupport.URLParams
  8775  	ifNoneMatch_ string
  8776  	ctx_         context.Context
  8777  	header_      http.Header
  8778  }
  8779  
  8780  // Get: Returns an invitation. This method returns the following error codes: *
  8781  // `PERMISSION_DENIED` if the requesting user is not permitted to view the
  8782  // requested invitation or for access errors. * `NOT_FOUND` if no invitation
  8783  // exists with the requested ID.
  8784  //
  8785  // - id: Identifier of the invitation to return.
  8786  func (r *InvitationsService) Get(id string) *InvitationsGetCall {
  8787  	c := &InvitationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8788  	c.id = id
  8789  	return c
  8790  }
  8791  
  8792  // Fields allows partial responses to be retrieved. See
  8793  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  8794  // details.
  8795  func (c *InvitationsGetCall) Fields(s ...googleapi.Field) *InvitationsGetCall {
  8796  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8797  	return c
  8798  }
  8799  
  8800  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  8801  // object's ETag matches the given value. This is useful for getting updates
  8802  // only after the object has changed since the last request.
  8803  func (c *InvitationsGetCall) IfNoneMatch(entityTag string) *InvitationsGetCall {
  8804  	c.ifNoneMatch_ = entityTag
  8805  	return c
  8806  }
  8807  
  8808  // Context sets the context to be used in this call's Do method.
  8809  func (c *InvitationsGetCall) Context(ctx context.Context) *InvitationsGetCall {
  8810  	c.ctx_ = ctx
  8811  	return c
  8812  }
  8813  
  8814  // Header returns a http.Header that can be modified by the caller to add
  8815  // headers to the request.
  8816  func (c *InvitationsGetCall) Header() http.Header {
  8817  	if c.header_ == nil {
  8818  		c.header_ = make(http.Header)
  8819  	}
  8820  	return c.header_
  8821  }
  8822  
  8823  func (c *InvitationsGetCall) doRequest(alt string) (*http.Response, error) {
  8824  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  8825  	if c.ifNoneMatch_ != "" {
  8826  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8827  	}
  8828  	var body io.Reader = nil
  8829  	c.urlParams_.Set("alt", alt)
  8830  	c.urlParams_.Set("prettyPrint", "false")
  8831  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/invitations/{id}")
  8832  	urls += "?" + c.urlParams_.Encode()
  8833  	req, err := http.NewRequest("GET", urls, body)
  8834  	if err != nil {
  8835  		return nil, err
  8836  	}
  8837  	req.Header = reqHeaders
  8838  	googleapi.Expand(req.URL, map[string]string{
  8839  		"id": c.id,
  8840  	})
  8841  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8842  }
  8843  
  8844  // Do executes the "classroom.invitations.get" call.
  8845  // Any non-2xx status code is an error. Response headers are in either
  8846  // *Invitation.ServerResponse.Header or (if a response was returned at all) in
  8847  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  8848  // whether the returned error was because http.StatusNotModified was returned.
  8849  func (c *InvitationsGetCall) Do(opts ...googleapi.CallOption) (*Invitation, error) {
  8850  	gensupport.SetOptions(c.urlParams_, opts...)
  8851  	res, err := c.doRequest("json")
  8852  	if res != nil && res.StatusCode == http.StatusNotModified {
  8853  		if res.Body != nil {
  8854  			res.Body.Close()
  8855  		}
  8856  		return nil, gensupport.WrapError(&googleapi.Error{
  8857  			Code:   res.StatusCode,
  8858  			Header: res.Header,
  8859  		})
  8860  	}
  8861  	if err != nil {
  8862  		return nil, err
  8863  	}
  8864  	defer googleapi.CloseBody(res)
  8865  	if err := googleapi.CheckResponse(res); err != nil {
  8866  		return nil, gensupport.WrapError(err)
  8867  	}
  8868  	ret := &Invitation{
  8869  		ServerResponse: googleapi.ServerResponse{
  8870  			Header:         res.Header,
  8871  			HTTPStatusCode: res.StatusCode,
  8872  		},
  8873  	}
  8874  	target := &ret
  8875  	if err := gensupport.DecodeResponse(target, res); err != nil {
  8876  		return nil, err
  8877  	}
  8878  	return ret, nil
  8879  }
  8880  
  8881  type InvitationsListCall struct {
  8882  	s            *Service
  8883  	urlParams_   gensupport.URLParams
  8884  	ifNoneMatch_ string
  8885  	ctx_         context.Context
  8886  	header_      http.Header
  8887  }
  8888  
  8889  // List: Returns a list of invitations that the requesting user is permitted to
  8890  // view, restricted to those that match the list request. *Note:* At least one
  8891  // of `user_id` or `course_id` must be supplied. Both fields can be supplied.
  8892  // This method returns the following error codes: * `PERMISSION_DENIED` for
  8893  // access errors.
  8894  func (r *InvitationsService) List() *InvitationsListCall {
  8895  	c := &InvitationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  8896  	return c
  8897  }
  8898  
  8899  // CourseId sets the optional parameter "courseId": Restricts returned
  8900  // invitations to those for a course with the specified identifier.
  8901  func (c *InvitationsListCall) CourseId(courseId string) *InvitationsListCall {
  8902  	c.urlParams_.Set("courseId", courseId)
  8903  	return c
  8904  }
  8905  
  8906  // PageSize sets the optional parameter "pageSize": Maximum number of items to
  8907  // return. The default is 500 if unspecified or `0`. The server may return
  8908  // fewer than the specified number of results.
  8909  func (c *InvitationsListCall) PageSize(pageSize int64) *InvitationsListCall {
  8910  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  8911  	return c
  8912  }
  8913  
  8914  // PageToken sets the optional parameter "pageToken": nextPageToken value
  8915  // returned from a previous list call, indicating that the subsequent page of
  8916  // results should be returned. The list request must be otherwise identical to
  8917  // the one that resulted in this token.
  8918  func (c *InvitationsListCall) PageToken(pageToken string) *InvitationsListCall {
  8919  	c.urlParams_.Set("pageToken", pageToken)
  8920  	return c
  8921  }
  8922  
  8923  // UserId sets the optional parameter "userId": Restricts returned invitations
  8924  // to those for a specific user. The identifier can be one of the following: *
  8925  // the numeric identifier for the user * the email address of the user * the
  8926  // string literal "me", indicating the requesting user
  8927  func (c *InvitationsListCall) UserId(userId string) *InvitationsListCall {
  8928  	c.urlParams_.Set("userId", userId)
  8929  	return c
  8930  }
  8931  
  8932  // Fields allows partial responses to be retrieved. See
  8933  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  8934  // details.
  8935  func (c *InvitationsListCall) Fields(s ...googleapi.Field) *InvitationsListCall {
  8936  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  8937  	return c
  8938  }
  8939  
  8940  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  8941  // object's ETag matches the given value. This is useful for getting updates
  8942  // only after the object has changed since the last request.
  8943  func (c *InvitationsListCall) IfNoneMatch(entityTag string) *InvitationsListCall {
  8944  	c.ifNoneMatch_ = entityTag
  8945  	return c
  8946  }
  8947  
  8948  // Context sets the context to be used in this call's Do method.
  8949  func (c *InvitationsListCall) Context(ctx context.Context) *InvitationsListCall {
  8950  	c.ctx_ = ctx
  8951  	return c
  8952  }
  8953  
  8954  // Header returns a http.Header that can be modified by the caller to add
  8955  // headers to the request.
  8956  func (c *InvitationsListCall) Header() http.Header {
  8957  	if c.header_ == nil {
  8958  		c.header_ = make(http.Header)
  8959  	}
  8960  	return c.header_
  8961  }
  8962  
  8963  func (c *InvitationsListCall) doRequest(alt string) (*http.Response, error) {
  8964  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  8965  	if c.ifNoneMatch_ != "" {
  8966  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  8967  	}
  8968  	var body io.Reader = nil
  8969  	c.urlParams_.Set("alt", alt)
  8970  	c.urlParams_.Set("prettyPrint", "false")
  8971  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/invitations")
  8972  	urls += "?" + c.urlParams_.Encode()
  8973  	req, err := http.NewRequest("GET", urls, body)
  8974  	if err != nil {
  8975  		return nil, err
  8976  	}
  8977  	req.Header = reqHeaders
  8978  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  8979  }
  8980  
  8981  // Do executes the "classroom.invitations.list" call.
  8982  // Any non-2xx status code is an error. Response headers are in either
  8983  // *ListInvitationsResponse.ServerResponse.Header or (if a response was
  8984  // returned at all) in error.(*googleapi.Error).Header. Use
  8985  // googleapi.IsNotModified to check whether the returned error was because
  8986  // http.StatusNotModified was returned.
  8987  func (c *InvitationsListCall) Do(opts ...googleapi.CallOption) (*ListInvitationsResponse, error) {
  8988  	gensupport.SetOptions(c.urlParams_, opts...)
  8989  	res, err := c.doRequest("json")
  8990  	if res != nil && res.StatusCode == http.StatusNotModified {
  8991  		if res.Body != nil {
  8992  			res.Body.Close()
  8993  		}
  8994  		return nil, gensupport.WrapError(&googleapi.Error{
  8995  			Code:   res.StatusCode,
  8996  			Header: res.Header,
  8997  		})
  8998  	}
  8999  	if err != nil {
  9000  		return nil, err
  9001  	}
  9002  	defer googleapi.CloseBody(res)
  9003  	if err := googleapi.CheckResponse(res); err != nil {
  9004  		return nil, gensupport.WrapError(err)
  9005  	}
  9006  	ret := &ListInvitationsResponse{
  9007  		ServerResponse: googleapi.ServerResponse{
  9008  			Header:         res.Header,
  9009  			HTTPStatusCode: res.StatusCode,
  9010  		},
  9011  	}
  9012  	target := &ret
  9013  	if err := gensupport.DecodeResponse(target, res); err != nil {
  9014  		return nil, err
  9015  	}
  9016  	return ret, nil
  9017  }
  9018  
  9019  // Pages invokes f for each page of results.
  9020  // A non-nil error returned from f will halt the iteration.
  9021  // The provided context supersedes any context provided to the Context method.
  9022  func (c *InvitationsListCall) Pages(ctx context.Context, f func(*ListInvitationsResponse) error) error {
  9023  	c.ctx_ = ctx
  9024  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  9025  	for {
  9026  		x, err := c.Do()
  9027  		if err != nil {
  9028  			return err
  9029  		}
  9030  		if err := f(x); err != nil {
  9031  			return err
  9032  		}
  9033  		if x.NextPageToken == "" {
  9034  			return nil
  9035  		}
  9036  		c.PageToken(x.NextPageToken)
  9037  	}
  9038  }
  9039  
  9040  type RegistrationsCreateCall struct {
  9041  	s            *Service
  9042  	registration *Registration
  9043  	urlParams_   gensupport.URLParams
  9044  	ctx_         context.Context
  9045  	header_      http.Header
  9046  }
  9047  
  9048  // Create: Creates a `Registration`, causing Classroom to start sending
  9049  // notifications from the provided `feed` to the destination provided in
  9050  // `cloudPubSubTopic`. Returns the created `Registration`. Currently, this will
  9051  // be the same as the argument, but with server-assigned fields such as
  9052  // `expiry_time` and `id` filled in. Note that any value specified for the
  9053  // `expiry_time` or `id` fields will be ignored. While Classroom may validate
  9054  // the `cloudPubSubTopic` and return errors on a best effort basis, it is the
  9055  // caller's responsibility to ensure that it exists and that Classroom has
  9056  // permission to publish to it. This method may return the following error
  9057  // codes: * `PERMISSION_DENIED` if: * the authenticated user does not have
  9058  // permission to receive notifications from the requested field; or * the
  9059  // current user has not granted access to the current Cloud project with the
  9060  // appropriate scope for the requested feed. Note that domain-wide delegation
  9061  // of authority is not currently supported for this purpose. If the request has
  9062  // the appropriate scope, but no grant exists, a Request Errors is returned. *
  9063  // another access error is encountered. * `INVALID_ARGUMENT` if: * no
  9064  // `cloudPubsubTopic` is specified, or the specified `cloudPubsubTopic` is not
  9065  // valid; or * no `feed` is specified, or the specified `feed` is not valid. *
  9066  // `NOT_FOUND` if: * the specified `feed` cannot be located, or the requesting
  9067  // user does not have permission to determine whether or not it exists; or *
  9068  // the specified `cloudPubsubTopic` cannot be located, or Classroom has not
  9069  // been granted permission to publish to it.
  9070  func (r *RegistrationsService) Create(registration *Registration) *RegistrationsCreateCall {
  9071  	c := &RegistrationsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9072  	c.registration = registration
  9073  	return c
  9074  }
  9075  
  9076  // Fields allows partial responses to be retrieved. See
  9077  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  9078  // details.
  9079  func (c *RegistrationsCreateCall) Fields(s ...googleapi.Field) *RegistrationsCreateCall {
  9080  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9081  	return c
  9082  }
  9083  
  9084  // Context sets the context to be used in this call's Do method.
  9085  func (c *RegistrationsCreateCall) Context(ctx context.Context) *RegistrationsCreateCall {
  9086  	c.ctx_ = ctx
  9087  	return c
  9088  }
  9089  
  9090  // Header returns a http.Header that can be modified by the caller to add
  9091  // headers to the request.
  9092  func (c *RegistrationsCreateCall) Header() http.Header {
  9093  	if c.header_ == nil {
  9094  		c.header_ = make(http.Header)
  9095  	}
  9096  	return c.header_
  9097  }
  9098  
  9099  func (c *RegistrationsCreateCall) doRequest(alt string) (*http.Response, error) {
  9100  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  9101  	var body io.Reader = nil
  9102  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.registration)
  9103  	if err != nil {
  9104  		return nil, err
  9105  	}
  9106  	c.urlParams_.Set("alt", alt)
  9107  	c.urlParams_.Set("prettyPrint", "false")
  9108  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/registrations")
  9109  	urls += "?" + c.urlParams_.Encode()
  9110  	req, err := http.NewRequest("POST", urls, body)
  9111  	if err != nil {
  9112  		return nil, err
  9113  	}
  9114  	req.Header = reqHeaders
  9115  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9116  }
  9117  
  9118  // Do executes the "classroom.registrations.create" call.
  9119  // Any non-2xx status code is an error. Response headers are in either
  9120  // *Registration.ServerResponse.Header or (if a response was returned at all)
  9121  // in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9122  // whether the returned error was because http.StatusNotModified was returned.
  9123  func (c *RegistrationsCreateCall) Do(opts ...googleapi.CallOption) (*Registration, error) {
  9124  	gensupport.SetOptions(c.urlParams_, opts...)
  9125  	res, err := c.doRequest("json")
  9126  	if res != nil && res.StatusCode == http.StatusNotModified {
  9127  		if res.Body != nil {
  9128  			res.Body.Close()
  9129  		}
  9130  		return nil, gensupport.WrapError(&googleapi.Error{
  9131  			Code:   res.StatusCode,
  9132  			Header: res.Header,
  9133  		})
  9134  	}
  9135  	if err != nil {
  9136  		return nil, err
  9137  	}
  9138  	defer googleapi.CloseBody(res)
  9139  	if err := googleapi.CheckResponse(res); err != nil {
  9140  		return nil, gensupport.WrapError(err)
  9141  	}
  9142  	ret := &Registration{
  9143  		ServerResponse: googleapi.ServerResponse{
  9144  			Header:         res.Header,
  9145  			HTTPStatusCode: res.StatusCode,
  9146  		},
  9147  	}
  9148  	target := &ret
  9149  	if err := gensupport.DecodeResponse(target, res); err != nil {
  9150  		return nil, err
  9151  	}
  9152  	return ret, nil
  9153  }
  9154  
  9155  type RegistrationsDeleteCall struct {
  9156  	s              *Service
  9157  	registrationId string
  9158  	urlParams_     gensupport.URLParams
  9159  	ctx_           context.Context
  9160  	header_        http.Header
  9161  }
  9162  
  9163  // Delete: Deletes a `Registration`, causing Classroom to stop sending
  9164  // notifications for that `Registration`.
  9165  //
  9166  // - registrationId: The `registration_id` of the `Registration` to be deleted.
  9167  func (r *RegistrationsService) Delete(registrationId string) *RegistrationsDeleteCall {
  9168  	c := &RegistrationsDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9169  	c.registrationId = registrationId
  9170  	return c
  9171  }
  9172  
  9173  // Fields allows partial responses to be retrieved. See
  9174  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  9175  // details.
  9176  func (c *RegistrationsDeleteCall) Fields(s ...googleapi.Field) *RegistrationsDeleteCall {
  9177  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9178  	return c
  9179  }
  9180  
  9181  // Context sets the context to be used in this call's Do method.
  9182  func (c *RegistrationsDeleteCall) Context(ctx context.Context) *RegistrationsDeleteCall {
  9183  	c.ctx_ = ctx
  9184  	return c
  9185  }
  9186  
  9187  // Header returns a http.Header that can be modified by the caller to add
  9188  // headers to the request.
  9189  func (c *RegistrationsDeleteCall) Header() http.Header {
  9190  	if c.header_ == nil {
  9191  		c.header_ = make(http.Header)
  9192  	}
  9193  	return c.header_
  9194  }
  9195  
  9196  func (c *RegistrationsDeleteCall) doRequest(alt string) (*http.Response, error) {
  9197  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  9198  	var body io.Reader = nil
  9199  	c.urlParams_.Set("alt", alt)
  9200  	c.urlParams_.Set("prettyPrint", "false")
  9201  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/registrations/{registrationId}")
  9202  	urls += "?" + c.urlParams_.Encode()
  9203  	req, err := http.NewRequest("DELETE", urls, body)
  9204  	if err != nil {
  9205  		return nil, err
  9206  	}
  9207  	req.Header = reqHeaders
  9208  	googleapi.Expand(req.URL, map[string]string{
  9209  		"registrationId": c.registrationId,
  9210  	})
  9211  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9212  }
  9213  
  9214  // Do executes the "classroom.registrations.delete" call.
  9215  // Any non-2xx status code is an error. Response headers are in either
  9216  // *Empty.ServerResponse.Header or (if a response was returned at all) in
  9217  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9218  // whether the returned error was because http.StatusNotModified was returned.
  9219  func (c *RegistrationsDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
  9220  	gensupport.SetOptions(c.urlParams_, opts...)
  9221  	res, err := c.doRequest("json")
  9222  	if res != nil && res.StatusCode == http.StatusNotModified {
  9223  		if res.Body != nil {
  9224  			res.Body.Close()
  9225  		}
  9226  		return nil, gensupport.WrapError(&googleapi.Error{
  9227  			Code:   res.StatusCode,
  9228  			Header: res.Header,
  9229  		})
  9230  	}
  9231  	if err != nil {
  9232  		return nil, err
  9233  	}
  9234  	defer googleapi.CloseBody(res)
  9235  	if err := googleapi.CheckResponse(res); err != nil {
  9236  		return nil, gensupport.WrapError(err)
  9237  	}
  9238  	ret := &Empty{
  9239  		ServerResponse: googleapi.ServerResponse{
  9240  			Header:         res.Header,
  9241  			HTTPStatusCode: res.StatusCode,
  9242  		},
  9243  	}
  9244  	target := &ret
  9245  	if err := gensupport.DecodeResponse(target, res); err != nil {
  9246  		return nil, err
  9247  	}
  9248  	return ret, nil
  9249  }
  9250  
  9251  type UserProfilesGetCall struct {
  9252  	s            *Service
  9253  	userId       string
  9254  	urlParams_   gensupport.URLParams
  9255  	ifNoneMatch_ string
  9256  	ctx_         context.Context
  9257  	header_      http.Header
  9258  }
  9259  
  9260  // Get: Returns a user profile. This method returns the following error codes:
  9261  // * `PERMISSION_DENIED` if the requesting user is not permitted to access this
  9262  // user profile, if no profile exists with the requested ID, or for access
  9263  // errors.
  9264  //
  9265  //   - userId: Identifier of the profile to return. The identifier can be one of
  9266  //     the following: * the numeric identifier for the user * the email address
  9267  //     of the user * the string literal "me", indicating the requesting user.
  9268  func (r *UserProfilesService) Get(userId string) *UserProfilesGetCall {
  9269  	c := &UserProfilesGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9270  	c.userId = userId
  9271  	return c
  9272  }
  9273  
  9274  // Fields allows partial responses to be retrieved. See
  9275  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  9276  // details.
  9277  func (c *UserProfilesGetCall) Fields(s ...googleapi.Field) *UserProfilesGetCall {
  9278  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9279  	return c
  9280  }
  9281  
  9282  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  9283  // object's ETag matches the given value. This is useful for getting updates
  9284  // only after the object has changed since the last request.
  9285  func (c *UserProfilesGetCall) IfNoneMatch(entityTag string) *UserProfilesGetCall {
  9286  	c.ifNoneMatch_ = entityTag
  9287  	return c
  9288  }
  9289  
  9290  // Context sets the context to be used in this call's Do method.
  9291  func (c *UserProfilesGetCall) Context(ctx context.Context) *UserProfilesGetCall {
  9292  	c.ctx_ = ctx
  9293  	return c
  9294  }
  9295  
  9296  // Header returns a http.Header that can be modified by the caller to add
  9297  // headers to the request.
  9298  func (c *UserProfilesGetCall) Header() http.Header {
  9299  	if c.header_ == nil {
  9300  		c.header_ = make(http.Header)
  9301  	}
  9302  	return c.header_
  9303  }
  9304  
  9305  func (c *UserProfilesGetCall) doRequest(alt string) (*http.Response, error) {
  9306  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  9307  	if c.ifNoneMatch_ != "" {
  9308  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9309  	}
  9310  	var body io.Reader = nil
  9311  	c.urlParams_.Set("alt", alt)
  9312  	c.urlParams_.Set("prettyPrint", "false")
  9313  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/userProfiles/{userId}")
  9314  	urls += "?" + c.urlParams_.Encode()
  9315  	req, err := http.NewRequest("GET", urls, body)
  9316  	if err != nil {
  9317  		return nil, err
  9318  	}
  9319  	req.Header = reqHeaders
  9320  	googleapi.Expand(req.URL, map[string]string{
  9321  		"userId": c.userId,
  9322  	})
  9323  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9324  }
  9325  
  9326  // Do executes the "classroom.userProfiles.get" call.
  9327  // Any non-2xx status code is an error. Response headers are in either
  9328  // *UserProfile.ServerResponse.Header or (if a response was returned at all) in
  9329  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
  9330  // whether the returned error was because http.StatusNotModified was returned.
  9331  func (c *UserProfilesGetCall) Do(opts ...googleapi.CallOption) (*UserProfile, error) {
  9332  	gensupport.SetOptions(c.urlParams_, opts...)
  9333  	res, err := c.doRequest("json")
  9334  	if res != nil && res.StatusCode == http.StatusNotModified {
  9335  		if res.Body != nil {
  9336  			res.Body.Close()
  9337  		}
  9338  		return nil, gensupport.WrapError(&googleapi.Error{
  9339  			Code:   res.StatusCode,
  9340  			Header: res.Header,
  9341  		})
  9342  	}
  9343  	if err != nil {
  9344  		return nil, err
  9345  	}
  9346  	defer googleapi.CloseBody(res)
  9347  	if err := googleapi.CheckResponse(res); err != nil {
  9348  		return nil, gensupport.WrapError(err)
  9349  	}
  9350  	ret := &UserProfile{
  9351  		ServerResponse: googleapi.ServerResponse{
  9352  			Header:         res.Header,
  9353  			HTTPStatusCode: res.StatusCode,
  9354  		},
  9355  	}
  9356  	target := &ret
  9357  	if err := gensupport.DecodeResponse(target, res); err != nil {
  9358  		return nil, err
  9359  	}
  9360  	return ret, nil
  9361  }
  9362  
  9363  type UserProfilesGuardianInvitationsCreateCall struct {
  9364  	s                  *Service
  9365  	studentId          string
  9366  	guardianinvitation *GuardianInvitation
  9367  	urlParams_         gensupport.URLParams
  9368  	ctx_               context.Context
  9369  	header_            http.Header
  9370  }
  9371  
  9372  // Create: Creates a guardian invitation, and sends an email to the guardian
  9373  // asking them to confirm that they are the student's guardian. Once the
  9374  // guardian accepts the invitation, their `state` will change to `COMPLETED`
  9375  // and they will start receiving guardian notifications. A `Guardian` resource
  9376  // will also be created to represent the active guardian. The request object
  9377  // must have the `student_id` and `invited_email_address` fields set. Failing
  9378  // to set these fields, or setting any other fields in the request, will result
  9379  // in an error. This method returns the following error codes: *
  9380  // `PERMISSION_DENIED` if the current user does not have permission to manage
  9381  // guardians, if the guardian in question has already rejected too many
  9382  // requests for that student, if guardians are not enabled for the domain in
  9383  // question, or for other access errors. * `RESOURCE_EXHAUSTED` if the student
  9384  // or guardian has exceeded the guardian link limit. * `INVALID_ARGUMENT` if
  9385  // the guardian email address is not valid (for example, if it is too long), or
  9386  // if the format of the student ID provided cannot be recognized (it is not an
  9387  // email address, nor a `user_id` from this API). This error will also be
  9388  // returned if read-only fields are set, or if the `state` field is set to to a
  9389  // value other than `PENDING`. * `NOT_FOUND` if the student ID provided is a
  9390  // valid student ID, but Classroom has no record of that student. *
  9391  // `ALREADY_EXISTS` if there is already a pending guardian invitation for the
  9392  // student and `invited_email_address` provided, or if the provided
  9393  // `invited_email_address` matches the Google account of an existing `Guardian`
  9394  // for this user.
  9395  //
  9396  // - studentId: ID of the student (in standard format).
  9397  func (r *UserProfilesGuardianInvitationsService) Create(studentId string, guardianinvitation *GuardianInvitation) *UserProfilesGuardianInvitationsCreateCall {
  9398  	c := &UserProfilesGuardianInvitationsCreateCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9399  	c.studentId = studentId
  9400  	c.guardianinvitation = guardianinvitation
  9401  	return c
  9402  }
  9403  
  9404  // Fields allows partial responses to be retrieved. See
  9405  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  9406  // details.
  9407  func (c *UserProfilesGuardianInvitationsCreateCall) Fields(s ...googleapi.Field) *UserProfilesGuardianInvitationsCreateCall {
  9408  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9409  	return c
  9410  }
  9411  
  9412  // Context sets the context to be used in this call's Do method.
  9413  func (c *UserProfilesGuardianInvitationsCreateCall) Context(ctx context.Context) *UserProfilesGuardianInvitationsCreateCall {
  9414  	c.ctx_ = ctx
  9415  	return c
  9416  }
  9417  
  9418  // Header returns a http.Header that can be modified by the caller to add
  9419  // headers to the request.
  9420  func (c *UserProfilesGuardianInvitationsCreateCall) Header() http.Header {
  9421  	if c.header_ == nil {
  9422  		c.header_ = make(http.Header)
  9423  	}
  9424  	return c.header_
  9425  }
  9426  
  9427  func (c *UserProfilesGuardianInvitationsCreateCall) doRequest(alt string) (*http.Response, error) {
  9428  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  9429  	var body io.Reader = nil
  9430  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.guardianinvitation)
  9431  	if err != nil {
  9432  		return nil, err
  9433  	}
  9434  	c.urlParams_.Set("alt", alt)
  9435  	c.urlParams_.Set("prettyPrint", "false")
  9436  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/userProfiles/{studentId}/guardianInvitations")
  9437  	urls += "?" + c.urlParams_.Encode()
  9438  	req, err := http.NewRequest("POST", urls, body)
  9439  	if err != nil {
  9440  		return nil, err
  9441  	}
  9442  	req.Header = reqHeaders
  9443  	googleapi.Expand(req.URL, map[string]string{
  9444  		"studentId": c.studentId,
  9445  	})
  9446  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9447  }
  9448  
  9449  // Do executes the "classroom.userProfiles.guardianInvitations.create" call.
  9450  // Any non-2xx status code is an error. Response headers are in either
  9451  // *GuardianInvitation.ServerResponse.Header or (if a response was returned at
  9452  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9453  // check whether the returned error was because http.StatusNotModified was
  9454  // returned.
  9455  func (c *UserProfilesGuardianInvitationsCreateCall) Do(opts ...googleapi.CallOption) (*GuardianInvitation, error) {
  9456  	gensupport.SetOptions(c.urlParams_, opts...)
  9457  	res, err := c.doRequest("json")
  9458  	if res != nil && res.StatusCode == http.StatusNotModified {
  9459  		if res.Body != nil {
  9460  			res.Body.Close()
  9461  		}
  9462  		return nil, gensupport.WrapError(&googleapi.Error{
  9463  			Code:   res.StatusCode,
  9464  			Header: res.Header,
  9465  		})
  9466  	}
  9467  	if err != nil {
  9468  		return nil, err
  9469  	}
  9470  	defer googleapi.CloseBody(res)
  9471  	if err := googleapi.CheckResponse(res); err != nil {
  9472  		return nil, gensupport.WrapError(err)
  9473  	}
  9474  	ret := &GuardianInvitation{
  9475  		ServerResponse: googleapi.ServerResponse{
  9476  			Header:         res.Header,
  9477  			HTTPStatusCode: res.StatusCode,
  9478  		},
  9479  	}
  9480  	target := &ret
  9481  	if err := gensupport.DecodeResponse(target, res); err != nil {
  9482  		return nil, err
  9483  	}
  9484  	return ret, nil
  9485  }
  9486  
  9487  type UserProfilesGuardianInvitationsGetCall struct {
  9488  	s            *Service
  9489  	studentId    string
  9490  	invitationId string
  9491  	urlParams_   gensupport.URLParams
  9492  	ifNoneMatch_ string
  9493  	ctx_         context.Context
  9494  	header_      http.Header
  9495  }
  9496  
  9497  // Get: Returns a specific guardian invitation. This method returns the
  9498  // following error codes: * `PERMISSION_DENIED` if the requesting user is not
  9499  // permitted to view guardian invitations for the student identified by the
  9500  // `student_id`, if guardians are not enabled for the domain in question, or
  9501  // for other access errors. * `INVALID_ARGUMENT` if a `student_id` is
  9502  // specified, but its format cannot be recognized (it is not an email address,
  9503  // nor a `student_id` from the API, nor the literal string `me`). * `NOT_FOUND`
  9504  // if Classroom cannot find any record of the given student or `invitation_id`.
  9505  // May also be returned if the student exists, but the requesting user does not
  9506  // have access to see that student.
  9507  //
  9508  //   - invitationId: The `id` field of the `GuardianInvitation` being requested.
  9509  //   - studentId: The ID of the student whose guardian invitation is being
  9510  //     requested.
  9511  func (r *UserProfilesGuardianInvitationsService) Get(studentId string, invitationId string) *UserProfilesGuardianInvitationsGetCall {
  9512  	c := &UserProfilesGuardianInvitationsGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9513  	c.studentId = studentId
  9514  	c.invitationId = invitationId
  9515  	return c
  9516  }
  9517  
  9518  // Fields allows partial responses to be retrieved. See
  9519  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  9520  // details.
  9521  func (c *UserProfilesGuardianInvitationsGetCall) Fields(s ...googleapi.Field) *UserProfilesGuardianInvitationsGetCall {
  9522  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9523  	return c
  9524  }
  9525  
  9526  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  9527  // object's ETag matches the given value. This is useful for getting updates
  9528  // only after the object has changed since the last request.
  9529  func (c *UserProfilesGuardianInvitationsGetCall) IfNoneMatch(entityTag string) *UserProfilesGuardianInvitationsGetCall {
  9530  	c.ifNoneMatch_ = entityTag
  9531  	return c
  9532  }
  9533  
  9534  // Context sets the context to be used in this call's Do method.
  9535  func (c *UserProfilesGuardianInvitationsGetCall) Context(ctx context.Context) *UserProfilesGuardianInvitationsGetCall {
  9536  	c.ctx_ = ctx
  9537  	return c
  9538  }
  9539  
  9540  // Header returns a http.Header that can be modified by the caller to add
  9541  // headers to the request.
  9542  func (c *UserProfilesGuardianInvitationsGetCall) Header() http.Header {
  9543  	if c.header_ == nil {
  9544  		c.header_ = make(http.Header)
  9545  	}
  9546  	return c.header_
  9547  }
  9548  
  9549  func (c *UserProfilesGuardianInvitationsGetCall) doRequest(alt string) (*http.Response, error) {
  9550  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  9551  	if c.ifNoneMatch_ != "" {
  9552  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9553  	}
  9554  	var body io.Reader = nil
  9555  	c.urlParams_.Set("alt", alt)
  9556  	c.urlParams_.Set("prettyPrint", "false")
  9557  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/userProfiles/{studentId}/guardianInvitations/{invitationId}")
  9558  	urls += "?" + c.urlParams_.Encode()
  9559  	req, err := http.NewRequest("GET", urls, body)
  9560  	if err != nil {
  9561  		return nil, err
  9562  	}
  9563  	req.Header = reqHeaders
  9564  	googleapi.Expand(req.URL, map[string]string{
  9565  		"studentId":    c.studentId,
  9566  		"invitationId": c.invitationId,
  9567  	})
  9568  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9569  }
  9570  
  9571  // Do executes the "classroom.userProfiles.guardianInvitations.get" call.
  9572  // Any non-2xx status code is an error. Response headers are in either
  9573  // *GuardianInvitation.ServerResponse.Header or (if a response was returned at
  9574  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9575  // check whether the returned error was because http.StatusNotModified was
  9576  // returned.
  9577  func (c *UserProfilesGuardianInvitationsGetCall) Do(opts ...googleapi.CallOption) (*GuardianInvitation, error) {
  9578  	gensupport.SetOptions(c.urlParams_, opts...)
  9579  	res, err := c.doRequest("json")
  9580  	if res != nil && res.StatusCode == http.StatusNotModified {
  9581  		if res.Body != nil {
  9582  			res.Body.Close()
  9583  		}
  9584  		return nil, gensupport.WrapError(&googleapi.Error{
  9585  			Code:   res.StatusCode,
  9586  			Header: res.Header,
  9587  		})
  9588  	}
  9589  	if err != nil {
  9590  		return nil, err
  9591  	}
  9592  	defer googleapi.CloseBody(res)
  9593  	if err := googleapi.CheckResponse(res); err != nil {
  9594  		return nil, gensupport.WrapError(err)
  9595  	}
  9596  	ret := &GuardianInvitation{
  9597  		ServerResponse: googleapi.ServerResponse{
  9598  			Header:         res.Header,
  9599  			HTTPStatusCode: res.StatusCode,
  9600  		},
  9601  	}
  9602  	target := &ret
  9603  	if err := gensupport.DecodeResponse(target, res); err != nil {
  9604  		return nil, err
  9605  	}
  9606  	return ret, nil
  9607  }
  9608  
  9609  type UserProfilesGuardianInvitationsListCall struct {
  9610  	s            *Service
  9611  	studentId    string
  9612  	urlParams_   gensupport.URLParams
  9613  	ifNoneMatch_ string
  9614  	ctx_         context.Context
  9615  	header_      http.Header
  9616  }
  9617  
  9618  // List: Returns a list of guardian invitations that the requesting user is
  9619  // permitted to view, filtered by the parameters provided. This method returns
  9620  // the following error codes: * `PERMISSION_DENIED` if a `student_id` is
  9621  // specified, and the requesting user is not permitted to view guardian
  9622  // invitations for that student, if "-" is specified as the `student_id` and
  9623  // the user is not a domain administrator, if guardians are not enabled for the
  9624  // domain in question, or for other access errors. * `INVALID_ARGUMENT` if a
  9625  // `student_id` is specified, but its format cannot be recognized (it is not an
  9626  // email address, nor a `student_id` from the API, nor the literal string
  9627  // `me`). May also be returned if an invalid `page_token` or `state` is
  9628  // provided. * `NOT_FOUND` if a `student_id` is specified, and its format can
  9629  // be recognized, but Classroom has no record of that student.
  9630  //
  9631  //   - studentId: The ID of the student whose guardian invitations are to be
  9632  //     returned. The identifier can be one of the following: * the numeric
  9633  //     identifier for the user * the email address of the user * the string
  9634  //     literal "me", indicating the requesting user * the string literal "-",
  9635  //     indicating that results should be returned for all students that the
  9636  //     requesting user is permitted to view guardian invitations.
  9637  func (r *UserProfilesGuardianInvitationsService) List(studentId string) *UserProfilesGuardianInvitationsListCall {
  9638  	c := &UserProfilesGuardianInvitationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9639  	c.studentId = studentId
  9640  	return c
  9641  }
  9642  
  9643  // InvitedEmailAddress sets the optional parameter "invitedEmailAddress": If
  9644  // specified, only results with the specified `invited_email_address` are
  9645  // returned.
  9646  func (c *UserProfilesGuardianInvitationsListCall) InvitedEmailAddress(invitedEmailAddress string) *UserProfilesGuardianInvitationsListCall {
  9647  	c.urlParams_.Set("invitedEmailAddress", invitedEmailAddress)
  9648  	return c
  9649  }
  9650  
  9651  // PageSize sets the optional parameter "pageSize": Maximum number of items to
  9652  // return. Zero or unspecified indicates that the server may assign a maximum.
  9653  // The server may return fewer than the specified number of results.
  9654  func (c *UserProfilesGuardianInvitationsListCall) PageSize(pageSize int64) *UserProfilesGuardianInvitationsListCall {
  9655  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
  9656  	return c
  9657  }
  9658  
  9659  // PageToken sets the optional parameter "pageToken": nextPageToken value
  9660  // returned from a previous list call, indicating that the subsequent page of
  9661  // results should be returned. The list request must be otherwise identical to
  9662  // the one that resulted in this token.
  9663  func (c *UserProfilesGuardianInvitationsListCall) PageToken(pageToken string) *UserProfilesGuardianInvitationsListCall {
  9664  	c.urlParams_.Set("pageToken", pageToken)
  9665  	return c
  9666  }
  9667  
  9668  // States sets the optional parameter "states": If specified, only results with
  9669  // the specified `state` values are returned. Otherwise, results with a `state`
  9670  // of `PENDING` are returned.
  9671  //
  9672  // Possible values:
  9673  //
  9674  //	"GUARDIAN_INVITATION_STATE_UNSPECIFIED" - Should never be returned.
  9675  //	"PENDING" - The invitation is active and awaiting a response.
  9676  //	"COMPLETE" - The invitation is no longer active. It may have been
  9677  //
  9678  // accepted, declined, withdrawn or it may have expired.
  9679  func (c *UserProfilesGuardianInvitationsListCall) States(states ...string) *UserProfilesGuardianInvitationsListCall {
  9680  	c.urlParams_.SetMulti("states", append([]string{}, states...))
  9681  	return c
  9682  }
  9683  
  9684  // Fields allows partial responses to be retrieved. See
  9685  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  9686  // details.
  9687  func (c *UserProfilesGuardianInvitationsListCall) Fields(s ...googleapi.Field) *UserProfilesGuardianInvitationsListCall {
  9688  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9689  	return c
  9690  }
  9691  
  9692  // IfNoneMatch sets an optional parameter which makes the operation fail if the
  9693  // object's ETag matches the given value. This is useful for getting updates
  9694  // only after the object has changed since the last request.
  9695  func (c *UserProfilesGuardianInvitationsListCall) IfNoneMatch(entityTag string) *UserProfilesGuardianInvitationsListCall {
  9696  	c.ifNoneMatch_ = entityTag
  9697  	return c
  9698  }
  9699  
  9700  // Context sets the context to be used in this call's Do method.
  9701  func (c *UserProfilesGuardianInvitationsListCall) Context(ctx context.Context) *UserProfilesGuardianInvitationsListCall {
  9702  	c.ctx_ = ctx
  9703  	return c
  9704  }
  9705  
  9706  // Header returns a http.Header that can be modified by the caller to add
  9707  // headers to the request.
  9708  func (c *UserProfilesGuardianInvitationsListCall) Header() http.Header {
  9709  	if c.header_ == nil {
  9710  		c.header_ = make(http.Header)
  9711  	}
  9712  	return c.header_
  9713  }
  9714  
  9715  func (c *UserProfilesGuardianInvitationsListCall) doRequest(alt string) (*http.Response, error) {
  9716  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  9717  	if c.ifNoneMatch_ != "" {
  9718  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
  9719  	}
  9720  	var body io.Reader = nil
  9721  	c.urlParams_.Set("alt", alt)
  9722  	c.urlParams_.Set("prettyPrint", "false")
  9723  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/userProfiles/{studentId}/guardianInvitations")
  9724  	urls += "?" + c.urlParams_.Encode()
  9725  	req, err := http.NewRequest("GET", urls, body)
  9726  	if err != nil {
  9727  		return nil, err
  9728  	}
  9729  	req.Header = reqHeaders
  9730  	googleapi.Expand(req.URL, map[string]string{
  9731  		"studentId": c.studentId,
  9732  	})
  9733  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9734  }
  9735  
  9736  // Do executes the "classroom.userProfiles.guardianInvitations.list" call.
  9737  // Any non-2xx status code is an error. Response headers are in either
  9738  // *ListGuardianInvitationsResponse.ServerResponse.Header or (if a response was
  9739  // returned at all) in error.(*googleapi.Error).Header. Use
  9740  // googleapi.IsNotModified to check whether the returned error was because
  9741  // http.StatusNotModified was returned.
  9742  func (c *UserProfilesGuardianInvitationsListCall) Do(opts ...googleapi.CallOption) (*ListGuardianInvitationsResponse, error) {
  9743  	gensupport.SetOptions(c.urlParams_, opts...)
  9744  	res, err := c.doRequest("json")
  9745  	if res != nil && res.StatusCode == http.StatusNotModified {
  9746  		if res.Body != nil {
  9747  			res.Body.Close()
  9748  		}
  9749  		return nil, gensupport.WrapError(&googleapi.Error{
  9750  			Code:   res.StatusCode,
  9751  			Header: res.Header,
  9752  		})
  9753  	}
  9754  	if err != nil {
  9755  		return nil, err
  9756  	}
  9757  	defer googleapi.CloseBody(res)
  9758  	if err := googleapi.CheckResponse(res); err != nil {
  9759  		return nil, gensupport.WrapError(err)
  9760  	}
  9761  	ret := &ListGuardianInvitationsResponse{
  9762  		ServerResponse: googleapi.ServerResponse{
  9763  			Header:         res.Header,
  9764  			HTTPStatusCode: res.StatusCode,
  9765  		},
  9766  	}
  9767  	target := &ret
  9768  	if err := gensupport.DecodeResponse(target, res); err != nil {
  9769  		return nil, err
  9770  	}
  9771  	return ret, nil
  9772  }
  9773  
  9774  // Pages invokes f for each page of results.
  9775  // A non-nil error returned from f will halt the iteration.
  9776  // The provided context supersedes any context provided to the Context method.
  9777  func (c *UserProfilesGuardianInvitationsListCall) Pages(ctx context.Context, f func(*ListGuardianInvitationsResponse) error) error {
  9778  	c.ctx_ = ctx
  9779  	defer c.PageToken(c.urlParams_.Get("pageToken"))
  9780  	for {
  9781  		x, err := c.Do()
  9782  		if err != nil {
  9783  			return err
  9784  		}
  9785  		if err := f(x); err != nil {
  9786  			return err
  9787  		}
  9788  		if x.NextPageToken == "" {
  9789  			return nil
  9790  		}
  9791  		c.PageToken(x.NextPageToken)
  9792  	}
  9793  }
  9794  
  9795  type UserProfilesGuardianInvitationsPatchCall struct {
  9796  	s                  *Service
  9797  	studentId          string
  9798  	invitationId       string
  9799  	guardianinvitation *GuardianInvitation
  9800  	urlParams_         gensupport.URLParams
  9801  	ctx_               context.Context
  9802  	header_            http.Header
  9803  }
  9804  
  9805  // Patch: Modifies a guardian invitation. Currently, the only valid
  9806  // modification is to change the `state` from `PENDING` to `COMPLETE`. This has
  9807  // the effect of withdrawing the invitation. This method returns the following
  9808  // error codes: * `PERMISSION_DENIED` if the current user does not have
  9809  // permission to manage guardians, if guardians are not enabled for the domain
  9810  // in question or for other access errors. * `FAILED_PRECONDITION` if the
  9811  // guardian link is not in the `PENDING` state. * `INVALID_ARGUMENT` if the
  9812  // format of the student ID provided cannot be recognized (it is not an email
  9813  // address, nor a `user_id` from this API), or if the passed
  9814  // `GuardianInvitation` has a `state` other than `COMPLETE`, or if it modifies
  9815  // fields other than `state`. * `NOT_FOUND` if the student ID provided is a
  9816  // valid student ID, but Classroom has no record of that student, or if the
  9817  // `id` field does not refer to a guardian invitation known to Classroom.
  9818  //
  9819  //   - invitationId: The `id` field of the `GuardianInvitation` to be modified.
  9820  //   - studentId: The ID of the student whose guardian invitation is to be
  9821  //     modified.
  9822  func (r *UserProfilesGuardianInvitationsService) Patch(studentId string, invitationId string, guardianinvitation *GuardianInvitation) *UserProfilesGuardianInvitationsPatchCall {
  9823  	c := &UserProfilesGuardianInvitationsPatchCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9824  	c.studentId = studentId
  9825  	c.invitationId = invitationId
  9826  	c.guardianinvitation = guardianinvitation
  9827  	return c
  9828  }
  9829  
  9830  // UpdateMask sets the optional parameter "updateMask": Mask that identifies
  9831  // which fields on the course to update. This field is required to do an
  9832  // update. The update fails if invalid fields are specified. The following
  9833  // fields are valid: * `state` When set in a query parameter, this field should
  9834  // be specified as `updateMask=,,...`
  9835  func (c *UserProfilesGuardianInvitationsPatchCall) UpdateMask(updateMask string) *UserProfilesGuardianInvitationsPatchCall {
  9836  	c.urlParams_.Set("updateMask", updateMask)
  9837  	return c
  9838  }
  9839  
  9840  // Fields allows partial responses to be retrieved. See
  9841  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  9842  // details.
  9843  func (c *UserProfilesGuardianInvitationsPatchCall) Fields(s ...googleapi.Field) *UserProfilesGuardianInvitationsPatchCall {
  9844  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9845  	return c
  9846  }
  9847  
  9848  // Context sets the context to be used in this call's Do method.
  9849  func (c *UserProfilesGuardianInvitationsPatchCall) Context(ctx context.Context) *UserProfilesGuardianInvitationsPatchCall {
  9850  	c.ctx_ = ctx
  9851  	return c
  9852  }
  9853  
  9854  // Header returns a http.Header that can be modified by the caller to add
  9855  // headers to the request.
  9856  func (c *UserProfilesGuardianInvitationsPatchCall) Header() http.Header {
  9857  	if c.header_ == nil {
  9858  		c.header_ = make(http.Header)
  9859  	}
  9860  	return c.header_
  9861  }
  9862  
  9863  func (c *UserProfilesGuardianInvitationsPatchCall) doRequest(alt string) (*http.Response, error) {
  9864  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "application/json", c.header_)
  9865  	var body io.Reader = nil
  9866  	body, err := googleapi.WithoutDataWrapper.JSONReader(c.guardianinvitation)
  9867  	if err != nil {
  9868  		return nil, err
  9869  	}
  9870  	c.urlParams_.Set("alt", alt)
  9871  	c.urlParams_.Set("prettyPrint", "false")
  9872  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/userProfiles/{studentId}/guardianInvitations/{invitationId}")
  9873  	urls += "?" + c.urlParams_.Encode()
  9874  	req, err := http.NewRequest("PATCH", urls, body)
  9875  	if err != nil {
  9876  		return nil, err
  9877  	}
  9878  	req.Header = reqHeaders
  9879  	googleapi.Expand(req.URL, map[string]string{
  9880  		"studentId":    c.studentId,
  9881  		"invitationId": c.invitationId,
  9882  	})
  9883  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9884  }
  9885  
  9886  // Do executes the "classroom.userProfiles.guardianInvitations.patch" call.
  9887  // Any non-2xx status code is an error. Response headers are in either
  9888  // *GuardianInvitation.ServerResponse.Header or (if a response was returned at
  9889  // all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
  9890  // check whether the returned error was because http.StatusNotModified was
  9891  // returned.
  9892  func (c *UserProfilesGuardianInvitationsPatchCall) Do(opts ...googleapi.CallOption) (*GuardianInvitation, error) {
  9893  	gensupport.SetOptions(c.urlParams_, opts...)
  9894  	res, err := c.doRequest("json")
  9895  	if res != nil && res.StatusCode == http.StatusNotModified {
  9896  		if res.Body != nil {
  9897  			res.Body.Close()
  9898  		}
  9899  		return nil, gensupport.WrapError(&googleapi.Error{
  9900  			Code:   res.StatusCode,
  9901  			Header: res.Header,
  9902  		})
  9903  	}
  9904  	if err != nil {
  9905  		return nil, err
  9906  	}
  9907  	defer googleapi.CloseBody(res)
  9908  	if err := googleapi.CheckResponse(res); err != nil {
  9909  		return nil, gensupport.WrapError(err)
  9910  	}
  9911  	ret := &GuardianInvitation{
  9912  		ServerResponse: googleapi.ServerResponse{
  9913  			Header:         res.Header,
  9914  			HTTPStatusCode: res.StatusCode,
  9915  		},
  9916  	}
  9917  	target := &ret
  9918  	if err := gensupport.DecodeResponse(target, res); err != nil {
  9919  		return nil, err
  9920  	}
  9921  	return ret, nil
  9922  }
  9923  
  9924  type UserProfilesGuardiansDeleteCall struct {
  9925  	s          *Service
  9926  	studentId  string
  9927  	guardianId string
  9928  	urlParams_ gensupport.URLParams
  9929  	ctx_       context.Context
  9930  	header_    http.Header
  9931  }
  9932  
  9933  // Delete: Deletes a guardian. The guardian will no longer receive guardian
  9934  // notifications and the guardian will no longer be accessible via the API.
  9935  // This method returns the following error codes: * `PERMISSION_DENIED` if no
  9936  // user that matches the provided `student_id` is visible to the requesting
  9937  // user, if the requesting user is not permitted to manage guardians for the
  9938  // student identified by the `student_id`, if guardians are not enabled for the
  9939  // domain in question, or for other access errors. * `INVALID_ARGUMENT` if a
  9940  // `student_id` is specified, but its format cannot be recognized (it is not an
  9941  // email address, nor a `student_id` from the API). * `NOT_FOUND` if the
  9942  // requesting user is permitted to modify guardians for the requested
  9943  // `student_id`, but no `Guardian` record exists for that student with the
  9944  // provided `guardian_id`.
  9945  //
  9946  //   - guardianId: The `id` field from a `Guardian`.
  9947  //   - studentId: The student whose guardian is to be deleted. One of the
  9948  //     following: * the numeric identifier for the user * the email address of
  9949  //     the user * the string literal "me", indicating the requesting user.
  9950  func (r *UserProfilesGuardiansService) Delete(studentId string, guardianId string) *UserProfilesGuardiansDeleteCall {
  9951  	c := &UserProfilesGuardiansDeleteCall{s: r.s, urlParams_: make(gensupport.URLParams)}
  9952  	c.studentId = studentId
  9953  	c.guardianId = guardianId
  9954  	return c
  9955  }
  9956  
  9957  // Fields allows partial responses to be retrieved. See
  9958  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
  9959  // details.
  9960  func (c *UserProfilesGuardiansDeleteCall) Fields(s ...googleapi.Field) *UserProfilesGuardiansDeleteCall {
  9961  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
  9962  	return c
  9963  }
  9964  
  9965  // Context sets the context to be used in this call's Do method.
  9966  func (c *UserProfilesGuardiansDeleteCall) Context(ctx context.Context) *UserProfilesGuardiansDeleteCall {
  9967  	c.ctx_ = ctx
  9968  	return c
  9969  }
  9970  
  9971  // Header returns a http.Header that can be modified by the caller to add
  9972  // headers to the request.
  9973  func (c *UserProfilesGuardiansDeleteCall) Header() http.Header {
  9974  	if c.header_ == nil {
  9975  		c.header_ = make(http.Header)
  9976  	}
  9977  	return c.header_
  9978  }
  9979  
  9980  func (c *UserProfilesGuardiansDeleteCall) doRequest(alt string) (*http.Response, error) {
  9981  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
  9982  	var body io.Reader = nil
  9983  	c.urlParams_.Set("alt", alt)
  9984  	c.urlParams_.Set("prettyPrint", "false")
  9985  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/userProfiles/{studentId}/guardians/{guardianId}")
  9986  	urls += "?" + c.urlParams_.Encode()
  9987  	req, err := http.NewRequest("DELETE", urls, body)
  9988  	if err != nil {
  9989  		return nil, err
  9990  	}
  9991  	req.Header = reqHeaders
  9992  	googleapi.Expand(req.URL, map[string]string{
  9993  		"studentId":  c.studentId,
  9994  		"guardianId": c.guardianId,
  9995  	})
  9996  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
  9997  }
  9998  
  9999  // Do executes the "classroom.userProfiles.guardians.delete" call.
 10000  // Any non-2xx status code is an error. Response headers are in either
 10001  // *Empty.ServerResponse.Header or (if a response was returned at all) in
 10002  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
 10003  // whether the returned error was because http.StatusNotModified was returned.
 10004  func (c *UserProfilesGuardiansDeleteCall) Do(opts ...googleapi.CallOption) (*Empty, error) {
 10005  	gensupport.SetOptions(c.urlParams_, opts...)
 10006  	res, err := c.doRequest("json")
 10007  	if res != nil && res.StatusCode == http.StatusNotModified {
 10008  		if res.Body != nil {
 10009  			res.Body.Close()
 10010  		}
 10011  		return nil, gensupport.WrapError(&googleapi.Error{
 10012  			Code:   res.StatusCode,
 10013  			Header: res.Header,
 10014  		})
 10015  	}
 10016  	if err != nil {
 10017  		return nil, err
 10018  	}
 10019  	defer googleapi.CloseBody(res)
 10020  	if err := googleapi.CheckResponse(res); err != nil {
 10021  		return nil, gensupport.WrapError(err)
 10022  	}
 10023  	ret := &Empty{
 10024  		ServerResponse: googleapi.ServerResponse{
 10025  			Header:         res.Header,
 10026  			HTTPStatusCode: res.StatusCode,
 10027  		},
 10028  	}
 10029  	target := &ret
 10030  	if err := gensupport.DecodeResponse(target, res); err != nil {
 10031  		return nil, err
 10032  	}
 10033  	return ret, nil
 10034  }
 10035  
 10036  type UserProfilesGuardiansGetCall struct {
 10037  	s            *Service
 10038  	studentId    string
 10039  	guardianId   string
 10040  	urlParams_   gensupport.URLParams
 10041  	ifNoneMatch_ string
 10042  	ctx_         context.Context
 10043  	header_      http.Header
 10044  }
 10045  
 10046  // Get: Returns a specific guardian. This method returns the following error
 10047  // codes: * `PERMISSION_DENIED` if no user that matches the provided
 10048  // `student_id` is visible to the requesting user, if the requesting user is
 10049  // not permitted to view guardian information for the student identified by the
 10050  // `student_id`, if guardians are not enabled for the domain in question, or
 10051  // for other access errors. * `INVALID_ARGUMENT` if a `student_id` is
 10052  // specified, but its format cannot be recognized (it is not an email address,
 10053  // nor a `student_id` from the API, nor the literal string `me`). * `NOT_FOUND`
 10054  // if the requesting user is permitted to view guardians for the requested
 10055  // `student_id`, but no `Guardian` record exists for that student that matches
 10056  // the provided `guardian_id`.
 10057  //
 10058  //   - guardianId: The `id` field from a `Guardian`.
 10059  //   - studentId: The student whose guardian is being requested. One of the
 10060  //     following: * the numeric identifier for the user * the email address of
 10061  //     the user * the string literal "me", indicating the requesting user.
 10062  func (r *UserProfilesGuardiansService) Get(studentId string, guardianId string) *UserProfilesGuardiansGetCall {
 10063  	c := &UserProfilesGuardiansGetCall{s: r.s, urlParams_: make(gensupport.URLParams)}
 10064  	c.studentId = studentId
 10065  	c.guardianId = guardianId
 10066  	return c
 10067  }
 10068  
 10069  // Fields allows partial responses to be retrieved. See
 10070  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
 10071  // details.
 10072  func (c *UserProfilesGuardiansGetCall) Fields(s ...googleapi.Field) *UserProfilesGuardiansGetCall {
 10073  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
 10074  	return c
 10075  }
 10076  
 10077  // IfNoneMatch sets an optional parameter which makes the operation fail if the
 10078  // object's ETag matches the given value. This is useful for getting updates
 10079  // only after the object has changed since the last request.
 10080  func (c *UserProfilesGuardiansGetCall) IfNoneMatch(entityTag string) *UserProfilesGuardiansGetCall {
 10081  	c.ifNoneMatch_ = entityTag
 10082  	return c
 10083  }
 10084  
 10085  // Context sets the context to be used in this call's Do method.
 10086  func (c *UserProfilesGuardiansGetCall) Context(ctx context.Context) *UserProfilesGuardiansGetCall {
 10087  	c.ctx_ = ctx
 10088  	return c
 10089  }
 10090  
 10091  // Header returns a http.Header that can be modified by the caller to add
 10092  // headers to the request.
 10093  func (c *UserProfilesGuardiansGetCall) Header() http.Header {
 10094  	if c.header_ == nil {
 10095  		c.header_ = make(http.Header)
 10096  	}
 10097  	return c.header_
 10098  }
 10099  
 10100  func (c *UserProfilesGuardiansGetCall) doRequest(alt string) (*http.Response, error) {
 10101  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
 10102  	if c.ifNoneMatch_ != "" {
 10103  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
 10104  	}
 10105  	var body io.Reader = nil
 10106  	c.urlParams_.Set("alt", alt)
 10107  	c.urlParams_.Set("prettyPrint", "false")
 10108  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/userProfiles/{studentId}/guardians/{guardianId}")
 10109  	urls += "?" + c.urlParams_.Encode()
 10110  	req, err := http.NewRequest("GET", urls, body)
 10111  	if err != nil {
 10112  		return nil, err
 10113  	}
 10114  	req.Header = reqHeaders
 10115  	googleapi.Expand(req.URL, map[string]string{
 10116  		"studentId":  c.studentId,
 10117  		"guardianId": c.guardianId,
 10118  	})
 10119  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
 10120  }
 10121  
 10122  // Do executes the "classroom.userProfiles.guardians.get" call.
 10123  // Any non-2xx status code is an error. Response headers are in either
 10124  // *Guardian.ServerResponse.Header or (if a response was returned at all) in
 10125  // error.(*googleapi.Error).Header. Use googleapi.IsNotModified to check
 10126  // whether the returned error was because http.StatusNotModified was returned.
 10127  func (c *UserProfilesGuardiansGetCall) Do(opts ...googleapi.CallOption) (*Guardian, error) {
 10128  	gensupport.SetOptions(c.urlParams_, opts...)
 10129  	res, err := c.doRequest("json")
 10130  	if res != nil && res.StatusCode == http.StatusNotModified {
 10131  		if res.Body != nil {
 10132  			res.Body.Close()
 10133  		}
 10134  		return nil, gensupport.WrapError(&googleapi.Error{
 10135  			Code:   res.StatusCode,
 10136  			Header: res.Header,
 10137  		})
 10138  	}
 10139  	if err != nil {
 10140  		return nil, err
 10141  	}
 10142  	defer googleapi.CloseBody(res)
 10143  	if err := googleapi.CheckResponse(res); err != nil {
 10144  		return nil, gensupport.WrapError(err)
 10145  	}
 10146  	ret := &Guardian{
 10147  		ServerResponse: googleapi.ServerResponse{
 10148  			Header:         res.Header,
 10149  			HTTPStatusCode: res.StatusCode,
 10150  		},
 10151  	}
 10152  	target := &ret
 10153  	if err := gensupport.DecodeResponse(target, res); err != nil {
 10154  		return nil, err
 10155  	}
 10156  	return ret, nil
 10157  }
 10158  
 10159  type UserProfilesGuardiansListCall struct {
 10160  	s            *Service
 10161  	studentId    string
 10162  	urlParams_   gensupport.URLParams
 10163  	ifNoneMatch_ string
 10164  	ctx_         context.Context
 10165  	header_      http.Header
 10166  }
 10167  
 10168  // List: Returns a list of guardians that the requesting user is permitted to
 10169  // view, restricted to those that match the request. To list guardians for any
 10170  // student that the requesting user may view guardians for, use the literal
 10171  // character `-` for the student ID. This method returns the following error
 10172  // codes: * `PERMISSION_DENIED` if a `student_id` is specified, and the
 10173  // requesting user is not permitted to view guardian information for that
 10174  // student, if "-" is specified as the `student_id` and the user is not a
 10175  // domain administrator, if guardians are not enabled for the domain in
 10176  // question, if the `invited_email_address` filter is set by a user who is not
 10177  // a domain administrator, or for other access errors. * `INVALID_ARGUMENT` if
 10178  // a `student_id` is specified, but its format cannot be recognized (it is not
 10179  // an email address, nor a `student_id` from the API, nor the literal string
 10180  // `me`). May also be returned if an invalid `page_token` is provided. *
 10181  // `NOT_FOUND` if a `student_id` is specified, and its format can be
 10182  // recognized, but Classroom has no record of that student.
 10183  //
 10184  //   - studentId: Filter results by the student who the guardian is linked to.
 10185  //     The identifier can be one of the following: * the numeric identifier for
 10186  //     the user * the email address of the user * the string literal "me",
 10187  //     indicating the requesting user * the string literal "-", indicating that
 10188  //     results should be returned for all students that the requesting user has
 10189  //     access to view.
 10190  func (r *UserProfilesGuardiansService) List(studentId string) *UserProfilesGuardiansListCall {
 10191  	c := &UserProfilesGuardiansListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
 10192  	c.studentId = studentId
 10193  	return c
 10194  }
 10195  
 10196  // InvitedEmailAddress sets the optional parameter "invitedEmailAddress":
 10197  // Filter results by the email address that the original invitation was sent
 10198  // to, resulting in this guardian link. This filter can only be used by domain
 10199  // administrators.
 10200  func (c *UserProfilesGuardiansListCall) InvitedEmailAddress(invitedEmailAddress string) *UserProfilesGuardiansListCall {
 10201  	c.urlParams_.Set("invitedEmailAddress", invitedEmailAddress)
 10202  	return c
 10203  }
 10204  
 10205  // PageSize sets the optional parameter "pageSize": Maximum number of items to
 10206  // return. Zero or unspecified indicates that the server may assign a maximum.
 10207  // The server may return fewer than the specified number of results.
 10208  func (c *UserProfilesGuardiansListCall) PageSize(pageSize int64) *UserProfilesGuardiansListCall {
 10209  	c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
 10210  	return c
 10211  }
 10212  
 10213  // PageToken sets the optional parameter "pageToken": nextPageToken value
 10214  // returned from a previous list call, indicating that the subsequent page of
 10215  // results should be returned. The list request must be otherwise identical to
 10216  // the one that resulted in this token.
 10217  func (c *UserProfilesGuardiansListCall) PageToken(pageToken string) *UserProfilesGuardiansListCall {
 10218  	c.urlParams_.Set("pageToken", pageToken)
 10219  	return c
 10220  }
 10221  
 10222  // Fields allows partial responses to be retrieved. See
 10223  // https://developers.google.com/gdata/docs/2.0/basics#PartialResponse for more
 10224  // details.
 10225  func (c *UserProfilesGuardiansListCall) Fields(s ...googleapi.Field) *UserProfilesGuardiansListCall {
 10226  	c.urlParams_.Set("fields", googleapi.CombineFields(s))
 10227  	return c
 10228  }
 10229  
 10230  // IfNoneMatch sets an optional parameter which makes the operation fail if the
 10231  // object's ETag matches the given value. This is useful for getting updates
 10232  // only after the object has changed since the last request.
 10233  func (c *UserProfilesGuardiansListCall) IfNoneMatch(entityTag string) *UserProfilesGuardiansListCall {
 10234  	c.ifNoneMatch_ = entityTag
 10235  	return c
 10236  }
 10237  
 10238  // Context sets the context to be used in this call's Do method.
 10239  func (c *UserProfilesGuardiansListCall) Context(ctx context.Context) *UserProfilesGuardiansListCall {
 10240  	c.ctx_ = ctx
 10241  	return c
 10242  }
 10243  
 10244  // Header returns a http.Header that can be modified by the caller to add
 10245  // headers to the request.
 10246  func (c *UserProfilesGuardiansListCall) Header() http.Header {
 10247  	if c.header_ == nil {
 10248  		c.header_ = make(http.Header)
 10249  	}
 10250  	return c.header_
 10251  }
 10252  
 10253  func (c *UserProfilesGuardiansListCall) doRequest(alt string) (*http.Response, error) {
 10254  	reqHeaders := gensupport.SetHeaders(c.s.userAgent(), "", c.header_)
 10255  	if c.ifNoneMatch_ != "" {
 10256  		reqHeaders.Set("If-None-Match", c.ifNoneMatch_)
 10257  	}
 10258  	var body io.Reader = nil
 10259  	c.urlParams_.Set("alt", alt)
 10260  	c.urlParams_.Set("prettyPrint", "false")
 10261  	urls := googleapi.ResolveRelative(c.s.BasePath, "v1/userProfiles/{studentId}/guardians")
 10262  	urls += "?" + c.urlParams_.Encode()
 10263  	req, err := http.NewRequest("GET", urls, body)
 10264  	if err != nil {
 10265  		return nil, err
 10266  	}
 10267  	req.Header = reqHeaders
 10268  	googleapi.Expand(req.URL, map[string]string{
 10269  		"studentId": c.studentId,
 10270  	})
 10271  	return gensupport.SendRequest(c.ctx_, c.s.client, req)
 10272  }
 10273  
 10274  // Do executes the "classroom.userProfiles.guardians.list" call.
 10275  // Any non-2xx status code is an error. Response headers are in either
 10276  // *ListGuardiansResponse.ServerResponse.Header or (if a response was returned
 10277  // at all) in error.(*googleapi.Error).Header. Use googleapi.IsNotModified to
 10278  // check whether the returned error was because http.StatusNotModified was
 10279  // returned.
 10280  func (c *UserProfilesGuardiansListCall) Do(opts ...googleapi.CallOption) (*ListGuardiansResponse, error) {
 10281  	gensupport.SetOptions(c.urlParams_, opts...)
 10282  	res, err := c.doRequest("json")
 10283  	if res != nil && res.StatusCode == http.StatusNotModified {
 10284  		if res.Body != nil {
 10285  			res.Body.Close()
 10286  		}
 10287  		return nil, gensupport.WrapError(&googleapi.Error{
 10288  			Code:   res.StatusCode,
 10289  			Header: res.Header,
 10290  		})
 10291  	}
 10292  	if err != nil {
 10293  		return nil, err
 10294  	}
 10295  	defer googleapi.CloseBody(res)
 10296  	if err := googleapi.CheckResponse(res); err != nil {
 10297  		return nil, gensupport.WrapError(err)
 10298  	}
 10299  	ret := &ListGuardiansResponse{
 10300  		ServerResponse: googleapi.ServerResponse{
 10301  			Header:         res.Header,
 10302  			HTTPStatusCode: res.StatusCode,
 10303  		},
 10304  	}
 10305  	target := &ret
 10306  	if err := gensupport.DecodeResponse(target, res); err != nil {
 10307  		return nil, err
 10308  	}
 10309  	return ret, nil
 10310  }
 10311  
 10312  // Pages invokes f for each page of results.
 10313  // A non-nil error returned from f will halt the iteration.
 10314  // The provided context supersedes any context provided to the Context method.
 10315  func (c *UserProfilesGuardiansListCall) Pages(ctx context.Context, f func(*ListGuardiansResponse) error) error {
 10316  	c.ctx_ = ctx
 10317  	defer c.PageToken(c.urlParams_.Get("pageToken"))
 10318  	for {
 10319  		x, err := c.Do()
 10320  		if err != nil {
 10321  			return err
 10322  		}
 10323  		if err := f(x); err != nil {
 10324  			return err
 10325  		}
 10326  		if x.NextPageToken == "" {
 10327  			return nil
 10328  		}
 10329  		c.PageToken(x.NextPageToken)
 10330  	}
 10331  }
 10332  

View as plain text