@maxim_mazurok/gapi.client.classroom-v1 0.0.20220806

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/tests.ts ADDED
@@ -0,0 +1,1422 @@
1
+ /* This is stub file for gapi.client.classroom-v1 definition tests */
2
+ // IMPORTANT
3
+ // This file was generated by https://github.com/Maxim-Mazurok/google-api-typings-generator. Please do not edit it manually.
4
+ // In case of any problems please post issue to https://github.com/Maxim-Mazurok/google-api-typings-generator
5
+
6
+ // Revision: 20220806
7
+
8
+ gapi.load('client', async () => {
9
+ /** now we can use gapi.client */
10
+
11
+ await gapi.client.load('https://classroom.googleapis.com/$discovery/rest?version=v1');
12
+ /** now we can use gapi.client.classroom */
13
+
14
+ /** don't forget to authenticate your client before sending any request to resources: */
15
+ /** declare client_id registered in Google Developers Console */
16
+ const client_id = '<<PUT YOUR CLIENT ID HERE>>';
17
+ const scope = [
18
+ /** View and manage announcements in Google Classroom */
19
+ 'https://www.googleapis.com/auth/classroom.announcements',
20
+ /** View announcements in Google Classroom */
21
+ 'https://www.googleapis.com/auth/classroom.announcements.readonly',
22
+ /** See, edit, create, and permanently delete your Google Classroom classes */
23
+ 'https://www.googleapis.com/auth/classroom.courses',
24
+ /** View your Google Classroom classes */
25
+ 'https://www.googleapis.com/auth/classroom.courses.readonly',
26
+ /** See, create and edit coursework items including assignments, questions, and grades */
27
+ 'https://www.googleapis.com/auth/classroom.coursework.me',
28
+ /** View your course work and grades in Google Classroom */
29
+ 'https://www.googleapis.com/auth/classroom.coursework.me.readonly',
30
+ /** Manage course work and grades for students in the Google Classroom classes you teach and view the course work and grades for classes you administer */
31
+ 'https://www.googleapis.com/auth/classroom.coursework.students',
32
+ /** View course work and grades for students in the Google Classroom classes you teach or administer */
33
+ 'https://www.googleapis.com/auth/classroom.coursework.students.readonly',
34
+ /** See, edit, and create classwork materials in Google Classroom */
35
+ 'https://www.googleapis.com/auth/classroom.courseworkmaterials',
36
+ /** See all classwork materials for your Google Classroom classes */
37
+ 'https://www.googleapis.com/auth/classroom.courseworkmaterials.readonly',
38
+ /** View your Google Classroom guardians */
39
+ 'https://www.googleapis.com/auth/classroom.guardianlinks.me.readonly',
40
+ /** View and manage guardians for students in your Google Classroom classes */
41
+ 'https://www.googleapis.com/auth/classroom.guardianlinks.students',
42
+ /** View guardians for students in your Google Classroom classes */
43
+ 'https://www.googleapis.com/auth/classroom.guardianlinks.students.readonly',
44
+ /** View the email addresses of people in your classes */
45
+ 'https://www.googleapis.com/auth/classroom.profile.emails',
46
+ /** View the profile photos of people in your classes */
47
+ 'https://www.googleapis.com/auth/classroom.profile.photos',
48
+ /** Receive notifications about your Google Classroom data */
49
+ 'https://www.googleapis.com/auth/classroom.push-notifications',
50
+ /** Manage your Google Classroom class rosters */
51
+ 'https://www.googleapis.com/auth/classroom.rosters',
52
+ /** View your Google Classroom class rosters */
53
+ 'https://www.googleapis.com/auth/classroom.rosters.readonly',
54
+ /** View your course work and grades in Google Classroom */
55
+ 'https://www.googleapis.com/auth/classroom.student-submissions.me.readonly',
56
+ /** View course work and grades for students in the Google Classroom classes you teach or administer */
57
+ 'https://www.googleapis.com/auth/classroom.student-submissions.students.readonly',
58
+ /** See, create, and edit topics in Google Classroom */
59
+ 'https://www.googleapis.com/auth/classroom.topics',
60
+ /** View topics in Google Classroom */
61
+ 'https://www.googleapis.com/auth/classroom.topics.readonly',
62
+ ];
63
+ const immediate = false;
64
+ gapi.auth.authorize({ client_id, scope, immediate }, authResult => {
65
+ if (authResult && !authResult.error) {
66
+ /** handle successful authorization */
67
+ run();
68
+ } else {
69
+ /** handle authorization error */
70
+ }
71
+ });
72
+
73
+ async function run() {
74
+ /**
75
+ * Creates a course. The user specified in `ownerId` is the owner of the created course and added as a teacher. A non-admin requesting user can only create a course with themselves as the
76
+ * owner. Domain admins can create courses owned by any user within their domain. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not
77
+ * permitted to create courses or for access errors. * `NOT_FOUND` if the primary teacher is not a valid user. * `FAILED_PRECONDITION` if the course owner's account is disabled or for the
78
+ * following request errors: * UserGroupsMembershipLimitReached * `ALREADY_EXISTS` if an alias was specified in the `id` and already exists.
79
+ */
80
+ await gapi.client.classroom.courses.create({
81
+ }, {
82
+ alternateLink: "Test string",
83
+ calendarId: "Test string",
84
+ courseGroupEmail: "Test string",
85
+ courseMaterialSets: [
86
+ {
87
+ materials: [
88
+ {
89
+ driveFile: {
90
+ alternateLink: "Test string",
91
+ id: "Test string",
92
+ thumbnailUrl: "Test string",
93
+ title: "Test string",
94
+ },
95
+ form: {
96
+ formUrl: "Test string",
97
+ responseUrl: "Test string",
98
+ thumbnailUrl: "Test string",
99
+ title: "Test string",
100
+ },
101
+ link: {
102
+ thumbnailUrl: "Test string",
103
+ title: "Test string",
104
+ url: "Test string",
105
+ },
106
+ youTubeVideo: {
107
+ alternateLink: "Test string",
108
+ id: "Test string",
109
+ thumbnailUrl: "Test string",
110
+ title: "Test string",
111
+ },
112
+ }
113
+ ],
114
+ title: "Test string",
115
+ }
116
+ ],
117
+ courseState: "Test string",
118
+ creationTime: "Test string",
119
+ description: "Test string",
120
+ descriptionHeading: "Test string",
121
+ enrollmentCode: "Test string",
122
+ gradebookSettings: {
123
+ calculationType: "Test string",
124
+ displaySetting: "Test string",
125
+ gradeCategories: [
126
+ {
127
+ defaultGradeDenominator: 42,
128
+ id: "Test string",
129
+ name: "Test string",
130
+ weight: 42,
131
+ }
132
+ ],
133
+ },
134
+ guardiansEnabled: true,
135
+ id: "Test string",
136
+ name: "Test string",
137
+ ownerId: "Test string",
138
+ room: "Test string",
139
+ section: "Test string",
140
+ teacherFolder: {
141
+ alternateLink: "Test string",
142
+ id: "Test string",
143
+ title: "Test string",
144
+ },
145
+ teacherGroupEmail: "Test string",
146
+ updateTime: "Test string",
147
+ });
148
+ /**
149
+ * Deletes a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to delete the requested course or for access errors. *
150
+ * `NOT_FOUND` if no course exists with the requested ID.
151
+ */
152
+ await gapi.client.classroom.courses.delete({
153
+ id: "Test string",
154
+ });
155
+ /**
156
+ * Returns a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors. *
157
+ * `NOT_FOUND` if no course exists with the requested ID.
158
+ */
159
+ await gapi.client.classroom.courses.get({
160
+ id: "Test string",
161
+ });
162
+ /**
163
+ * Returns a list of courses that the requesting user is permitted to view, restricted to those that match the request. Returned courses are ordered by creation time, with the most
164
+ * recently created coming first. This method returns the following error codes: * `PERMISSION_DENIED` for access errors. * `INVALID_ARGUMENT` if the query argument is malformed. *
165
+ * `NOT_FOUND` if any users specified in the query arguments do not exist.
166
+ */
167
+ await gapi.client.classroom.courses.list({
168
+ courseStates: "Test string",
169
+ pageSize: 42,
170
+ pageToken: "Test string",
171
+ studentId: "Test string",
172
+ teacherId: "Test string",
173
+ });
174
+ /**
175
+ * Updates one or more fields in a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to modify the requested course or
176
+ * for access errors. * `NOT_FOUND` if no course exists with the requested ID. * `INVALID_ARGUMENT` if invalid fields are specified in the update mask or if no update mask is supplied. *
177
+ * `FAILED_PRECONDITION` for the following request errors: * CourseNotModifiable * InactiveCourseOwner
178
+ */
179
+ await gapi.client.classroom.courses.patch({
180
+ id: "Test string",
181
+ updateMask: "Test string",
182
+ }, {
183
+ alternateLink: "Test string",
184
+ calendarId: "Test string",
185
+ courseGroupEmail: "Test string",
186
+ courseMaterialSets: [
187
+ {
188
+ materials: [
189
+ {
190
+ driveFile: {
191
+ alternateLink: "Test string",
192
+ id: "Test string",
193
+ thumbnailUrl: "Test string",
194
+ title: "Test string",
195
+ },
196
+ form: {
197
+ formUrl: "Test string",
198
+ responseUrl: "Test string",
199
+ thumbnailUrl: "Test string",
200
+ title: "Test string",
201
+ },
202
+ link: {
203
+ thumbnailUrl: "Test string",
204
+ title: "Test string",
205
+ url: "Test string",
206
+ },
207
+ youTubeVideo: {
208
+ alternateLink: "Test string",
209
+ id: "Test string",
210
+ thumbnailUrl: "Test string",
211
+ title: "Test string",
212
+ },
213
+ }
214
+ ],
215
+ title: "Test string",
216
+ }
217
+ ],
218
+ courseState: "Test string",
219
+ creationTime: "Test string",
220
+ description: "Test string",
221
+ descriptionHeading: "Test string",
222
+ enrollmentCode: "Test string",
223
+ gradebookSettings: {
224
+ calculationType: "Test string",
225
+ displaySetting: "Test string",
226
+ gradeCategories: [
227
+ {
228
+ defaultGradeDenominator: 42,
229
+ id: "Test string",
230
+ name: "Test string",
231
+ weight: 42,
232
+ }
233
+ ],
234
+ },
235
+ guardiansEnabled: true,
236
+ id: "Test string",
237
+ name: "Test string",
238
+ ownerId: "Test string",
239
+ room: "Test string",
240
+ section: "Test string",
241
+ teacherFolder: {
242
+ alternateLink: "Test string",
243
+ id: "Test string",
244
+ title: "Test string",
245
+ },
246
+ teacherGroupEmail: "Test string",
247
+ updateTime: "Test string",
248
+ });
249
+ /**
250
+ * Updates a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to modify the requested course or for access errors. *
251
+ * `NOT_FOUND` if no course exists with the requested ID. * `FAILED_PRECONDITION` for the following request errors: * CourseNotModifiable
252
+ */
253
+ await gapi.client.classroom.courses.update({
254
+ id: "Test string",
255
+ }, {
256
+ alternateLink: "Test string",
257
+ calendarId: "Test string",
258
+ courseGroupEmail: "Test string",
259
+ courseMaterialSets: [
260
+ {
261
+ materials: [
262
+ {
263
+ driveFile: {
264
+ alternateLink: "Test string",
265
+ id: "Test string",
266
+ thumbnailUrl: "Test string",
267
+ title: "Test string",
268
+ },
269
+ form: {
270
+ formUrl: "Test string",
271
+ responseUrl: "Test string",
272
+ thumbnailUrl: "Test string",
273
+ title: "Test string",
274
+ },
275
+ link: {
276
+ thumbnailUrl: "Test string",
277
+ title: "Test string",
278
+ url: "Test string",
279
+ },
280
+ youTubeVideo: {
281
+ alternateLink: "Test string",
282
+ id: "Test string",
283
+ thumbnailUrl: "Test string",
284
+ title: "Test string",
285
+ },
286
+ }
287
+ ],
288
+ title: "Test string",
289
+ }
290
+ ],
291
+ courseState: "Test string",
292
+ creationTime: "Test string",
293
+ description: "Test string",
294
+ descriptionHeading: "Test string",
295
+ enrollmentCode: "Test string",
296
+ gradebookSettings: {
297
+ calculationType: "Test string",
298
+ displaySetting: "Test string",
299
+ gradeCategories: [
300
+ {
301
+ defaultGradeDenominator: 42,
302
+ id: "Test string",
303
+ name: "Test string",
304
+ weight: 42,
305
+ }
306
+ ],
307
+ },
308
+ guardiansEnabled: true,
309
+ id: "Test string",
310
+ name: "Test string",
311
+ ownerId: "Test string",
312
+ room: "Test string",
313
+ section: "Test string",
314
+ teacherFolder: {
315
+ alternateLink: "Test string",
316
+ id: "Test string",
317
+ title: "Test string",
318
+ },
319
+ teacherGroupEmail: "Test string",
320
+ updateTime: "Test string",
321
+ });
322
+ /**
323
+ * Creates an alias for a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to create the alias or for access errors. *
324
+ * `NOT_FOUND` if the course does not exist. * `ALREADY_EXISTS` if the alias already exists. * `FAILED_PRECONDITION` if the alias requested does not make sense for the requesting user or
325
+ * course (for example, if a user not in a domain attempts to access a domain-scoped alias).
326
+ */
327
+ await gapi.client.classroom.courses.aliases.create({
328
+ courseId: "Test string",
329
+ }, {
330
+ alias: "Test string",
331
+ });
332
+ /**
333
+ * Deletes an alias of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to remove the alias or for access errors. *
334
+ * `NOT_FOUND` if the alias does not exist. * `FAILED_PRECONDITION` if the alias requested does not make sense for the requesting user or course (for example, if a user not in a domain
335
+ * attempts to delete a domain-scoped alias).
336
+ */
337
+ await gapi.client.classroom.courses.aliases.delete({
338
+ alias: "Test string",
339
+ courseId: "Test string",
340
+ });
341
+ /**
342
+ * Returns a list of aliases for a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the course or for access
343
+ * errors. * `NOT_FOUND` if the course does not exist.
344
+ */
345
+ await gapi.client.classroom.courses.aliases.list({
346
+ courseId: "Test string",
347
+ pageSize: 42,
348
+ pageToken: "Test string",
349
+ });
350
+ /**
351
+ * Creates an announcement. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course, create
352
+ * announcements in the requested course, share a Drive attachment, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course does not
353
+ * exist. * `FAILED_PRECONDITION` for the following request error: * AttachmentNotVisible
354
+ */
355
+ await gapi.client.classroom.courses.announcements.create({
356
+ courseId: "Test string",
357
+ }, {
358
+ alternateLink: "Test string",
359
+ assigneeMode: "Test string",
360
+ courseId: "Test string",
361
+ creationTime: "Test string",
362
+ creatorUserId: "Test string",
363
+ id: "Test string",
364
+ individualStudentsOptions: {
365
+ studentIds: [
366
+ "Test string"
367
+ ],
368
+ },
369
+ materials: [
370
+ {
371
+ driveFile: {
372
+ driveFile: {
373
+ alternateLink: "Test string",
374
+ id: "Test string",
375
+ thumbnailUrl: "Test string",
376
+ title: "Test string",
377
+ },
378
+ shareMode: "Test string",
379
+ },
380
+ form: {
381
+ formUrl: "Test string",
382
+ responseUrl: "Test string",
383
+ thumbnailUrl: "Test string",
384
+ title: "Test string",
385
+ },
386
+ link: {
387
+ thumbnailUrl: "Test string",
388
+ title: "Test string",
389
+ url: "Test string",
390
+ },
391
+ youtubeVideo: {
392
+ alternateLink: "Test string",
393
+ id: "Test string",
394
+ thumbnailUrl: "Test string",
395
+ title: "Test string",
396
+ },
397
+ }
398
+ ],
399
+ scheduledTime: "Test string",
400
+ state: "Test string",
401
+ text: "Test string",
402
+ updateTime: "Test string",
403
+ });
404
+ /**
405
+ * Deletes an announcement. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the
406
+ * corresponding announcement item. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting developer project did not create the corresponding announcement,
407
+ * if the requesting user is not permitted to delete the requested course or for access errors. * `FAILED_PRECONDITION` if the requested announcement has already been deleted. *
408
+ * `NOT_FOUND` if no course exists with the requested ID.
409
+ */
410
+ await gapi.client.classroom.courses.announcements.delete({
411
+ courseId: "Test string",
412
+ id: "Test string",
413
+ });
414
+ /**
415
+ * Returns an announcement. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or announcement, or
416
+ * for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course or announcement does not exist.
417
+ */
418
+ await gapi.client.classroom.courses.announcements.get({
419
+ courseId: "Test string",
420
+ id: "Test string",
421
+ });
422
+ /**
423
+ * Returns a list of announcements that the requester is permitted to view. Course students may only view `PUBLISHED` announcements. Course teachers and domain administrators may view all
424
+ * announcements. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors. *
425
+ * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course does not exist.
426
+ */
427
+ await gapi.client.classroom.courses.announcements.list({
428
+ announcementStates: "Test string",
429
+ courseId: "Test string",
430
+ orderBy: "Test string",
431
+ pageSize: 42,
432
+ pageToken: "Test string",
433
+ });
434
+ /**
435
+ * Modifies assignee mode and options of an announcement. Only a teacher of the course that contains the announcement may call this method. This method returns the following error codes: *
436
+ * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work or for access errors. * `INVALID_ARGUMENT` if the request is malformed. *
437
+ * `NOT_FOUND` if the requested course or course work does not exist.
438
+ */
439
+ await gapi.client.classroom.courses.announcements.modifyAssignees({
440
+ courseId: "Test string",
441
+ id: "Test string",
442
+ }, {
443
+ assigneeMode: "Test string",
444
+ modifyIndividualStudentsOptions: {
445
+ addStudentIds: [
446
+ "Test string"
447
+ ],
448
+ removeStudentIds: [
449
+ "Test string"
450
+ ],
451
+ },
452
+ });
453
+ /**
454
+ * Updates one or more fields of an announcement. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting developer project did not create the corresponding
455
+ * announcement or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `FAILED_PRECONDITION` if the requested announcement has already been deleted. * `NOT_FOUND` if the
456
+ * requested course or announcement does not exist
457
+ */
458
+ await gapi.client.classroom.courses.announcements.patch({
459
+ courseId: "Test string",
460
+ id: "Test string",
461
+ updateMask: "Test string",
462
+ }, {
463
+ alternateLink: "Test string",
464
+ assigneeMode: "Test string",
465
+ courseId: "Test string",
466
+ creationTime: "Test string",
467
+ creatorUserId: "Test string",
468
+ id: "Test string",
469
+ individualStudentsOptions: {
470
+ studentIds: [
471
+ "Test string"
472
+ ],
473
+ },
474
+ materials: [
475
+ {
476
+ driveFile: {
477
+ driveFile: {
478
+ alternateLink: "Test string",
479
+ id: "Test string",
480
+ thumbnailUrl: "Test string",
481
+ title: "Test string",
482
+ },
483
+ shareMode: "Test string",
484
+ },
485
+ form: {
486
+ formUrl: "Test string",
487
+ responseUrl: "Test string",
488
+ thumbnailUrl: "Test string",
489
+ title: "Test string",
490
+ },
491
+ link: {
492
+ thumbnailUrl: "Test string",
493
+ title: "Test string",
494
+ url: "Test string",
495
+ },
496
+ youtubeVideo: {
497
+ alternateLink: "Test string",
498
+ id: "Test string",
499
+ thumbnailUrl: "Test string",
500
+ title: "Test string",
501
+ },
502
+ }
503
+ ],
504
+ scheduledTime: "Test string",
505
+ state: "Test string",
506
+ text: "Test string",
507
+ updateTime: "Test string",
508
+ });
509
+ /**
510
+ * Creates course work. The resulting course work (and corresponding student submissions) are associated with the Developer Console project of the [OAuth client
511
+ * ID](https://support.google.com/cloud/answer/6158849) used to make the request. Classroom API requests to modify course work and student submissions must be made with an OAuth client ID
512
+ * from the associated Developer Console project. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested
513
+ * course, create course work in the requested course, share a Drive attachment, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested
514
+ * course does not exist. * `FAILED_PRECONDITION` for the following request error: * AttachmentNotVisible
515
+ */
516
+ await gapi.client.classroom.courses.courseWork.create({
517
+ courseId: "Test string",
518
+ }, {
519
+ alternateLink: "Test string",
520
+ assigneeMode: "Test string",
521
+ assignment: {
522
+ studentWorkFolder: {
523
+ alternateLink: "Test string",
524
+ id: "Test string",
525
+ title: "Test string",
526
+ },
527
+ },
528
+ associatedWithDeveloper: true,
529
+ courseId: "Test string",
530
+ creationTime: "Test string",
531
+ creatorUserId: "Test string",
532
+ description: "Test string",
533
+ dueDate: {
534
+ day: 42,
535
+ month: 42,
536
+ year: 42,
537
+ },
538
+ dueTime: {
539
+ hours: 42,
540
+ minutes: 42,
541
+ nanos: 42,
542
+ seconds: 42,
543
+ },
544
+ gradeCategory: {
545
+ defaultGradeDenominator: 42,
546
+ id: "Test string",
547
+ name: "Test string",
548
+ weight: 42,
549
+ },
550
+ id: "Test string",
551
+ individualStudentsOptions: {
552
+ studentIds: [
553
+ "Test string"
554
+ ],
555
+ },
556
+ materials: [
557
+ {
558
+ driveFile: {
559
+ driveFile: {
560
+ alternateLink: "Test string",
561
+ id: "Test string",
562
+ thumbnailUrl: "Test string",
563
+ title: "Test string",
564
+ },
565
+ shareMode: "Test string",
566
+ },
567
+ form: {
568
+ formUrl: "Test string",
569
+ responseUrl: "Test string",
570
+ thumbnailUrl: "Test string",
571
+ title: "Test string",
572
+ },
573
+ link: {
574
+ thumbnailUrl: "Test string",
575
+ title: "Test string",
576
+ url: "Test string",
577
+ },
578
+ youtubeVideo: {
579
+ alternateLink: "Test string",
580
+ id: "Test string",
581
+ thumbnailUrl: "Test string",
582
+ title: "Test string",
583
+ },
584
+ }
585
+ ],
586
+ maxPoints: 42,
587
+ multipleChoiceQuestion: {
588
+ choices: [
589
+ "Test string"
590
+ ],
591
+ },
592
+ scheduledTime: "Test string",
593
+ state: "Test string",
594
+ submissionModificationMode: "Test string",
595
+ title: "Test string",
596
+ topicId: "Test string",
597
+ updateTime: "Test string",
598
+ workType: "Test string",
599
+ });
600
+ /**
601
+ * Deletes a course work. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the
602
+ * corresponding course work item. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting developer project did not create the corresponding course work, if
603
+ * the requesting user is not permitted to delete the requested course or for access errors. * `FAILED_PRECONDITION` if the requested course work has already been deleted. * `NOT_FOUND` if
604
+ * no course exists with the requested ID.
605
+ */
606
+ await gapi.client.classroom.courses.courseWork.delete({
607
+ courseId: "Test string",
608
+ id: "Test string",
609
+ });
610
+ /**
611
+ * Returns course work. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, or for
612
+ * access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course or course work does not exist.
613
+ */
614
+ await gapi.client.classroom.courses.courseWork.get({
615
+ courseId: "Test string",
616
+ id: "Test string",
617
+ });
618
+ /**
619
+ * Returns a list of course work that the requester is permitted to view. Course students may only view `PUBLISHED` course work. Course teachers and domain administrators may view all
620
+ * course work. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors. *
621
+ * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course does not exist.
622
+ */
623
+ await gapi.client.classroom.courses.courseWork.list({
624
+ courseId: "Test string",
625
+ courseWorkStates: "Test string",
626
+ orderBy: "Test string",
627
+ pageSize: 42,
628
+ pageToken: "Test string",
629
+ });
630
+ /**
631
+ * Modifies assignee mode and options of a coursework. Only a teacher of the course that contains the coursework may call this method. This method returns the following error codes: *
632
+ * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work or for access errors. * `INVALID_ARGUMENT` if the request is malformed. *
633
+ * `NOT_FOUND` if the requested course or course work does not exist.
634
+ */
635
+ await gapi.client.classroom.courses.courseWork.modifyAssignees({
636
+ courseId: "Test string",
637
+ id: "Test string",
638
+ }, {
639
+ assigneeMode: "Test string",
640
+ modifyIndividualStudentsOptions: {
641
+ addStudentIds: [
642
+ "Test string"
643
+ ],
644
+ removeStudentIds: [
645
+ "Test string"
646
+ ],
647
+ },
648
+ });
649
+ /**
650
+ * Updates one or more fields of a course work. See google.classroom.v1.CourseWork for details of which fields may be updated and who may change them. This request must be made by the
651
+ * Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following
652
+ * error codes: * `PERMISSION_DENIED` if the requesting developer project did not create the corresponding course work, if the user is not permitted to make the requested modification to
653
+ * the student submission, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `FAILED_PRECONDITION` if the requested course work has already been deleted. *
654
+ * `NOT_FOUND` if the requested course, course work, or student submission does not exist.
655
+ */
656
+ await gapi.client.classroom.courses.courseWork.patch({
657
+ courseId: "Test string",
658
+ id: "Test string",
659
+ updateMask: "Test string",
660
+ }, {
661
+ alternateLink: "Test string",
662
+ assigneeMode: "Test string",
663
+ assignment: {
664
+ studentWorkFolder: {
665
+ alternateLink: "Test string",
666
+ id: "Test string",
667
+ title: "Test string",
668
+ },
669
+ },
670
+ associatedWithDeveloper: true,
671
+ courseId: "Test string",
672
+ creationTime: "Test string",
673
+ creatorUserId: "Test string",
674
+ description: "Test string",
675
+ dueDate: {
676
+ day: 42,
677
+ month: 42,
678
+ year: 42,
679
+ },
680
+ dueTime: {
681
+ hours: 42,
682
+ minutes: 42,
683
+ nanos: 42,
684
+ seconds: 42,
685
+ },
686
+ gradeCategory: {
687
+ defaultGradeDenominator: 42,
688
+ id: "Test string",
689
+ name: "Test string",
690
+ weight: 42,
691
+ },
692
+ id: "Test string",
693
+ individualStudentsOptions: {
694
+ studentIds: [
695
+ "Test string"
696
+ ],
697
+ },
698
+ materials: [
699
+ {
700
+ driveFile: {
701
+ driveFile: {
702
+ alternateLink: "Test string",
703
+ id: "Test string",
704
+ thumbnailUrl: "Test string",
705
+ title: "Test string",
706
+ },
707
+ shareMode: "Test string",
708
+ },
709
+ form: {
710
+ formUrl: "Test string",
711
+ responseUrl: "Test string",
712
+ thumbnailUrl: "Test string",
713
+ title: "Test string",
714
+ },
715
+ link: {
716
+ thumbnailUrl: "Test string",
717
+ title: "Test string",
718
+ url: "Test string",
719
+ },
720
+ youtubeVideo: {
721
+ alternateLink: "Test string",
722
+ id: "Test string",
723
+ thumbnailUrl: "Test string",
724
+ title: "Test string",
725
+ },
726
+ }
727
+ ],
728
+ maxPoints: 42,
729
+ multipleChoiceQuestion: {
730
+ choices: [
731
+ "Test string"
732
+ ],
733
+ },
734
+ scheduledTime: "Test string",
735
+ state: "Test string",
736
+ submissionModificationMode: "Test string",
737
+ title: "Test string",
738
+ topicId: "Test string",
739
+ updateTime: "Test string",
740
+ workType: "Test string",
741
+ });
742
+ /**
743
+ * Returns a student submission. * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course, course work, or student submission or for access errors. *
744
+ * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student submission does not exist.
745
+ */
746
+ await gapi.client.classroom.courses.courseWork.studentSubmissions.get({
747
+ courseId: "Test string",
748
+ courseWorkId: "Test string",
749
+ id: "Test string",
750
+ });
751
+ /**
752
+ * Returns a list of student submissions that the requester is permitted to view, factoring in the OAuth scopes of the request. `-` may be specified as the `course_work_id` to include
753
+ * student submissions for multiple course work items. Course students may only view their own work. Course teachers and domain administrators may view all student submissions. This method
754
+ * returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, or for access errors. *
755
+ * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course does not exist.
756
+ */
757
+ await gapi.client.classroom.courses.courseWork.studentSubmissions.list({
758
+ courseId: "Test string",
759
+ courseWorkId: "Test string",
760
+ late: "Test string",
761
+ pageSize: 42,
762
+ pageToken: "Test string",
763
+ states: "Test string",
764
+ userId: "Test string",
765
+ });
766
+ /**
767
+ * Modifies attachments of student submission. Attachments may only be added to student submissions belonging to course work objects with a `workType` of `ASSIGNMENT`. This request must be
768
+ * made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns
769
+ * the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, if the user is not permitted to modify
770
+ * attachments on the requested student submission, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student
771
+ * submission does not exist.
772
+ */
773
+ await gapi.client.classroom.courses.courseWork.studentSubmissions.modifyAttachments({
774
+ courseId: "Test string",
775
+ courseWorkId: "Test string",
776
+ id: "Test string",
777
+ }, {
778
+ addAttachments: [
779
+ {
780
+ driveFile: {
781
+ alternateLink: "Test string",
782
+ id: "Test string",
783
+ thumbnailUrl: "Test string",
784
+ title: "Test string",
785
+ },
786
+ form: {
787
+ formUrl: "Test string",
788
+ responseUrl: "Test string",
789
+ thumbnailUrl: "Test string",
790
+ title: "Test string",
791
+ },
792
+ link: {
793
+ thumbnailUrl: "Test string",
794
+ title: "Test string",
795
+ url: "Test string",
796
+ },
797
+ youTubeVideo: {
798
+ alternateLink: "Test string",
799
+ id: "Test string",
800
+ thumbnailUrl: "Test string",
801
+ title: "Test string",
802
+ },
803
+ }
804
+ ],
805
+ });
806
+ /**
807
+ * Updates one or more fields of a student submission. See google.classroom.v1.StudentSubmission for details of which fields may be updated and who may change them. This request must be
808
+ * made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns
809
+ * the following error codes: * `PERMISSION_DENIED` if the requesting developer project did not create the corresponding course work, if the user is not permitted to make the requested
810
+ * modification to the student submission, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student submission
811
+ * does not exist.
812
+ */
813
+ await gapi.client.classroom.courses.courseWork.studentSubmissions.patch({
814
+ courseId: "Test string",
815
+ courseWorkId: "Test string",
816
+ id: "Test string",
817
+ updateMask: "Test string",
818
+ }, {
819
+ alternateLink: "Test string",
820
+ assignedGrade: 42,
821
+ assignmentSubmission: {
822
+ attachments: [
823
+ {
824
+ driveFile: {
825
+ alternateLink: "Test string",
826
+ id: "Test string",
827
+ thumbnailUrl: "Test string",
828
+ title: "Test string",
829
+ },
830
+ form: {
831
+ formUrl: "Test string",
832
+ responseUrl: "Test string",
833
+ thumbnailUrl: "Test string",
834
+ title: "Test string",
835
+ },
836
+ link: {
837
+ thumbnailUrl: "Test string",
838
+ title: "Test string",
839
+ url: "Test string",
840
+ },
841
+ youTubeVideo: {
842
+ alternateLink: "Test string",
843
+ id: "Test string",
844
+ thumbnailUrl: "Test string",
845
+ title: "Test string",
846
+ },
847
+ }
848
+ ],
849
+ },
850
+ associatedWithDeveloper: true,
851
+ courseId: "Test string",
852
+ courseWorkId: "Test string",
853
+ courseWorkType: "Test string",
854
+ creationTime: "Test string",
855
+ draftGrade: 42,
856
+ id: "Test string",
857
+ late: true,
858
+ multipleChoiceSubmission: {
859
+ answer: "Test string",
860
+ },
861
+ shortAnswerSubmission: {
862
+ answer: "Test string",
863
+ },
864
+ state: "Test string",
865
+ submissionHistory: [
866
+ {
867
+ gradeHistory: {
868
+ actorUserId: "Test string",
869
+ gradeChangeType: "Test string",
870
+ gradeTimestamp: "Test string",
871
+ maxPoints: 42,
872
+ pointsEarned: 42,
873
+ },
874
+ stateHistory: {
875
+ actorUserId: "Test string",
876
+ state: "Test string",
877
+ stateTimestamp: "Test string",
878
+ },
879
+ }
880
+ ],
881
+ updateTime: "Test string",
882
+ userId: "Test string",
883
+ });
884
+ /**
885
+ * Reclaims a student submission on behalf of the student that owns it. Reclaiming a student submission transfers ownership of attached Drive files to the student and updates the
886
+ * submission state. Only the student that owns the requested student submission may call this method, and only for a student submission that has been turned in. This request must be made
887
+ * by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the
888
+ * following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, unsubmit the requested student submission, or for
889
+ * access errors. * `FAILED_PRECONDITION` if the student submission has not been turned in. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course
890
+ * work, or student submission does not exist.
891
+ */
892
+ await gapi.client.classroom.courses.courseWork.studentSubmissions.reclaim({
893
+ courseId: "Test string",
894
+ courseWorkId: "Test string",
895
+ id: "Test string",
896
+ }, {
897
+ });
898
+ /**
899
+ * Returns a student submission. Returning a student submission transfers ownership of attached Drive files to the student and may also update the submission state. Unlike the Classroom
900
+ * application, returning a student submission does not set assignedGrade to the draftGrade value. Only a teacher of the course that contains the requested student submission may call this
901
+ * method. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work
902
+ * item. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, return the requested
903
+ * student submission, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course, course work, or student submission does not exist.
904
+ */
905
+ await gapi.client.classroom.courses.courseWork.studentSubmissions.return({
906
+ courseId: "Test string",
907
+ courseWorkId: "Test string",
908
+ id: "Test string",
909
+ }, {
910
+ });
911
+ /**
912
+ * Turns in a student submission. Turning in a student submission transfers ownership of attached Drive files to the teacher and may also update the submission state. This may only be
913
+ * called by the student that owns the specified student submission. This request must be made by the Developer Console project of the [OAuth client
914
+ * ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes: * `PERMISSION_DENIED` if the
915
+ * requesting user is not permitted to access the requested course or course work, turn in the requested student submission, or for access errors. * `INVALID_ARGUMENT` if the request is
916
+ * malformed. * `NOT_FOUND` if the requested course, course work, or student submission does not exist.
917
+ */
918
+ await gapi.client.classroom.courses.courseWork.studentSubmissions.turnIn({
919
+ courseId: "Test string",
920
+ courseWorkId: "Test string",
921
+ id: "Test string",
922
+ }, {
923
+ });
924
+ /**
925
+ * Creates a course work material. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course, create
926
+ * course work material in the requested course, share a Drive attachment, or for access errors. * `INVALID_ARGUMENT` if the request is malformed or if more than 20 * materials are
927
+ * provided. * `NOT_FOUND` if the requested course does not exist. * `FAILED_PRECONDITION` for the following request error: * AttachmentNotVisible
928
+ */
929
+ await gapi.client.classroom.courses.courseWorkMaterials.create({
930
+ courseId: "Test string",
931
+ }, {
932
+ alternateLink: "Test string",
933
+ assigneeMode: "Test string",
934
+ courseId: "Test string",
935
+ creationTime: "Test string",
936
+ creatorUserId: "Test string",
937
+ description: "Test string",
938
+ id: "Test string",
939
+ individualStudentsOptions: {
940
+ studentIds: [
941
+ "Test string"
942
+ ],
943
+ },
944
+ materials: [
945
+ {
946
+ driveFile: {
947
+ driveFile: {
948
+ alternateLink: "Test string",
949
+ id: "Test string",
950
+ thumbnailUrl: "Test string",
951
+ title: "Test string",
952
+ },
953
+ shareMode: "Test string",
954
+ },
955
+ form: {
956
+ formUrl: "Test string",
957
+ responseUrl: "Test string",
958
+ thumbnailUrl: "Test string",
959
+ title: "Test string",
960
+ },
961
+ link: {
962
+ thumbnailUrl: "Test string",
963
+ title: "Test string",
964
+ url: "Test string",
965
+ },
966
+ youtubeVideo: {
967
+ alternateLink: "Test string",
968
+ id: "Test string",
969
+ thumbnailUrl: "Test string",
970
+ title: "Test string",
971
+ },
972
+ }
973
+ ],
974
+ scheduledTime: "Test string",
975
+ state: "Test string",
976
+ title: "Test string",
977
+ topicId: "Test string",
978
+ updateTime: "Test string",
979
+ });
980
+ /**
981
+ * Deletes a course work material. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the
982
+ * corresponding course work material item. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting developer project did not create the corresponding course
983
+ * work material, if the requesting user is not permitted to delete the requested course or for access errors. * `FAILED_PRECONDITION` if the requested course work material has already
984
+ * been deleted. * `NOT_FOUND` if no course exists with the requested ID.
985
+ */
986
+ await gapi.client.classroom.courses.courseWorkMaterials.delete({
987
+ courseId: "Test string",
988
+ id: "Test string",
989
+ });
990
+ /**
991
+ * Returns a course work material. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course
992
+ * work material, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course or course work material does not exist.
993
+ */
994
+ await gapi.client.classroom.courses.courseWorkMaterials.get({
995
+ courseId: "Test string",
996
+ id: "Test string",
997
+ });
998
+ /**
999
+ * Returns a list of course work material that the requester is permitted to view. Course students may only view `PUBLISHED` course work material. Course teachers and domain administrators
1000
+ * may view all course work material. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for
1001
+ * access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course does not exist.
1002
+ */
1003
+ await gapi.client.classroom.courses.courseWorkMaterials.list({
1004
+ courseId: "Test string",
1005
+ courseWorkMaterialStates: "Test string",
1006
+ materialDriveId: "Test string",
1007
+ materialLink: "Test string",
1008
+ orderBy: "Test string",
1009
+ pageSize: 42,
1010
+ pageToken: "Test string",
1011
+ });
1012
+ /**
1013
+ * Updates one or more fields of a course work material. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting developer project for access errors. *
1014
+ * `INVALID_ARGUMENT` if the request is malformed. * `FAILED_PRECONDITION` if the requested course work material has already been deleted. * `NOT_FOUND` if the requested course or course
1015
+ * work material does not exist
1016
+ */
1017
+ await gapi.client.classroom.courses.courseWorkMaterials.patch({
1018
+ courseId: "Test string",
1019
+ id: "Test string",
1020
+ updateMask: "Test string",
1021
+ }, {
1022
+ alternateLink: "Test string",
1023
+ assigneeMode: "Test string",
1024
+ courseId: "Test string",
1025
+ creationTime: "Test string",
1026
+ creatorUserId: "Test string",
1027
+ description: "Test string",
1028
+ id: "Test string",
1029
+ individualStudentsOptions: {
1030
+ studentIds: [
1031
+ "Test string"
1032
+ ],
1033
+ },
1034
+ materials: [
1035
+ {
1036
+ driveFile: {
1037
+ driveFile: {
1038
+ alternateLink: "Test string",
1039
+ id: "Test string",
1040
+ thumbnailUrl: "Test string",
1041
+ title: "Test string",
1042
+ },
1043
+ shareMode: "Test string",
1044
+ },
1045
+ form: {
1046
+ formUrl: "Test string",
1047
+ responseUrl: "Test string",
1048
+ thumbnailUrl: "Test string",
1049
+ title: "Test string",
1050
+ },
1051
+ link: {
1052
+ thumbnailUrl: "Test string",
1053
+ title: "Test string",
1054
+ url: "Test string",
1055
+ },
1056
+ youtubeVideo: {
1057
+ alternateLink: "Test string",
1058
+ id: "Test string",
1059
+ thumbnailUrl: "Test string",
1060
+ title: "Test string",
1061
+ },
1062
+ }
1063
+ ],
1064
+ scheduledTime: "Test string",
1065
+ state: "Test string",
1066
+ title: "Test string",
1067
+ topicId: "Test string",
1068
+ updateTime: "Test string",
1069
+ });
1070
+ /**
1071
+ * Adds a user as a student of a course. Domain administrators are permitted to [directly add](https://developers.google.com/classroom/guides/manage-users) users within their domain as
1072
+ * students to courses within their domain. Students are permitted to add themselves to a course using an enrollment code. This method returns the following error codes: *
1073
+ * `PERMISSION_DENIED` if the requesting user is not permitted to create students in this course or for access errors. * `NOT_FOUND` if the requested course ID does not exist. *
1074
+ * `FAILED_PRECONDITION` if the requested user's account is disabled, for the following request errors: * CourseMemberLimitReached * CourseNotModifiable * UserGroupsMembershipLimitReached
1075
+ * * InactiveCourseOwner * `ALREADY_EXISTS` if the user is already a student or teacher in the course.
1076
+ */
1077
+ await gapi.client.classroom.courses.students.create({
1078
+ courseId: "Test string",
1079
+ enrollmentCode: "Test string",
1080
+ }, {
1081
+ courseId: "Test string",
1082
+ profile: {
1083
+ emailAddress: "Test string",
1084
+ id: "Test string",
1085
+ name: {
1086
+ familyName: "Test string",
1087
+ fullName: "Test string",
1088
+ givenName: "Test string",
1089
+ },
1090
+ permissions: [
1091
+ {
1092
+ permission: "Test string",
1093
+ }
1094
+ ],
1095
+ photoUrl: "Test string",
1096
+ verifiedTeacher: true,
1097
+ },
1098
+ studentWorkFolder: {
1099
+ alternateLink: "Test string",
1100
+ id: "Test string",
1101
+ title: "Test string",
1102
+ },
1103
+ userId: "Test string",
1104
+ });
1105
+ /**
1106
+ * Deletes a student of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to delete students of this course or for
1107
+ * access errors. * `NOT_FOUND` if no student of this course has the requested ID or if the course does not exist.
1108
+ */
1109
+ await gapi.client.classroom.courses.students.delete({
1110
+ courseId: "Test string",
1111
+ userId: "Test string",
1112
+ });
1113
+ /**
1114
+ * Returns a student of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view students of this course or for access
1115
+ * errors. * `NOT_FOUND` if no student of this course has the requested ID or if the course does not exist.
1116
+ */
1117
+ await gapi.client.classroom.courses.students.get({
1118
+ courseId: "Test string",
1119
+ userId: "Test string",
1120
+ });
1121
+ /**
1122
+ * Returns a list of students of this course that the requester is permitted to view. This method returns the following error codes: * `NOT_FOUND` if the course does not exist. *
1123
+ * `PERMISSION_DENIED` for access errors.
1124
+ */
1125
+ await gapi.client.classroom.courses.students.list({
1126
+ courseId: "Test string",
1127
+ pageSize: 42,
1128
+ pageToken: "Test string",
1129
+ });
1130
+ /**
1131
+ * Creates a teacher of a course. Domain administrators are permitted to [directly add](https://developers.google.com/classroom/guides/manage-users) users within their domain as teachers
1132
+ * to courses within their domain. Non-admin users should send an Invitation instead. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not
1133
+ * permitted to create teachers in this course or for access errors. * `NOT_FOUND` if the requested course ID does not exist. * `FAILED_PRECONDITION` if the requested user's account is
1134
+ * disabled, for the following request errors: * CourseMemberLimitReached * CourseNotModifiable * CourseTeacherLimitReached * UserGroupsMembershipLimitReached * InactiveCourseOwner *
1135
+ * `ALREADY_EXISTS` if the user is already a teacher or student in the course.
1136
+ */
1137
+ await gapi.client.classroom.courses.teachers.create({
1138
+ courseId: "Test string",
1139
+ }, {
1140
+ courseId: "Test string",
1141
+ profile: {
1142
+ emailAddress: "Test string",
1143
+ id: "Test string",
1144
+ name: {
1145
+ familyName: "Test string",
1146
+ fullName: "Test string",
1147
+ givenName: "Test string",
1148
+ },
1149
+ permissions: [
1150
+ {
1151
+ permission: "Test string",
1152
+ }
1153
+ ],
1154
+ photoUrl: "Test string",
1155
+ verifiedTeacher: true,
1156
+ },
1157
+ userId: "Test string",
1158
+ });
1159
+ /**
1160
+ * Removes the specified teacher from the specified course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to delete teachers
1161
+ * of this course or for access errors. * `NOT_FOUND` if no teacher of this course has the requested ID or if the course does not exist. * `FAILED_PRECONDITION` if the requested ID belongs
1162
+ * to the primary teacher of this course. * `FAILED_PRECONDITION` if the requested ID belongs to the owner of the course Drive folder. * `FAILED_PRECONDITION` if the course no longer has
1163
+ * an active owner.
1164
+ */
1165
+ await gapi.client.classroom.courses.teachers.delete({
1166
+ courseId: "Test string",
1167
+ userId: "Test string",
1168
+ });
1169
+ /**
1170
+ * Returns a teacher of a course. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view teachers of this course or for access
1171
+ * errors. * `NOT_FOUND` if no teacher of this course has the requested ID or if the course does not exist.
1172
+ */
1173
+ await gapi.client.classroom.courses.teachers.get({
1174
+ courseId: "Test string",
1175
+ userId: "Test string",
1176
+ });
1177
+ /**
1178
+ * Returns a list of teachers of this course that the requester is permitted to view. This method returns the following error codes: * `NOT_FOUND` if the course does not exist. *
1179
+ * `PERMISSION_DENIED` for access errors.
1180
+ */
1181
+ await gapi.client.classroom.courses.teachers.list({
1182
+ courseId: "Test string",
1183
+ pageSize: 42,
1184
+ pageToken: "Test string",
1185
+ });
1186
+ /**
1187
+ * Creates a topic. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course, create a topic in the
1188
+ * requested course, or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course does not exist.
1189
+ */
1190
+ await gapi.client.classroom.courses.topics.create({
1191
+ courseId: "Test string",
1192
+ }, {
1193
+ courseId: "Test string",
1194
+ name: "Test string",
1195
+ topicId: "Test string",
1196
+ updateTime: "Test string",
1197
+ });
1198
+ /**
1199
+ * Deletes a topic. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not allowed to delete the requested topic or for access errors. *
1200
+ * `FAILED_PRECONDITION` if the requested topic has already been deleted. * `NOT_FOUND` if no course or topic exists with the requested ID.
1201
+ */
1202
+ await gapi.client.classroom.courses.topics.delete({
1203
+ courseId: "Test string",
1204
+ id: "Test string",
1205
+ });
1206
+ /**
1207
+ * Returns a topic. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or topic, or for access
1208
+ * errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course or topic does not exist.
1209
+ */
1210
+ await gapi.client.classroom.courses.topics.get({
1211
+ courseId: "Test string",
1212
+ id: "Test string",
1213
+ });
1214
+ /**
1215
+ * Returns the list of topics that the requester is permitted to view. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to
1216
+ * access the requested course or for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course does not exist.
1217
+ */
1218
+ await gapi.client.classroom.courses.topics.list({
1219
+ courseId: "Test string",
1220
+ pageSize: 42,
1221
+ pageToken: "Test string",
1222
+ });
1223
+ /**
1224
+ * Updates one or more fields of a topic. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting developer project did not create the corresponding topic or
1225
+ * for access errors. * `INVALID_ARGUMENT` if the request is malformed. * `NOT_FOUND` if the requested course or topic does not exist
1226
+ */
1227
+ await gapi.client.classroom.courses.topics.patch({
1228
+ courseId: "Test string",
1229
+ id: "Test string",
1230
+ updateMask: "Test string",
1231
+ }, {
1232
+ courseId: "Test string",
1233
+ name: "Test string",
1234
+ topicId: "Test string",
1235
+ updateTime: "Test string",
1236
+ });
1237
+ /**
1238
+ * Accepts an invitation, removing it and adding the invited user to the teachers or students (as appropriate) of the specified course. Only the invited user may accept an invitation. This
1239
+ * method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to accept the requested invitation or for access errors. * `FAILED_PRECONDITION`
1240
+ * for the following request errors: * CourseMemberLimitReached * CourseNotModifiable * CourseTeacherLimitReached * UserGroupsMembershipLimitReached * `NOT_FOUND` if no invitation exists
1241
+ * with the requested ID.
1242
+ */
1243
+ await gapi.client.classroom.invitations.accept({
1244
+ id: "Test string",
1245
+ });
1246
+ /**
1247
+ * Creates an invitation. Only one invitation for a user and course may exist at a time. Delete and re-create an invitation to make changes. This method returns the following error codes:
1248
+ * * `PERMISSION_DENIED` if the requesting user is not permitted to create invitations for this course or for access errors. * `NOT_FOUND` if the course or the user does not exist. *
1249
+ * `FAILED_PRECONDITION` if the requested user's account is disabled or if the user already has this role or a role with greater permissions. * `ALREADY_EXISTS` if an invitation for the
1250
+ * specified user and course already exists.
1251
+ */
1252
+ await gapi.client.classroom.invitations.create({
1253
+ }, {
1254
+ courseId: "Test string",
1255
+ id: "Test string",
1256
+ role: "Test string",
1257
+ userId: "Test string",
1258
+ });
1259
+ /**
1260
+ * Deletes an invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to delete the requested invitation or for access
1261
+ * errors. * `NOT_FOUND` if no invitation exists with the requested ID.
1262
+ */
1263
+ await gapi.client.classroom.invitations.delete({
1264
+ id: "Test string",
1265
+ });
1266
+ /**
1267
+ * Returns an invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view the requested invitation or for access
1268
+ * errors. * `NOT_FOUND` if no invitation exists with the requested ID.
1269
+ */
1270
+ await gapi.client.classroom.invitations.get({
1271
+ id: "Test string",
1272
+ });
1273
+ /**
1274
+ * Returns a list of invitations that the requesting user is permitted to view, restricted to those that match the list request. *Note:* At least one of `user_id` or `course_id` must be
1275
+ * supplied. Both fields can be supplied. This method returns the following error codes: * `PERMISSION_DENIED` for access errors.
1276
+ */
1277
+ await gapi.client.classroom.invitations.list({
1278
+ courseId: "Test string",
1279
+ pageSize: 42,
1280
+ pageToken: "Test string",
1281
+ userId: "Test string",
1282
+ });
1283
+ /**
1284
+ * Creates a `Registration`, causing Classroom to start sending notifications from the provided `feed` to the destination provided in `cloudPubSubTopic`. Returns the created
1285
+ * `Registration`. Currently, this will be the same as the argument, but with server-assigned fields such as `expiry_time` and `id` filled in. Note that any value specified for the
1286
+ * `expiry_time` or `id` fields will be ignored. While Classroom may validate the `cloudPubSubTopic` and return errors on a best effort basis, it is the caller's responsibility to ensure
1287
+ * that it exists and that Classroom has permission to publish to it. This method may return the following error codes: * `PERMISSION_DENIED` if: * the authenticated user does not have
1288
+ * permission to receive notifications from the requested field; or * the current user has not granted access to the current Cloud project with the appropriate scope for the requested
1289
+ * feed. Note that domain-wide delegation of authority is not currently supported for this purpose. If the request has the appropriate scope, but no grant exists, a Request Errors is
1290
+ * returned. * another access error is encountered. * `INVALID_ARGUMENT` if: * no `cloudPubsubTopic` is specified, or the specified `cloudPubsubTopic` is not valid; or * no `feed` is
1291
+ * specified, or the specified `feed` is not valid. * `NOT_FOUND` if: * the specified `feed` cannot be located, or the requesting user does not have permission to determine whether or not
1292
+ * it exists; or * the specified `cloudPubsubTopic` cannot be located, or Classroom has not been granted permission to publish to it.
1293
+ */
1294
+ await gapi.client.classroom.registrations.create({
1295
+ }, {
1296
+ cloudPubsubTopic: {
1297
+ topicName: "Test string",
1298
+ },
1299
+ expiryTime: "Test string",
1300
+ feed: {
1301
+ courseRosterChangesInfo: {
1302
+ courseId: "Test string",
1303
+ },
1304
+ courseWorkChangesInfo: {
1305
+ courseId: "Test string",
1306
+ },
1307
+ feedType: "Test string",
1308
+ },
1309
+ registrationId: "Test string",
1310
+ });
1311
+ /** Deletes a `Registration`, causing Classroom to stop sending notifications for that `Registration`. */
1312
+ await gapi.client.classroom.registrations.delete({
1313
+ registrationId: "Test string",
1314
+ });
1315
+ /**
1316
+ * Returns a user profile. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to access this user profile, if no profile exists
1317
+ * with the requested ID, or for access errors.
1318
+ */
1319
+ await gapi.client.classroom.userProfiles.get({
1320
+ userId: "Test string",
1321
+ });
1322
+ /**
1323
+ * Creates a guardian invitation, and sends an email to the guardian asking them to confirm that they are the student's guardian. Once the guardian accepts the invitation, their `state`
1324
+ * will change to `COMPLETED` and they will start receiving guardian notifications. A `Guardian` resource will also be created to represent the active guardian. The request object must
1325
+ * have the `student_id` and `invited_email_address` fields set. Failing to set these fields, or setting any other fields in the request, will result in an error. This method returns the
1326
+ * following error codes: * `PERMISSION_DENIED` if the current user does not have permission to manage guardians, if the guardian in question has already rejected too many requests for
1327
+ * that student, if guardians are not enabled for the domain in question, or for other access errors. * `RESOURCE_EXHAUSTED` if the student or guardian has exceeded the guardian link
1328
+ * limit. * `INVALID_ARGUMENT` if the guardian email address is not valid (for example, if it is too long), or if the format of the student ID provided cannot be recognized (it is not an
1329
+ * email address, nor a `user_id` from this API). This error will also be returned if read-only fields are set, or if the `state` field is set to to a value other than `PENDING`. *
1330
+ * `NOT_FOUND` if the student ID provided is a valid student ID, but Classroom has no record of that student. * `ALREADY_EXISTS` if there is already a pending guardian invitation for the
1331
+ * student and `invited_email_address` provided, or if the provided `invited_email_address` matches the Google account of an existing `Guardian` for this user.
1332
+ */
1333
+ await gapi.client.classroom.userProfiles.guardianInvitations.create({
1334
+ studentId: "Test string",
1335
+ }, {
1336
+ creationTime: "Test string",
1337
+ invitationId: "Test string",
1338
+ invitedEmailAddress: "Test string",
1339
+ state: "Test string",
1340
+ studentId: "Test string",
1341
+ });
1342
+ /**
1343
+ * Returns a specific guardian invitation. This method returns the following error codes: * `PERMISSION_DENIED` if the requesting user is not permitted to view guardian invitations for the
1344
+ * student identified by the `student_id`, if guardians are not enabled for the domain in question, or for other access errors. * `INVALID_ARGUMENT` if a `student_id` is specified, but its
1345
+ * format cannot be recognized (it is not an email address, nor a `student_id` from the API, nor the literal string `me`). * `NOT_FOUND` if Classroom cannot find any record of the given
1346
+ * student or `invitation_id`. May also be returned if the student exists, but the requesting user does not have access to see that student.
1347
+ */
1348
+ await gapi.client.classroom.userProfiles.guardianInvitations.get({
1349
+ invitationId: "Test string",
1350
+ studentId: "Test string",
1351
+ });
1352
+ /**
1353
+ * Returns a list of guardian invitations that the requesting user is permitted to view, filtered by the parameters provided. This method returns the following error codes: *
1354
+ * `PERMISSION_DENIED` if a `student_id` is specified, and the requesting user is not permitted to view guardian invitations for that student, if `"-"` is specified as the `student_id` and
1355
+ * the user is not a domain administrator, if guardians are not enabled for the domain in question, or for other access errors. * `INVALID_ARGUMENT` if a `student_id` is specified, but its
1356
+ * format cannot be recognized (it is not an email address, nor a `student_id` from the API, nor the literal string `me`). May also be returned if an invalid `page_token` or `state` is
1357
+ * provided. * `NOT_FOUND` if a `student_id` is specified, and its format can be recognized, but Classroom has no record of that student.
1358
+ */
1359
+ await gapi.client.classroom.userProfiles.guardianInvitations.list({
1360
+ invitedEmailAddress: "Test string",
1361
+ pageSize: 42,
1362
+ pageToken: "Test string",
1363
+ states: "Test string",
1364
+ studentId: "Test string",
1365
+ });
1366
+ /**
1367
+ * Modifies a guardian invitation. Currently, the only valid modification is to change the `state` from `PENDING` to `COMPLETE`. This has the effect of withdrawing the invitation. This
1368
+ * method returns the following error codes: * `PERMISSION_DENIED` if the current user does not have permission to manage guardians, if guardians are not enabled for the domain in question
1369
+ * or for other access errors. * `FAILED_PRECONDITION` if the guardian link is not in the `PENDING` state. * `INVALID_ARGUMENT` if the format of the student ID provided cannot be
1370
+ * recognized (it is not an email address, nor a `user_id` from this API), or if the passed `GuardianInvitation` has a `state` other than `COMPLETE`, or if it modifies fields other than
1371
+ * `state`. * `NOT_FOUND` if the student ID provided is a valid student ID, but Classroom has no record of that student, or if the `id` field does not refer to a guardian invitation known
1372
+ * to Classroom.
1373
+ */
1374
+ await gapi.client.classroom.userProfiles.guardianInvitations.patch({
1375
+ invitationId: "Test string",
1376
+ studentId: "Test string",
1377
+ updateMask: "Test string",
1378
+ }, {
1379
+ creationTime: "Test string",
1380
+ invitationId: "Test string",
1381
+ invitedEmailAddress: "Test string",
1382
+ state: "Test string",
1383
+ studentId: "Test string",
1384
+ });
1385
+ /**
1386
+ * Deletes a guardian. The guardian will no longer receive guardian notifications and the guardian will no longer be accessible via the API. This method returns the following error codes:
1387
+ * * `PERMISSION_DENIED` if no user that matches the provided `student_id` is visible to the requesting user, if the requesting user is not permitted to manage guardians for the student
1388
+ * identified by the `student_id`, if guardians are not enabled for the domain in question, or for other access errors. * `INVALID_ARGUMENT` if a `student_id` is specified, but its format
1389
+ * cannot be recognized (it is not an email address, nor a `student_id` from the API). * `NOT_FOUND` if the requesting user is permitted to modify guardians for the requested `student_id`,
1390
+ * but no `Guardian` record exists for that student with the provided `guardian_id`.
1391
+ */
1392
+ await gapi.client.classroom.userProfiles.guardians.delete({
1393
+ guardianId: "Test string",
1394
+ studentId: "Test string",
1395
+ });
1396
+ /**
1397
+ * Returns a specific guardian. This method returns the following error codes: * `PERMISSION_DENIED` if no user that matches the provided `student_id` is visible to the requesting user, if
1398
+ * the requesting user is not permitted to view guardian information for the student identified by the `student_id`, if guardians are not enabled for the domain in question, or for other
1399
+ * access errors. * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot be recognized (it is not an email address, nor a `student_id` from the API, nor the literal
1400
+ * string `me`). * `NOT_FOUND` if the requesting user is permitted to view guardians for the requested `student_id`, but no `Guardian` record exists for that student that matches the
1401
+ * provided `guardian_id`.
1402
+ */
1403
+ await gapi.client.classroom.userProfiles.guardians.get({
1404
+ guardianId: "Test string",
1405
+ studentId: "Test string",
1406
+ });
1407
+ /**
1408
+ * Returns a list of guardians that the requesting user is permitted to view, restricted to those that match the request. To list guardians for any student that the requesting user may
1409
+ * view guardians for, use the literal character `-` for the student ID. This method returns the following error codes: * `PERMISSION_DENIED` if a `student_id` is specified, and the
1410
+ * requesting user is not permitted to view guardian information for that student, if `"-"` is specified as the `student_id` and the user is not a domain administrator, if guardians are
1411
+ * not enabled for the domain in question, if the `invited_email_address` filter is set by a user who is not a domain administrator, or for other access errors. * `INVALID_ARGUMENT` if a
1412
+ * `student_id` is specified, but its format cannot be recognized (it is not an email address, nor a `student_id` from the API, nor the literal string `me`). May also be returned if an
1413
+ * invalid `page_token` is provided. * `NOT_FOUND` if a `student_id` is specified, and its format can be recognized, but Classroom has no record of that student.
1414
+ */
1415
+ await gapi.client.classroom.userProfiles.guardians.list({
1416
+ invitedEmailAddress: "Test string",
1417
+ pageSize: 42,
1418
+ pageToken: "Test string",
1419
+ studentId: "Test string",
1420
+ });
1421
+ }
1422
+ });