1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56 package classroom
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
79
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
102 const (
103
104 ClassroomAnnouncementsScope = "https://www.googleapis.com/auth/classroom.announcements"
105
106
107 ClassroomAnnouncementsReadonlyScope = "https://www.googleapis.com/auth/classroom.announcements.readonly"
108
109
110 ClassroomCoursesScope = "https://www.googleapis.com/auth/classroom.courses"
111
112
113 ClassroomCoursesReadonlyScope = "https://www.googleapis.com/auth/classroom.courses.readonly"
114
115
116
117 ClassroomCourseworkMeScope = "https://www.googleapis.com/auth/classroom.coursework.me"
118
119
120 ClassroomCourseworkMeReadonlyScope = "https://www.googleapis.com/auth/classroom.coursework.me.readonly"
121
122
123
124 ClassroomCourseworkStudentsScope = "https://www.googleapis.com/auth/classroom.coursework.students"
125
126
127
128 ClassroomCourseworkStudentsReadonlyScope = "https://www.googleapis.com/auth/classroom.coursework.students.readonly"
129
130
131 ClassroomCourseworkmaterialsScope = "https://www.googleapis.com/auth/classroom.courseworkmaterials"
132
133
134 ClassroomCourseworkmaterialsReadonlyScope = "https://www.googleapis.com/auth/classroom.courseworkmaterials.readonly"
135
136
137 ClassroomGuardianlinksMeReadonlyScope = "https://www.googleapis.com/auth/classroom.guardianlinks.me.readonly"
138
139
140 ClassroomGuardianlinksStudentsScope = "https://www.googleapis.com/auth/classroom.guardianlinks.students"
141
142
143 ClassroomGuardianlinksStudentsReadonlyScope = "https://www.googleapis.com/auth/classroom.guardianlinks.students.readonly"
144
145
146 ClassroomProfileEmailsScope = "https://www.googleapis.com/auth/classroom.profile.emails"
147
148
149 ClassroomProfilePhotosScope = "https://www.googleapis.com/auth/classroom.profile.photos"
150
151
152 ClassroomPushNotificationsScope = "https://www.googleapis.com/auth/classroom.push-notifications"
153
154
155 ClassroomRostersScope = "https://www.googleapis.com/auth/classroom.rosters"
156
157
158 ClassroomRostersReadonlyScope = "https://www.googleapis.com/auth/classroom.rosters.readonly"
159
160
161 ClassroomStudentSubmissionsMeReadonlyScope = "https://www.googleapis.com/auth/classroom.student-submissions.me.readonly"
162
163
164
165 ClassroomStudentSubmissionsStudentsReadonlyScope = "https://www.googleapis.com/auth/classroom.student-submissions.students.readonly"
166
167
168 ClassroomTopicsScope = "https://www.googleapis.com/auth/classroom.topics"
169
170
171 ClassroomTopicsReadonlyScope = "https://www.googleapis.com/auth/classroom.topics.readonly"
172 )
173
174
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
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
221
222
223
224
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
240 UserAgent string
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
415 type Announcement struct {
416
417
418 AlternateLink string `json:"alternateLink,omitempty"`
419
420
421
422
423
424
425
426 AssigneeMode string `json:"assigneeMode,omitempty"`
427
428 CourseId string `json:"courseId,omitempty"`
429
430 CreationTime string `json:"creationTime,omitempty"`
431
432
433 CreatorUserId string `json:"creatorUserId,omitempty"`
434
435
436 Id string `json:"id,omitempty"`
437
438
439
440
441 IndividualStudentsOptions *IndividualStudentsOptions `json:"individualStudentsOptions,omitempty"`
442
443
444 Materials []*Material `json:"materials,omitempty"`
445
446
447 ScheduledTime string `json:"scheduledTime,omitempty"`
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462 State string `json:"state,omitempty"`
463
464
465 Text string `json:"text,omitempty"`
466
467
468 UpdateTime string `json:"updateTime,omitempty"`
469
470
471 googleapi.ServerResponse `json:"-"`
472
473
474
475
476
477 ForceSendFields []string `json:"-"`
478
479
480
481
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
491 type Assignment struct {
492
493
494 StudentWorkFolder *DriveFolder `json:"studentWorkFolder,omitempty"`
495
496
497
498
499
500 ForceSendFields []string `json:"-"`
501
502
503
504
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
514 type AssignmentSubmission struct {
515
516
517
518
519
520
521 Attachments []*Attachment `json:"attachments,omitempty"`
522
523
524
525
526
527 ForceSendFields []string `json:"-"`
528
529
530
531
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
541
542 type Attachment struct {
543
544 DriveFile *DriveFile `json:"driveFile,omitempty"`
545
546 Form *Form `json:"form,omitempty"`
547
548 Link *Link `json:"link,omitempty"`
549
550 YouTubeVideo *YouTubeVideo `json:"youTubeVideo,omitempty"`
551
552
553
554
555
556 ForceSendFields []string `json:"-"`
557
558
559
560
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
570
571
572
573 type CloudPubsubTopic struct {
574
575
576 TopicName string `json:"topicName,omitempty"`
577
578
579
580
581
582 ForceSendFields []string `json:"-"`
583
584
585
586
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
596 type Course struct {
597
598
599 AlternateLink string `json:"alternateLink,omitempty"`
600
601
602
603
604
605
606 CalendarId string `json:"calendarId,omitempty"`
607
608
609
610 CourseGroupEmail string `json:"courseGroupEmail,omitempty"`
611
612
613 CourseMaterialSets []*CourseMaterialSet `json:"courseMaterialSets,omitempty"`
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635 CourseState string `json:"courseState,omitempty"`
636
637
638 CreationTime string `json:"creationTime,omitempty"`
639
640
641
642
643 Description string `json:"description,omitempty"`
644
645
646
647 DescriptionHeading string `json:"descriptionHeading,omitempty"`
648
649
650 EnrollmentCode string `json:"enrollmentCode,omitempty"`
651
652
653
654 GradebookSettings *GradebookSettings `json:"gradebookSettings,omitempty"`
655
656
657 GuardiansEnabled bool `json:"guardiansEnabled,omitempty"`
658
659
660
661
662
663 Id string `json:"id,omitempty"`
664
665
666 Name string `json:"name,omitempty"`
667
668
669
670
671
672
673
674 OwnerId string `json:"ownerId,omitempty"`
675
676
677 Room string `json:"room,omitempty"`
678
679
680 Section string `json:"section,omitempty"`
681
682
683
684 TeacherFolder *DriveFolder `json:"teacherFolder,omitempty"`
685
686
687
688 TeacherGroupEmail string `json:"teacherGroupEmail,omitempty"`
689
690
691 UpdateTime string `json:"updateTime,omitempty"`
692
693
694 googleapi.ServerResponse `json:"-"`
695
696
697
698
699
700 ForceSendFields []string `json:"-"`
701
702
703
704
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
714
715
716
717
718
719
720
721
722
723
724
725 type CourseAlias struct {
726
727
728
729
730 Alias string `json:"alias,omitempty"`
731
732
733 googleapi.ServerResponse `json:"-"`
734
735
736
737
738
739 ForceSendFields []string `json:"-"`
740
741
742
743
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
753 type CourseMaterial struct {
754
755 DriveFile *DriveFile `json:"driveFile,omitempty"`
756
757 Form *Form `json:"form,omitempty"`
758
759 Link *Link `json:"link,omitempty"`
760
761 YouTubeVideo *YouTubeVideo `json:"youTubeVideo,omitempty"`
762
763
764
765
766
767 ForceSendFields []string `json:"-"`
768
769
770
771
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
781
782
783 type CourseMaterialSet struct {
784
785 Materials []*CourseMaterial `json:"materials,omitempty"`
786
787 Title string `json:"title,omitempty"`
788
789
790
791
792
793 ForceSendFields []string `json:"-"`
794
795
796
797
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
807
808 type CourseRosterChangesInfo struct {
809
810 CourseId string `json:"courseId,omitempty"`
811
812
813
814
815
816 ForceSendFields []string `json:"-"`
817
818
819
820
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
830 type CourseWork struct {
831
832
833 AlternateLink string `json:"alternateLink,omitempty"`
834
835
836
837
838
839
840
841 AssigneeMode string `json:"assigneeMode,omitempty"`
842
843
844 Assignment *Assignment `json:"assignment,omitempty"`
845
846
847
848 AssociatedWithDeveloper bool `json:"associatedWithDeveloper,omitempty"`
849
850 CourseId string `json:"courseId,omitempty"`
851
852 CreationTime string `json:"creationTime,omitempty"`
853
854
855 CreatorUserId string `json:"creatorUserId,omitempty"`
856
857
858
859 Description string `json:"description,omitempty"`
860
861
862 DueDate *Date `json:"dueDate,omitempty"`
863
864
865 DueTime *TimeOfDay `json:"dueTime,omitempty"`
866
867
868
869 GradeCategory *GradeCategory `json:"gradeCategory,omitempty"`
870
871
872 Id string `json:"id,omitempty"`
873
874
875
876
877 IndividualStudentsOptions *IndividualStudentsOptions `json:"individualStudentsOptions,omitempty"`
878
879
880 Materials []*Material `json:"materials,omitempty"`
881
882
883
884 MaxPoints float64 `json:"maxPoints,omitempty"`
885
886
887
888
889
890 MultipleChoiceQuestion *MultipleChoiceQuestion `json:"multipleChoiceQuestion,omitempty"`
891
892
893 ScheduledTime string `json:"scheduledTime,omitempty"`
894
895
896
897
898
899
900
901
902
903
904
905
906
907 State string `json:"state,omitempty"`
908
909
910
911
912
913
914
915
916
917
918 SubmissionModificationMode string `json:"submissionModificationMode,omitempty"`
919
920
921 Title string `json:"title,omitempty"`
922
923
924 TopicId string `json:"topicId,omitempty"`
925
926
927 UpdateTime string `json:"updateTime,omitempty"`
928
929
930
931
932
933
934
935
936
937 WorkType string `json:"workType,omitempty"`
938
939
940 googleapi.ServerResponse `json:"-"`
941
942
943
944
945
946 ForceSendFields []string `json:"-"`
947
948
949
950
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
974
975 type CourseWorkChangesInfo struct {
976
977 CourseId string `json:"courseId,omitempty"`
978
979
980
981
982
983 ForceSendFields []string `json:"-"`
984
985
986
987
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
997
998 type CourseWorkMaterial struct {
999
1000
1001 AlternateLink string `json:"alternateLink,omitempty"`
1002
1003
1004
1005
1006
1007
1008
1009 AssigneeMode string `json:"assigneeMode,omitempty"`
1010
1011 CourseId string `json:"courseId,omitempty"`
1012
1013
1014 CreationTime string `json:"creationTime,omitempty"`
1015
1016
1017 CreatorUserId string `json:"creatorUserId,omitempty"`
1018
1019
1020 Description string `json:"description,omitempty"`
1021
1022
1023 Id string `json:"id,omitempty"`
1024
1025
1026
1027
1028 IndividualStudentsOptions *IndividualStudentsOptions `json:"individualStudentsOptions,omitempty"`
1029
1030
1031 Materials []*Material `json:"materials,omitempty"`
1032
1033
1034 ScheduledTime string `json:"scheduledTime,omitempty"`
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050 State string `json:"state,omitempty"`
1051
1052
1053 Title string `json:"title,omitempty"`
1054
1055
1056 TopicId string `json:"topicId,omitempty"`
1057
1058
1059 UpdateTime string `json:"updateTime,omitempty"`
1060
1061
1062 googleapi.ServerResponse `json:"-"`
1063
1064
1065
1066
1067
1068 ForceSendFields []string `json:"-"`
1069
1070
1071
1072
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
1082
1083
1084
1085
1086
1087
1088
1089
1090 type Date struct {
1091
1092
1093
1094 Day int64 `json:"day,omitempty"`
1095
1096
1097 Month int64 `json:"month,omitempty"`
1098
1099
1100 Year int64 `json:"year,omitempty"`
1101
1102
1103
1104
1105
1106 ForceSendFields []string `json:"-"`
1107
1108
1109
1110
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
1120 type DriveFile struct {
1121
1122 AlternateLink string `json:"alternateLink,omitempty"`
1123
1124 Id string `json:"id,omitempty"`
1125
1126 ThumbnailUrl string `json:"thumbnailUrl,omitempty"`
1127
1128 Title string `json:"title,omitempty"`
1129
1130
1131
1132
1133
1134 ForceSendFields []string `json:"-"`
1135
1136
1137
1138
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
1148 type DriveFolder struct {
1149
1150 AlternateLink string `json:"alternateLink,omitempty"`
1151
1152 Id string `json:"id,omitempty"`
1153
1154 Title string `json:"title,omitempty"`
1155
1156
1157
1158
1159
1160 ForceSendFields []string `json:"-"`
1161
1162
1163
1164
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
1174
1175
1176
1177 type Empty struct {
1178
1179 googleapi.ServerResponse `json:"-"`
1180 }
1181
1182
1183
1184 type Feed struct {
1185
1186
1187
1188 CourseRosterChangesInfo *CourseRosterChangesInfo `json:"courseRosterChangesInfo,omitempty"`
1189
1190
1191
1192 CourseWorkChangesInfo *CourseWorkChangesInfo `json:"courseWorkChangesInfo,omitempty"`
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213 FeedType string `json:"feedType,omitempty"`
1214
1215
1216
1217
1218
1219 ForceSendFields []string `json:"-"`
1220
1221
1222
1223
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
1233 type Form struct {
1234
1235 FormUrl string `json:"formUrl,omitempty"`
1236
1237
1238
1239 ResponseUrl string `json:"responseUrl,omitempty"`
1240
1241 ThumbnailUrl string `json:"thumbnailUrl,omitempty"`
1242
1243 Title string `json:"title,omitempty"`
1244
1245
1246
1247
1248
1249 ForceSendFields []string `json:"-"`
1250
1251
1252
1253
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
1263 type GlobalPermission struct {
1264
1265
1266
1267
1268
1269
1270 Permission string `json:"permission,omitempty"`
1271
1272
1273
1274
1275
1276 ForceSendFields []string `json:"-"`
1277
1278
1279
1280
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
1290
1291
1292
1293 type GradeCategory struct {
1294
1295
1296 DefaultGradeDenominator int64 `json:"defaultGradeDenominator,omitempty"`
1297
1298 Id string `json:"id,omitempty"`
1299
1300 Name string `json:"name,omitempty"`
1301
1302
1303
1304
1305 Weight int64 `json:"weight,omitempty"`
1306
1307
1308
1309
1310
1311 ForceSendFields []string `json:"-"`
1312
1313
1314
1315
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
1325 type GradeHistory struct {
1326
1327 ActorUserId string `json:"actorUserId,omitempty"`
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339 GradeChangeType string `json:"gradeChangeType,omitempty"`
1340
1341 GradeTimestamp string `json:"gradeTimestamp,omitempty"`
1342
1343
1344 MaxPoints float64 `json:"maxPoints,omitempty"`
1345
1346
1347 PointsEarned float64 `json:"pointsEarned,omitempty"`
1348
1349
1350
1351
1352
1353 ForceSendFields []string `json:"-"`
1354
1355
1356
1357
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
1383
1384
1385 type GradebookSettings struct {
1386
1387
1388
1389
1390
1391
1392
1393
1394 CalculationType string `json:"calculationType,omitempty"`
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406 DisplaySetting string `json:"displaySetting,omitempty"`
1407
1408
1409 GradeCategories []*GradeCategory `json:"gradeCategories,omitempty"`
1410
1411
1412
1413
1414
1415 ForceSendFields []string `json:"-"`
1416
1417
1418
1419
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
1429
1430 type Guardian struct {
1431
1432 GuardianId string `json:"guardianId,omitempty"`
1433
1434 GuardianProfile *UserProfile `json:"guardianProfile,omitempty"`
1435
1436
1437 InvitedEmailAddress string `json:"invitedEmailAddress,omitempty"`
1438
1439
1440 StudentId string `json:"studentId,omitempty"`
1441
1442
1443 googleapi.ServerResponse `json:"-"`
1444
1445
1446
1447
1448
1449 ForceSendFields []string `json:"-"`
1450
1451
1452
1453
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
1463
1464 type GuardianInvitation struct {
1465
1466 CreationTime string `json:"creationTime,omitempty"`
1467
1468 InvitationId string `json:"invitationId,omitempty"`
1469
1470
1471 InvitedEmailAddress string `json:"invitedEmailAddress,omitempty"`
1472
1473
1474
1475
1476
1477
1478
1479 State string `json:"state,omitempty"`
1480
1481 StudentId string `json:"studentId,omitempty"`
1482
1483
1484 googleapi.ServerResponse `json:"-"`
1485
1486
1487
1488
1489
1490 ForceSendFields []string `json:"-"`
1491
1492
1493
1494
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
1504
1505 type IndividualStudentsOptions struct {
1506
1507
1508 StudentIds []string `json:"studentIds,omitempty"`
1509
1510
1511
1512
1513
1514 ForceSendFields []string `json:"-"`
1515
1516
1517
1518
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
1528 type Invitation struct {
1529
1530 CourseId string `json:"courseId,omitempty"`
1531
1532 Id string `json:"id,omitempty"`
1533
1534
1535
1536
1537
1538
1539
1540
1541 Role string `json:"role,omitempty"`
1542
1543
1544
1545
1546 UserId string `json:"userId,omitempty"`
1547
1548
1549 googleapi.ServerResponse `json:"-"`
1550
1551
1552
1553
1554
1555 ForceSendFields []string `json:"-"`
1556
1557
1558
1559
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
1569 type Link struct {
1570
1571 ThumbnailUrl string `json:"thumbnailUrl,omitempty"`
1572
1573 Title string `json:"title,omitempty"`
1574
1575
1576 Url string `json:"url,omitempty"`
1577
1578
1579
1580
1581
1582 ForceSendFields []string `json:"-"`
1583
1584
1585
1586
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
1596 type ListAnnouncementsResponse struct {
1597
1598 Announcements []*Announcement `json:"announcements,omitempty"`
1599
1600
1601 NextPageToken string `json:"nextPageToken,omitempty"`
1602
1603
1604 googleapi.ServerResponse `json:"-"`
1605
1606
1607
1608
1609
1610 ForceSendFields []string `json:"-"`
1611
1612
1613
1614
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
1624 type ListCourseAliasesResponse struct {
1625
1626 Aliases []*CourseAlias `json:"aliases,omitempty"`
1627
1628
1629 NextPageToken string `json:"nextPageToken,omitempty"`
1630
1631
1632 googleapi.ServerResponse `json:"-"`
1633
1634
1635
1636
1637
1638 ForceSendFields []string `json:"-"`
1639
1640
1641
1642
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
1652 type ListCourseWorkMaterialResponse struct {
1653
1654 CourseWorkMaterial []*CourseWorkMaterial `json:"courseWorkMaterial,omitempty"`
1655
1656
1657 NextPageToken string `json:"nextPageToken,omitempty"`
1658
1659
1660 googleapi.ServerResponse `json:"-"`
1661
1662
1663
1664
1665
1666 ForceSendFields []string `json:"-"`
1667
1668
1669
1670
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
1680 type ListCourseWorkResponse struct {
1681
1682 CourseWork []*CourseWork `json:"courseWork,omitempty"`
1683
1684
1685 NextPageToken string `json:"nextPageToken,omitempty"`
1686
1687
1688 googleapi.ServerResponse `json:"-"`
1689
1690
1691
1692
1693
1694 ForceSendFields []string `json:"-"`
1695
1696
1697
1698
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
1708 type ListCoursesResponse struct {
1709
1710 Courses []*Course `json:"courses,omitempty"`
1711
1712
1713 NextPageToken string `json:"nextPageToken,omitempty"`
1714
1715
1716 googleapi.ServerResponse `json:"-"`
1717
1718
1719
1720
1721
1722 ForceSendFields []string `json:"-"`
1723
1724
1725
1726
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
1736 type ListGuardianInvitationsResponse struct {
1737
1738 GuardianInvitations []*GuardianInvitation `json:"guardianInvitations,omitempty"`
1739
1740
1741 NextPageToken string `json:"nextPageToken,omitempty"`
1742
1743
1744 googleapi.ServerResponse `json:"-"`
1745
1746
1747
1748
1749
1750 ForceSendFields []string `json:"-"`
1751
1752
1753
1754
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
1764 type ListGuardiansResponse struct {
1765
1766
1767 Guardians []*Guardian `json:"guardians,omitempty"`
1768
1769
1770 NextPageToken string `json:"nextPageToken,omitempty"`
1771
1772
1773 googleapi.ServerResponse `json:"-"`
1774
1775
1776
1777
1778
1779 ForceSendFields []string `json:"-"`
1780
1781
1782
1783
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
1793 type ListInvitationsResponse struct {
1794
1795 Invitations []*Invitation `json:"invitations,omitempty"`
1796
1797
1798 NextPageToken string `json:"nextPageToken,omitempty"`
1799
1800
1801 googleapi.ServerResponse `json:"-"`
1802
1803
1804
1805
1806
1807 ForceSendFields []string `json:"-"`
1808
1809
1810
1811
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
1821 type ListStudentSubmissionsResponse struct {
1822
1823
1824 NextPageToken string `json:"nextPageToken,omitempty"`
1825
1826 StudentSubmissions []*StudentSubmission `json:"studentSubmissions,omitempty"`
1827
1828
1829 googleapi.ServerResponse `json:"-"`
1830
1831
1832
1833
1834
1835 ForceSendFields []string `json:"-"`
1836
1837
1838
1839
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
1849 type ListStudentsResponse struct {
1850
1851
1852 NextPageToken string `json:"nextPageToken,omitempty"`
1853
1854 Students []*Student `json:"students,omitempty"`
1855
1856
1857 googleapi.ServerResponse `json:"-"`
1858
1859
1860
1861
1862
1863 ForceSendFields []string `json:"-"`
1864
1865
1866
1867
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
1877 type ListTeachersResponse struct {
1878
1879
1880 NextPageToken string `json:"nextPageToken,omitempty"`
1881
1882 Teachers []*Teacher `json:"teachers,omitempty"`
1883
1884
1885 googleapi.ServerResponse `json:"-"`
1886
1887
1888
1889
1890
1891 ForceSendFields []string `json:"-"`
1892
1893
1894
1895
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
1905 type ListTopicResponse struct {
1906
1907
1908 NextPageToken string `json:"nextPageToken,omitempty"`
1909
1910 Topic []*Topic `json:"topic,omitempty"`
1911
1912
1913 googleapi.ServerResponse `json:"-"`
1914
1915
1916
1917
1918
1919 ForceSendFields []string `json:"-"`
1920
1921
1922
1923
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
1933
1934 type Material struct {
1935
1936 DriveFile *SharedDriveFile `json:"driveFile,omitempty"`
1937
1938 Form *Form `json:"form,omitempty"`
1939
1940
1941 Link *Link `json:"link,omitempty"`
1942
1943 YoutubeVideo *YouTubeVideo `json:"youtubeVideo,omitempty"`
1944
1945
1946
1947
1948
1949 ForceSendFields []string `json:"-"`
1950
1951
1952
1953
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
1963
1964 type ModifyAnnouncementAssigneesRequest struct {
1965
1966
1967
1968
1969
1970
1971
1972 AssigneeMode string `json:"assigneeMode,omitempty"`
1973
1974
1975
1976 ModifyIndividualStudentsOptions *ModifyIndividualStudentsOptions `json:"modifyIndividualStudentsOptions,omitempty"`
1977
1978
1979
1980
1981
1982 ForceSendFields []string `json:"-"`
1983
1984
1985
1986
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
1996
1997 type ModifyAttachmentsRequest struct {
1998
1999
2000 AddAttachments []*Attachment `json:"addAttachments,omitempty"`
2001
2002
2003
2004
2005
2006 ForceSendFields []string `json:"-"`
2007
2008
2009
2010
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
2020
2021 type ModifyCourseWorkAssigneesRequest struct {
2022
2023
2024
2025
2026
2027
2028
2029 AssigneeMode string `json:"assigneeMode,omitempty"`
2030
2031
2032
2033 ModifyIndividualStudentsOptions *ModifyIndividualStudentsOptions `json:"modifyIndividualStudentsOptions,omitempty"`
2034
2035
2036
2037
2038
2039 ForceSendFields []string `json:"-"`
2040
2041
2042
2043
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
2053
2054
2055 type ModifyIndividualStudentsOptions struct {
2056
2057
2058 AddStudentIds []string `json:"addStudentIds,omitempty"`
2059
2060
2061 RemoveStudentIds []string `json:"removeStudentIds,omitempty"`
2062
2063
2064
2065
2066
2067 ForceSendFields []string `json:"-"`
2068
2069
2070
2071
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
2081 type MultipleChoiceQuestion struct {
2082
2083 Choices []string `json:"choices,omitempty"`
2084
2085
2086
2087
2088
2089 ForceSendFields []string `json:"-"`
2090
2091
2092
2093
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
2103 type MultipleChoiceSubmission struct {
2104
2105 Answer string `json:"answer,omitempty"`
2106
2107
2108
2109
2110
2111 ForceSendFields []string `json:"-"`
2112
2113
2114
2115
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
2125 type Name struct {
2126
2127 FamilyName string `json:"familyName,omitempty"`
2128
2129
2130 FullName string `json:"fullName,omitempty"`
2131
2132 GivenName string `json:"givenName,omitempty"`
2133
2134
2135
2136
2137
2138 ForceSendFields []string `json:"-"`
2139
2140
2141
2142
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
2152 type ReclaimStudentSubmissionRequest struct {
2153 }
2154
2155
2156
2157 type Registration struct {
2158
2159
2160 CloudPubsubTopic *CloudPubsubTopic `json:"cloudPubsubTopic,omitempty"`
2161
2162
2163 ExpiryTime string `json:"expiryTime,omitempty"`
2164
2165
2166 Feed *Feed `json:"feed,omitempty"`
2167
2168
2169 RegistrationId string `json:"registrationId,omitempty"`
2170
2171
2172 googleapi.ServerResponse `json:"-"`
2173
2174
2175
2176
2177
2178 ForceSendFields []string `json:"-"`
2179
2180
2181
2182
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
2192 type ReturnStudentSubmissionRequest struct {
2193 }
2194
2195
2196 type SharedDriveFile struct {
2197
2198 DriveFile *DriveFile `json:"driveFile,omitempty"`
2199
2200
2201
2202
2203
2204
2205
2206
2207 ShareMode string `json:"shareMode,omitempty"`
2208
2209
2210
2211
2212
2213 ForceSendFields []string `json:"-"`
2214
2215
2216
2217
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
2227 type ShortAnswerSubmission struct {
2228
2229 Answer string `json:"answer,omitempty"`
2230
2231
2232
2233
2234
2235 ForceSendFields []string `json:"-"`
2236
2237
2238
2239
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
2249 type StateHistory struct {
2250
2251 ActorUserId string `json:"actorUserId,omitempty"`
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267 State string `json:"state,omitempty"`
2268
2269 StateTimestamp string `json:"stateTimestamp,omitempty"`
2270
2271
2272
2273
2274
2275 ForceSendFields []string `json:"-"`
2276
2277
2278
2279
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
2289 type Student struct {
2290
2291 CourseId string `json:"courseId,omitempty"`
2292
2293 Profile *UserProfile `json:"profile,omitempty"`
2294
2295
2296
2297 StudentWorkFolder *DriveFolder `json:"studentWorkFolder,omitempty"`
2298
2299
2300
2301
2302 UserId string `json:"userId,omitempty"`
2303
2304
2305 googleapi.ServerResponse `json:"-"`
2306
2307
2308
2309
2310
2311 ForceSendFields []string `json:"-"`
2312
2313
2314
2315
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
2325
2326
2327
2328 type StudentSubmission struct {
2329
2330
2331 AlternateLink string `json:"alternateLink,omitempty"`
2332
2333
2334
2335 AssignedGrade float64 `json:"assignedGrade,omitempty"`
2336
2337
2338 AssignmentSubmission *AssignmentSubmission `json:"assignmentSubmission,omitempty"`
2339
2340
2341
2342 AssociatedWithDeveloper bool `json:"associatedWithDeveloper,omitempty"`
2343
2344 CourseId string `json:"courseId,omitempty"`
2345
2346 CourseWorkId string `json:"courseWorkId,omitempty"`
2347
2348
2349
2350
2351
2352
2353
2354
2355 CourseWorkType string `json:"courseWorkType,omitempty"`
2356
2357
2358 CreationTime string `json:"creationTime,omitempty"`
2359
2360
2361
2362
2363 DraftGrade float64 `json:"draftGrade,omitempty"`
2364
2365
2366 Id string `json:"id,omitempty"`
2367
2368 Late bool `json:"late,omitempty"`
2369
2370
2371 MultipleChoiceSubmission *MultipleChoiceSubmission `json:"multipleChoiceSubmission,omitempty"`
2372
2373
2374 ShortAnswerSubmission *ShortAnswerSubmission `json:"shortAnswerSubmission,omitempty"`
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386 State string `json:"state,omitempty"`
2387
2388
2389 SubmissionHistory []*SubmissionHistory `json:"submissionHistory,omitempty"`
2390
2391
2392 UpdateTime string `json:"updateTime,omitempty"`
2393
2394 UserId string `json:"userId,omitempty"`
2395
2396
2397 googleapi.ServerResponse `json:"-"`
2398
2399
2400
2401
2402
2403 ForceSendFields []string `json:"-"`
2404
2405
2406
2407
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
2433
2434 type SubmissionHistory struct {
2435
2436 GradeHistory *GradeHistory `json:"gradeHistory,omitempty"`
2437
2438 StateHistory *StateHistory `json:"stateHistory,omitempty"`
2439
2440
2441
2442
2443
2444 ForceSendFields []string `json:"-"`
2445
2446
2447
2448
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
2458 type Teacher struct {
2459
2460 CourseId string `json:"courseId,omitempty"`
2461
2462 Profile *UserProfile `json:"profile,omitempty"`
2463
2464
2465
2466
2467 UserId string `json:"userId,omitempty"`
2468
2469
2470 googleapi.ServerResponse `json:"-"`
2471
2472
2473
2474
2475
2476 ForceSendFields []string `json:"-"`
2477
2478
2479
2480
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
2490
2491
2492 type TimeOfDay struct {
2493
2494
2495
2496 Hours int64 `json:"hours,omitempty"`
2497
2498 Minutes int64 `json:"minutes,omitempty"`
2499
2500 Nanos int64 `json:"nanos,omitempty"`
2501
2502
2503 Seconds int64 `json:"seconds,omitempty"`
2504
2505
2506
2507
2508
2509 ForceSendFields []string `json:"-"`
2510
2511
2512
2513
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
2523 type Topic struct {
2524
2525 CourseId string `json:"courseId,omitempty"`
2526
2527
2528
2529
2530 Name string `json:"name,omitempty"`
2531
2532 TopicId string `json:"topicId,omitempty"`
2533
2534 UpdateTime string `json:"updateTime,omitempty"`
2535
2536
2537 googleapi.ServerResponse `json:"-"`
2538
2539
2540
2541
2542
2543 ForceSendFields []string `json:"-"`
2544
2545
2546
2547
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
2557 type TurnInStudentSubmissionRequest struct {
2558 }
2559
2560
2561 type UserProfile struct {
2562
2563
2564
2565 EmailAddress string `json:"emailAddress,omitempty"`
2566
2567 Id string `json:"id,omitempty"`
2568
2569 Name *Name `json:"name,omitempty"`
2570
2571 Permissions []*GlobalPermission `json:"permissions,omitempty"`
2572
2573
2574
2575 PhotoUrl string `json:"photoUrl,omitempty"`
2576
2577
2578
2579
2580 VerifiedTeacher bool `json:"verifiedTeacher,omitempty"`
2581
2582
2583 googleapi.ServerResponse `json:"-"`
2584
2585
2586
2587
2588
2589 ForceSendFields []string `json:"-"`
2590
2591
2592
2593
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
2603 type YouTubeVideo struct {
2604
2605 AlternateLink string `json:"alternateLink,omitempty"`
2606
2607 Id string `json:"id,omitempty"`
2608
2609 ThumbnailUrl string `json:"thumbnailUrl,omitempty"`
2610
2611 Title string `json:"title,omitempty"`
2612
2613
2614
2615
2616
2617 ForceSendFields []string `json:"-"`
2618
2619
2620
2621
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
2639
2640
2641
2642
2643
2644
2645
2646
2647
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
2655
2656
2657 func (c *CoursesCreateCall) Fields(s ...googleapi.Field) *CoursesCreateCall {
2658 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2659 return c
2660 }
2661
2662
2663 func (c *CoursesCreateCall) Context(ctx context.Context) *CoursesCreateCall {
2664 c.ctx_ = ctx
2665 return c
2666 }
2667
2668
2669
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
2697
2698
2699
2700
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
2742
2743
2744
2745
2746
2747
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
2755
2756
2757 func (c *CoursesDeleteCall) Fields(s ...googleapi.Field) *CoursesDeleteCall {
2758 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2759 return c
2760 }
2761
2762
2763 func (c *CoursesDeleteCall) Context(ctx context.Context) *CoursesDeleteCall {
2764 c.ctx_ = ctx
2765 return c
2766 }
2767
2768
2769
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
2796
2797
2798
2799
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
2842
2843
2844
2845
2846
2847
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
2855
2856
2857 func (c *CoursesGetCall) Fields(s ...googleapi.Field) *CoursesGetCall {
2858 c.urlParams_.Set("fields", googleapi.CombineFields(s))
2859 return c
2860 }
2861
2862
2863
2864
2865 func (c *CoursesGetCall) IfNoneMatch(entityTag string) *CoursesGetCall {
2866 c.ifNoneMatch_ = entityTag
2867 return c
2868 }
2869
2870
2871 func (c *CoursesGetCall) Context(ctx context.Context) *CoursesGetCall {
2872 c.ctx_ = ctx
2873 return c
2874 }
2875
2876
2877
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
2907
2908
2909
2910
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
2952
2953
2954
2955
2956
2957 func (r *CoursesService) List() *CoursesListCall {
2958 c := &CoursesListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
2959 return c
2960 }
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994 func (c *CoursesListCall) CourseStates(courseStates ...string) *CoursesListCall {
2995 c.urlParams_.SetMulti("courseStates", append([]string{}, courseStates...))
2996 return c
2997 }
2998
2999
3000
3001
3002 func (c *CoursesListCall) PageSize(pageSize int64) *CoursesListCall {
3003 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3004 return c
3005 }
3006
3007
3008
3009
3010
3011 func (c *CoursesListCall) PageToken(pageToken string) *CoursesListCall {
3012 c.urlParams_.Set("pageToken", pageToken)
3013 return c
3014 }
3015
3016
3017
3018
3019
3020
3021 func (c *CoursesListCall) StudentId(studentId string) *CoursesListCall {
3022 c.urlParams_.Set("studentId", studentId)
3023 return c
3024 }
3025
3026
3027
3028
3029
3030
3031 func (c *CoursesListCall) TeacherId(teacherId string) *CoursesListCall {
3032 c.urlParams_.Set("teacherId", teacherId)
3033 return c
3034 }
3035
3036
3037
3038
3039 func (c *CoursesListCall) Fields(s ...googleapi.Field) *CoursesListCall {
3040 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3041 return c
3042 }
3043
3044
3045
3046
3047 func (c *CoursesListCall) IfNoneMatch(entityTag string) *CoursesListCall {
3048 c.ifNoneMatch_ = entityTag
3049 return c
3050 }
3051
3052
3053 func (c *CoursesListCall) Context(ctx context.Context) *CoursesListCall {
3054 c.ctx_ = ctx
3055 return c
3056 }
3057
3058
3059
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
3086
3087
3088
3089
3090
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
3124
3125
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
3154
3155
3156
3157
3158
3159
3160
3161
3162
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
3171
3172
3173
3174
3175
3176
3177
3178
3179 func (c *CoursesPatchCall) UpdateMask(updateMask string) *CoursesPatchCall {
3180 c.urlParams_.Set("updateMask", updateMask)
3181 return c
3182 }
3183
3184
3185
3186
3187 func (c *CoursesPatchCall) Fields(s ...googleapi.Field) *CoursesPatchCall {
3188 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3189 return c
3190 }
3191
3192
3193 func (c *CoursesPatchCall) Context(ctx context.Context) *CoursesPatchCall {
3194 c.ctx_ = ctx
3195 return c
3196 }
3197
3198
3199
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
3230
3231
3232
3233
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
3276
3277
3278
3279
3280
3281
3282
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
3291
3292
3293 func (c *CoursesUpdateCall) Fields(s ...googleapi.Field) *CoursesUpdateCall {
3294 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3295 return c
3296 }
3297
3298
3299 func (c *CoursesUpdateCall) Context(ctx context.Context) *CoursesUpdateCall {
3300 c.ctx_ = ctx
3301 return c
3302 }
3303
3304
3305
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
3336
3337
3338
3339
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
3382
3383
3384
3385
3386
3387
3388
3389
3390
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
3399
3400
3401 func (c *CoursesAliasesCreateCall) Fields(s ...googleapi.Field) *CoursesAliasesCreateCall {
3402 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3403 return c
3404 }
3405
3406
3407 func (c *CoursesAliasesCreateCall) Context(ctx context.Context) *CoursesAliasesCreateCall {
3408 c.ctx_ = ctx
3409 return c
3410 }
3411
3412
3413
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
3444
3445
3446
3447
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
3490
3491
3492
3493
3494
3495
3496
3497
3498
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
3507
3508
3509 func (c *CoursesAliasesDeleteCall) Fields(s ...googleapi.Field) *CoursesAliasesDeleteCall {
3510 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3511 return c
3512 }
3513
3514
3515 func (c *CoursesAliasesDeleteCall) Context(ctx context.Context) *CoursesAliasesDeleteCall {
3516 c.ctx_ = ctx
3517 return c
3518 }
3519
3520
3521
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
3549
3550
3551
3552
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
3595
3596
3597
3598
3599
3600
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
3608
3609
3610 func (c *CoursesAliasesListCall) PageSize(pageSize int64) *CoursesAliasesListCall {
3611 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
3612 return c
3613 }
3614
3615
3616
3617
3618
3619 func (c *CoursesAliasesListCall) PageToken(pageToken string) *CoursesAliasesListCall {
3620 c.urlParams_.Set("pageToken", pageToken)
3621 return c
3622 }
3623
3624
3625
3626
3627 func (c *CoursesAliasesListCall) Fields(s ...googleapi.Field) *CoursesAliasesListCall {
3628 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3629 return c
3630 }
3631
3632
3633
3634
3635 func (c *CoursesAliasesListCall) IfNoneMatch(entityTag string) *CoursesAliasesListCall {
3636 c.ifNoneMatch_ = entityTag
3637 return c
3638 }
3639
3640
3641 func (c *CoursesAliasesListCall) Context(ctx context.Context) *CoursesAliasesListCall {
3642 c.ctx_ = ctx
3643 return c
3644 }
3645
3646
3647
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
3677
3678
3679
3680
3681
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
3715
3716
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
3745
3746
3747
3748
3749
3750
3751
3752
3753
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
3762
3763
3764 func (c *CoursesAnnouncementsCreateCall) Fields(s ...googleapi.Field) *CoursesAnnouncementsCreateCall {
3765 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3766 return c
3767 }
3768
3769
3770 func (c *CoursesAnnouncementsCreateCall) Context(ctx context.Context) *CoursesAnnouncementsCreateCall {
3771 c.ctx_ = ctx
3772 return c
3773 }
3774
3775
3776
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
3807
3808
3809
3810
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
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
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
3874
3875
3876 func (c *CoursesAnnouncementsDeleteCall) Fields(s ...googleapi.Field) *CoursesAnnouncementsDeleteCall {
3877 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3878 return c
3879 }
3880
3881
3882 func (c *CoursesAnnouncementsDeleteCall) Context(ctx context.Context) *CoursesAnnouncementsDeleteCall {
3883 c.ctx_ = ctx
3884 return c
3885 }
3886
3887
3888
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
3916
3917
3918
3919
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
3963
3964
3965
3966
3967
3968
3969
3970
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
3979
3980
3981 func (c *CoursesAnnouncementsGetCall) Fields(s ...googleapi.Field) *CoursesAnnouncementsGetCall {
3982 c.urlParams_.Set("fields", googleapi.CombineFields(s))
3983 return c
3984 }
3985
3986
3987
3988
3989 func (c *CoursesAnnouncementsGetCall) IfNoneMatch(entityTag string) *CoursesAnnouncementsGetCall {
3990 c.ifNoneMatch_ = entityTag
3991 return c
3992 }
3993
3994
3995 func (c *CoursesAnnouncementsGetCall) Context(ctx context.Context) *CoursesAnnouncementsGetCall {
3996 c.ctx_ = ctx
3997 return c
3998 }
3999
4000
4001
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
4032
4033
4034
4035
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
4078
4079
4080
4081
4082
4083
4084
4085
4086
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
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116 func (c *CoursesAnnouncementsListCall) AnnouncementStates(announcementStates ...string) *CoursesAnnouncementsListCall {
4117 c.urlParams_.SetMulti("announcementStates", append([]string{}, announcementStates...))
4118 return c
4119 }
4120
4121
4122
4123
4124
4125
4126 func (c *CoursesAnnouncementsListCall) OrderBy(orderBy string) *CoursesAnnouncementsListCall {
4127 c.urlParams_.Set("orderBy", orderBy)
4128 return c
4129 }
4130
4131
4132
4133
4134 func (c *CoursesAnnouncementsListCall) PageSize(pageSize int64) *CoursesAnnouncementsListCall {
4135 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4136 return c
4137 }
4138
4139
4140
4141
4142
4143 func (c *CoursesAnnouncementsListCall) PageToken(pageToken string) *CoursesAnnouncementsListCall {
4144 c.urlParams_.Set("pageToken", pageToken)
4145 return c
4146 }
4147
4148
4149
4150
4151 func (c *CoursesAnnouncementsListCall) Fields(s ...googleapi.Field) *CoursesAnnouncementsListCall {
4152 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4153 return c
4154 }
4155
4156
4157
4158
4159 func (c *CoursesAnnouncementsListCall) IfNoneMatch(entityTag string) *CoursesAnnouncementsListCall {
4160 c.ifNoneMatch_ = entityTag
4161 return c
4162 }
4163
4164
4165 func (c *CoursesAnnouncementsListCall) Context(ctx context.Context) *CoursesAnnouncementsListCall {
4166 c.ctx_ = ctx
4167 return c
4168 }
4169
4170
4171
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
4201
4202
4203
4204
4205
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
4239
4240
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
4270
4271
4272
4273
4274
4275
4276
4277
4278
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
4288
4289
4290 func (c *CoursesAnnouncementsModifyAssigneesCall) Fields(s ...googleapi.Field) *CoursesAnnouncementsModifyAssigneesCall {
4291 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4292 return c
4293 }
4294
4295
4296 func (c *CoursesAnnouncementsModifyAssigneesCall) Context(ctx context.Context) *CoursesAnnouncementsModifyAssigneesCall {
4297 c.ctx_ = ctx
4298 return c
4299 }
4300
4301
4302
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
4334
4335
4336
4337
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
4381
4382
4383
4384
4385
4386
4387
4388
4389
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
4399
4400
4401
4402
4403
4404
4405
4406 func (c *CoursesAnnouncementsPatchCall) UpdateMask(updateMask string) *CoursesAnnouncementsPatchCall {
4407 c.urlParams_.Set("updateMask", updateMask)
4408 return c
4409 }
4410
4411
4412
4413
4414 func (c *CoursesAnnouncementsPatchCall) Fields(s ...googleapi.Field) *CoursesAnnouncementsPatchCall {
4415 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4416 return c
4417 }
4418
4419
4420 func (c *CoursesAnnouncementsPatchCall) Context(ctx context.Context) *CoursesAnnouncementsPatchCall {
4421 c.ctx_ = ctx
4422 return c
4423 }
4424
4425
4426
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
4458
4459
4460
4461
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
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
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
4526
4527
4528 func (c *CoursesCourseWorkCreateCall) Fields(s ...googleapi.Field) *CoursesCourseWorkCreateCall {
4529 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4530 return c
4531 }
4532
4533
4534 func (c *CoursesCourseWorkCreateCall) Context(ctx context.Context) *CoursesCourseWorkCreateCall {
4535 c.ctx_ = ctx
4536 return c
4537 }
4538
4539
4540
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
4571
4572
4573
4574
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
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
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
4638
4639
4640 func (c *CoursesCourseWorkDeleteCall) Fields(s ...googleapi.Field) *CoursesCourseWorkDeleteCall {
4641 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4642 return c
4643 }
4644
4645
4646 func (c *CoursesCourseWorkDeleteCall) Context(ctx context.Context) *CoursesCourseWorkDeleteCall {
4647 c.ctx_ = ctx
4648 return c
4649 }
4650
4651
4652
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
4680
4681
4682
4683
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
4727
4728
4729
4730
4731
4732
4733
4734
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
4743
4744
4745 func (c *CoursesCourseWorkGetCall) Fields(s ...googleapi.Field) *CoursesCourseWorkGetCall {
4746 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4747 return c
4748 }
4749
4750
4751
4752
4753 func (c *CoursesCourseWorkGetCall) IfNoneMatch(entityTag string) *CoursesCourseWorkGetCall {
4754 c.ifNoneMatch_ = entityTag
4755 return c
4756 }
4757
4758
4759 func (c *CoursesCourseWorkGetCall) Context(ctx context.Context) *CoursesCourseWorkGetCall {
4760 c.ctx_ = ctx
4761 return c
4762 }
4763
4764
4765
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
4796
4797
4798
4799
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
4842
4843
4844
4845
4846
4847
4848
4849
4850
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
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879 func (c *CoursesCourseWorkListCall) CourseWorkStates(courseWorkStates ...string) *CoursesCourseWorkListCall {
4880 c.urlParams_.SetMulti("courseWorkStates", append([]string{}, courseWorkStates...))
4881 return c
4882 }
4883
4884
4885
4886
4887
4888
4889
4890 func (c *CoursesCourseWorkListCall) OrderBy(orderBy string) *CoursesCourseWorkListCall {
4891 c.urlParams_.Set("orderBy", orderBy)
4892 return c
4893 }
4894
4895
4896
4897
4898 func (c *CoursesCourseWorkListCall) PageSize(pageSize int64) *CoursesCourseWorkListCall {
4899 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
4900 return c
4901 }
4902
4903
4904
4905
4906
4907 func (c *CoursesCourseWorkListCall) PageToken(pageToken string) *CoursesCourseWorkListCall {
4908 c.urlParams_.Set("pageToken", pageToken)
4909 return c
4910 }
4911
4912
4913
4914
4915 func (c *CoursesCourseWorkListCall) Fields(s ...googleapi.Field) *CoursesCourseWorkListCall {
4916 c.urlParams_.Set("fields", googleapi.CombineFields(s))
4917 return c
4918 }
4919
4920
4921
4922
4923 func (c *CoursesCourseWorkListCall) IfNoneMatch(entityTag string) *CoursesCourseWorkListCall {
4924 c.ifNoneMatch_ = entityTag
4925 return c
4926 }
4927
4928
4929 func (c *CoursesCourseWorkListCall) Context(ctx context.Context) *CoursesCourseWorkListCall {
4930 c.ctx_ = ctx
4931 return c
4932 }
4933
4934
4935
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
4965
4966
4967
4968
4969
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
5003
5004
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
5034
5035
5036
5037
5038
5039
5040
5041
5042
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
5052
5053
5054 func (c *CoursesCourseWorkModifyAssigneesCall) Fields(s ...googleapi.Field) *CoursesCourseWorkModifyAssigneesCall {
5055 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5056 return c
5057 }
5058
5059
5060 func (c *CoursesCourseWorkModifyAssigneesCall) Context(ctx context.Context) *CoursesCourseWorkModifyAssigneesCall {
5061 c.ctx_ = ctx
5062 return c
5063 }
5064
5065
5066
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
5098
5099
5100
5101
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
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
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
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178 func (c *CoursesCourseWorkPatchCall) UpdateMask(updateMask string) *CoursesCourseWorkPatchCall {
5179 c.urlParams_.Set("updateMask", updateMask)
5180 return c
5181 }
5182
5183
5184
5185
5186 func (c *CoursesCourseWorkPatchCall) Fields(s ...googleapi.Field) *CoursesCourseWorkPatchCall {
5187 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5188 return c
5189 }
5190
5191
5192 func (c *CoursesCourseWorkPatchCall) Context(ctx context.Context) *CoursesCourseWorkPatchCall {
5193 c.ctx_ = ctx
5194 return c
5195 }
5196
5197
5198
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
5230
5231
5232
5233
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
5278
5279
5280
5281
5282
5283
5284
5285
5286
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
5296
5297
5298 func (c *CoursesCourseWorkStudentSubmissionsGetCall) Fields(s ...googleapi.Field) *CoursesCourseWorkStudentSubmissionsGetCall {
5299 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5300 return c
5301 }
5302
5303
5304
5305
5306 func (c *CoursesCourseWorkStudentSubmissionsGetCall) IfNoneMatch(entityTag string) *CoursesCourseWorkStudentSubmissionsGetCall {
5307 c.ifNoneMatch_ = entityTag
5308 return c
5309 }
5310
5311
5312 func (c *CoursesCourseWorkStudentSubmissionsGetCall) Context(ctx context.Context) *CoursesCourseWorkStudentSubmissionsGetCall {
5313 c.ctx_ = ctx
5314 return c
5315 }
5316
5317
5318
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
5350
5351
5352
5353
5354
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
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
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
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431 func (c *CoursesCourseWorkStudentSubmissionsListCall) Late(late string) *CoursesCourseWorkStudentSubmissionsListCall {
5432 c.urlParams_.Set("late", late)
5433 return c
5434 }
5435
5436
5437
5438
5439 func (c *CoursesCourseWorkStudentSubmissionsListCall) PageSize(pageSize int64) *CoursesCourseWorkStudentSubmissionsListCall {
5440 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
5441 return c
5442 }
5443
5444
5445
5446
5447
5448 func (c *CoursesCourseWorkStudentSubmissionsListCall) PageToken(pageToken string) *CoursesCourseWorkStudentSubmissionsListCall {
5449 c.urlParams_.Set("pageToken", pageToken)
5450 return c
5451 }
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471 func (c *CoursesCourseWorkStudentSubmissionsListCall) States(states ...string) *CoursesCourseWorkStudentSubmissionsListCall {
5472 c.urlParams_.SetMulti("states", append([]string{}, states...))
5473 return c
5474 }
5475
5476
5477
5478
5479
5480
5481 func (c *CoursesCourseWorkStudentSubmissionsListCall) UserId(userId string) *CoursesCourseWorkStudentSubmissionsListCall {
5482 c.urlParams_.Set("userId", userId)
5483 return c
5484 }
5485
5486
5487
5488
5489 func (c *CoursesCourseWorkStudentSubmissionsListCall) Fields(s ...googleapi.Field) *CoursesCourseWorkStudentSubmissionsListCall {
5490 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5491 return c
5492 }
5493
5494
5495
5496
5497 func (c *CoursesCourseWorkStudentSubmissionsListCall) IfNoneMatch(entityTag string) *CoursesCourseWorkStudentSubmissionsListCall {
5498 c.ifNoneMatch_ = entityTag
5499 return c
5500 }
5501
5502
5503 func (c *CoursesCourseWorkStudentSubmissionsListCall) Context(ctx context.Context) *CoursesCourseWorkStudentSubmissionsListCall {
5504 c.ctx_ = ctx
5505 return c
5506 }
5507
5508
5509
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
5540
5541
5542
5543
5544
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
5578
5579
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
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
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
5635
5636
5637 func (c *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall) Fields(s ...googleapi.Field) *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall {
5638 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5639 return c
5640 }
5641
5642
5643 func (c *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall) Context(ctx context.Context) *CoursesCourseWorkStudentSubmissionsModifyAttachmentsCall {
5644 c.ctx_ = ctx
5645 return c
5646 }
5647
5648
5649
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
5682
5683
5684
5685
5686
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
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
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
5756
5757
5758
5759
5760 func (c *CoursesCourseWorkStudentSubmissionsPatchCall) UpdateMask(updateMask string) *CoursesCourseWorkStudentSubmissionsPatchCall {
5761 c.urlParams_.Set("updateMask", updateMask)
5762 return c
5763 }
5764
5765
5766
5767
5768 func (c *CoursesCourseWorkStudentSubmissionsPatchCall) Fields(s ...googleapi.Field) *CoursesCourseWorkStudentSubmissionsPatchCall {
5769 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5770 return c
5771 }
5772
5773
5774 func (c *CoursesCourseWorkStudentSubmissionsPatchCall) Context(ctx context.Context) *CoursesCourseWorkStudentSubmissionsPatchCall {
5775 c.ctx_ = ctx
5776 return c
5777 }
5778
5779
5780
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
5813
5814
5815
5816
5817
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
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
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
5890
5891
5892 func (c *CoursesCourseWorkStudentSubmissionsReclaimCall) Fields(s ...googleapi.Field) *CoursesCourseWorkStudentSubmissionsReclaimCall {
5893 c.urlParams_.Set("fields", googleapi.CombineFields(s))
5894 return c
5895 }
5896
5897
5898 func (c *CoursesCourseWorkStudentSubmissionsReclaimCall) Context(ctx context.Context) *CoursesCourseWorkStudentSubmissionsReclaimCall {
5899 c.ctx_ = ctx
5900 return c
5901 }
5902
5903
5904
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
5937
5938
5939
5940
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
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
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
6012
6013
6014 func (c *CoursesCourseWorkStudentSubmissionsReturnCall) Fields(s ...googleapi.Field) *CoursesCourseWorkStudentSubmissionsReturnCall {
6015 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6016 return c
6017 }
6018
6019
6020 func (c *CoursesCourseWorkStudentSubmissionsReturnCall) Context(ctx context.Context) *CoursesCourseWorkStudentSubmissionsReturnCall {
6021 c.ctx_ = ctx
6022 return c
6023 }
6024
6025
6026
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
6059
6060
6061
6062
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
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
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
6133
6134
6135 func (c *CoursesCourseWorkStudentSubmissionsTurnInCall) Fields(s ...googleapi.Field) *CoursesCourseWorkStudentSubmissionsTurnInCall {
6136 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6137 return c
6138 }
6139
6140
6141 func (c *CoursesCourseWorkStudentSubmissionsTurnInCall) Context(ctx context.Context) *CoursesCourseWorkStudentSubmissionsTurnInCall {
6142 c.ctx_ = ctx
6143 return c
6144 }
6145
6146
6147
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
6180
6181
6182
6183
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
6226
6227
6228
6229
6230
6231
6232
6233
6234
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
6243
6244
6245 func (c *CoursesCourseWorkMaterialsCreateCall) Fields(s ...googleapi.Field) *CoursesCourseWorkMaterialsCreateCall {
6246 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6247 return c
6248 }
6249
6250
6251 func (c *CoursesCourseWorkMaterialsCreateCall) Context(ctx context.Context) *CoursesCourseWorkMaterialsCreateCall {
6252 c.ctx_ = ctx
6253 return c
6254 }
6255
6256
6257
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
6288
6289
6290
6291
6292
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
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
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
6356
6357
6358 func (c *CoursesCourseWorkMaterialsDeleteCall) Fields(s ...googleapi.Field) *CoursesCourseWorkMaterialsDeleteCall {
6359 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6360 return c
6361 }
6362
6363
6364 func (c *CoursesCourseWorkMaterialsDeleteCall) Context(ctx context.Context) *CoursesCourseWorkMaterialsDeleteCall {
6365 c.ctx_ = ctx
6366 return c
6367 }
6368
6369
6370
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
6398
6399
6400
6401
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
6445
6446
6447
6448
6449
6450
6451
6452
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
6461
6462
6463 func (c *CoursesCourseWorkMaterialsGetCall) Fields(s ...googleapi.Field) *CoursesCourseWorkMaterialsGetCall {
6464 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6465 return c
6466 }
6467
6468
6469
6470
6471 func (c *CoursesCourseWorkMaterialsGetCall) IfNoneMatch(entityTag string) *CoursesCourseWorkMaterialsGetCall {
6472 c.ifNoneMatch_ = entityTag
6473 return c
6474 }
6475
6476
6477 func (c *CoursesCourseWorkMaterialsGetCall) Context(ctx context.Context) *CoursesCourseWorkMaterialsGetCall {
6478 c.ctx_ = ctx
6479 return c
6480 }
6481
6482
6483
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
6514
6515
6516
6517
6518
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
6561
6562
6563
6564
6565
6566
6567
6568
6569
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
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601 func (c *CoursesCourseWorkMaterialsListCall) CourseWorkMaterialStates(courseWorkMaterialStates ...string) *CoursesCourseWorkMaterialsListCall {
6602 c.urlParams_.SetMulti("courseWorkMaterialStates", append([]string{}, courseWorkMaterialStates...))
6603 return c
6604 }
6605
6606
6607
6608
6609
6610 func (c *CoursesCourseWorkMaterialsListCall) MaterialDriveId(materialDriveId string) *CoursesCourseWorkMaterialsListCall {
6611 c.urlParams_.Set("materialDriveId", materialDriveId)
6612 return c
6613 }
6614
6615
6616
6617
6618 func (c *CoursesCourseWorkMaterialsListCall) MaterialLink(materialLink string) *CoursesCourseWorkMaterialsListCall {
6619 c.urlParams_.Set("materialLink", materialLink)
6620 return c
6621 }
6622
6623
6624
6625
6626
6627
6628 func (c *CoursesCourseWorkMaterialsListCall) OrderBy(orderBy string) *CoursesCourseWorkMaterialsListCall {
6629 c.urlParams_.Set("orderBy", orderBy)
6630 return c
6631 }
6632
6633
6634
6635
6636 func (c *CoursesCourseWorkMaterialsListCall) PageSize(pageSize int64) *CoursesCourseWorkMaterialsListCall {
6637 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
6638 return c
6639 }
6640
6641
6642
6643
6644
6645 func (c *CoursesCourseWorkMaterialsListCall) PageToken(pageToken string) *CoursesCourseWorkMaterialsListCall {
6646 c.urlParams_.Set("pageToken", pageToken)
6647 return c
6648 }
6649
6650
6651
6652
6653 func (c *CoursesCourseWorkMaterialsListCall) Fields(s ...googleapi.Field) *CoursesCourseWorkMaterialsListCall {
6654 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6655 return c
6656 }
6657
6658
6659
6660
6661 func (c *CoursesCourseWorkMaterialsListCall) IfNoneMatch(entityTag string) *CoursesCourseWorkMaterialsListCall {
6662 c.ifNoneMatch_ = entityTag
6663 return c
6664 }
6665
6666
6667 func (c *CoursesCourseWorkMaterialsListCall) Context(ctx context.Context) *CoursesCourseWorkMaterialsListCall {
6668 c.ctx_ = ctx
6669 return c
6670 }
6671
6672
6673
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
6703
6704
6705
6706
6707
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
6741
6742
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
6772
6773
6774
6775
6776
6777
6778
6779
6780
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
6790
6791
6792
6793
6794
6795
6796
6797
6798 func (c *CoursesCourseWorkMaterialsPatchCall) UpdateMask(updateMask string) *CoursesCourseWorkMaterialsPatchCall {
6799 c.urlParams_.Set("updateMask", updateMask)
6800 return c
6801 }
6802
6803
6804
6805
6806 func (c *CoursesCourseWorkMaterialsPatchCall) Fields(s ...googleapi.Field) *CoursesCourseWorkMaterialsPatchCall {
6807 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6808 return c
6809 }
6810
6811
6812 func (c *CoursesCourseWorkMaterialsPatchCall) Context(ctx context.Context) *CoursesCourseWorkMaterialsPatchCall {
6813 c.ctx_ = ctx
6814 return c
6815 }
6816
6817
6818
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
6850
6851
6852
6853
6854
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
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
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
6919
6920
6921
6922 func (c *CoursesStudentsCreateCall) EnrollmentCode(enrollmentCode string) *CoursesStudentsCreateCall {
6923 c.urlParams_.Set("enrollmentCode", enrollmentCode)
6924 return c
6925 }
6926
6927
6928
6929
6930 func (c *CoursesStudentsCreateCall) Fields(s ...googleapi.Field) *CoursesStudentsCreateCall {
6931 c.urlParams_.Set("fields", googleapi.CombineFields(s))
6932 return c
6933 }
6934
6935
6936 func (c *CoursesStudentsCreateCall) Context(ctx context.Context) *CoursesStudentsCreateCall {
6937 c.ctx_ = ctx
6938 return c
6939 }
6940
6941
6942
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
6973
6974
6975
6976
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
7019
7020
7021
7022
7023
7024
7025
7026
7027
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
7036
7037
7038 func (c *CoursesStudentsDeleteCall) Fields(s ...googleapi.Field) *CoursesStudentsDeleteCall {
7039 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7040 return c
7041 }
7042
7043
7044 func (c *CoursesStudentsDeleteCall) Context(ctx context.Context) *CoursesStudentsDeleteCall {
7045 c.ctx_ = ctx
7046 return c
7047 }
7048
7049
7050
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
7078
7079
7080
7081
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
7125
7126
7127
7128
7129
7130
7131
7132
7133
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
7142
7143
7144 func (c *CoursesStudentsGetCall) Fields(s ...googleapi.Field) *CoursesStudentsGetCall {
7145 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7146 return c
7147 }
7148
7149
7150
7151
7152 func (c *CoursesStudentsGetCall) IfNoneMatch(entityTag string) *CoursesStudentsGetCall {
7153 c.ifNoneMatch_ = entityTag
7154 return c
7155 }
7156
7157
7158 func (c *CoursesStudentsGetCall) Context(ctx context.Context) *CoursesStudentsGetCall {
7159 c.ctx_ = ctx
7160 return c
7161 }
7162
7163
7164
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
7195
7196
7197
7198
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
7241
7242
7243
7244
7245
7246
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
7254
7255
7256 func (c *CoursesStudentsListCall) PageSize(pageSize int64) *CoursesStudentsListCall {
7257 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
7258 return c
7259 }
7260
7261
7262
7263
7264
7265 func (c *CoursesStudentsListCall) PageToken(pageToken string) *CoursesStudentsListCall {
7266 c.urlParams_.Set("pageToken", pageToken)
7267 return c
7268 }
7269
7270
7271
7272
7273 func (c *CoursesStudentsListCall) Fields(s ...googleapi.Field) *CoursesStudentsListCall {
7274 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7275 return c
7276 }
7277
7278
7279
7280
7281 func (c *CoursesStudentsListCall) IfNoneMatch(entityTag string) *CoursesStudentsListCall {
7282 c.ifNoneMatch_ = entityTag
7283 return c
7284 }
7285
7286
7287 func (c *CoursesStudentsListCall) Context(ctx context.Context) *CoursesStudentsListCall {
7288 c.ctx_ = ctx
7289 return c
7290 }
7291
7292
7293
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
7323
7324
7325
7326
7327
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
7361
7362
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
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
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
7413
7414
7415 func (c *CoursesTeachersCreateCall) Fields(s ...googleapi.Field) *CoursesTeachersCreateCall {
7416 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7417 return c
7418 }
7419
7420
7421 func (c *CoursesTeachersCreateCall) Context(ctx context.Context) *CoursesTeachersCreateCall {
7422 c.ctx_ = ctx
7423 return c
7424 }
7425
7426
7427
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
7458
7459
7460
7461
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
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
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
7525
7526
7527 func (c *CoursesTeachersDeleteCall) Fields(s ...googleapi.Field) *CoursesTeachersDeleteCall {
7528 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7529 return c
7530 }
7531
7532
7533 func (c *CoursesTeachersDeleteCall) Context(ctx context.Context) *CoursesTeachersDeleteCall {
7534 c.ctx_ = ctx
7535 return c
7536 }
7537
7538
7539
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
7567
7568
7569
7570
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
7614
7615
7616
7617
7618
7619
7620
7621
7622
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
7631
7632
7633 func (c *CoursesTeachersGetCall) Fields(s ...googleapi.Field) *CoursesTeachersGetCall {
7634 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7635 return c
7636 }
7637
7638
7639
7640
7641 func (c *CoursesTeachersGetCall) IfNoneMatch(entityTag string) *CoursesTeachersGetCall {
7642 c.ifNoneMatch_ = entityTag
7643 return c
7644 }
7645
7646
7647 func (c *CoursesTeachersGetCall) Context(ctx context.Context) *CoursesTeachersGetCall {
7648 c.ctx_ = ctx
7649 return c
7650 }
7651
7652
7653
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
7684
7685
7686
7687
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
7730
7731
7732
7733
7734
7735
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
7743
7744
7745 func (c *CoursesTeachersListCall) PageSize(pageSize int64) *CoursesTeachersListCall {
7746 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
7747 return c
7748 }
7749
7750
7751
7752
7753
7754 func (c *CoursesTeachersListCall) PageToken(pageToken string) *CoursesTeachersListCall {
7755 c.urlParams_.Set("pageToken", pageToken)
7756 return c
7757 }
7758
7759
7760
7761
7762 func (c *CoursesTeachersListCall) Fields(s ...googleapi.Field) *CoursesTeachersListCall {
7763 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7764 return c
7765 }
7766
7767
7768
7769
7770 func (c *CoursesTeachersListCall) IfNoneMatch(entityTag string) *CoursesTeachersListCall {
7771 c.ifNoneMatch_ = entityTag
7772 return c
7773 }
7774
7775
7776 func (c *CoursesTeachersListCall) Context(ctx context.Context) *CoursesTeachersListCall {
7777 c.ctx_ = ctx
7778 return c
7779 }
7780
7781
7782
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
7812
7813
7814
7815
7816
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
7850
7851
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
7880
7881
7882
7883
7884
7885
7886
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
7895
7896
7897 func (c *CoursesTopicsCreateCall) Fields(s ...googleapi.Field) *CoursesTopicsCreateCall {
7898 c.urlParams_.Set("fields", googleapi.CombineFields(s))
7899 return c
7900 }
7901
7902
7903 func (c *CoursesTopicsCreateCall) Context(ctx context.Context) *CoursesTopicsCreateCall {
7904 c.ctx_ = ctx
7905 return c
7906 }
7907
7908
7909
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
7940
7941
7942
7943
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
7986
7987
7988
7989
7990
7991
7992
7993
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
8002
8003
8004 func (c *CoursesTopicsDeleteCall) Fields(s ...googleapi.Field) *CoursesTopicsDeleteCall {
8005 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8006 return c
8007 }
8008
8009
8010 func (c *CoursesTopicsDeleteCall) Context(ctx context.Context) *CoursesTopicsDeleteCall {
8011 c.ctx_ = ctx
8012 return c
8013 }
8014
8015
8016
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
8044
8045
8046
8047
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
8091
8092
8093
8094
8095
8096
8097
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
8106
8107
8108 func (c *CoursesTopicsGetCall) Fields(s ...googleapi.Field) *CoursesTopicsGetCall {
8109 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8110 return c
8111 }
8112
8113
8114
8115
8116 func (c *CoursesTopicsGetCall) IfNoneMatch(entityTag string) *CoursesTopicsGetCall {
8117 c.ifNoneMatch_ = entityTag
8118 return c
8119 }
8120
8121
8122 func (c *CoursesTopicsGetCall) Context(ctx context.Context) *CoursesTopicsGetCall {
8123 c.ctx_ = ctx
8124 return c
8125 }
8126
8127
8128
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
8159
8160
8161
8162
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
8205
8206
8207
8208
8209
8210
8211
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
8219
8220
8221 func (c *CoursesTopicsListCall) PageSize(pageSize int64) *CoursesTopicsListCall {
8222 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
8223 return c
8224 }
8225
8226
8227
8228
8229
8230 func (c *CoursesTopicsListCall) PageToken(pageToken string) *CoursesTopicsListCall {
8231 c.urlParams_.Set("pageToken", pageToken)
8232 return c
8233 }
8234
8235
8236
8237
8238 func (c *CoursesTopicsListCall) Fields(s ...googleapi.Field) *CoursesTopicsListCall {
8239 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8240 return c
8241 }
8242
8243
8244
8245
8246 func (c *CoursesTopicsListCall) IfNoneMatch(entityTag string) *CoursesTopicsListCall {
8247 c.ifNoneMatch_ = entityTag
8248 return c
8249 }
8250
8251
8252 func (c *CoursesTopicsListCall) Context(ctx context.Context) *CoursesTopicsListCall {
8253 c.ctx_ = ctx
8254 return c
8255 }
8256
8257
8258
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
8288
8289
8290
8291
8292
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
8326
8327
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
8357
8358
8359
8360
8361
8362
8363
8364
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
8374
8375
8376
8377
8378
8379
8380 func (c *CoursesTopicsPatchCall) UpdateMask(updateMask string) *CoursesTopicsPatchCall {
8381 c.urlParams_.Set("updateMask", updateMask)
8382 return c
8383 }
8384
8385
8386
8387
8388 func (c *CoursesTopicsPatchCall) Fields(s ...googleapi.Field) *CoursesTopicsPatchCall {
8389 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8390 return c
8391 }
8392
8393
8394 func (c *CoursesTopicsPatchCall) Context(ctx context.Context) *CoursesTopicsPatchCall {
8395 c.ctx_ = ctx
8396 return c
8397 }
8398
8399
8400
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
8432
8433
8434
8435
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
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
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
8494
8495
8496 func (c *InvitationsAcceptCall) Fields(s ...googleapi.Field) *InvitationsAcceptCall {
8497 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8498 return c
8499 }
8500
8501
8502 func (c *InvitationsAcceptCall) Context(ctx context.Context) *InvitationsAcceptCall {
8503 c.ctx_ = ctx
8504 return c
8505 }
8506
8507
8508
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
8535
8536
8537
8538
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
8580
8581
8582
8583
8584
8585
8586
8587
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
8595
8596
8597 func (c *InvitationsCreateCall) Fields(s ...googleapi.Field) *InvitationsCreateCall {
8598 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8599 return c
8600 }
8601
8602
8603 func (c *InvitationsCreateCall) Context(ctx context.Context) *InvitationsCreateCall {
8604 c.ctx_ = ctx
8605 return c
8606 }
8607
8608
8609
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
8637
8638
8639
8640
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
8682
8683
8684
8685
8686
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
8694
8695
8696 func (c *InvitationsDeleteCall) Fields(s ...googleapi.Field) *InvitationsDeleteCall {
8697 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8698 return c
8699 }
8700
8701
8702 func (c *InvitationsDeleteCall) Context(ctx context.Context) *InvitationsDeleteCall {
8703 c.ctx_ = ctx
8704 return c
8705 }
8706
8707
8708
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
8735
8736
8737
8738
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
8781
8782
8783
8784
8785
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
8793
8794
8795 func (c *InvitationsGetCall) Fields(s ...googleapi.Field) *InvitationsGetCall {
8796 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8797 return c
8798 }
8799
8800
8801
8802
8803 func (c *InvitationsGetCall) IfNoneMatch(entityTag string) *InvitationsGetCall {
8804 c.ifNoneMatch_ = entityTag
8805 return c
8806 }
8807
8808
8809 func (c *InvitationsGetCall) Context(ctx context.Context) *InvitationsGetCall {
8810 c.ctx_ = ctx
8811 return c
8812 }
8813
8814
8815
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
8845
8846
8847
8848
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
8890
8891
8892
8893
8894 func (r *InvitationsService) List() *InvitationsListCall {
8895 c := &InvitationsListCall{s: r.s, urlParams_: make(gensupport.URLParams)}
8896 return c
8897 }
8898
8899
8900
8901 func (c *InvitationsListCall) CourseId(courseId string) *InvitationsListCall {
8902 c.urlParams_.Set("courseId", courseId)
8903 return c
8904 }
8905
8906
8907
8908
8909 func (c *InvitationsListCall) PageSize(pageSize int64) *InvitationsListCall {
8910 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
8911 return c
8912 }
8913
8914
8915
8916
8917
8918 func (c *InvitationsListCall) PageToken(pageToken string) *InvitationsListCall {
8919 c.urlParams_.Set("pageToken", pageToken)
8920 return c
8921 }
8922
8923
8924
8925
8926
8927 func (c *InvitationsListCall) UserId(userId string) *InvitationsListCall {
8928 c.urlParams_.Set("userId", userId)
8929 return c
8930 }
8931
8932
8933
8934
8935 func (c *InvitationsListCall) Fields(s ...googleapi.Field) *InvitationsListCall {
8936 c.urlParams_.Set("fields", googleapi.CombineFields(s))
8937 return c
8938 }
8939
8940
8941
8942
8943 func (c *InvitationsListCall) IfNoneMatch(entityTag string) *InvitationsListCall {
8944 c.ifNoneMatch_ = entityTag
8945 return c
8946 }
8947
8948
8949 func (c *InvitationsListCall) Context(ctx context.Context) *InvitationsListCall {
8950 c.ctx_ = ctx
8951 return c
8952 }
8953
8954
8955
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
8982
8983
8984
8985
8986
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
9020
9021
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
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
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
9077
9078
9079 func (c *RegistrationsCreateCall) Fields(s ...googleapi.Field) *RegistrationsCreateCall {
9080 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9081 return c
9082 }
9083
9084
9085 func (c *RegistrationsCreateCall) Context(ctx context.Context) *RegistrationsCreateCall {
9086 c.ctx_ = ctx
9087 return c
9088 }
9089
9090
9091
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
9119
9120
9121
9122
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
9164
9165
9166
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
9174
9175
9176 func (c *RegistrationsDeleteCall) Fields(s ...googleapi.Field) *RegistrationsDeleteCall {
9177 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9178 return c
9179 }
9180
9181
9182 func (c *RegistrationsDeleteCall) Context(ctx context.Context) *RegistrationsDeleteCall {
9183 c.ctx_ = ctx
9184 return c
9185 }
9186
9187
9188
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
9215
9216
9217
9218
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
9261
9262
9263
9264
9265
9266
9267
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
9275
9276
9277 func (c *UserProfilesGetCall) Fields(s ...googleapi.Field) *UserProfilesGetCall {
9278 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9279 return c
9280 }
9281
9282
9283
9284
9285 func (c *UserProfilesGetCall) IfNoneMatch(entityTag string) *UserProfilesGetCall {
9286 c.ifNoneMatch_ = entityTag
9287 return c
9288 }
9289
9290
9291 func (c *UserProfilesGetCall) Context(ctx context.Context) *UserProfilesGetCall {
9292 c.ctx_ = ctx
9293 return c
9294 }
9295
9296
9297
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
9327
9328
9329
9330
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
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
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
9405
9406
9407 func (c *UserProfilesGuardianInvitationsCreateCall) Fields(s ...googleapi.Field) *UserProfilesGuardianInvitationsCreateCall {
9408 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9409 return c
9410 }
9411
9412
9413 func (c *UserProfilesGuardianInvitationsCreateCall) Context(ctx context.Context) *UserProfilesGuardianInvitationsCreateCall {
9414 c.ctx_ = ctx
9415 return c
9416 }
9417
9418
9419
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
9450
9451
9452
9453
9454
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
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
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
9519
9520
9521 func (c *UserProfilesGuardianInvitationsGetCall) Fields(s ...googleapi.Field) *UserProfilesGuardianInvitationsGetCall {
9522 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9523 return c
9524 }
9525
9526
9527
9528
9529 func (c *UserProfilesGuardianInvitationsGetCall) IfNoneMatch(entityTag string) *UserProfilesGuardianInvitationsGetCall {
9530 c.ifNoneMatch_ = entityTag
9531 return c
9532 }
9533
9534
9535 func (c *UserProfilesGuardianInvitationsGetCall) Context(ctx context.Context) *UserProfilesGuardianInvitationsGetCall {
9536 c.ctx_ = ctx
9537 return c
9538 }
9539
9540
9541
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
9572
9573
9574
9575
9576
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
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
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
9644
9645
9646 func (c *UserProfilesGuardianInvitationsListCall) InvitedEmailAddress(invitedEmailAddress string) *UserProfilesGuardianInvitationsListCall {
9647 c.urlParams_.Set("invitedEmailAddress", invitedEmailAddress)
9648 return c
9649 }
9650
9651
9652
9653
9654 func (c *UserProfilesGuardianInvitationsListCall) PageSize(pageSize int64) *UserProfilesGuardianInvitationsListCall {
9655 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
9656 return c
9657 }
9658
9659
9660
9661
9662
9663 func (c *UserProfilesGuardianInvitationsListCall) PageToken(pageToken string) *UserProfilesGuardianInvitationsListCall {
9664 c.urlParams_.Set("pageToken", pageToken)
9665 return c
9666 }
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679 func (c *UserProfilesGuardianInvitationsListCall) States(states ...string) *UserProfilesGuardianInvitationsListCall {
9680 c.urlParams_.SetMulti("states", append([]string{}, states...))
9681 return c
9682 }
9683
9684
9685
9686
9687 func (c *UserProfilesGuardianInvitationsListCall) Fields(s ...googleapi.Field) *UserProfilesGuardianInvitationsListCall {
9688 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9689 return c
9690 }
9691
9692
9693
9694
9695 func (c *UserProfilesGuardianInvitationsListCall) IfNoneMatch(entityTag string) *UserProfilesGuardianInvitationsListCall {
9696 c.ifNoneMatch_ = entityTag
9697 return c
9698 }
9699
9700
9701 func (c *UserProfilesGuardianInvitationsListCall) Context(ctx context.Context) *UserProfilesGuardianInvitationsListCall {
9702 c.ctx_ = ctx
9703 return c
9704 }
9705
9706
9707
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
9737
9738
9739
9740
9741
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
9775
9776
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
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
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
9831
9832
9833
9834
9835 func (c *UserProfilesGuardianInvitationsPatchCall) UpdateMask(updateMask string) *UserProfilesGuardianInvitationsPatchCall {
9836 c.urlParams_.Set("updateMask", updateMask)
9837 return c
9838 }
9839
9840
9841
9842
9843 func (c *UserProfilesGuardianInvitationsPatchCall) Fields(s ...googleapi.Field) *UserProfilesGuardianInvitationsPatchCall {
9844 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9845 return c
9846 }
9847
9848
9849 func (c *UserProfilesGuardianInvitationsPatchCall) Context(ctx context.Context) *UserProfilesGuardianInvitationsPatchCall {
9850 c.ctx_ = ctx
9851 return c
9852 }
9853
9854
9855
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
9887
9888
9889
9890
9891
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
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
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
9958
9959
9960 func (c *UserProfilesGuardiansDeleteCall) Fields(s ...googleapi.Field) *UserProfilesGuardiansDeleteCall {
9961 c.urlParams_.Set("fields", googleapi.CombineFields(s))
9962 return c
9963 }
9964
9965
9966 func (c *UserProfilesGuardiansDeleteCall) Context(ctx context.Context) *UserProfilesGuardiansDeleteCall {
9967 c.ctx_ = ctx
9968 return c
9969 }
9970
9971
9972
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
10000
10001
10002
10003
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
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
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
10070
10071
10072 func (c *UserProfilesGuardiansGetCall) Fields(s ...googleapi.Field) *UserProfilesGuardiansGetCall {
10073 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10074 return c
10075 }
10076
10077
10078
10079
10080 func (c *UserProfilesGuardiansGetCall) IfNoneMatch(entityTag string) *UserProfilesGuardiansGetCall {
10081 c.ifNoneMatch_ = entityTag
10082 return c
10083 }
10084
10085
10086 func (c *UserProfilesGuardiansGetCall) Context(ctx context.Context) *UserProfilesGuardiansGetCall {
10087 c.ctx_ = ctx
10088 return c
10089 }
10090
10091
10092
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
10123
10124
10125
10126
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
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
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
10197
10198
10199
10200 func (c *UserProfilesGuardiansListCall) InvitedEmailAddress(invitedEmailAddress string) *UserProfilesGuardiansListCall {
10201 c.urlParams_.Set("invitedEmailAddress", invitedEmailAddress)
10202 return c
10203 }
10204
10205
10206
10207
10208 func (c *UserProfilesGuardiansListCall) PageSize(pageSize int64) *UserProfilesGuardiansListCall {
10209 c.urlParams_.Set("pageSize", fmt.Sprint(pageSize))
10210 return c
10211 }
10212
10213
10214
10215
10216
10217 func (c *UserProfilesGuardiansListCall) PageToken(pageToken string) *UserProfilesGuardiansListCall {
10218 c.urlParams_.Set("pageToken", pageToken)
10219 return c
10220 }
10221
10222
10223
10224
10225 func (c *UserProfilesGuardiansListCall) Fields(s ...googleapi.Field) *UserProfilesGuardiansListCall {
10226 c.urlParams_.Set("fields", googleapi.CombineFields(s))
10227 return c
10228 }
10229
10230
10231
10232
10233 func (c *UserProfilesGuardiansListCall) IfNoneMatch(entityTag string) *UserProfilesGuardiansListCall {
10234 c.ifNoneMatch_ = entityTag
10235 return c
10236 }
10237
10238
10239 func (c *UserProfilesGuardiansListCall) Context(ctx context.Context) *UserProfilesGuardiansListCall {
10240 c.ctx_ = ctx
10241 return c
10242 }
10243
10244
10245
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
10275
10276
10277
10278
10279
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
10313
10314
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