| OLD | NEW |
| 1 // This is a generated file (see the discoveryapis_generator project). | 1 // This is a generated file (see the discoveryapis_generator project). |
| 2 | 2 |
| 3 library googleapis.classroom.v1; | 3 library googleapis.classroom.v1; |
| 4 | 4 |
| 5 import 'dart:core' as core; | 5 import 'dart:core' as core; |
| 6 import 'dart:async' as async; | 6 import 'dart:async' as async; |
| 7 import 'dart:convert' as convert; | 7 import 'dart:convert' as convert; |
| 8 | 8 |
| 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; | 9 import 'package:_discoveryapis_commons/_discoveryapis_commons.dart' as commons; |
| 10 import 'package:http/http.dart' as http; | 10 import 'package:http/http.dart' as http; |
| 11 | 11 |
| 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' show | 12 export 'package:_discoveryapis_commons/_discoveryapis_commons.dart' |
| 13 ApiRequestError, DetailedApiRequestError; | 13 show ApiRequestError, DetailedApiRequestError; |
| 14 | 14 |
| 15 const core.String USER_AGENT = 'dart-api-client classroom/v1'; | 15 const core.String USER_AGENT = 'dart-api-client classroom/v1'; |
| 16 | 16 |
| 17 /** Manages classes, rosters, and invitations in Google Classroom. */ | 17 /// Manages classes, rosters, and invitations in Google Classroom. |
| 18 class ClassroomApi { | 18 class ClassroomApi { |
| 19 /** Manage your Google Classroom classes */ | 19 /// Manage your Google Classroom classes |
| 20 static const ClassroomCoursesScope = "https://www.googleapis.com/auth/classroo
m.courses"; | 20 static const ClassroomCoursesScope = |
| 21 "https://www.googleapis.com/auth/classroom.courses"; |
| 21 | 22 |
| 22 /** View your Google Classroom classes */ | 23 /// View your Google Classroom classes |
| 23 static const ClassroomCoursesReadonlyScope = "https://www.googleapis.com/auth/
classroom.courses.readonly"; | 24 static const ClassroomCoursesReadonlyScope = |
| 25 "https://www.googleapis.com/auth/classroom.courses.readonly"; |
| 24 | 26 |
| 25 /** Manage your course work and view your grades in Google Classroom */ | 27 /// Manage your course work and view your grades in Google Classroom |
| 26 static const ClassroomCourseworkMeScope = "https://www.googleapis.com/auth/cla
ssroom.coursework.me"; | 28 static const ClassroomCourseworkMeScope = |
| 29 "https://www.googleapis.com/auth/classroom.coursework.me"; |
| 27 | 30 |
| 28 /** View your course work and grades in Google Classroom */ | 31 /// View your course work and grades in Google Classroom |
| 29 static const ClassroomCourseworkMeReadonlyScope = "https://www.googleapis.com/
auth/classroom.coursework.me.readonly"; | 32 static const ClassroomCourseworkMeReadonlyScope = |
| 33 "https://www.googleapis.com/auth/classroom.coursework.me.readonly"; |
| 30 | 34 |
| 31 /** | 35 /// Manage course work and grades for students in the Google Classroom |
| 32 * Manage course work and grades for students in the Google Classroom classes | 36 /// classes you teach and view the course work and grades for classes you |
| 33 * you teach and view the course work and grades for classes you administer | 37 /// administer |
| 34 */ | 38 static const ClassroomCourseworkStudentsScope = |
| 35 static const ClassroomCourseworkStudentsScope = "https://www.googleapis.com/au
th/classroom.coursework.students"; | 39 "https://www.googleapis.com/auth/classroom.coursework.students"; |
| 36 | 40 |
| 37 /** | 41 /// View course work and grades for students in the Google Classroom classes |
| 38 * View course work and grades for students in the Google Classroom classes | 42 /// you teach or administer |
| 39 * you teach or administer | 43 static const ClassroomCourseworkStudentsReadonlyScope = |
| 40 */ | 44 "https://www.googleapis.com/auth/classroom.coursework.students.readonly"; |
| 41 static const ClassroomCourseworkStudentsReadonlyScope = "https://www.googleapi
s.com/auth/classroom.coursework.students.readonly"; | |
| 42 | 45 |
| 43 /** View your Google Classroom guardians */ | 46 /// View your Google Classroom guardians |
| 44 static const ClassroomGuardianlinksMeReadonlyScope = "https://www.googleapis.c
om/auth/classroom.guardianlinks.me.readonly"; | 47 static const ClassroomGuardianlinksMeReadonlyScope = |
| 48 "https://www.googleapis.com/auth/classroom.guardianlinks.me.readonly"; |
| 45 | 49 |
| 46 /** | 50 /// View and manage guardians for students in your Google Classroom classes |
| 47 * View and manage guardians for students in your Google Classroom classes | 51 static const ClassroomGuardianlinksStudentsScope = |
| 48 */ | 52 "https://www.googleapis.com/auth/classroom.guardianlinks.students"; |
| 49 static const ClassroomGuardianlinksStudentsScope = "https://www.googleapis.com
/auth/classroom.guardianlinks.students"; | |
| 50 | 53 |
| 51 /** View guardians for students in your Google Classroom classes */ | 54 /// View guardians for students in your Google Classroom classes |
| 52 static const ClassroomGuardianlinksStudentsReadonlyScope = "https://www.google
apis.com/auth/classroom.guardianlinks.students.readonly"; | 55 static const ClassroomGuardianlinksStudentsReadonlyScope = |
| 56 "https://www.googleapis.com/auth/classroom.guardianlinks.students.readonly
"; |
| 53 | 57 |
| 54 /** View the email addresses of people in your classes */ | 58 /// View the email addresses of people in your classes |
| 55 static const ClassroomProfileEmailsScope = "https://www.googleapis.com/auth/cl
assroom.profile.emails"; | 59 static const ClassroomProfileEmailsScope = |
| 60 "https://www.googleapis.com/auth/classroom.profile.emails"; |
| 56 | 61 |
| 57 /** View the profile photos of people in your classes */ | 62 /// View the profile photos of people in your classes |
| 58 static const ClassroomProfilePhotosScope = "https://www.googleapis.com/auth/cl
assroom.profile.photos"; | 63 static const ClassroomProfilePhotosScope = |
| 64 "https://www.googleapis.com/auth/classroom.profile.photos"; |
| 59 | 65 |
| 60 /** Manage your Google Classroom class rosters */ | 66 /// Manage your Google Classroom class rosters |
| 61 static const ClassroomRostersScope = "https://www.googleapis.com/auth/classroo
m.rosters"; | 67 static const ClassroomRostersScope = |
| 68 "https://www.googleapis.com/auth/classroom.rosters"; |
| 62 | 69 |
| 63 /** View your Google Classroom class rosters */ | 70 /// View your Google Classroom class rosters |
| 64 static const ClassroomRostersReadonlyScope = "https://www.googleapis.com/auth/
classroom.rosters.readonly"; | 71 static const ClassroomRostersReadonlyScope = |
| 72 "https://www.googleapis.com/auth/classroom.rosters.readonly"; |
| 65 | 73 |
| 66 /** View your course work and grades in Google Classroom */ | 74 /// View your course work and grades in Google Classroom |
| 67 static const ClassroomStudentSubmissionsMeReadonlyScope = "https://www.googlea
pis.com/auth/classroom.student-submissions.me.readonly"; | 75 static const ClassroomStudentSubmissionsMeReadonlyScope = |
| 76 "https://www.googleapis.com/auth/classroom.student-submissions.me.readonly
"; |
| 68 | 77 |
| 69 /** | 78 /// View course work and grades for students in the Google Classroom classes |
| 70 * View course work and grades for students in the Google Classroom classes | 79 /// you teach or administer |
| 71 * you teach or administer | 80 static const ClassroomStudentSubmissionsStudentsReadonlyScope = |
| 72 */ | 81 "https://www.googleapis.com/auth/classroom.student-submissions.students.re
adonly"; |
| 73 static const ClassroomStudentSubmissionsStudentsReadonlyScope = "https://www.g
oogleapis.com/auth/classroom.student-submissions.students.readonly"; | |
| 74 | |
| 75 | 82 |
| 76 final commons.ApiRequester _requester; | 83 final commons.ApiRequester _requester; |
| 77 | 84 |
| 78 CoursesResourceApi get courses => new CoursesResourceApi(_requester); | 85 CoursesResourceApi get courses => new CoursesResourceApi(_requester); |
| 79 InvitationsResourceApi get invitations => new InvitationsResourceApi(_requeste
r); | 86 InvitationsResourceApi get invitations => |
| 80 UserProfilesResourceApi get userProfiles => new UserProfilesResourceApi(_reque
ster); | 87 new InvitationsResourceApi(_requester); |
| 88 UserProfilesResourceApi get userProfiles => |
| 89 new UserProfilesResourceApi(_requester); |
| 81 | 90 |
| 82 ClassroomApi(http.Client client, {core.String rootUrl: "https://classroom.goog
leapis.com/", core.String servicePath: ""}) : | 91 ClassroomApi(http.Client client, |
| 83 _requester = new commons.ApiRequester(client, rootUrl, servicePath, USER_A
GENT); | 92 {core.String rootUrl: "https://classroom.googleapis.com/", |
| 93 core.String servicePath: ""}) |
| 94 : _requester = |
| 95 new commons.ApiRequester(client, rootUrl, servicePath, USER_AGENT); |
| 84 } | 96 } |
| 85 | 97 |
| 86 | |
| 87 class CoursesResourceApi { | 98 class CoursesResourceApi { |
| 88 final commons.ApiRequester _requester; | 99 final commons.ApiRequester _requester; |
| 89 | 100 |
| 90 CoursesAliasesResourceApi get aliases => new CoursesAliasesResourceApi(_reques
ter); | 101 CoursesAliasesResourceApi get aliases => |
| 91 CoursesCourseWorkResourceApi get courseWork => new CoursesCourseWorkResourceAp
i(_requester); | 102 new CoursesAliasesResourceApi(_requester); |
| 92 CoursesStudentsResourceApi get students => new CoursesStudentsResourceApi(_req
uester); | 103 CoursesCourseWorkResourceApi get courseWork => |
| 93 CoursesTeachersResourceApi get teachers => new CoursesTeachersResourceApi(_req
uester); | 104 new CoursesCourseWorkResourceApi(_requester); |
| 105 CoursesStudentsResourceApi get students => |
| 106 new CoursesStudentsResourceApi(_requester); |
| 107 CoursesTeachersResourceApi get teachers => |
| 108 new CoursesTeachersResourceApi(_requester); |
| 94 | 109 |
| 95 CoursesResourceApi(commons.ApiRequester client) : | 110 CoursesResourceApi(commons.ApiRequester client) : _requester = client; |
| 96 _requester = client; | |
| 97 | 111 |
| 98 /** | 112 /// Creates a course. |
| 99 * Creates a course. | 113 /// |
| 100 * | 114 /// The user specified in `ownerId` is the owner of the created course |
| 101 * The user specified in `ownerId` is the owner of the created course | 115 /// and added as a teacher. |
| 102 * and added as a teacher. | 116 /// |
| 103 * | 117 /// This method returns the following error codes: |
| 104 * This method returns the following error codes: | 118 /// |
| 105 * | 119 /// * `PERMISSION_DENIED` if the requesting user is not permitted to create |
| 106 * * `PERMISSION_DENIED` if the requesting user is not permitted to create | 120 /// courses or for access errors. |
| 107 * courses or for access errors. | 121 /// * `NOT_FOUND` if the primary teacher is not a valid user. |
| 108 * * `NOT_FOUND` if the primary teacher is not a valid user. | 122 /// * `FAILED_PRECONDITION` if the course owner's account is disabled or for |
| 109 * * `FAILED_PRECONDITION` if the course owner's account is disabled or for | 123 /// the following request errors: |
| 110 * the following request errors: | 124 /// * UserGroupsMembershipLimitReached |
| 111 * * UserGroupsMembershipLimitReached | 125 /// * `ALREADY_EXISTS` if an alias was specified in the `id` and |
| 112 * * `ALREADY_EXISTS` if an alias was specified in the `id` and | 126 /// already exists. |
| 113 * already exists. | 127 /// |
| 114 * | 128 /// [request] - The metadata request object. |
| 115 * [request] - The metadata request object. | 129 /// |
| 116 * | 130 /// Request parameters: |
| 117 * Request parameters: | 131 /// |
| 118 * | 132 /// Completes with a [Course]. |
| 119 * Completes with a [Course]. | 133 /// |
| 120 * | 134 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 121 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 135 /// an error. |
| 122 * error. | 136 /// |
| 123 * | 137 /// If the used [http.Client] completes with an error when making a REST |
| 124 * If the used [http.Client] completes with an error when making a REST call, | 138 /// call, this method will complete with the same error. |
| 125 * this method will complete with the same error. | |
| 126 */ | |
| 127 async.Future<Course> create(Course request) { | 139 async.Future<Course> create(Course request) { |
| 128 var _url = null; | 140 var _url = null; |
| 129 var _queryParams = new core.Map(); | 141 var _queryParams = new core.Map(); |
| 130 var _uploadMedia = null; | 142 var _uploadMedia = null; |
| 131 var _uploadOptions = null; | 143 var _uploadOptions = null; |
| 132 var _downloadOptions = commons.DownloadOptions.Metadata; | 144 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 133 var _body = null; | 145 var _body = null; |
| 134 | 146 |
| 135 if (request != null) { | 147 if (request != null) { |
| 136 _body = convert.JSON.encode((request).toJson()); | 148 _body = convert.JSON.encode((request).toJson()); |
| 137 } | 149 } |
| 138 | 150 |
| 139 _url = 'v1/courses'; | 151 _url = 'v1/courses'; |
| 140 | 152 |
| 141 var _response = _requester.request(_url, | 153 var _response = _requester.request(_url, "POST", |
| 142 "POST", | 154 body: _body, |
| 143 body: _body, | 155 queryParams: _queryParams, |
| 144 queryParams: _queryParams, | 156 uploadOptions: _uploadOptions, |
| 145 uploadOptions: _uploadOptions, | 157 uploadMedia: _uploadMedia, |
| 146 uploadMedia: _uploadMedia, | 158 downloadOptions: _downloadOptions); |
| 147 downloadOptions: _downloadOptions); | |
| 148 return _response.then((data) => new Course.fromJson(data)); | 159 return _response.then((data) => new Course.fromJson(data)); |
| 149 } | 160 } |
| 150 | 161 |
| 151 /** | 162 /// Deletes a course. |
| 152 * Deletes a course. | 163 /// |
| 153 * | 164 /// This method returns the following error codes: |
| 154 * This method returns the following error codes: | 165 /// |
| 155 * | 166 /// * `PERMISSION_DENIED` if the requesting user is not permitted to delete |
| 156 * * `PERMISSION_DENIED` if the requesting user is not permitted to delete the | 167 /// the |
| 157 * requested course or for access errors. | 168 /// requested course or for access errors. |
| 158 * * `NOT_FOUND` if no course exists with the requested ID. | 169 /// * `NOT_FOUND` if no course exists with the requested ID. |
| 159 * | 170 /// |
| 160 * Request parameters: | 171 /// Request parameters: |
| 161 * | 172 /// |
| 162 * [id] - Identifier of the course to delete. | 173 /// [id] - Identifier of the course to delete. |
| 163 * This identifier can be either the Classroom-assigned identifier or an | 174 /// This identifier can be either the Classroom-assigned identifier or an |
| 164 * alias. | 175 /// alias. |
| 165 * | 176 /// |
| 166 * Completes with a [Empty]. | 177 /// Completes with a [Empty]. |
| 167 * | 178 /// |
| 168 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 179 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 169 * error. | 180 /// an error. |
| 170 * | 181 /// |
| 171 * If the used [http.Client] completes with an error when making a REST call, | 182 /// If the used [http.Client] completes with an error when making a REST |
| 172 * this method will complete with the same error. | 183 /// call, this method will complete with the same error. |
| 173 */ | |
| 174 async.Future<Empty> delete(core.String id) { | 184 async.Future<Empty> delete(core.String id) { |
| 175 var _url = null; | 185 var _url = null; |
| 176 var _queryParams = new core.Map(); | 186 var _queryParams = new core.Map(); |
| 177 var _uploadMedia = null; | 187 var _uploadMedia = null; |
| 178 var _uploadOptions = null; | 188 var _uploadOptions = null; |
| 179 var _downloadOptions = commons.DownloadOptions.Metadata; | 189 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 180 var _body = null; | 190 var _body = null; |
| 181 | 191 |
| 182 if (id == null) { | 192 if (id == null) { |
| 183 throw new core.ArgumentError("Parameter id is required."); | 193 throw new core.ArgumentError("Parameter id is required."); |
| 184 } | 194 } |
| 185 | 195 |
| 186 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$id'); | 196 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$id'); |
| 187 | 197 |
| 188 var _response = _requester.request(_url, | 198 var _response = _requester.request(_url, "DELETE", |
| 189 "DELETE", | 199 body: _body, |
| 190 body: _body, | 200 queryParams: _queryParams, |
| 191 queryParams: _queryParams, | 201 uploadOptions: _uploadOptions, |
| 192 uploadOptions: _uploadOptions, | 202 uploadMedia: _uploadMedia, |
| 193 uploadMedia: _uploadMedia, | 203 downloadOptions: _downloadOptions); |
| 194 downloadOptions: _downloadOptions); | |
| 195 return _response.then((data) => new Empty.fromJson(data)); | 204 return _response.then((data) => new Empty.fromJson(data)); |
| 196 } | 205 } |
| 197 | 206 |
| 198 /** | 207 /// Returns a course. |
| 199 * Returns a course. | 208 /// |
| 200 * | 209 /// This method returns the following error codes: |
| 201 * This method returns the following error codes: | 210 /// |
| 202 * | 211 /// * `PERMISSION_DENIED` if the requesting user is not permitted to access |
| 203 * * `PERMISSION_DENIED` if the requesting user is not permitted to access the | 212 /// the |
| 204 * requested course or for access errors. | 213 /// requested course or for access errors. |
| 205 * * `NOT_FOUND` if no course exists with the requested ID. | 214 /// * `NOT_FOUND` if no course exists with the requested ID. |
| 206 * | 215 /// |
| 207 * Request parameters: | 216 /// Request parameters: |
| 208 * | 217 /// |
| 209 * [id] - Identifier of the course to return. | 218 /// [id] - Identifier of the course to return. |
| 210 * This identifier can be either the Classroom-assigned identifier or an | 219 /// This identifier can be either the Classroom-assigned identifier or an |
| 211 * alias. | 220 /// alias. |
| 212 * | 221 /// |
| 213 * Completes with a [Course]. | 222 /// Completes with a [Course]. |
| 214 * | 223 /// |
| 215 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 224 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 216 * error. | 225 /// an error. |
| 217 * | 226 /// |
| 218 * If the used [http.Client] completes with an error when making a REST call, | 227 /// If the used [http.Client] completes with an error when making a REST |
| 219 * this method will complete with the same error. | 228 /// call, this method will complete with the same error. |
| 220 */ | |
| 221 async.Future<Course> get(core.String id) { | 229 async.Future<Course> get(core.String id) { |
| 222 var _url = null; | 230 var _url = null; |
| 223 var _queryParams = new core.Map(); | 231 var _queryParams = new core.Map(); |
| 224 var _uploadMedia = null; | 232 var _uploadMedia = null; |
| 225 var _uploadOptions = null; | 233 var _uploadOptions = null; |
| 226 var _downloadOptions = commons.DownloadOptions.Metadata; | 234 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 227 var _body = null; | 235 var _body = null; |
| 228 | 236 |
| 229 if (id == null) { | 237 if (id == null) { |
| 230 throw new core.ArgumentError("Parameter id is required."); | 238 throw new core.ArgumentError("Parameter id is required."); |
| 231 } | 239 } |
| 232 | 240 |
| 233 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$id'); | 241 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$id'); |
| 234 | 242 |
| 235 var _response = _requester.request(_url, | 243 var _response = _requester.request(_url, "GET", |
| 236 "GET", | 244 body: _body, |
| 237 body: _body, | 245 queryParams: _queryParams, |
| 238 queryParams: _queryParams, | 246 uploadOptions: _uploadOptions, |
| 239 uploadOptions: _uploadOptions, | 247 uploadMedia: _uploadMedia, |
| 240 uploadMedia: _uploadMedia, | 248 downloadOptions: _downloadOptions); |
| 241 downloadOptions: _downloadOptions); | |
| 242 return _response.then((data) => new Course.fromJson(data)); | 249 return _response.then((data) => new Course.fromJson(data)); |
| 243 } | 250 } |
| 244 | 251 |
| 245 /** | 252 /// Returns a list of courses that the requesting user is permitted to view, |
| 246 * Returns a list of courses that the requesting user is permitted to view, | 253 /// restricted to those that match the request. Returned courses are ordered |
| 247 * restricted to those that match the request. Returned courses are ordered by | 254 /// by |
| 248 * creation time, with the most recently created coming first. | 255 /// creation time, with the most recently created coming first. |
| 249 * | 256 /// |
| 250 * This method returns the following error codes: | 257 /// This method returns the following error codes: |
| 251 * | 258 /// |
| 252 * * `PERMISSION_DENIED` for access errors. | 259 /// * `PERMISSION_DENIED` for access errors. |
| 253 * * `INVALID_ARGUMENT` if the query argument is malformed. | 260 /// * `INVALID_ARGUMENT` if the query argument is malformed. |
| 254 * * `NOT_FOUND` if any users specified in the query arguments do not exist. | 261 /// * `NOT_FOUND` if any users specified in the query arguments do not exist. |
| 255 * | 262 /// |
| 256 * Request parameters: | 263 /// Request parameters: |
| 257 * | 264 /// |
| 258 * [courseStates] - Restricts returned courses to those in one of the | 265 /// [studentId] - Restricts returned courses to those having a student with |
| 259 * specified states | 266 /// the specified |
| 260 * The default value is ACTIVE, ARCHIVED, PROVISIONED, DECLINED. | 267 /// identifier. The identifier can be one of the following: |
| 261 * | 268 /// |
| 262 * [teacherId] - Restricts returned courses to those having a teacher with the | 269 /// * the numeric identifier for the user |
| 263 * specified | 270 /// * the email address of the user |
| 264 * identifier. The identifier can be one of the following: | 271 /// * the string literal `"me"`, indicating the requesting user |
| 265 * | 272 /// |
| 266 * * the numeric identifier for the user | 273 /// [pageToken] - nextPageToken |
| 267 * * the email address of the user | 274 /// value returned from a previous |
| 268 * * the string literal `"me"`, indicating the requesting user | 275 /// list call, |
| 269 * | 276 /// indicating that the subsequent page of results should be returned. |
| 270 * [studentId] - Restricts returned courses to those having a student with the | 277 /// |
| 271 * specified | 278 /// The list request must be |
| 272 * identifier. The identifier can be one of the following: | 279 /// otherwise identical to the one that resulted in this token. |
| 273 * | 280 /// |
| 274 * * the numeric identifier for the user | 281 /// [pageSize] - Maximum number of items to return. Zero or unspecified |
| 275 * * the email address of the user | 282 /// indicates that the |
| 276 * * the string literal `"me"`, indicating the requesting user | 283 /// server may assign a maximum. |
| 277 * | 284 /// |
| 278 * [pageToken] - nextPageToken | 285 /// The server may return fewer than the specified number of results. |
| 279 * value returned from a previous | 286 /// |
| 280 * list call, | 287 /// [courseStates] - Restricts returned courses to those in one of the |
| 281 * indicating that the subsequent page of results should be returned. | 288 /// specified states |
| 282 * | 289 /// The default value is ACTIVE, ARCHIVED, PROVISIONED, DECLINED. |
| 283 * The list request must be | 290 /// |
| 284 * otherwise identical to the one that resulted in this token. | 291 /// [teacherId] - Restricts returned courses to those having a teacher with |
| 285 * | 292 /// the specified |
| 286 * [pageSize] - Maximum number of items to return. Zero or unspecified | 293 /// identifier. The identifier can be one of the following: |
| 287 * indicates that the | 294 /// |
| 288 * server may assign a maximum. | 295 /// * the numeric identifier for the user |
| 289 * | 296 /// * the email address of the user |
| 290 * The server may return fewer than the specified number of results. | 297 /// * the string literal `"me"`, indicating the requesting user |
| 291 * | 298 /// |
| 292 * Completes with a [ListCoursesResponse]. | 299 /// Completes with a [ListCoursesResponse]. |
| 293 * | 300 /// |
| 294 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 301 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 295 * error. | 302 /// an error. |
| 296 * | 303 /// |
| 297 * If the used [http.Client] completes with an error when making a REST call, | 304 /// If the used [http.Client] completes with an error when making a REST |
| 298 * this method will complete with the same error. | 305 /// call, this method will complete with the same error. |
| 299 */ | 306 async.Future<ListCoursesResponse> list( |
| 300 async.Future<ListCoursesResponse> list({core.List<core.String> courseStates, c
ore.String teacherId, core.String studentId, core.String pageToken, core.int pag
eSize}) { | 307 {core.String studentId, |
| 308 core.String pageToken, |
| 309 core.int pageSize, |
| 310 core.List<core.String> courseStates, |
| 311 core.String teacherId}) { |
| 301 var _url = null; | 312 var _url = null; |
| 302 var _queryParams = new core.Map(); | 313 var _queryParams = new core.Map(); |
| 303 var _uploadMedia = null; | 314 var _uploadMedia = null; |
| 304 var _uploadOptions = null; | 315 var _uploadOptions = null; |
| 305 var _downloadOptions = commons.DownloadOptions.Metadata; | 316 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 306 var _body = null; | 317 var _body = null; |
| 307 | 318 |
| 308 if (courseStates != null) { | |
| 309 _queryParams["courseStates"] = courseStates; | |
| 310 } | |
| 311 if (teacherId != null) { | |
| 312 _queryParams["teacherId"] = [teacherId]; | |
| 313 } | |
| 314 if (studentId != null) { | 319 if (studentId != null) { |
| 315 _queryParams["studentId"] = [studentId]; | 320 _queryParams["studentId"] = [studentId]; |
| 316 } | 321 } |
| 317 if (pageToken != null) { | 322 if (pageToken != null) { |
| 318 _queryParams["pageToken"] = [pageToken]; | 323 _queryParams["pageToken"] = [pageToken]; |
| 319 } | 324 } |
| 320 if (pageSize != null) { | 325 if (pageSize != null) { |
| 321 _queryParams["pageSize"] = ["${pageSize}"]; | 326 _queryParams["pageSize"] = ["${pageSize}"]; |
| 322 } | 327 } |
| 328 if (courseStates != null) { |
| 329 _queryParams["courseStates"] = courseStates; |
| 330 } |
| 331 if (teacherId != null) { |
| 332 _queryParams["teacherId"] = [teacherId]; |
| 333 } |
| 323 | 334 |
| 324 _url = 'v1/courses'; | 335 _url = 'v1/courses'; |
| 325 | 336 |
| 326 var _response = _requester.request(_url, | 337 var _response = _requester.request(_url, "GET", |
| 327 "GET", | 338 body: _body, |
| 328 body: _body, | 339 queryParams: _queryParams, |
| 329 queryParams: _queryParams, | 340 uploadOptions: _uploadOptions, |
| 330 uploadOptions: _uploadOptions, | 341 uploadMedia: _uploadMedia, |
| 331 uploadMedia: _uploadMedia, | 342 downloadOptions: _downloadOptions); |
| 332 downloadOptions: _downloadOptions); | |
| 333 return _response.then((data) => new ListCoursesResponse.fromJson(data)); | 343 return _response.then((data) => new ListCoursesResponse.fromJson(data)); |
| 334 } | 344 } |
| 335 | 345 |
| 336 /** | 346 /// Updates one or more fields in a course. |
| 337 * Updates one or more fields in a course. | 347 /// |
| 338 * | 348 /// This method returns the following error codes: |
| 339 * This method returns the following error codes: | 349 /// |
| 340 * | 350 /// * `PERMISSION_DENIED` if the requesting user is not permitted to modify |
| 341 * * `PERMISSION_DENIED` if the requesting user is not permitted to modify the | 351 /// the |
| 342 * requested course or for access errors. | 352 /// requested course or for access errors. |
| 343 * * `NOT_FOUND` if no course exists with the requested ID. | 353 /// * `NOT_FOUND` if no course exists with the requested ID. |
| 344 * * `INVALID_ARGUMENT` if invalid fields are specified in the update mask or | 354 /// * `INVALID_ARGUMENT` if invalid fields are specified in the update mask |
| 345 * if no update mask is supplied. | 355 /// or |
| 346 * * `FAILED_PRECONDITION` for the following request errors: | 356 /// if no update mask is supplied. |
| 347 * * CourseNotModifiable | 357 /// * `FAILED_PRECONDITION` for the following request errors: |
| 348 * | 358 /// * CourseNotModifiable |
| 349 * [request] - The metadata request object. | 359 /// |
| 350 * | 360 /// [request] - The metadata request object. |
| 351 * Request parameters: | 361 /// |
| 352 * | 362 /// Request parameters: |
| 353 * [id] - Identifier of the course to update. | 363 /// |
| 354 * This identifier can be either the Classroom-assigned identifier or an | 364 /// [id] - Identifier of the course to update. |
| 355 * alias. | 365 /// This identifier can be either the Classroom-assigned identifier or an |
| 356 * | 366 /// alias. |
| 357 * [updateMask] - Mask that identifies which fields on the course to update. | 367 /// |
| 358 * This field is required to do an update. The update will fail if invalid | 368 /// [updateMask] - Mask that identifies which fields on the course to update. |
| 359 * fields are specified. The following fields are valid: | 369 /// This field is required to do an update. The update will fail if invalid |
| 360 * | 370 /// fields are specified. The following fields are valid: |
| 361 * * `name` | 371 /// |
| 362 * * `section` | 372 /// * `name` |
| 363 * * `descriptionHeading` | 373 /// * `section` |
| 364 * * `description` | 374 /// * `descriptionHeading` |
| 365 * * `room` | 375 /// * `description` |
| 366 * * `courseState` | 376 /// * `room` |
| 367 * * `ownerId` | 377 /// * `courseState` |
| 368 * | 378 /// * `ownerId` |
| 369 * Note: patches to ownerId are treated as being effective immediately, but in | 379 /// |
| 370 * practice it may take some time for the ownership transfer of all affected | 380 /// Note: patches to ownerId are treated as being effective immediately, but |
| 371 * resources to complete. | 381 /// in |
| 372 * | 382 /// practice it may take some time for the ownership transfer of all affected |
| 373 * When set in a query parameter, this field should be specified as | 383 /// resources to complete. |
| 374 * | 384 /// |
| 375 * `updateMask=<field1>,<field2>,...` | 385 /// When set in a query parameter, this field should be specified as |
| 376 * | 386 /// |
| 377 * Completes with a [Course]. | 387 /// `updateMask=<field1>,<field2>,...` |
| 378 * | 388 /// |
| 379 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 389 /// Completes with a [Course]. |
| 380 * error. | 390 /// |
| 381 * | 391 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 382 * If the used [http.Client] completes with an error when making a REST call, | 392 /// an error. |
| 383 * this method will complete with the same error. | 393 /// |
| 384 */ | 394 /// If the used [http.Client] completes with an error when making a REST |
| 385 async.Future<Course> patch(Course request, core.String id, {core.String update
Mask}) { | 395 /// call, this method will complete with the same error. |
| 396 async.Future<Course> patch(Course request, core.String id, |
| 397 {core.String updateMask}) { |
| 386 var _url = null; | 398 var _url = null; |
| 387 var _queryParams = new core.Map(); | 399 var _queryParams = new core.Map(); |
| 388 var _uploadMedia = null; | 400 var _uploadMedia = null; |
| 389 var _uploadOptions = null; | 401 var _uploadOptions = null; |
| 390 var _downloadOptions = commons.DownloadOptions.Metadata; | 402 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 391 var _body = null; | 403 var _body = null; |
| 392 | 404 |
| 393 if (request != null) { | 405 if (request != null) { |
| 394 _body = convert.JSON.encode((request).toJson()); | 406 _body = convert.JSON.encode((request).toJson()); |
| 395 } | 407 } |
| 396 if (id == null) { | 408 if (id == null) { |
| 397 throw new core.ArgumentError("Parameter id is required."); | 409 throw new core.ArgumentError("Parameter id is required."); |
| 398 } | 410 } |
| 399 if (updateMask != null) { | 411 if (updateMask != null) { |
| 400 _queryParams["updateMask"] = [updateMask]; | 412 _queryParams["updateMask"] = [updateMask]; |
| 401 } | 413 } |
| 402 | 414 |
| 403 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$id'); | 415 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$id'); |
| 404 | 416 |
| 405 var _response = _requester.request(_url, | 417 var _response = _requester.request(_url, "PATCH", |
| 406 "PATCH", | 418 body: _body, |
| 407 body: _body, | 419 queryParams: _queryParams, |
| 408 queryParams: _queryParams, | 420 uploadOptions: _uploadOptions, |
| 409 uploadOptions: _uploadOptions, | 421 uploadMedia: _uploadMedia, |
| 410 uploadMedia: _uploadMedia, | 422 downloadOptions: _downloadOptions); |
| 411 downloadOptions: _downloadOptions); | |
| 412 return _response.then((data) => new Course.fromJson(data)); | 423 return _response.then((data) => new Course.fromJson(data)); |
| 413 } | 424 } |
| 414 | 425 |
| 415 /** | 426 /// Updates a course. |
| 416 * Updates a course. | 427 /// |
| 417 * | 428 /// This method returns the following error codes: |
| 418 * This method returns the following error codes: | 429 /// |
| 419 * | 430 /// * `PERMISSION_DENIED` if the requesting user is not permitted to modify |
| 420 * * `PERMISSION_DENIED` if the requesting user is not permitted to modify the | 431 /// the |
| 421 * requested course or for access errors. | 432 /// requested course or for access errors. |
| 422 * * `NOT_FOUND` if no course exists with the requested ID. | 433 /// * `NOT_FOUND` if no course exists with the requested ID. |
| 423 * * `FAILED_PRECONDITION` for the following request errors: | 434 /// * `FAILED_PRECONDITION` for the following request errors: |
| 424 * * CourseNotModifiable | 435 /// * CourseNotModifiable |
| 425 * | 436 /// |
| 426 * [request] - The metadata request object. | 437 /// [request] - The metadata request object. |
| 427 * | 438 /// |
| 428 * Request parameters: | 439 /// Request parameters: |
| 429 * | 440 /// |
| 430 * [id] - Identifier of the course to update. | 441 /// [id] - Identifier of the course to update. |
| 431 * This identifier can be either the Classroom-assigned identifier or an | 442 /// This identifier can be either the Classroom-assigned identifier or an |
| 432 * alias. | 443 /// alias. |
| 433 * | 444 /// |
| 434 * Completes with a [Course]. | 445 /// Completes with a [Course]. |
| 435 * | 446 /// |
| 436 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 447 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 437 * error. | 448 /// an error. |
| 438 * | 449 /// |
| 439 * If the used [http.Client] completes with an error when making a REST call, | 450 /// If the used [http.Client] completes with an error when making a REST |
| 440 * this method will complete with the same error. | 451 /// call, this method will complete with the same error. |
| 441 */ | |
| 442 async.Future<Course> update(Course request, core.String id) { | 452 async.Future<Course> update(Course request, core.String id) { |
| 443 var _url = null; | 453 var _url = null; |
| 444 var _queryParams = new core.Map(); | 454 var _queryParams = new core.Map(); |
| 445 var _uploadMedia = null; | 455 var _uploadMedia = null; |
| 446 var _uploadOptions = null; | 456 var _uploadOptions = null; |
| 447 var _downloadOptions = commons.DownloadOptions.Metadata; | 457 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 448 var _body = null; | 458 var _body = null; |
| 449 | 459 |
| 450 if (request != null) { | 460 if (request != null) { |
| 451 _body = convert.JSON.encode((request).toJson()); | 461 _body = convert.JSON.encode((request).toJson()); |
| 452 } | 462 } |
| 453 if (id == null) { | 463 if (id == null) { |
| 454 throw new core.ArgumentError("Parameter id is required."); | 464 throw new core.ArgumentError("Parameter id is required."); |
| 455 } | 465 } |
| 456 | 466 |
| 457 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$id'); | 467 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$id'); |
| 458 | 468 |
| 459 var _response = _requester.request(_url, | 469 var _response = _requester.request(_url, "PUT", |
| 460 "PUT", | 470 body: _body, |
| 461 body: _body, | 471 queryParams: _queryParams, |
| 462 queryParams: _queryParams, | 472 uploadOptions: _uploadOptions, |
| 463 uploadOptions: _uploadOptions, | 473 uploadMedia: _uploadMedia, |
| 464 uploadMedia: _uploadMedia, | 474 downloadOptions: _downloadOptions); |
| 465 downloadOptions: _downloadOptions); | |
| 466 return _response.then((data) => new Course.fromJson(data)); | 475 return _response.then((data) => new Course.fromJson(data)); |
| 467 } | 476 } |
| 468 | |
| 469 } | 477 } |
| 470 | 478 |
| 471 | |
| 472 class CoursesAliasesResourceApi { | 479 class CoursesAliasesResourceApi { |
| 473 final commons.ApiRequester _requester; | 480 final commons.ApiRequester _requester; |
| 474 | 481 |
| 475 CoursesAliasesResourceApi(commons.ApiRequester client) : | 482 CoursesAliasesResourceApi(commons.ApiRequester client) : _requester = client; |
| 476 _requester = client; | |
| 477 | 483 |
| 478 /** | 484 /// Creates an alias for a course. |
| 479 * Creates an alias for a course. | 485 /// |
| 480 * | 486 /// This method returns the following error codes: |
| 481 * This method returns the following error codes: | 487 /// |
| 482 * | 488 /// * `PERMISSION_DENIED` if the requesting user is not permitted to create |
| 483 * * `PERMISSION_DENIED` if the requesting user is not permitted to create the | 489 /// the |
| 484 * alias or for access errors. | 490 /// alias or for access errors. |
| 485 * * `NOT_FOUND` if the course does not exist. | 491 /// * `NOT_FOUND` if the course does not exist. |
| 486 * * `ALREADY_EXISTS` if the alias already exists. | 492 /// * `ALREADY_EXISTS` if the alias already exists. |
| 487 * * `FAILED_PRECONDITION` if the alias requested does not make sense for the | 493 /// * `FAILED_PRECONDITION` if the alias requested does not make sense for |
| 488 * requesting user or course (for example, if a user not in a domain | 494 /// the |
| 489 * attempts to access a domain-scoped alias). | 495 /// requesting user or course (for example, if a user not in a domain |
| 490 * | 496 /// attempts to access a domain-scoped alias). |
| 491 * [request] - The metadata request object. | 497 /// |
| 492 * | 498 /// [request] - The metadata request object. |
| 493 * Request parameters: | 499 /// |
| 494 * | 500 /// Request parameters: |
| 495 * [courseId] - Identifier of the course to alias. | 501 /// |
| 496 * This identifier can be either the Classroom-assigned identifier or an | 502 /// [courseId] - Identifier of the course to alias. |
| 497 * alias. | 503 /// This identifier can be either the Classroom-assigned identifier or an |
| 498 * | 504 /// alias. |
| 499 * Completes with a [CourseAlias]. | 505 /// |
| 500 * | 506 /// Completes with a [CourseAlias]. |
| 501 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 507 /// |
| 502 * error. | 508 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 503 * | 509 /// an error. |
| 504 * If the used [http.Client] completes with an error when making a REST call, | 510 /// |
| 505 * this method will complete with the same error. | 511 /// If the used [http.Client] completes with an error when making a REST |
| 506 */ | 512 /// call, this method will complete with the same error. |
| 507 async.Future<CourseAlias> create(CourseAlias request, core.String courseId) { | 513 async.Future<CourseAlias> create(CourseAlias request, core.String courseId) { |
| 508 var _url = null; | 514 var _url = null; |
| 509 var _queryParams = new core.Map(); | 515 var _queryParams = new core.Map(); |
| 510 var _uploadMedia = null; | 516 var _uploadMedia = null; |
| 511 var _uploadOptions = null; | 517 var _uploadOptions = null; |
| 512 var _downloadOptions = commons.DownloadOptions.Metadata; | 518 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 513 var _body = null; | 519 var _body = null; |
| 514 | 520 |
| 515 if (request != null) { | 521 if (request != null) { |
| 516 _body = convert.JSON.encode((request).toJson()); | 522 _body = convert.JSON.encode((request).toJson()); |
| 517 } | 523 } |
| 518 if (courseId == null) { | 524 if (courseId == null) { |
| 519 throw new core.ArgumentError("Parameter courseId is required."); | 525 throw new core.ArgumentError("Parameter courseId is required."); |
| 520 } | 526 } |
| 521 | 527 |
| 522 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$courseId') + '/aliase
s'; | 528 _url = |
| 529 'v1/courses/' + commons.Escaper.ecapeVariable('$courseId') + '/aliases'; |
| 523 | 530 |
| 524 var _response = _requester.request(_url, | 531 var _response = _requester.request(_url, "POST", |
| 525 "POST", | 532 body: _body, |
| 526 body: _body, | 533 queryParams: _queryParams, |
| 527 queryParams: _queryParams, | 534 uploadOptions: _uploadOptions, |
| 528 uploadOptions: _uploadOptions, | 535 uploadMedia: _uploadMedia, |
| 529 uploadMedia: _uploadMedia, | 536 downloadOptions: _downloadOptions); |
| 530 downloadOptions: _downloadOptions); | |
| 531 return _response.then((data) => new CourseAlias.fromJson(data)); | 537 return _response.then((data) => new CourseAlias.fromJson(data)); |
| 532 } | 538 } |
| 533 | 539 |
| 534 /** | 540 /// Deletes an alias of a course. |
| 535 * Deletes an alias of a course. | 541 /// |
| 536 * | 542 /// This method returns the following error codes: |
| 537 * This method returns the following error codes: | 543 /// |
| 538 * | 544 /// * `PERMISSION_DENIED` if the requesting user is not permitted to remove |
| 539 * * `PERMISSION_DENIED` if the requesting user is not permitted to remove the | 545 /// the |
| 540 * alias or for access errors. | 546 /// alias or for access errors. |
| 541 * * `NOT_FOUND` if the alias does not exist. | 547 /// * `NOT_FOUND` if the alias does not exist. |
| 542 * * `FAILED_PRECONDITION` if the alias requested does not make sense for the | 548 /// * `FAILED_PRECONDITION` if the alias requested does not make sense for |
| 543 * requesting user or course (for example, if a user not in a domain | 549 /// the |
| 544 * attempts to delete a domain-scoped alias). | 550 /// requesting user or course (for example, if a user not in a domain |
| 545 * | 551 /// attempts to delete a domain-scoped alias). |
| 546 * Request parameters: | 552 /// |
| 547 * | 553 /// Request parameters: |
| 548 * [courseId] - Identifier of the course whose alias should be deleted. | 554 /// |
| 549 * This identifier can be either the Classroom-assigned identifier or an | 555 /// [courseId] - Identifier of the course whose alias should be deleted. |
| 550 * alias. | 556 /// This identifier can be either the Classroom-assigned identifier or an |
| 551 * | 557 /// alias. |
| 552 * [alias] - Alias to delete. | 558 /// |
| 553 * This may not be the Classroom-assigned identifier. | 559 /// [alias] - Alias to delete. |
| 554 * | 560 /// This may not be the Classroom-assigned identifier. |
| 555 * Completes with a [Empty]. | 561 /// |
| 556 * | 562 /// Completes with a [Empty]. |
| 557 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 563 /// |
| 558 * error. | 564 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 559 * | 565 /// an error. |
| 560 * If the used [http.Client] completes with an error when making a REST call, | 566 /// |
| 561 * this method will complete with the same error. | 567 /// If the used [http.Client] completes with an error when making a REST |
| 562 */ | 568 /// call, this method will complete with the same error. |
| 563 async.Future<Empty> delete(core.String courseId, core.String alias) { | 569 async.Future<Empty> delete(core.String courseId, core.String alias) { |
| 564 var _url = null; | 570 var _url = null; |
| 565 var _queryParams = new core.Map(); | 571 var _queryParams = new core.Map(); |
| 566 var _uploadMedia = null; | 572 var _uploadMedia = null; |
| 567 var _uploadOptions = null; | 573 var _uploadOptions = null; |
| 568 var _downloadOptions = commons.DownloadOptions.Metadata; | 574 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 569 var _body = null; | 575 var _body = null; |
| 570 | 576 |
| 571 if (courseId == null) { | 577 if (courseId == null) { |
| 572 throw new core.ArgumentError("Parameter courseId is required."); | 578 throw new core.ArgumentError("Parameter courseId is required."); |
| 573 } | 579 } |
| 574 if (alias == null) { | 580 if (alias == null) { |
| 575 throw new core.ArgumentError("Parameter alias is required."); | 581 throw new core.ArgumentError("Parameter alias is required."); |
| 576 } | 582 } |
| 577 | 583 |
| 578 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$courseId') + '/aliase
s/' + commons.Escaper.ecapeVariable('$alias'); | 584 _url = 'v1/courses/' + |
| 585 commons.Escaper.ecapeVariable('$courseId') + |
| 586 '/aliases/' + |
| 587 commons.Escaper.ecapeVariable('$alias'); |
| 579 | 588 |
| 580 var _response = _requester.request(_url, | 589 var _response = _requester.request(_url, "DELETE", |
| 581 "DELETE", | 590 body: _body, |
| 582 body: _body, | 591 queryParams: _queryParams, |
| 583 queryParams: _queryParams, | 592 uploadOptions: _uploadOptions, |
| 584 uploadOptions: _uploadOptions, | 593 uploadMedia: _uploadMedia, |
| 585 uploadMedia: _uploadMedia, | 594 downloadOptions: _downloadOptions); |
| 586 downloadOptions: _downloadOptions); | |
| 587 return _response.then((data) => new Empty.fromJson(data)); | 595 return _response.then((data) => new Empty.fromJson(data)); |
| 588 } | 596 } |
| 589 | 597 |
| 590 /** | 598 /// Returns a list of aliases for a course. |
| 591 * Returns a list of aliases for a course. | 599 /// |
| 592 * | 600 /// This method returns the following error codes: |
| 593 * This method returns the following error codes: | 601 /// |
| 594 * | 602 /// * `PERMISSION_DENIED` if the requesting user is not permitted to access |
| 595 * * `PERMISSION_DENIED` if the requesting user is not permitted to access the | 603 /// the |
| 596 * course or for access errors. | 604 /// course or for access errors. |
| 597 * * `NOT_FOUND` if the course does not exist. | 605 /// * `NOT_FOUND` if the course does not exist. |
| 598 * | 606 /// |
| 599 * Request parameters: | 607 /// Request parameters: |
| 600 * | 608 /// |
| 601 * [courseId] - The identifier of the course. | 609 /// [courseId] - The identifier of the course. |
| 602 * This identifier can be either the Classroom-assigned identifier or an | 610 /// This identifier can be either the Classroom-assigned identifier or an |
| 603 * alias. | 611 /// alias. |
| 604 * | 612 /// |
| 605 * [pageToken] - nextPageToken | 613 /// [pageToken] - nextPageToken |
| 606 * value returned from a previous | 614 /// value returned from a previous |
| 607 * list call, | 615 /// list call, |
| 608 * indicating that the subsequent page of results should be returned. | 616 /// indicating that the subsequent page of results should be returned. |
| 609 * | 617 /// |
| 610 * The list request | 618 /// The list request |
| 611 * must be otherwise identical to the one that resulted in this token. | 619 /// must be otherwise identical to the one that resulted in this token. |
| 612 * | 620 /// |
| 613 * [pageSize] - Maximum number of items to return. Zero or unspecified | 621 /// [pageSize] - Maximum number of items to return. Zero or unspecified |
| 614 * indicates that the | 622 /// indicates that the |
| 615 * server may assign a maximum. | 623 /// server may assign a maximum. |
| 616 * | 624 /// |
| 617 * The server may return fewer than the specified number of results. | 625 /// The server may return fewer than the specified number of results. |
| 618 * | 626 /// |
| 619 * Completes with a [ListCourseAliasesResponse]. | 627 /// Completes with a [ListCourseAliasesResponse]. |
| 620 * | 628 /// |
| 621 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 629 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 622 * error. | 630 /// an error. |
| 623 * | 631 /// |
| 624 * If the used [http.Client] completes with an error when making a REST call, | 632 /// If the used [http.Client] completes with an error when making a REST |
| 625 * this method will complete with the same error. | 633 /// call, this method will complete with the same error. |
| 626 */ | 634 async.Future<ListCourseAliasesResponse> list(core.String courseId, |
| 627 async.Future<ListCourseAliasesResponse> list(core.String courseId, {core.Strin
g pageToken, core.int pageSize}) { | 635 {core.String pageToken, core.int pageSize}) { |
| 628 var _url = null; | 636 var _url = null; |
| 629 var _queryParams = new core.Map(); | 637 var _queryParams = new core.Map(); |
| 630 var _uploadMedia = null; | 638 var _uploadMedia = null; |
| 631 var _uploadOptions = null; | 639 var _uploadOptions = null; |
| 632 var _downloadOptions = commons.DownloadOptions.Metadata; | 640 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 633 var _body = null; | 641 var _body = null; |
| 634 | 642 |
| 635 if (courseId == null) { | 643 if (courseId == null) { |
| 636 throw new core.ArgumentError("Parameter courseId is required."); | 644 throw new core.ArgumentError("Parameter courseId is required."); |
| 637 } | 645 } |
| 638 if (pageToken != null) { | 646 if (pageToken != null) { |
| 639 _queryParams["pageToken"] = [pageToken]; | 647 _queryParams["pageToken"] = [pageToken]; |
| 640 } | 648 } |
| 641 if (pageSize != null) { | 649 if (pageSize != null) { |
| 642 _queryParams["pageSize"] = ["${pageSize}"]; | 650 _queryParams["pageSize"] = ["${pageSize}"]; |
| 643 } | 651 } |
| 644 | 652 |
| 645 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$courseId') + '/aliase
s'; | 653 _url = |
| 654 'v1/courses/' + commons.Escaper.ecapeVariable('$courseId') + '/aliases'; |
| 646 | 655 |
| 647 var _response = _requester.request(_url, | 656 var _response = _requester.request(_url, "GET", |
| 648 "GET", | 657 body: _body, |
| 649 body: _body, | 658 queryParams: _queryParams, |
| 650 queryParams: _queryParams, | 659 uploadOptions: _uploadOptions, |
| 651 uploadOptions: _uploadOptions, | 660 uploadMedia: _uploadMedia, |
| 652 uploadMedia: _uploadMedia, | 661 downloadOptions: _downloadOptions); |
| 653 downloadOptions: _downloadOptions); | 662 return _response |
| 654 return _response.then((data) => new ListCourseAliasesResponse.fromJson(data)
); | 663 .then((data) => new ListCourseAliasesResponse.fromJson(data)); |
| 655 } | 664 } |
| 656 | |
| 657 } | 665 } |
| 658 | 666 |
| 659 | |
| 660 class CoursesCourseWorkResourceApi { | 667 class CoursesCourseWorkResourceApi { |
| 661 final commons.ApiRequester _requester; | 668 final commons.ApiRequester _requester; |
| 662 | 669 |
| 663 CoursesCourseWorkStudentSubmissionsResourceApi get studentSubmissions => new C
oursesCourseWorkStudentSubmissionsResourceApi(_requester); | 670 CoursesCourseWorkStudentSubmissionsResourceApi get studentSubmissions => |
| 671 new CoursesCourseWorkStudentSubmissionsResourceApi(_requester); |
| 664 | 672 |
| 665 CoursesCourseWorkResourceApi(commons.ApiRequester client) : | 673 CoursesCourseWorkResourceApi(commons.ApiRequester client) |
| 666 _requester = client; | 674 : _requester = client; |
| 667 | 675 |
| 668 /** | 676 /// Creates course work. |
| 669 * Creates course work. | 677 /// |
| 670 * | 678 /// The resulting course work (and corresponding student submissions) are |
| 671 * The resulting course work (and corresponding student submissions) are | 679 /// associated with the Developer Console project of the |
| 672 * associated with the Developer Console project of the | 680 /// [OAuth client ID](https://support.google.com/cloud/answer/6158849) used |
| 673 * [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to | 681 /// to |
| 674 * make the request. Classroom API requests to modify course work and student | 682 /// make the request. Classroom API requests to modify course work and |
| 675 * submissions must be made with an OAuth client ID from the associated | 683 /// student |
| 676 * Developer Console project. | 684 /// submissions must be made with an OAuth client ID from the associated |
| 677 * | 685 /// Developer Console project. |
| 678 * This method returns the following error codes: | 686 /// |
| 679 * | 687 /// This method returns the following error codes: |
| 680 * * `PERMISSION_DENIED` if the requesting user is not permitted to access the | 688 /// |
| 681 * requested course, create course work in the requested course, share a | 689 /// * `PERMISSION_DENIED` if the requesting user is not permitted to access |
| 682 * Drive attachment, or for access errors. | 690 /// the |
| 683 * * `INVALID_ARGUMENT` if the request is malformed. | 691 /// requested course, create course work in the requested course, share a |
| 684 * * `NOT_FOUND` if the requested course does not exist. | 692 /// Drive attachment, or for access errors. |
| 685 * * `FAILED_PRECONDITION` for the following request error: | 693 /// * `INVALID_ARGUMENT` if the request is malformed. |
| 686 * * AttachmentNotVisible | 694 /// * `NOT_FOUND` if the requested course does not exist. |
| 687 * | 695 /// * `FAILED_PRECONDITION` for the following request error: |
| 688 * [request] - The metadata request object. | 696 /// * AttachmentNotVisible |
| 689 * | 697 /// |
| 690 * Request parameters: | 698 /// [request] - The metadata request object. |
| 691 * | 699 /// |
| 692 * [courseId] - Identifier of the course. | 700 /// Request parameters: |
| 693 * This identifier can be either the Classroom-assigned identifier or an | 701 /// |
| 694 * alias. | 702 /// [courseId] - Identifier of the course. |
| 695 * | 703 /// This identifier can be either the Classroom-assigned identifier or an |
| 696 * Completes with a [CourseWork]. | 704 /// alias. |
| 697 * | 705 /// |
| 698 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 706 /// Completes with a [CourseWork]. |
| 699 * error. | 707 /// |
| 700 * | 708 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 701 * If the used [http.Client] completes with an error when making a REST call, | 709 /// an error. |
| 702 * this method will complete with the same error. | 710 /// |
| 703 */ | 711 /// If the used [http.Client] completes with an error when making a REST |
| 712 /// call, this method will complete with the same error. |
| 704 async.Future<CourseWork> create(CourseWork request, core.String courseId) { | 713 async.Future<CourseWork> create(CourseWork request, core.String courseId) { |
| 705 var _url = null; | 714 var _url = null; |
| 706 var _queryParams = new core.Map(); | 715 var _queryParams = new core.Map(); |
| 707 var _uploadMedia = null; | 716 var _uploadMedia = null; |
| 708 var _uploadOptions = null; | 717 var _uploadOptions = null; |
| 709 var _downloadOptions = commons.DownloadOptions.Metadata; | 718 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 710 var _body = null; | 719 var _body = null; |
| 711 | 720 |
| 712 if (request != null) { | 721 if (request != null) { |
| 713 _body = convert.JSON.encode((request).toJson()); | 722 _body = convert.JSON.encode((request).toJson()); |
| 714 } | 723 } |
| 715 if (courseId == null) { | 724 if (courseId == null) { |
| 716 throw new core.ArgumentError("Parameter courseId is required."); | 725 throw new core.ArgumentError("Parameter courseId is required."); |
| 717 } | 726 } |
| 718 | 727 |
| 719 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$courseId') + '/course
Work'; | 728 _url = 'v1/courses/' + |
| 729 commons.Escaper.ecapeVariable('$courseId') + |
| 730 '/courseWork'; |
| 720 | 731 |
| 721 var _response = _requester.request(_url, | 732 var _response = _requester.request(_url, "POST", |
| 722 "POST", | 733 body: _body, |
| 723 body: _body, | 734 queryParams: _queryParams, |
| 724 queryParams: _queryParams, | 735 uploadOptions: _uploadOptions, |
| 725 uploadOptions: _uploadOptions, | 736 uploadMedia: _uploadMedia, |
| 726 uploadMedia: _uploadMedia, | 737 downloadOptions: _downloadOptions); |
| 727 downloadOptions: _downloadOptions); | |
| 728 return _response.then((data) => new CourseWork.fromJson(data)); | 738 return _response.then((data) => new CourseWork.fromJson(data)); |
| 729 } | 739 } |
| 730 | 740 |
| 731 /** | 741 /// Deletes a course work. |
| 732 * Deletes a course work. | 742 /// |
| 733 * | 743 /// This request must be made by the Developer Console project of the |
| 734 * This request must be made by the Developer Console project of the | 744 /// [OAuth client ID](https://support.google.com/cloud/answer/6158849) used |
| 735 * [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to | 745 /// to |
| 736 * create the corresponding course work item. | 746 /// create the corresponding course work item. |
| 737 * | 747 /// |
| 738 * This method returns the following error codes: | 748 /// This method returns the following error codes: |
| 739 * | 749 /// |
| 740 * * `PERMISSION_DENIED` if the requesting developer project did not create | 750 /// * `PERMISSION_DENIED` if the requesting developer project did not create |
| 741 * the corresponding course work, if the requesting user is not permitted | 751 /// the corresponding course work, if the requesting user is not permitted |
| 742 * to delete the requested course or for access errors. | 752 /// to delete the requested course or for access errors. |
| 743 * * `FAILED_PRECONDITION` if the requested course work has already been | 753 /// * `FAILED_PRECONDITION` if the requested course work has already been |
| 744 * deleted. | 754 /// deleted. |
| 745 * * `NOT_FOUND` if no course exists with the requested ID. | 755 /// * `NOT_FOUND` if no course exists with the requested ID. |
| 746 * | 756 /// |
| 747 * Request parameters: | 757 /// Request parameters: |
| 748 * | 758 /// |
| 749 * [courseId] - Identifier of the course. | 759 /// [courseId] - Identifier of the course. |
| 750 * This identifier can be either the Classroom-assigned identifier or an | 760 /// This identifier can be either the Classroom-assigned identifier or an |
| 751 * alias. | 761 /// alias. |
| 752 * | 762 /// |
| 753 * [id] - Identifier of the course work to delete. | 763 /// [id] - Identifier of the course work to delete. |
| 754 * This identifier is a Classroom-assigned identifier. | 764 /// This identifier is a Classroom-assigned identifier. |
| 755 * | 765 /// |
| 756 * Completes with a [Empty]. | 766 /// Completes with a [Empty]. |
| 757 * | 767 /// |
| 758 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 768 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 759 * error. | 769 /// an error. |
| 760 * | 770 /// |
| 761 * If the used [http.Client] completes with an error when making a REST call, | 771 /// If the used [http.Client] completes with an error when making a REST |
| 762 * this method will complete with the same error. | 772 /// call, this method will complete with the same error. |
| 763 */ | |
| 764 async.Future<Empty> delete(core.String courseId, core.String id) { | 773 async.Future<Empty> delete(core.String courseId, core.String id) { |
| 765 var _url = null; | 774 var _url = null; |
| 766 var _queryParams = new core.Map(); | 775 var _queryParams = new core.Map(); |
| 767 var _uploadMedia = null; | 776 var _uploadMedia = null; |
| 768 var _uploadOptions = null; | 777 var _uploadOptions = null; |
| 769 var _downloadOptions = commons.DownloadOptions.Metadata; | 778 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 770 var _body = null; | 779 var _body = null; |
| 771 | 780 |
| 772 if (courseId == null) { | 781 if (courseId == null) { |
| 773 throw new core.ArgumentError("Parameter courseId is required."); | 782 throw new core.ArgumentError("Parameter courseId is required."); |
| 774 } | 783 } |
| 775 if (id == null) { | 784 if (id == null) { |
| 776 throw new core.ArgumentError("Parameter id is required."); | 785 throw new core.ArgumentError("Parameter id is required."); |
| 777 } | 786 } |
| 778 | 787 |
| 779 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$courseId') + '/course
Work/' + commons.Escaper.ecapeVariable('$id'); | 788 _url = 'v1/courses/' + |
| 789 commons.Escaper.ecapeVariable('$courseId') + |
| 790 '/courseWork/' + |
| 791 commons.Escaper.ecapeVariable('$id'); |
| 780 | 792 |
| 781 var _response = _requester.request(_url, | 793 var _response = _requester.request(_url, "DELETE", |
| 782 "DELETE", | 794 body: _body, |
| 783 body: _body, | 795 queryParams: _queryParams, |
| 784 queryParams: _queryParams, | 796 uploadOptions: _uploadOptions, |
| 785 uploadOptions: _uploadOptions, | 797 uploadMedia: _uploadMedia, |
| 786 uploadMedia: _uploadMedia, | 798 downloadOptions: _downloadOptions); |
| 787 downloadOptions: _downloadOptions); | |
| 788 return _response.then((data) => new Empty.fromJson(data)); | 799 return _response.then((data) => new Empty.fromJson(data)); |
| 789 } | 800 } |
| 790 | 801 |
| 791 /** | 802 /// Returns course work. |
| 792 * Returns course work. | 803 /// |
| 793 * | 804 /// This method returns the following error codes: |
| 794 * This method returns the following error codes: | 805 /// |
| 795 * | 806 /// * `PERMISSION_DENIED` if the requesting user is not permitted to access |
| 796 * * `PERMISSION_DENIED` if the requesting user is not permitted to access the | 807 /// the |
| 797 * requested course or course work, or for access errors. | 808 /// requested course or course work, or for access errors. |
| 798 * * `INVALID_ARGUMENT` if the request is malformed. | 809 /// * `INVALID_ARGUMENT` if the request is malformed. |
| 799 * * `NOT_FOUND` if the requested course or course work does not exist. | 810 /// * `NOT_FOUND` if the requested course or course work does not exist. |
| 800 * | 811 /// |
| 801 * Request parameters: | 812 /// Request parameters: |
| 802 * | 813 /// |
| 803 * [courseId] - Identifier of the course. | 814 /// [courseId] - Identifier of the course. |
| 804 * This identifier can be either the Classroom-assigned identifier or an | 815 /// This identifier can be either the Classroom-assigned identifier or an |
| 805 * alias. | 816 /// alias. |
| 806 * | 817 /// |
| 807 * [id] - Identifier of the course work. | 818 /// [id] - Identifier of the course work. |
| 808 * | 819 /// |
| 809 * Completes with a [CourseWork]. | 820 /// Completes with a [CourseWork]. |
| 810 * | 821 /// |
| 811 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 822 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 812 * error. | 823 /// an error. |
| 813 * | 824 /// |
| 814 * If the used [http.Client] completes with an error when making a REST call, | 825 /// If the used [http.Client] completes with an error when making a REST |
| 815 * this method will complete with the same error. | 826 /// call, this method will complete with the same error. |
| 816 */ | |
| 817 async.Future<CourseWork> get(core.String courseId, core.String id) { | 827 async.Future<CourseWork> get(core.String courseId, core.String id) { |
| 818 var _url = null; | 828 var _url = null; |
| 819 var _queryParams = new core.Map(); | 829 var _queryParams = new core.Map(); |
| 820 var _uploadMedia = null; | 830 var _uploadMedia = null; |
| 821 var _uploadOptions = null; | 831 var _uploadOptions = null; |
| 822 var _downloadOptions = commons.DownloadOptions.Metadata; | 832 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 823 var _body = null; | 833 var _body = null; |
| 824 | 834 |
| 825 if (courseId == null) { | 835 if (courseId == null) { |
| 826 throw new core.ArgumentError("Parameter courseId is required."); | 836 throw new core.ArgumentError("Parameter courseId is required."); |
| 827 } | 837 } |
| 828 if (id == null) { | 838 if (id == null) { |
| 829 throw new core.ArgumentError("Parameter id is required."); | 839 throw new core.ArgumentError("Parameter id is required."); |
| 830 } | 840 } |
| 831 | 841 |
| 832 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$courseId') + '/course
Work/' + commons.Escaper.ecapeVariable('$id'); | 842 _url = 'v1/courses/' + |
| 843 commons.Escaper.ecapeVariable('$courseId') + |
| 844 '/courseWork/' + |
| 845 commons.Escaper.ecapeVariable('$id'); |
| 833 | 846 |
| 834 var _response = _requester.request(_url, | 847 var _response = _requester.request(_url, "GET", |
| 835 "GET", | 848 body: _body, |
| 836 body: _body, | 849 queryParams: _queryParams, |
| 837 queryParams: _queryParams, | 850 uploadOptions: _uploadOptions, |
| 838 uploadOptions: _uploadOptions, | 851 uploadMedia: _uploadMedia, |
| 839 uploadMedia: _uploadMedia, | 852 downloadOptions: _downloadOptions); |
| 840 downloadOptions: _downloadOptions); | |
| 841 return _response.then((data) => new CourseWork.fromJson(data)); | 853 return _response.then((data) => new CourseWork.fromJson(data)); |
| 842 } | 854 } |
| 843 | 855 |
| 844 /** | 856 /// Returns a list of course work that the requester is permitted to view. |
| 845 * Returns a list of course work that the requester is permitted to view. | 857 /// |
| 846 * | 858 /// Course students may only view `PUBLISHED` course work. Course teachers |
| 847 * Course students may only view `PUBLISHED` course work. Course teachers | 859 /// and domain administrators may view all course work. |
| 848 * and domain administrators may view all course work. | 860 /// |
| 849 * | 861 /// This method returns the following error codes: |
| 850 * This method returns the following error codes: | 862 /// |
| 851 * | 863 /// * `PERMISSION_DENIED` if the requesting user is not permitted to access |
| 852 * * `PERMISSION_DENIED` if the requesting user is not permitted to access | 864 /// the requested course or for access errors. |
| 853 * the requested course or for access errors. | 865 /// * `INVALID_ARGUMENT` if the request is malformed. |
| 854 * * `INVALID_ARGUMENT` if the request is malformed. | 866 /// * `NOT_FOUND` if the requested course does not exist. |
| 855 * * `NOT_FOUND` if the requested course does not exist. | 867 /// |
| 856 * | 868 /// Request parameters: |
| 857 * Request parameters: | 869 /// |
| 858 * | 870 /// [courseId] - Identifier of the course. |
| 859 * [courseId] - Identifier of the course. | 871 /// This identifier can be either the Classroom-assigned identifier or an |
| 860 * This identifier can be either the Classroom-assigned identifier or an | 872 /// alias. |
| 861 * alias. | 873 /// |
| 862 * | 874 /// [pageToken] - nextPageToken |
| 863 * [pageToken] - nextPageToken | 875 /// value returned from a previous |
| 864 * value returned from a previous | 876 /// list call, |
| 865 * list call, | 877 /// indicating that the subsequent page of results should be returned. |
| 866 * indicating that the subsequent page of results should be returned. | 878 /// |
| 867 * | 879 /// The list request |
| 868 * The list request | 880 /// must be otherwise identical to the one that resulted in this token. |
| 869 * must be otherwise identical to the one that resulted in this token. | 881 /// |
| 870 * | 882 /// [orderBy] - Optional sort ordering for results. A comma-separated list of |
| 871 * [orderBy] - Optional sort ordering for results. A comma-separated list of | 883 /// fields with |
| 872 * fields with | 884 /// an optional sort direction keyword. Supported fields are `updateTime` |
| 873 * an optional sort direction keyword. Supported fields are `updateTime` | 885 /// and `dueDate`. Supported direction keywords are `asc` and `desc`. |
| 874 * and `dueDate`. Supported direction keywords are `asc` and `desc`. | 886 /// If not specified, `updateTime desc` is the default behavior. |
| 875 * If not specified, `updateTime desc` is the default behavior. | 887 /// Examples: `dueDate asc,updateTime desc`, `updateTime,dueDate desc` |
| 876 * Examples: `dueDate asc,updateTime desc`, `updateTime,dueDate desc` | 888 /// |
| 877 * | 889 /// [pageSize] - Maximum number of items to return. Zero or unspecified |
| 878 * [pageSize] - Maximum number of items to return. Zero or unspecified | 890 /// indicates that the |
| 879 * indicates that the | 891 /// server may assign a maximum. |
| 880 * server may assign a maximum. | 892 /// |
| 881 * | 893 /// The server may return fewer than the specified number of results. |
| 882 * The server may return fewer than the specified number of results. | 894 /// |
| 883 * | 895 /// [courseWorkStates] - Restriction on the work status to return. Only |
| 884 * [courseWorkStates] - Restriction on the work status to return. Only | 896 /// courseWork that matches |
| 885 * courseWork that matches | 897 /// is returned. If unspecified, items with a work status of `PUBLISHED` |
| 886 * is returned. If unspecified, items with a work status of `PUBLISHED` | 898 /// is returned. |
| 887 * is returned. | 899 /// |
| 888 * | 900 /// Completes with a [ListCourseWorkResponse]. |
| 889 * Completes with a [ListCourseWorkResponse]. | 901 /// |
| 890 * | 902 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 891 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 903 /// an error. |
| 892 * error. | 904 /// |
| 893 * | 905 /// If the used [http.Client] completes with an error when making a REST |
| 894 * If the used [http.Client] completes with an error when making a REST call, | 906 /// call, this method will complete with the same error. |
| 895 * this method will complete with the same error. | 907 async.Future<ListCourseWorkResponse> list(core.String courseId, |
| 896 */ | 908 {core.String pageToken, |
| 897 async.Future<ListCourseWorkResponse> list(core.String courseId, {core.String p
ageToken, core.String orderBy, core.int pageSize, core.List<core.String> courseW
orkStates}) { | 909 core.String orderBy, |
| 910 core.int pageSize, |
| 911 core.List<core.String> courseWorkStates}) { |
| 898 var _url = null; | 912 var _url = null; |
| 899 var _queryParams = new core.Map(); | 913 var _queryParams = new core.Map(); |
| 900 var _uploadMedia = null; | 914 var _uploadMedia = null; |
| 901 var _uploadOptions = null; | 915 var _uploadOptions = null; |
| 902 var _downloadOptions = commons.DownloadOptions.Metadata; | 916 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 903 var _body = null; | 917 var _body = null; |
| 904 | 918 |
| 905 if (courseId == null) { | 919 if (courseId == null) { |
| 906 throw new core.ArgumentError("Parameter courseId is required."); | 920 throw new core.ArgumentError("Parameter courseId is required."); |
| 907 } | 921 } |
| 908 if (pageToken != null) { | 922 if (pageToken != null) { |
| 909 _queryParams["pageToken"] = [pageToken]; | 923 _queryParams["pageToken"] = [pageToken]; |
| 910 } | 924 } |
| 911 if (orderBy != null) { | 925 if (orderBy != null) { |
| 912 _queryParams["orderBy"] = [orderBy]; | 926 _queryParams["orderBy"] = [orderBy]; |
| 913 } | 927 } |
| 914 if (pageSize != null) { | 928 if (pageSize != null) { |
| 915 _queryParams["pageSize"] = ["${pageSize}"]; | 929 _queryParams["pageSize"] = ["${pageSize}"]; |
| 916 } | 930 } |
| 917 if (courseWorkStates != null) { | 931 if (courseWorkStates != null) { |
| 918 _queryParams["courseWorkStates"] = courseWorkStates; | 932 _queryParams["courseWorkStates"] = courseWorkStates; |
| 919 } | 933 } |
| 920 | 934 |
| 921 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$courseId') + '/course
Work'; | 935 _url = 'v1/courses/' + |
| 936 commons.Escaper.ecapeVariable('$courseId') + |
| 937 '/courseWork'; |
| 922 | 938 |
| 923 var _response = _requester.request(_url, | 939 var _response = _requester.request(_url, "GET", |
| 924 "GET", | 940 body: _body, |
| 925 body: _body, | 941 queryParams: _queryParams, |
| 926 queryParams: _queryParams, | 942 uploadOptions: _uploadOptions, |
| 927 uploadOptions: _uploadOptions, | 943 uploadMedia: _uploadMedia, |
| 928 uploadMedia: _uploadMedia, | 944 downloadOptions: _downloadOptions); |
| 929 downloadOptions: _downloadOptions); | |
| 930 return _response.then((data) => new ListCourseWorkResponse.fromJson(data)); | 945 return _response.then((data) => new ListCourseWorkResponse.fromJson(data)); |
| 931 } | 946 } |
| 932 | 947 |
| 933 /** | 948 /// Updates one or more fields of a course work. |
| 934 * Updates one or more fields of a course work. | 949 /// |
| 935 * | 950 /// See google.classroom.v1.CourseWork for details |
| 936 * See google.classroom.v1.CourseWork for details | 951 /// of which fields may be updated and who may change them. |
| 937 * of which fields may be updated and who may change them. | 952 /// |
| 938 * | 953 /// This request must be made by the Developer Console project of the |
| 939 * This request must be made by the Developer Console project of the | 954 /// [OAuth client ID](https://support.google.com/cloud/answer/6158849) used |
| 940 * [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to | 955 /// to |
| 941 * create the corresponding course work item. | 956 /// create the corresponding course work item. |
| 942 * | 957 /// |
| 943 * This method returns the following error codes: | 958 /// This method returns the following error codes: |
| 944 * | 959 /// |
| 945 * * `PERMISSION_DENIED` if the requesting developer project did not create | 960 /// * `PERMISSION_DENIED` if the requesting developer project did not create |
| 946 * the corresponding course work, if the user is not permitted to make the | 961 /// the corresponding course work, if the user is not permitted to make the |
| 947 * requested modification to the student submission, or for | 962 /// requested modification to the student submission, or for |
| 948 * access errors. | 963 /// access errors. |
| 949 * * `INVALID_ARGUMENT` if the request is malformed. | 964 /// * `INVALID_ARGUMENT` if the request is malformed. |
| 950 * * `FAILED_PRECONDITION` if the requested course work has already been | 965 /// * `FAILED_PRECONDITION` if the requested course work has already been |
| 951 * deleted. | 966 /// deleted. |
| 952 * * `NOT_FOUND` if the requested course, course work, or student submission | 967 /// * `NOT_FOUND` if the requested course, course work, or student submission |
| 953 * does not exist. | 968 /// does not exist. |
| 954 * | 969 /// |
| 955 * [request] - The metadata request object. | 970 /// [request] - The metadata request object. |
| 956 * | 971 /// |
| 957 * Request parameters: | 972 /// Request parameters: |
| 958 * | 973 /// |
| 959 * [courseId] - Identifier of the course. | 974 /// [courseId] - Identifier of the course. |
| 960 * This identifier can be either the Classroom-assigned identifier or an | 975 /// This identifier can be either the Classroom-assigned identifier or an |
| 961 * alias. | 976 /// alias. |
| 962 * | 977 /// |
| 963 * [id] - Identifier of the course work. | 978 /// [id] - Identifier of the course work. |
| 964 * | 979 /// |
| 965 * [updateMask] - Mask that identifies which fields on the course work to | 980 /// [updateMask] - Mask that identifies which fields on the course work to |
| 966 * update. | 981 /// update. |
| 967 * This field is required to do an update. The update fails if invalid | 982 /// This field is required to do an update. The update fails if invalid |
| 968 * fields are specified. If a field supports empty values, it can be cleared | 983 /// fields are specified. If a field supports empty values, it can be cleared |
| 969 * by specifying it in the update mask and not in the CourseWork object. If a | 984 /// by specifying it in the update mask and not in the CourseWork object. If |
| 970 * field that does not support empty values is included in the update mask and | 985 /// a |
| 971 * not set in the CourseWork object, an `INVALID_ARGUMENT` error will be | 986 /// field that does not support empty values is included in the update mask |
| 972 * returned. | 987 /// and |
| 973 * | 988 /// not set in the CourseWork object, an `INVALID_ARGUMENT` error will be |
| 974 * The following fields may be specified by teachers: | 989 /// returned. |
| 975 * * `title` | 990 /// |
| 976 * * `description` | 991 /// The following fields may be specified by teachers: |
| 977 * * `state` | 992 /// * `title` |
| 978 * * `due_date` | 993 /// * `description` |
| 979 * * `due_time` | 994 /// * `state` |
| 980 * * `max_points` | 995 /// * `due_date` |
| 981 * * `scheduled_time` | 996 /// * `due_time` |
| 982 * * `submission_modification_mode` | 997 /// * `max_points` |
| 983 * | 998 /// * `scheduled_time` |
| 984 * Completes with a [CourseWork]. | 999 /// * `submission_modification_mode` |
| 985 * | 1000 /// |
| 986 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1001 /// Completes with a [CourseWork]. |
| 987 * error. | 1002 /// |
| 988 * | 1003 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 989 * If the used [http.Client] completes with an error when making a REST call, | 1004 /// an error. |
| 990 * this method will complete with the same error. | 1005 /// |
| 991 */ | 1006 /// If the used [http.Client] completes with an error when making a REST |
| 992 async.Future<CourseWork> patch(CourseWork request, core.String courseId, core.
String id, {core.String updateMask}) { | 1007 /// call, this method will complete with the same error. |
| 1008 async.Future<CourseWork> patch( |
| 1009 CourseWork request, core.String courseId, core.String id, |
| 1010 {core.String updateMask}) { |
| 993 var _url = null; | 1011 var _url = null; |
| 994 var _queryParams = new core.Map(); | 1012 var _queryParams = new core.Map(); |
| 995 var _uploadMedia = null; | 1013 var _uploadMedia = null; |
| 996 var _uploadOptions = null; | 1014 var _uploadOptions = null; |
| 997 var _downloadOptions = commons.DownloadOptions.Metadata; | 1015 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 998 var _body = null; | 1016 var _body = null; |
| 999 | 1017 |
| 1000 if (request != null) { | 1018 if (request != null) { |
| 1001 _body = convert.JSON.encode((request).toJson()); | 1019 _body = convert.JSON.encode((request).toJson()); |
| 1002 } | 1020 } |
| 1003 if (courseId == null) { | 1021 if (courseId == null) { |
| 1004 throw new core.ArgumentError("Parameter courseId is required."); | 1022 throw new core.ArgumentError("Parameter courseId is required."); |
| 1005 } | 1023 } |
| 1006 if (id == null) { | 1024 if (id == null) { |
| 1007 throw new core.ArgumentError("Parameter id is required."); | 1025 throw new core.ArgumentError("Parameter id is required."); |
| 1008 } | 1026 } |
| 1009 if (updateMask != null) { | 1027 if (updateMask != null) { |
| 1010 _queryParams["updateMask"] = [updateMask]; | 1028 _queryParams["updateMask"] = [updateMask]; |
| 1011 } | 1029 } |
| 1012 | 1030 |
| 1013 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$courseId') + '/course
Work/' + commons.Escaper.ecapeVariable('$id'); | 1031 _url = 'v1/courses/' + |
| 1032 commons.Escaper.ecapeVariable('$courseId') + |
| 1033 '/courseWork/' + |
| 1034 commons.Escaper.ecapeVariable('$id'); |
| 1014 | 1035 |
| 1015 var _response = _requester.request(_url, | 1036 var _response = _requester.request(_url, "PATCH", |
| 1016 "PATCH", | 1037 body: _body, |
| 1017 body: _body, | 1038 queryParams: _queryParams, |
| 1018 queryParams: _queryParams, | 1039 uploadOptions: _uploadOptions, |
| 1019 uploadOptions: _uploadOptions, | 1040 uploadMedia: _uploadMedia, |
| 1020 uploadMedia: _uploadMedia, | 1041 downloadOptions: _downloadOptions); |
| 1021 downloadOptions: _downloadOptions); | |
| 1022 return _response.then((data) => new CourseWork.fromJson(data)); | 1042 return _response.then((data) => new CourseWork.fromJson(data)); |
| 1023 } | 1043 } |
| 1024 | |
| 1025 } | 1044 } |
| 1026 | 1045 |
| 1027 | |
| 1028 class CoursesCourseWorkStudentSubmissionsResourceApi { | 1046 class CoursesCourseWorkStudentSubmissionsResourceApi { |
| 1029 final commons.ApiRequester _requester; | 1047 final commons.ApiRequester _requester; |
| 1030 | 1048 |
| 1031 CoursesCourseWorkStudentSubmissionsResourceApi(commons.ApiRequester client) : | 1049 CoursesCourseWorkStudentSubmissionsResourceApi(commons.ApiRequester client) |
| 1032 _requester = client; | 1050 : _requester = client; |
| 1033 | 1051 |
| 1034 /** | 1052 /// Returns a student submission. |
| 1035 * Returns a student submission. | 1053 /// |
| 1036 * | 1054 /// * `PERMISSION_DENIED` if the requesting user is not permitted to access |
| 1037 * * `PERMISSION_DENIED` if the requesting user is not permitted to access the | 1055 /// the |
| 1038 * requested course, course work, or student submission or for | 1056 /// requested course, course work, or student submission or for |
| 1039 * access errors. | 1057 /// access errors. |
| 1040 * * `INVALID_ARGUMENT` if the request is malformed. | 1058 /// * `INVALID_ARGUMENT` if the request is malformed. |
| 1041 * * `NOT_FOUND` if the requested course, course work, or student submission | 1059 /// * `NOT_FOUND` if the requested course, course work, or student submission |
| 1042 * does not exist. | 1060 /// does not exist. |
| 1043 * | 1061 /// |
| 1044 * Request parameters: | 1062 /// Request parameters: |
| 1045 * | 1063 /// |
| 1046 * [courseId] - Identifier of the course. | 1064 /// [courseId] - Identifier of the course. |
| 1047 * This identifier can be either the Classroom-assigned identifier or an | 1065 /// This identifier can be either the Classroom-assigned identifier or an |
| 1048 * alias. | 1066 /// alias. |
| 1049 * | 1067 /// |
| 1050 * [courseWorkId] - Identifier of the course work. | 1068 /// [courseWorkId] - Identifier of the course work. |
| 1051 * | 1069 /// |
| 1052 * [id] - Identifier of the student submission. | 1070 /// [id] - Identifier of the student submission. |
| 1053 * | 1071 /// |
| 1054 * Completes with a [StudentSubmission]. | 1072 /// Completes with a [StudentSubmission]. |
| 1055 * | 1073 /// |
| 1056 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1074 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 1057 * error. | 1075 /// an error. |
| 1058 * | 1076 /// |
| 1059 * If the used [http.Client] completes with an error when making a REST call, | 1077 /// If the used [http.Client] completes with an error when making a REST |
| 1060 * this method will complete with the same error. | 1078 /// call, this method will complete with the same error. |
| 1061 */ | 1079 async.Future<StudentSubmission> get( |
| 1062 async.Future<StudentSubmission> get(core.String courseId, core.String courseWo
rkId, core.String id) { | 1080 core.String courseId, core.String courseWorkId, core.String id) { |
| 1063 var _url = null; | 1081 var _url = null; |
| 1064 var _queryParams = new core.Map(); | 1082 var _queryParams = new core.Map(); |
| 1065 var _uploadMedia = null; | 1083 var _uploadMedia = null; |
| 1066 var _uploadOptions = null; | 1084 var _uploadOptions = null; |
| 1067 var _downloadOptions = commons.DownloadOptions.Metadata; | 1085 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1068 var _body = null; | 1086 var _body = null; |
| 1069 | 1087 |
| 1070 if (courseId == null) { | 1088 if (courseId == null) { |
| 1071 throw new core.ArgumentError("Parameter courseId is required."); | 1089 throw new core.ArgumentError("Parameter courseId is required."); |
| 1072 } | 1090 } |
| 1073 if (courseWorkId == null) { | 1091 if (courseWorkId == null) { |
| 1074 throw new core.ArgumentError("Parameter courseWorkId is required."); | 1092 throw new core.ArgumentError("Parameter courseWorkId is required."); |
| 1075 } | 1093 } |
| 1076 if (id == null) { | 1094 if (id == null) { |
| 1077 throw new core.ArgumentError("Parameter id is required."); | 1095 throw new core.ArgumentError("Parameter id is required."); |
| 1078 } | 1096 } |
| 1079 | 1097 |
| 1080 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$courseId') + '/course
Work/' + commons.Escaper.ecapeVariable('$courseWorkId') + '/studentSubmissions/'
+ commons.Escaper.ecapeVariable('$id'); | 1098 _url = 'v1/courses/' + |
| 1099 commons.Escaper.ecapeVariable('$courseId') + |
| 1100 '/courseWork/' + |
| 1101 commons.Escaper.ecapeVariable('$courseWorkId') + |
| 1102 '/studentSubmissions/' + |
| 1103 commons.Escaper.ecapeVariable('$id'); |
| 1081 | 1104 |
| 1082 var _response = _requester.request(_url, | 1105 var _response = _requester.request(_url, "GET", |
| 1083 "GET", | 1106 body: _body, |
| 1084 body: _body, | 1107 queryParams: _queryParams, |
| 1085 queryParams: _queryParams, | 1108 uploadOptions: _uploadOptions, |
| 1086 uploadOptions: _uploadOptions, | 1109 uploadMedia: _uploadMedia, |
| 1087 uploadMedia: _uploadMedia, | 1110 downloadOptions: _downloadOptions); |
| 1088 downloadOptions: _downloadOptions); | |
| 1089 return _response.then((data) => new StudentSubmission.fromJson(data)); | 1111 return _response.then((data) => new StudentSubmission.fromJson(data)); |
| 1090 } | 1112 } |
| 1091 | 1113 |
| 1092 /** | 1114 /// Returns a list of student submissions that the requester is permitted to |
| 1093 * Returns a list of student submissions that the requester is permitted to | 1115 /// view, factoring in the OAuth scopes of the request. |
| 1094 * view, factoring in the OAuth scopes of the request. | 1116 /// `-` may be specified as the `course_work_id` to include student |
| 1095 * `-` may be specified as the `course_work_id` to include student | 1117 /// submissions for multiple course work items. |
| 1096 * submissions for multiple course work items. | 1118 /// |
| 1097 * | 1119 /// Course students may only view their own work. Course teachers |
| 1098 * Course students may only view their own work. Course teachers | 1120 /// and domain administrators may view all student submissions. |
| 1099 * and domain administrators may view all student submissions. | 1121 /// |
| 1100 * | 1122 /// This method returns the following error codes: |
| 1101 * This method returns the following error codes: | 1123 /// |
| 1102 * | 1124 /// * `PERMISSION_DENIED` if the requesting user is not permitted to access |
| 1103 * * `PERMISSION_DENIED` if the requesting user is not permitted to access the | 1125 /// the |
| 1104 * requested course or course work, or for access errors. | 1126 /// requested course or course work, or for access errors. |
| 1105 * * `INVALID_ARGUMENT` if the request is malformed. | 1127 /// * `INVALID_ARGUMENT` if the request is malformed. |
| 1106 * * `NOT_FOUND` if the requested course does not exist. | 1128 /// * `NOT_FOUND` if the requested course does not exist. |
| 1107 * | 1129 /// |
| 1108 * Request parameters: | 1130 /// Request parameters: |
| 1109 * | 1131 /// |
| 1110 * [courseId] - Identifier of the course. | 1132 /// [courseId] - Identifier of the course. |
| 1111 * This identifier can be either the Classroom-assigned identifier or an | 1133 /// This identifier can be either the Classroom-assigned identifier or an |
| 1112 * alias. | 1134 /// alias. |
| 1113 * | 1135 /// |
| 1114 * [courseWorkId] - Identifier of the student work to request. | 1136 /// [courseWorkId] - Identifier of the student work to request. |
| 1115 * This may be set to the string literal `"-"` to request student work for | 1137 /// This may be set to the string literal `"-"` to request student work for |
| 1116 * all course work in the specified course. | 1138 /// all course work in the specified course. |
| 1117 * | 1139 /// |
| 1118 * [late] - Requested lateness value. If specified, returned student | 1140 /// [late] - Requested lateness value. If specified, returned student |
| 1119 * submissions are | 1141 /// submissions are |
| 1120 * restricted by the requested value. | 1142 /// restricted by the requested value. |
| 1121 * If unspecified, submissions are returned regardless of `late` value. | 1143 /// If unspecified, submissions are returned regardless of `late` value. |
| 1122 * Possible string values are: | 1144 /// Possible string values are: |
| 1123 * - "LATE_VALUES_UNSPECIFIED" : A LATE_VALUES_UNSPECIFIED. | 1145 /// - "LATE_VALUES_UNSPECIFIED" : A LATE_VALUES_UNSPECIFIED. |
| 1124 * - "LATE_ONLY" : A LATE_ONLY. | 1146 /// - "LATE_ONLY" : A LATE_ONLY. |
| 1125 * - "NOT_LATE_ONLY" : A NOT_LATE_ONLY. | 1147 /// - "NOT_LATE_ONLY" : A NOT_LATE_ONLY. |
| 1126 * | 1148 /// |
| 1127 * [pageToken] - nextPageToken | 1149 /// [pageToken] - nextPageToken |
| 1128 * value returned from a previous | 1150 /// value returned from a previous |
| 1129 * list call, | 1151 /// list call, |
| 1130 * indicating that the subsequent page of results should be returned. | 1152 /// indicating that the subsequent page of results should be returned. |
| 1131 * | 1153 /// |
| 1132 * The list request | 1154 /// The list request |
| 1133 * must be otherwise identical to the one that resulted in this token. | 1155 /// must be otherwise identical to the one that resulted in this token. |
| 1134 * | 1156 /// |
| 1135 * [states] - Requested submission states. If specified, returned student | 1157 /// [pageSize] - Maximum number of items to return. Zero or unspecified |
| 1136 * submissions | 1158 /// indicates that the |
| 1137 * match one of the specified submission states. | 1159 /// server may assign a maximum. |
| 1138 * | 1160 /// |
| 1139 * [pageSize] - Maximum number of items to return. Zero or unspecified | 1161 /// The server may return fewer than the specified number of results. |
| 1140 * indicates that the | 1162 /// |
| 1141 * server may assign a maximum. | 1163 /// [states] - Requested submission states. If specified, returned student |
| 1142 * | 1164 /// submissions |
| 1143 * The server may return fewer than the specified number of results. | 1165 /// match one of the specified submission states. |
| 1144 * | 1166 /// |
| 1145 * [userId] - Optional argument to restrict returned student work to those | 1167 /// [userId] - Optional argument to restrict returned student work to those |
| 1146 * owned by the | 1168 /// owned by the |
| 1147 * student with the specified identifier. The identifier can be one of the | 1169 /// student with the specified identifier. The identifier can be one of the |
| 1148 * following: | 1170 /// following: |
| 1149 * | 1171 /// |
| 1150 * * the numeric identifier for the user | 1172 /// * the numeric identifier for the user |
| 1151 * * the email address of the user | 1173 /// * the email address of the user |
| 1152 * * the string literal `"me"`, indicating the requesting user | 1174 /// * the string literal `"me"`, indicating the requesting user |
| 1153 * | 1175 /// |
| 1154 * Completes with a [ListStudentSubmissionsResponse]. | 1176 /// Completes with a [ListStudentSubmissionsResponse]. |
| 1155 * | 1177 /// |
| 1156 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1178 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 1157 * error. | 1179 /// an error. |
| 1158 * | 1180 /// |
| 1159 * If the used [http.Client] completes with an error when making a REST call, | 1181 /// If the used [http.Client] completes with an error when making a REST |
| 1160 * this method will complete with the same error. | 1182 /// call, this method will complete with the same error. |
| 1161 */ | 1183 async.Future<ListStudentSubmissionsResponse> list( |
| 1162 async.Future<ListStudentSubmissionsResponse> list(core.String courseId, core.S
tring courseWorkId, {core.String late, core.String pageToken, core.List<core.Str
ing> states, core.int pageSize, core.String userId}) { | 1184 core.String courseId, core.String courseWorkId, |
| 1185 {core.String late, |
| 1186 core.String pageToken, |
| 1187 core.int pageSize, |
| 1188 core.List<core.String> states, |
| 1189 core.String userId}) { |
| 1163 var _url = null; | 1190 var _url = null; |
| 1164 var _queryParams = new core.Map(); | 1191 var _queryParams = new core.Map(); |
| 1165 var _uploadMedia = null; | 1192 var _uploadMedia = null; |
| 1166 var _uploadOptions = null; | 1193 var _uploadOptions = null; |
| 1167 var _downloadOptions = commons.DownloadOptions.Metadata; | 1194 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1168 var _body = null; | 1195 var _body = null; |
| 1169 | 1196 |
| 1170 if (courseId == null) { | 1197 if (courseId == null) { |
| 1171 throw new core.ArgumentError("Parameter courseId is required."); | 1198 throw new core.ArgumentError("Parameter courseId is required."); |
| 1172 } | 1199 } |
| 1173 if (courseWorkId == null) { | 1200 if (courseWorkId == null) { |
| 1174 throw new core.ArgumentError("Parameter courseWorkId is required."); | 1201 throw new core.ArgumentError("Parameter courseWorkId is required."); |
| 1175 } | 1202 } |
| 1176 if (late != null) { | 1203 if (late != null) { |
| 1177 _queryParams["late"] = [late]; | 1204 _queryParams["late"] = [late]; |
| 1178 } | 1205 } |
| 1179 if (pageToken != null) { | 1206 if (pageToken != null) { |
| 1180 _queryParams["pageToken"] = [pageToken]; | 1207 _queryParams["pageToken"] = [pageToken]; |
| 1181 } | 1208 } |
| 1209 if (pageSize != null) { |
| 1210 _queryParams["pageSize"] = ["${pageSize}"]; |
| 1211 } |
| 1182 if (states != null) { | 1212 if (states != null) { |
| 1183 _queryParams["states"] = states; | 1213 _queryParams["states"] = states; |
| 1184 } | 1214 } |
| 1185 if (pageSize != null) { | |
| 1186 _queryParams["pageSize"] = ["${pageSize}"]; | |
| 1187 } | |
| 1188 if (userId != null) { | 1215 if (userId != null) { |
| 1189 _queryParams["userId"] = [userId]; | 1216 _queryParams["userId"] = [userId]; |
| 1190 } | 1217 } |
| 1191 | 1218 |
| 1192 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$courseId') + '/course
Work/' + commons.Escaper.ecapeVariable('$courseWorkId') + '/studentSubmissions'; | 1219 _url = 'v1/courses/' + |
| 1220 commons.Escaper.ecapeVariable('$courseId') + |
| 1221 '/courseWork/' + |
| 1222 commons.Escaper.ecapeVariable('$courseWorkId') + |
| 1223 '/studentSubmissions'; |
| 1193 | 1224 |
| 1194 var _response = _requester.request(_url, | 1225 var _response = _requester.request(_url, "GET", |
| 1195 "GET", | 1226 body: _body, |
| 1196 body: _body, | 1227 queryParams: _queryParams, |
| 1197 queryParams: _queryParams, | 1228 uploadOptions: _uploadOptions, |
| 1198 uploadOptions: _uploadOptions, | 1229 uploadMedia: _uploadMedia, |
| 1199 uploadMedia: _uploadMedia, | 1230 downloadOptions: _downloadOptions); |
| 1200 downloadOptions: _downloadOptions); | 1231 return _response |
| 1201 return _response.then((data) => new ListStudentSubmissionsResponse.fromJson(
data)); | 1232 .then((data) => new ListStudentSubmissionsResponse.fromJson(data)); |
| 1202 } | 1233 } |
| 1203 | 1234 |
| 1204 /** | 1235 /// Modifies attachments of student submission. |
| 1205 * Modifies attachments of student submission. | 1236 /// |
| 1206 * | 1237 /// Attachments may only be added to student submissions belonging to course |
| 1207 * Attachments may only be added to student submissions belonging to course | 1238 /// work objects with a `workType` of `ASSIGNMENT`. |
| 1208 * work objects with a `workType` of `ASSIGNMENT`. | 1239 /// |
| 1209 * | 1240 /// This request must be made by the Developer Console project of the |
| 1210 * This request must be made by the Developer Console project of the | 1241 /// [OAuth client ID](https://support.google.com/cloud/answer/6158849) used |
| 1211 * [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to | 1242 /// to |
| 1212 * create the corresponding course work item. | 1243 /// create the corresponding course work item. |
| 1213 * | 1244 /// |
| 1214 * This method returns the following error codes: | 1245 /// This method returns the following error codes: |
| 1215 * | 1246 /// |
| 1216 * * `PERMISSION_DENIED` if the requesting user is not permitted to access the | 1247 /// * `PERMISSION_DENIED` if the requesting user is not permitted to access |
| 1217 * requested course or course work, if the user is not permitted to modify | 1248 /// the |
| 1218 * attachments on the requested student submission, or for | 1249 /// requested course or course work, if the user is not permitted to modify |
| 1219 * access errors. | 1250 /// attachments on the requested student submission, or for |
| 1220 * * `INVALID_ARGUMENT` if the request is malformed. | 1251 /// access errors. |
| 1221 * * `NOT_FOUND` if the requested course, course work, or student submission | 1252 /// * `INVALID_ARGUMENT` if the request is malformed. |
| 1222 * does not exist. | 1253 /// * `NOT_FOUND` if the requested course, course work, or student submission |
| 1223 * | 1254 /// does not exist. |
| 1224 * [request] - The metadata request object. | 1255 /// |
| 1225 * | 1256 /// [request] - The metadata request object. |
| 1226 * Request parameters: | 1257 /// |
| 1227 * | 1258 /// Request parameters: |
| 1228 * [courseId] - Identifier of the course. | 1259 /// |
| 1229 * This identifier can be either the Classroom-assigned identifier or an | 1260 /// [courseId] - Identifier of the course. |
| 1230 * alias. | 1261 /// This identifier can be either the Classroom-assigned identifier or an |
| 1231 * | 1262 /// alias. |
| 1232 * [courseWorkId] - Identifier of the course work. | 1263 /// |
| 1233 * | 1264 /// [courseWorkId] - Identifier of the course work. |
| 1234 * [id] - Identifier of the student submission. | 1265 /// |
| 1235 * | 1266 /// [id] - Identifier of the student submission. |
| 1236 * Completes with a [StudentSubmission]. | 1267 /// |
| 1237 * | 1268 /// Completes with a [StudentSubmission]. |
| 1238 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1269 /// |
| 1239 * error. | 1270 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 1240 * | 1271 /// an error. |
| 1241 * If the used [http.Client] completes with an error when making a REST call, | 1272 /// |
| 1242 * this method will complete with the same error. | 1273 /// If the used [http.Client] completes with an error when making a REST |
| 1243 */ | 1274 /// call, this method will complete with the same error. |
| 1244 async.Future<StudentSubmission> modifyAttachments(ModifyAttachmentsRequest req
uest, core.String courseId, core.String courseWorkId, core.String id) { | 1275 async.Future<StudentSubmission> modifyAttachments( |
| 1276 ModifyAttachmentsRequest request, |
| 1277 core.String courseId, |
| 1278 core.String courseWorkId, |
| 1279 core.String id) { |
| 1245 var _url = null; | 1280 var _url = null; |
| 1246 var _queryParams = new core.Map(); | 1281 var _queryParams = new core.Map(); |
| 1247 var _uploadMedia = null; | 1282 var _uploadMedia = null; |
| 1248 var _uploadOptions = null; | 1283 var _uploadOptions = null; |
| 1249 var _downloadOptions = commons.DownloadOptions.Metadata; | 1284 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1250 var _body = null; | 1285 var _body = null; |
| 1251 | 1286 |
| 1252 if (request != null) { | 1287 if (request != null) { |
| 1253 _body = convert.JSON.encode((request).toJson()); | 1288 _body = convert.JSON.encode((request).toJson()); |
| 1254 } | 1289 } |
| 1255 if (courseId == null) { | 1290 if (courseId == null) { |
| 1256 throw new core.ArgumentError("Parameter courseId is required."); | 1291 throw new core.ArgumentError("Parameter courseId is required."); |
| 1257 } | 1292 } |
| 1258 if (courseWorkId == null) { | 1293 if (courseWorkId == null) { |
| 1259 throw new core.ArgumentError("Parameter courseWorkId is required."); | 1294 throw new core.ArgumentError("Parameter courseWorkId is required."); |
| 1260 } | 1295 } |
| 1261 if (id == null) { | 1296 if (id == null) { |
| 1262 throw new core.ArgumentError("Parameter id is required."); | 1297 throw new core.ArgumentError("Parameter id is required."); |
| 1263 } | 1298 } |
| 1264 | 1299 |
| 1265 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$courseId') + '/course
Work/' + commons.Escaper.ecapeVariable('$courseWorkId') + '/studentSubmissions/'
+ commons.Escaper.ecapeVariable('$id') + ':modifyAttachments'; | 1300 _url = 'v1/courses/' + |
| 1301 commons.Escaper.ecapeVariable('$courseId') + |
| 1302 '/courseWork/' + |
| 1303 commons.Escaper.ecapeVariable('$courseWorkId') + |
| 1304 '/studentSubmissions/' + |
| 1305 commons.Escaper.ecapeVariable('$id') + |
| 1306 ':modifyAttachments'; |
| 1266 | 1307 |
| 1267 var _response = _requester.request(_url, | 1308 var _response = _requester.request(_url, "POST", |
| 1268 "POST", | 1309 body: _body, |
| 1269 body: _body, | 1310 queryParams: _queryParams, |
| 1270 queryParams: _queryParams, | 1311 uploadOptions: _uploadOptions, |
| 1271 uploadOptions: _uploadOptions, | 1312 uploadMedia: _uploadMedia, |
| 1272 uploadMedia: _uploadMedia, | 1313 downloadOptions: _downloadOptions); |
| 1273 downloadOptions: _downloadOptions); | |
| 1274 return _response.then((data) => new StudentSubmission.fromJson(data)); | 1314 return _response.then((data) => new StudentSubmission.fromJson(data)); |
| 1275 } | 1315 } |
| 1276 | 1316 |
| 1277 /** | 1317 /// Updates one or more fields of a student submission. |
| 1278 * Updates one or more fields of a student submission. | 1318 /// |
| 1279 * | 1319 /// See google.classroom.v1.StudentSubmission for details |
| 1280 * See google.classroom.v1.StudentSubmission for details | 1320 /// of which fields may be updated and who may change them. |
| 1281 * of which fields may be updated and who may change them. | 1321 /// |
| 1282 * | 1322 /// This request must be made by the Developer Console project of the |
| 1283 * This request must be made by the Developer Console project of the | 1323 /// [OAuth client ID](https://support.google.com/cloud/answer/6158849) used |
| 1284 * [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to | 1324 /// to |
| 1285 * create the corresponding course work item. | 1325 /// create the corresponding course work item. |
| 1286 * | 1326 /// |
| 1287 * This method returns the following error codes: | 1327 /// This method returns the following error codes: |
| 1288 * | 1328 /// |
| 1289 * * `PERMISSION_DENIED` if the requesting developer project did not create | 1329 /// * `PERMISSION_DENIED` if the requesting developer project did not create |
| 1290 * the corresponding course work, if the user is not permitted to make the | 1330 /// the corresponding course work, if the user is not permitted to make the |
| 1291 * requested modification to the student submission, or for | 1331 /// requested modification to the student submission, or for |
| 1292 * access errors. | 1332 /// access errors. |
| 1293 * * `INVALID_ARGUMENT` if the request is malformed. | 1333 /// * `INVALID_ARGUMENT` if the request is malformed. |
| 1294 * * `NOT_FOUND` if the requested course, course work, or student submission | 1334 /// * `NOT_FOUND` if the requested course, course work, or student submission |
| 1295 * does not exist. | 1335 /// does not exist. |
| 1296 * | 1336 /// |
| 1297 * [request] - The metadata request object. | 1337 /// [request] - The metadata request object. |
| 1298 * | 1338 /// |
| 1299 * Request parameters: | 1339 /// Request parameters: |
| 1300 * | 1340 /// |
| 1301 * [courseId] - Identifier of the course. | 1341 /// [courseId] - Identifier of the course. |
| 1302 * This identifier can be either the Classroom-assigned identifier or an | 1342 /// This identifier can be either the Classroom-assigned identifier or an |
| 1303 * alias. | 1343 /// alias. |
| 1304 * | 1344 /// |
| 1305 * [courseWorkId] - Identifier of the course work. | 1345 /// [courseWorkId] - Identifier of the course work. |
| 1306 * | 1346 /// |
| 1307 * [id] - Identifier of the student submission. | 1347 /// [id] - Identifier of the student submission. |
| 1308 * | 1348 /// |
| 1309 * [updateMask] - Mask that identifies which fields on the student submission | 1349 /// [updateMask] - Mask that identifies which fields on the student |
| 1310 * to update. | 1350 /// submission to update. |
| 1311 * This field is required to do an update. The update fails if invalid | 1351 /// This field is required to do an update. The update fails if invalid |
| 1312 * fields are specified. | 1352 /// fields are specified. |
| 1313 * | 1353 /// |
| 1314 * The following fields may be specified by teachers: | 1354 /// The following fields may be specified by teachers: |
| 1315 * * `draft_grade` | 1355 /// * `draft_grade` |
| 1316 * * `assigned_grade` | 1356 /// * `assigned_grade` |
| 1317 * | 1357 /// |
| 1318 * Completes with a [StudentSubmission]. | 1358 /// Completes with a [StudentSubmission]. |
| 1319 * | 1359 /// |
| 1320 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1360 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 1321 * error. | 1361 /// an error. |
| 1322 * | 1362 /// |
| 1323 * If the used [http.Client] completes with an error when making a REST call, | 1363 /// If the used [http.Client] completes with an error when making a REST |
| 1324 * this method will complete with the same error. | 1364 /// call, this method will complete with the same error. |
| 1325 */ | 1365 async.Future<StudentSubmission> patch(StudentSubmission request, |
| 1326 async.Future<StudentSubmission> patch(StudentSubmission request, core.String c
ourseId, core.String courseWorkId, core.String id, {core.String updateMask}) { | 1366 core.String courseId, core.String courseWorkId, core.String id, |
| 1367 {core.String updateMask}) { |
| 1327 var _url = null; | 1368 var _url = null; |
| 1328 var _queryParams = new core.Map(); | 1369 var _queryParams = new core.Map(); |
| 1329 var _uploadMedia = null; | 1370 var _uploadMedia = null; |
| 1330 var _uploadOptions = null; | 1371 var _uploadOptions = null; |
| 1331 var _downloadOptions = commons.DownloadOptions.Metadata; | 1372 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1332 var _body = null; | 1373 var _body = null; |
| 1333 | 1374 |
| 1334 if (request != null) { | 1375 if (request != null) { |
| 1335 _body = convert.JSON.encode((request).toJson()); | 1376 _body = convert.JSON.encode((request).toJson()); |
| 1336 } | 1377 } |
| 1337 if (courseId == null) { | 1378 if (courseId == null) { |
| 1338 throw new core.ArgumentError("Parameter courseId is required."); | 1379 throw new core.ArgumentError("Parameter courseId is required."); |
| 1339 } | 1380 } |
| 1340 if (courseWorkId == null) { | 1381 if (courseWorkId == null) { |
| 1341 throw new core.ArgumentError("Parameter courseWorkId is required."); | 1382 throw new core.ArgumentError("Parameter courseWorkId is required."); |
| 1342 } | 1383 } |
| 1343 if (id == null) { | 1384 if (id == null) { |
| 1344 throw new core.ArgumentError("Parameter id is required."); | 1385 throw new core.ArgumentError("Parameter id is required."); |
| 1345 } | 1386 } |
| 1346 if (updateMask != null) { | 1387 if (updateMask != null) { |
| 1347 _queryParams["updateMask"] = [updateMask]; | 1388 _queryParams["updateMask"] = [updateMask]; |
| 1348 } | 1389 } |
| 1349 | 1390 |
| 1350 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$courseId') + '/course
Work/' + commons.Escaper.ecapeVariable('$courseWorkId') + '/studentSubmissions/'
+ commons.Escaper.ecapeVariable('$id'); | 1391 _url = 'v1/courses/' + |
| 1392 commons.Escaper.ecapeVariable('$courseId') + |
| 1393 '/courseWork/' + |
| 1394 commons.Escaper.ecapeVariable('$courseWorkId') + |
| 1395 '/studentSubmissions/' + |
| 1396 commons.Escaper.ecapeVariable('$id'); |
| 1351 | 1397 |
| 1352 var _response = _requester.request(_url, | 1398 var _response = _requester.request(_url, "PATCH", |
| 1353 "PATCH", | 1399 body: _body, |
| 1354 body: _body, | 1400 queryParams: _queryParams, |
| 1355 queryParams: _queryParams, | 1401 uploadOptions: _uploadOptions, |
| 1356 uploadOptions: _uploadOptions, | 1402 uploadMedia: _uploadMedia, |
| 1357 uploadMedia: _uploadMedia, | 1403 downloadOptions: _downloadOptions); |
| 1358 downloadOptions: _downloadOptions); | |
| 1359 return _response.then((data) => new StudentSubmission.fromJson(data)); | 1404 return _response.then((data) => new StudentSubmission.fromJson(data)); |
| 1360 } | 1405 } |
| 1361 | 1406 |
| 1362 /** | 1407 /// Reclaims a student submission on behalf of the student that owns it. |
| 1363 * Reclaims a student submission on behalf of the student that owns it. | 1408 /// |
| 1364 * | 1409 /// Reclaiming a student submission transfers ownership of attached Drive |
| 1365 * Reclaiming a student submission transfers ownership of attached Drive | 1410 /// files to the student and update the submission state. |
| 1366 * files to the student and update the submission state. | 1411 /// |
| 1367 * | 1412 /// Only the student that owns the requested student submission may call this |
| 1368 * Only the student that owns the requested student submission may call this | 1413 /// method, and only for a student submission that has been turned in. |
| 1369 * method, and only for a student submission that has been turned in. | 1414 /// |
| 1370 * | 1415 /// This request must be made by the Developer Console project of the |
| 1371 * This request must be made by the Developer Console project of the | 1416 /// [OAuth client ID](https://support.google.com/cloud/answer/6158849) used |
| 1372 * [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to | 1417 /// to |
| 1373 * create the corresponding course work item. | 1418 /// create the corresponding course work item. |
| 1374 * | 1419 /// |
| 1375 * This method returns the following error codes: | 1420 /// This method returns the following error codes: |
| 1376 * | 1421 /// |
| 1377 * * `PERMISSION_DENIED` if the requesting user is not permitted to access the | 1422 /// * `PERMISSION_DENIED` if the requesting user is not permitted to access |
| 1378 * requested course or course work, unsubmit the requested student submission, | 1423 /// the |
| 1379 * or for access errors. | 1424 /// requested course or course work, unsubmit the requested student |
| 1380 * * `FAILED_PRECONDITION` if the student submission has not been turned in. | 1425 /// submission, |
| 1381 * * `INVALID_ARGUMENT` if the request is malformed. | 1426 /// or for access errors. |
| 1382 * * `NOT_FOUND` if the requested course, course work, or student submission | 1427 /// * `FAILED_PRECONDITION` if the student submission has not been turned in. |
| 1383 * does not exist. | 1428 /// * `INVALID_ARGUMENT` if the request is malformed. |
| 1384 * | 1429 /// * `NOT_FOUND` if the requested course, course work, or student submission |
| 1385 * [request] - The metadata request object. | 1430 /// does not exist. |
| 1386 * | 1431 /// |
| 1387 * Request parameters: | 1432 /// [request] - The metadata request object. |
| 1388 * | 1433 /// |
| 1389 * [courseId] - Identifier of the course. | 1434 /// Request parameters: |
| 1390 * This identifier can be either the Classroom-assigned identifier or an | 1435 /// |
| 1391 * alias. | 1436 /// [courseId] - Identifier of the course. |
| 1392 * | 1437 /// This identifier can be either the Classroom-assigned identifier or an |
| 1393 * [courseWorkId] - Identifier of the course work. | 1438 /// alias. |
| 1394 * | 1439 /// |
| 1395 * [id] - Identifier of the student submission. | 1440 /// [courseWorkId] - Identifier of the course work. |
| 1396 * | 1441 /// |
| 1397 * Completes with a [Empty]. | 1442 /// [id] - Identifier of the student submission. |
| 1398 * | 1443 /// |
| 1399 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1444 /// Completes with a [Empty]. |
| 1400 * error. | 1445 /// |
| 1401 * | 1446 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 1402 * If the used [http.Client] completes with an error when making a REST call, | 1447 /// an error. |
| 1403 * this method will complete with the same error. | 1448 /// |
| 1404 */ | 1449 /// If the used [http.Client] completes with an error when making a REST |
| 1405 async.Future<Empty> reclaim(ReclaimStudentSubmissionRequest request, core.Stri
ng courseId, core.String courseWorkId, core.String id) { | 1450 /// call, this method will complete with the same error. |
| 1451 async.Future<Empty> reclaim(ReclaimStudentSubmissionRequest request, |
| 1452 core.String courseId, core.String courseWorkId, core.String id) { |
| 1406 var _url = null; | 1453 var _url = null; |
| 1407 var _queryParams = new core.Map(); | 1454 var _queryParams = new core.Map(); |
| 1408 var _uploadMedia = null; | 1455 var _uploadMedia = null; |
| 1409 var _uploadOptions = null; | 1456 var _uploadOptions = null; |
| 1410 var _downloadOptions = commons.DownloadOptions.Metadata; | 1457 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1411 var _body = null; | 1458 var _body = null; |
| 1412 | 1459 |
| 1413 if (request != null) { | 1460 if (request != null) { |
| 1414 _body = convert.JSON.encode((request).toJson()); | 1461 _body = convert.JSON.encode((request).toJson()); |
| 1415 } | 1462 } |
| 1416 if (courseId == null) { | 1463 if (courseId == null) { |
| 1417 throw new core.ArgumentError("Parameter courseId is required."); | 1464 throw new core.ArgumentError("Parameter courseId is required."); |
| 1418 } | 1465 } |
| 1419 if (courseWorkId == null) { | 1466 if (courseWorkId == null) { |
| 1420 throw new core.ArgumentError("Parameter courseWorkId is required."); | 1467 throw new core.ArgumentError("Parameter courseWorkId is required."); |
| 1421 } | 1468 } |
| 1422 if (id == null) { | 1469 if (id == null) { |
| 1423 throw new core.ArgumentError("Parameter id is required."); | 1470 throw new core.ArgumentError("Parameter id is required."); |
| 1424 } | 1471 } |
| 1425 | 1472 |
| 1426 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$courseId') + '/course
Work/' + commons.Escaper.ecapeVariable('$courseWorkId') + '/studentSubmissions/'
+ commons.Escaper.ecapeVariable('$id') + ':reclaim'; | 1473 _url = 'v1/courses/' + |
| 1474 commons.Escaper.ecapeVariable('$courseId') + |
| 1475 '/courseWork/' + |
| 1476 commons.Escaper.ecapeVariable('$courseWorkId') + |
| 1477 '/studentSubmissions/' + |
| 1478 commons.Escaper.ecapeVariable('$id') + |
| 1479 ':reclaim'; |
| 1427 | 1480 |
| 1428 var _response = _requester.request(_url, | 1481 var _response = _requester.request(_url, "POST", |
| 1429 "POST", | 1482 body: _body, |
| 1430 body: _body, | 1483 queryParams: _queryParams, |
| 1431 queryParams: _queryParams, | 1484 uploadOptions: _uploadOptions, |
| 1432 uploadOptions: _uploadOptions, | 1485 uploadMedia: _uploadMedia, |
| 1433 uploadMedia: _uploadMedia, | 1486 downloadOptions: _downloadOptions); |
| 1434 downloadOptions: _downloadOptions); | |
| 1435 return _response.then((data) => new Empty.fromJson(data)); | 1487 return _response.then((data) => new Empty.fromJson(data)); |
| 1436 } | 1488 } |
| 1437 | 1489 |
| 1438 /** | 1490 /// Returns a student submission. |
| 1439 * Returns a student submission. | 1491 /// |
| 1440 * | 1492 /// Returning a student submission transfers ownership of attached Drive |
| 1441 * Returning a student submission transfers ownership of attached Drive | 1493 /// files to the student and may also update the submission state. |
| 1442 * files to the student and may also update the submission state. | 1494 /// Unlike the Classroom application, returning a student submission does not |
| 1443 * Unlike the Classroom application, returning a student submission does not | 1495 /// set assignedGrade to the draftGrade value. |
| 1444 * set assignedGrade to the draftGrade value. | 1496 /// |
| 1445 * | 1497 /// Only a teacher of the course that contains the requested student |
| 1446 * Only a teacher of the course that contains the requested student submission | 1498 /// submission |
| 1447 * may call this method. | 1499 /// may call this method. |
| 1448 * | 1500 /// |
| 1449 * This request must be made by the Developer Console project of the | 1501 /// This request must be made by the Developer Console project of the |
| 1450 * [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to | 1502 /// [OAuth client ID](https://support.google.com/cloud/answer/6158849) used |
| 1451 * create the corresponding course work item. | 1503 /// to |
| 1452 * | 1504 /// create the corresponding course work item. |
| 1453 * This method returns the following error codes: | 1505 /// |
| 1454 * | 1506 /// This method returns the following error codes: |
| 1455 * * `PERMISSION_DENIED` if the requesting user is not permitted to access the | 1507 /// |
| 1456 * requested course or course work, return the requested student submission, | 1508 /// * `PERMISSION_DENIED` if the requesting user is not permitted to access |
| 1457 * or for access errors. | 1509 /// the |
| 1458 * * `INVALID_ARGUMENT` if the request is malformed. | 1510 /// requested course or course work, return the requested student submission, |
| 1459 * * `NOT_FOUND` if the requested course, course work, or student submission | 1511 /// or for access errors. |
| 1460 * does not exist. | 1512 /// * `INVALID_ARGUMENT` if the request is malformed. |
| 1461 * | 1513 /// * `NOT_FOUND` if the requested course, course work, or student submission |
| 1462 * [request] - The metadata request object. | 1514 /// does not exist. |
| 1463 * | 1515 /// |
| 1464 * Request parameters: | 1516 /// [request] - The metadata request object. |
| 1465 * | 1517 /// |
| 1466 * [courseId] - Identifier of the course. | 1518 /// Request parameters: |
| 1467 * This identifier can be either the Classroom-assigned identifier or an | 1519 /// |
| 1468 * alias. | 1520 /// [courseId] - Identifier of the course. |
| 1469 * | 1521 /// This identifier can be either the Classroom-assigned identifier or an |
| 1470 * [courseWorkId] - Identifier of the course work. | 1522 /// alias. |
| 1471 * | 1523 /// |
| 1472 * [id] - Identifier of the student submission. | 1524 /// [courseWorkId] - Identifier of the course work. |
| 1473 * | 1525 /// |
| 1474 * Completes with a [Empty]. | 1526 /// [id] - Identifier of the student submission. |
| 1475 * | 1527 /// |
| 1476 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1528 /// Completes with a [Empty]. |
| 1477 * error. | 1529 /// |
| 1478 * | 1530 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 1479 * If the used [http.Client] completes with an error when making a REST call, | 1531 /// an error. |
| 1480 * this method will complete with the same error. | 1532 /// |
| 1481 */ | 1533 /// If the used [http.Client] completes with an error when making a REST |
| 1482 async.Future<Empty> return_(ReturnStudentSubmissionRequest request, core.Strin
g courseId, core.String courseWorkId, core.String id) { | 1534 /// call, this method will complete with the same error. |
| 1535 async.Future<Empty> return_(ReturnStudentSubmissionRequest request, |
| 1536 core.String courseId, core.String courseWorkId, core.String id) { |
| 1483 var _url = null; | 1537 var _url = null; |
| 1484 var _queryParams = new core.Map(); | 1538 var _queryParams = new core.Map(); |
| 1485 var _uploadMedia = null; | 1539 var _uploadMedia = null; |
| 1486 var _uploadOptions = null; | 1540 var _uploadOptions = null; |
| 1487 var _downloadOptions = commons.DownloadOptions.Metadata; | 1541 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1488 var _body = null; | 1542 var _body = null; |
| 1489 | 1543 |
| 1490 if (request != null) { | 1544 if (request != null) { |
| 1491 _body = convert.JSON.encode((request).toJson()); | 1545 _body = convert.JSON.encode((request).toJson()); |
| 1492 } | 1546 } |
| 1493 if (courseId == null) { | 1547 if (courseId == null) { |
| 1494 throw new core.ArgumentError("Parameter courseId is required."); | 1548 throw new core.ArgumentError("Parameter courseId is required."); |
| 1495 } | 1549 } |
| 1496 if (courseWorkId == null) { | 1550 if (courseWorkId == null) { |
| 1497 throw new core.ArgumentError("Parameter courseWorkId is required."); | 1551 throw new core.ArgumentError("Parameter courseWorkId is required."); |
| 1498 } | 1552 } |
| 1499 if (id == null) { | 1553 if (id == null) { |
| 1500 throw new core.ArgumentError("Parameter id is required."); | 1554 throw new core.ArgumentError("Parameter id is required."); |
| 1501 } | 1555 } |
| 1502 | 1556 |
| 1503 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$courseId') + '/course
Work/' + commons.Escaper.ecapeVariable('$courseWorkId') + '/studentSubmissions/'
+ commons.Escaper.ecapeVariable('$id') + ':return'; | 1557 _url = 'v1/courses/' + |
| 1558 commons.Escaper.ecapeVariable('$courseId') + |
| 1559 '/courseWork/' + |
| 1560 commons.Escaper.ecapeVariable('$courseWorkId') + |
| 1561 '/studentSubmissions/' + |
| 1562 commons.Escaper.ecapeVariable('$id') + |
| 1563 ':return'; |
| 1504 | 1564 |
| 1505 var _response = _requester.request(_url, | 1565 var _response = _requester.request(_url, "POST", |
| 1506 "POST", | 1566 body: _body, |
| 1507 body: _body, | 1567 queryParams: _queryParams, |
| 1508 queryParams: _queryParams, | 1568 uploadOptions: _uploadOptions, |
| 1509 uploadOptions: _uploadOptions, | 1569 uploadMedia: _uploadMedia, |
| 1510 uploadMedia: _uploadMedia, | 1570 downloadOptions: _downloadOptions); |
| 1511 downloadOptions: _downloadOptions); | |
| 1512 return _response.then((data) => new Empty.fromJson(data)); | 1571 return _response.then((data) => new Empty.fromJson(data)); |
| 1513 } | 1572 } |
| 1514 | 1573 |
| 1515 /** | 1574 /// Turns in a student submission. |
| 1516 * Turns in a student submission. | 1575 /// |
| 1517 * | 1576 /// Turning in a student submission transfers ownership of attached Drive |
| 1518 * Turning in a student submission transfers ownership of attached Drive | 1577 /// files to the teacher and may also update the submission state. |
| 1519 * files to the teacher and may also update the submission state. | 1578 /// |
| 1520 * | 1579 /// This may only be called by the student that owns the specified student |
| 1521 * This may only be called by the student that owns the specified student | 1580 /// submission. |
| 1522 * submission. | 1581 /// |
| 1523 * | 1582 /// This request must be made by the Developer Console project of the |
| 1524 * This request must be made by the Developer Console project of the | 1583 /// [OAuth client ID](https://support.google.com/cloud/answer/6158849) used |
| 1525 * [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to | 1584 /// to |
| 1526 * create the corresponding course work item. | 1585 /// create the corresponding course work item. |
| 1527 * | 1586 /// |
| 1528 * This method returns the following error codes: | 1587 /// This method returns the following error codes: |
| 1529 * | 1588 /// |
| 1530 * * `PERMISSION_DENIED` if the requesting user is not permitted to access the | 1589 /// * `PERMISSION_DENIED` if the requesting user is not permitted to access |
| 1531 * requested course or course work, turn in the requested student submission, | 1590 /// the |
| 1532 * or for access errors. | 1591 /// requested course or course work, turn in the requested student |
| 1533 * * `INVALID_ARGUMENT` if the request is malformed. | 1592 /// submission, |
| 1534 * * `NOT_FOUND` if the requested course, course work, or student submission | 1593 /// or for access errors. |
| 1535 * does not exist. | 1594 /// * `INVALID_ARGUMENT` if the request is malformed. |
| 1536 * | 1595 /// * `NOT_FOUND` if the requested course, course work, or student submission |
| 1537 * [request] - The metadata request object. | 1596 /// does not exist. |
| 1538 * | 1597 /// |
| 1539 * Request parameters: | 1598 /// [request] - The metadata request object. |
| 1540 * | 1599 /// |
| 1541 * [courseId] - Identifier of the course. | 1600 /// Request parameters: |
| 1542 * This identifier can be either the Classroom-assigned identifier or an | 1601 /// |
| 1543 * alias. | 1602 /// [courseId] - Identifier of the course. |
| 1544 * | 1603 /// This identifier can be either the Classroom-assigned identifier or an |
| 1545 * [courseWorkId] - Identifier of the course work. | 1604 /// alias. |
| 1546 * | 1605 /// |
| 1547 * [id] - Identifier of the student submission. | 1606 /// [courseWorkId] - Identifier of the course work. |
| 1548 * | 1607 /// |
| 1549 * Completes with a [Empty]. | 1608 /// [id] - Identifier of the student submission. |
| 1550 * | 1609 /// |
| 1551 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1610 /// Completes with a [Empty]. |
| 1552 * error. | 1611 /// |
| 1553 * | 1612 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 1554 * If the used [http.Client] completes with an error when making a REST call, | 1613 /// an error. |
| 1555 * this method will complete with the same error. | 1614 /// |
| 1556 */ | 1615 /// If the used [http.Client] completes with an error when making a REST |
| 1557 async.Future<Empty> turnIn(TurnInStudentSubmissionRequest request, core.String
courseId, core.String courseWorkId, core.String id) { | 1616 /// call, this method will complete with the same error. |
| 1617 async.Future<Empty> turnIn(TurnInStudentSubmissionRequest request, |
| 1618 core.String courseId, core.String courseWorkId, core.String id) { |
| 1558 var _url = null; | 1619 var _url = null; |
| 1559 var _queryParams = new core.Map(); | 1620 var _queryParams = new core.Map(); |
| 1560 var _uploadMedia = null; | 1621 var _uploadMedia = null; |
| 1561 var _uploadOptions = null; | 1622 var _uploadOptions = null; |
| 1562 var _downloadOptions = commons.DownloadOptions.Metadata; | 1623 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1563 var _body = null; | 1624 var _body = null; |
| 1564 | 1625 |
| 1565 if (request != null) { | 1626 if (request != null) { |
| 1566 _body = convert.JSON.encode((request).toJson()); | 1627 _body = convert.JSON.encode((request).toJson()); |
| 1567 } | 1628 } |
| 1568 if (courseId == null) { | 1629 if (courseId == null) { |
| 1569 throw new core.ArgumentError("Parameter courseId is required."); | 1630 throw new core.ArgumentError("Parameter courseId is required."); |
| 1570 } | 1631 } |
| 1571 if (courseWorkId == null) { | 1632 if (courseWorkId == null) { |
| 1572 throw new core.ArgumentError("Parameter courseWorkId is required."); | 1633 throw new core.ArgumentError("Parameter courseWorkId is required."); |
| 1573 } | 1634 } |
| 1574 if (id == null) { | 1635 if (id == null) { |
| 1575 throw new core.ArgumentError("Parameter id is required."); | 1636 throw new core.ArgumentError("Parameter id is required."); |
| 1576 } | 1637 } |
| 1577 | 1638 |
| 1578 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$courseId') + '/course
Work/' + commons.Escaper.ecapeVariable('$courseWorkId') + '/studentSubmissions/'
+ commons.Escaper.ecapeVariable('$id') + ':turnIn'; | 1639 _url = 'v1/courses/' + |
| 1640 commons.Escaper.ecapeVariable('$courseId') + |
| 1641 '/courseWork/' + |
| 1642 commons.Escaper.ecapeVariable('$courseWorkId') + |
| 1643 '/studentSubmissions/' + |
| 1644 commons.Escaper.ecapeVariable('$id') + |
| 1645 ':turnIn'; |
| 1579 | 1646 |
| 1580 var _response = _requester.request(_url, | 1647 var _response = _requester.request(_url, "POST", |
| 1581 "POST", | 1648 body: _body, |
| 1582 body: _body, | 1649 queryParams: _queryParams, |
| 1583 queryParams: _queryParams, | 1650 uploadOptions: _uploadOptions, |
| 1584 uploadOptions: _uploadOptions, | 1651 uploadMedia: _uploadMedia, |
| 1585 uploadMedia: _uploadMedia, | 1652 downloadOptions: _downloadOptions); |
| 1586 downloadOptions: _downloadOptions); | |
| 1587 return _response.then((data) => new Empty.fromJson(data)); | 1653 return _response.then((data) => new Empty.fromJson(data)); |
| 1588 } | 1654 } |
| 1589 | |
| 1590 } | 1655 } |
| 1591 | 1656 |
| 1592 | |
| 1593 class CoursesStudentsResourceApi { | 1657 class CoursesStudentsResourceApi { |
| 1594 final commons.ApiRequester _requester; | 1658 final commons.ApiRequester _requester; |
| 1595 | 1659 |
| 1596 CoursesStudentsResourceApi(commons.ApiRequester client) : | 1660 CoursesStudentsResourceApi(commons.ApiRequester client) : _requester = client; |
| 1597 _requester = client; | |
| 1598 | 1661 |
| 1599 /** | 1662 /// Adds a user as a student of a course. |
| 1600 * Adds a user as a student of a course. | 1663 /// |
| 1601 * | 1664 /// This method returns the following error codes: |
| 1602 * This method returns the following error codes: | 1665 /// |
| 1603 * | 1666 /// * `PERMISSION_DENIED` if the requesting user is not permitted to create |
| 1604 * * `PERMISSION_DENIED` if the requesting user is not permitted to create | 1667 /// students in this course or for access errors. |
| 1605 * students in this course or for access errors. | 1668 /// * `NOT_FOUND` if the requested course ID does not exist. |
| 1606 * * `NOT_FOUND` if the requested course ID does not exist. | 1669 /// * `FAILED_PRECONDITION` if the requested user's account is disabled, |
| 1607 * * `FAILED_PRECONDITION` if the requested user's account is disabled, | 1670 /// for the following request errors: |
| 1608 * for the following request errors: | 1671 /// * CourseMemberLimitReached |
| 1609 * * CourseMemberLimitReached | 1672 /// * CourseNotModifiable |
| 1610 * * CourseNotModifiable | 1673 /// * UserGroupsMembershipLimitReached |
| 1611 * * UserGroupsMembershipLimitReached | 1674 /// * `ALREADY_EXISTS` if the user is already a student or teacher in the |
| 1612 * * `ALREADY_EXISTS` if the user is already a student or teacher in the | 1675 /// course. |
| 1613 * course. | 1676 /// |
| 1614 * | 1677 /// [request] - The metadata request object. |
| 1615 * [request] - The metadata request object. | 1678 /// |
| 1616 * | 1679 /// Request parameters: |
| 1617 * Request parameters: | 1680 /// |
| 1618 * | 1681 /// [courseId] - Identifier of the course to create the student in. |
| 1619 * [courseId] - Identifier of the course to create the student in. | 1682 /// This identifier can be either the Classroom-assigned identifier or an |
| 1620 * This identifier can be either the Classroom-assigned identifier or an | 1683 /// alias. |
| 1621 * alias. | 1684 /// |
| 1622 * | 1685 /// [enrollmentCode] - Enrollment code of the course to create the student |
| 1623 * [enrollmentCode] - Enrollment code of the course to create the student in. | 1686 /// in. |
| 1624 * This code is required if userId | 1687 /// This code is required if userId |
| 1625 * corresponds to the requesting user; it may be omitted if the requesting | 1688 /// corresponds to the requesting user; it may be omitted if the requesting |
| 1626 * user has administrative permissions to create students for any user. | 1689 /// user has administrative permissions to create students for any user. |
| 1627 * | 1690 /// |
| 1628 * Completes with a [Student]. | 1691 /// Completes with a [Student]. |
| 1629 * | 1692 /// |
| 1630 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1693 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 1631 * error. | 1694 /// an error. |
| 1632 * | 1695 /// |
| 1633 * If the used [http.Client] completes with an error when making a REST call, | 1696 /// If the used [http.Client] completes with an error when making a REST |
| 1634 * this method will complete with the same error. | 1697 /// call, this method will complete with the same error. |
| 1635 */ | 1698 async.Future<Student> create(Student request, core.String courseId, |
| 1636 async.Future<Student> create(Student request, core.String courseId, {core.Stri
ng enrollmentCode}) { | 1699 {core.String enrollmentCode}) { |
| 1637 var _url = null; | 1700 var _url = null; |
| 1638 var _queryParams = new core.Map(); | 1701 var _queryParams = new core.Map(); |
| 1639 var _uploadMedia = null; | 1702 var _uploadMedia = null; |
| 1640 var _uploadOptions = null; | 1703 var _uploadOptions = null; |
| 1641 var _downloadOptions = commons.DownloadOptions.Metadata; | 1704 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1642 var _body = null; | 1705 var _body = null; |
| 1643 | 1706 |
| 1644 if (request != null) { | 1707 if (request != null) { |
| 1645 _body = convert.JSON.encode((request).toJson()); | 1708 _body = convert.JSON.encode((request).toJson()); |
| 1646 } | 1709 } |
| 1647 if (courseId == null) { | 1710 if (courseId == null) { |
| 1648 throw new core.ArgumentError("Parameter courseId is required."); | 1711 throw new core.ArgumentError("Parameter courseId is required."); |
| 1649 } | 1712 } |
| 1650 if (enrollmentCode != null) { | 1713 if (enrollmentCode != null) { |
| 1651 _queryParams["enrollmentCode"] = [enrollmentCode]; | 1714 _queryParams["enrollmentCode"] = [enrollmentCode]; |
| 1652 } | 1715 } |
| 1653 | 1716 |
| 1654 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$courseId') + '/studen
ts'; | 1717 _url = 'v1/courses/' + |
| 1718 commons.Escaper.ecapeVariable('$courseId') + |
| 1719 '/students'; |
| 1655 | 1720 |
| 1656 var _response = _requester.request(_url, | 1721 var _response = _requester.request(_url, "POST", |
| 1657 "POST", | 1722 body: _body, |
| 1658 body: _body, | 1723 queryParams: _queryParams, |
| 1659 queryParams: _queryParams, | 1724 uploadOptions: _uploadOptions, |
| 1660 uploadOptions: _uploadOptions, | 1725 uploadMedia: _uploadMedia, |
| 1661 uploadMedia: _uploadMedia, | 1726 downloadOptions: _downloadOptions); |
| 1662 downloadOptions: _downloadOptions); | |
| 1663 return _response.then((data) => new Student.fromJson(data)); | 1727 return _response.then((data) => new Student.fromJson(data)); |
| 1664 } | 1728 } |
| 1665 | 1729 |
| 1666 /** | 1730 /// Deletes a student of a course. |
| 1667 * Deletes a student of a course. | 1731 /// |
| 1668 * | 1732 /// This method returns the following error codes: |
| 1669 * This method returns the following error codes: | 1733 /// |
| 1670 * | 1734 /// * `PERMISSION_DENIED` if the requesting user is not permitted to delete |
| 1671 * * `PERMISSION_DENIED` if the requesting user is not permitted to delete | 1735 /// students of this course or for access errors. |
| 1672 * students of this course or for access errors. | 1736 /// * `NOT_FOUND` if no student of this course has the requested ID or if the |
| 1673 * * `NOT_FOUND` if no student of this course has the requested ID or if the | 1737 /// course does not exist. |
| 1674 * course does not exist. | 1738 /// |
| 1675 * | 1739 /// Request parameters: |
| 1676 * Request parameters: | 1740 /// |
| 1677 * | 1741 /// [courseId] - Identifier of the course. |
| 1678 * [courseId] - Identifier of the course. | 1742 /// This identifier can be either the Classroom-assigned identifier or an |
| 1679 * This identifier can be either the Classroom-assigned identifier or an | 1743 /// alias. |
| 1680 * alias. | 1744 /// |
| 1681 * | 1745 /// [userId] - Identifier of the student to delete. The identifier can be one |
| 1682 * [userId] - Identifier of the student to delete. The identifier can be one | 1746 /// of the |
| 1683 * of the | 1747 /// following: |
| 1684 * following: | 1748 /// |
| 1685 * | 1749 /// * the numeric identifier for the user |
| 1686 * * the numeric identifier for the user | 1750 /// * the email address of the user |
| 1687 * * the email address of the user | 1751 /// * the string literal `"me"`, indicating the requesting user |
| 1688 * * the string literal `"me"`, indicating the requesting user | 1752 /// |
| 1689 * | 1753 /// Completes with a [Empty]. |
| 1690 * Completes with a [Empty]. | 1754 /// |
| 1691 * | 1755 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 1692 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1756 /// an error. |
| 1693 * error. | 1757 /// |
| 1694 * | 1758 /// If the used [http.Client] completes with an error when making a REST |
| 1695 * If the used [http.Client] completes with an error when making a REST call, | 1759 /// call, this method will complete with the same error. |
| 1696 * this method will complete with the same error. | |
| 1697 */ | |
| 1698 async.Future<Empty> delete(core.String courseId, core.String userId) { | 1760 async.Future<Empty> delete(core.String courseId, core.String userId) { |
| 1699 var _url = null; | 1761 var _url = null; |
| 1700 var _queryParams = new core.Map(); | 1762 var _queryParams = new core.Map(); |
| 1701 var _uploadMedia = null; | 1763 var _uploadMedia = null; |
| 1702 var _uploadOptions = null; | 1764 var _uploadOptions = null; |
| 1703 var _downloadOptions = commons.DownloadOptions.Metadata; | 1765 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1704 var _body = null; | 1766 var _body = null; |
| 1705 | 1767 |
| 1706 if (courseId == null) { | 1768 if (courseId == null) { |
| 1707 throw new core.ArgumentError("Parameter courseId is required."); | 1769 throw new core.ArgumentError("Parameter courseId is required."); |
| 1708 } | 1770 } |
| 1709 if (userId == null) { | 1771 if (userId == null) { |
| 1710 throw new core.ArgumentError("Parameter userId is required."); | 1772 throw new core.ArgumentError("Parameter userId is required."); |
| 1711 } | 1773 } |
| 1712 | 1774 |
| 1713 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$courseId') + '/studen
ts/' + commons.Escaper.ecapeVariable('$userId'); | 1775 _url = 'v1/courses/' + |
| 1776 commons.Escaper.ecapeVariable('$courseId') + |
| 1777 '/students/' + |
| 1778 commons.Escaper.ecapeVariable('$userId'); |
| 1714 | 1779 |
| 1715 var _response = _requester.request(_url, | 1780 var _response = _requester.request(_url, "DELETE", |
| 1716 "DELETE", | 1781 body: _body, |
| 1717 body: _body, | 1782 queryParams: _queryParams, |
| 1718 queryParams: _queryParams, | 1783 uploadOptions: _uploadOptions, |
| 1719 uploadOptions: _uploadOptions, | 1784 uploadMedia: _uploadMedia, |
| 1720 uploadMedia: _uploadMedia, | 1785 downloadOptions: _downloadOptions); |
| 1721 downloadOptions: _downloadOptions); | |
| 1722 return _response.then((data) => new Empty.fromJson(data)); | 1786 return _response.then((data) => new Empty.fromJson(data)); |
| 1723 } | 1787 } |
| 1724 | 1788 |
| 1725 /** | 1789 /// Returns a student of a course. |
| 1726 * Returns a student of a course. | 1790 /// |
| 1727 * | 1791 /// This method returns the following error codes: |
| 1728 * This method returns the following error codes: | 1792 /// |
| 1729 * | 1793 /// * `PERMISSION_DENIED` if the requesting user is not permitted to view |
| 1730 * * `PERMISSION_DENIED` if the requesting user is not permitted to view | 1794 /// students of this course or for access errors. |
| 1731 * students of this course or for access errors. | 1795 /// * `NOT_FOUND` if no student of this course has the requested ID or if the |
| 1732 * * `NOT_FOUND` if no student of this course has the requested ID or if the | 1796 /// course does not exist. |
| 1733 * course does not exist. | 1797 /// |
| 1734 * | 1798 /// Request parameters: |
| 1735 * Request parameters: | 1799 /// |
| 1736 * | 1800 /// [courseId] - Identifier of the course. |
| 1737 * [courseId] - Identifier of the course. | 1801 /// This identifier can be either the Classroom-assigned identifier or an |
| 1738 * This identifier can be either the Classroom-assigned identifier or an | 1802 /// alias. |
| 1739 * alias. | 1803 /// |
| 1740 * | 1804 /// [userId] - Identifier of the student to return. The identifier can be one |
| 1741 * [userId] - Identifier of the student to return. The identifier can be one | 1805 /// of the |
| 1742 * of the | 1806 /// following: |
| 1743 * following: | 1807 /// |
| 1744 * | 1808 /// * the numeric identifier for the user |
| 1745 * * the numeric identifier for the user | 1809 /// * the email address of the user |
| 1746 * * the email address of the user | 1810 /// * the string literal `"me"`, indicating the requesting user |
| 1747 * * the string literal `"me"`, indicating the requesting user | 1811 /// |
| 1748 * | 1812 /// Completes with a [Student]. |
| 1749 * Completes with a [Student]. | 1813 /// |
| 1750 * | 1814 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 1751 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1815 /// an error. |
| 1752 * error. | 1816 /// |
| 1753 * | 1817 /// If the used [http.Client] completes with an error when making a REST |
| 1754 * If the used [http.Client] completes with an error when making a REST call, | 1818 /// call, this method will complete with the same error. |
| 1755 * this method will complete with the same error. | |
| 1756 */ | |
| 1757 async.Future<Student> get(core.String courseId, core.String userId) { | 1819 async.Future<Student> get(core.String courseId, core.String userId) { |
| 1758 var _url = null; | 1820 var _url = null; |
| 1759 var _queryParams = new core.Map(); | 1821 var _queryParams = new core.Map(); |
| 1760 var _uploadMedia = null; | 1822 var _uploadMedia = null; |
| 1761 var _uploadOptions = null; | 1823 var _uploadOptions = null; |
| 1762 var _downloadOptions = commons.DownloadOptions.Metadata; | 1824 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1763 var _body = null; | 1825 var _body = null; |
| 1764 | 1826 |
| 1765 if (courseId == null) { | 1827 if (courseId == null) { |
| 1766 throw new core.ArgumentError("Parameter courseId is required."); | 1828 throw new core.ArgumentError("Parameter courseId is required."); |
| 1767 } | 1829 } |
| 1768 if (userId == null) { | 1830 if (userId == null) { |
| 1769 throw new core.ArgumentError("Parameter userId is required."); | 1831 throw new core.ArgumentError("Parameter userId is required."); |
| 1770 } | 1832 } |
| 1771 | 1833 |
| 1772 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$courseId') + '/studen
ts/' + commons.Escaper.ecapeVariable('$userId'); | 1834 _url = 'v1/courses/' + |
| 1835 commons.Escaper.ecapeVariable('$courseId') + |
| 1836 '/students/' + |
| 1837 commons.Escaper.ecapeVariable('$userId'); |
| 1773 | 1838 |
| 1774 var _response = _requester.request(_url, | 1839 var _response = _requester.request(_url, "GET", |
| 1775 "GET", | 1840 body: _body, |
| 1776 body: _body, | 1841 queryParams: _queryParams, |
| 1777 queryParams: _queryParams, | 1842 uploadOptions: _uploadOptions, |
| 1778 uploadOptions: _uploadOptions, | 1843 uploadMedia: _uploadMedia, |
| 1779 uploadMedia: _uploadMedia, | 1844 downloadOptions: _downloadOptions); |
| 1780 downloadOptions: _downloadOptions); | |
| 1781 return _response.then((data) => new Student.fromJson(data)); | 1845 return _response.then((data) => new Student.fromJson(data)); |
| 1782 } | 1846 } |
| 1783 | 1847 |
| 1784 /** | 1848 /// Returns a list of students of this course that the requester |
| 1785 * Returns a list of students of this course that the requester | 1849 /// is permitted to view. |
| 1786 * is permitted to view. | 1850 /// |
| 1787 * | 1851 /// This method returns the following error codes: |
| 1788 * This method returns the following error codes: | 1852 /// |
| 1789 * | 1853 /// * `NOT_FOUND` if the course does not exist. |
| 1790 * * `NOT_FOUND` if the course does not exist. | 1854 /// * `PERMISSION_DENIED` for access errors. |
| 1791 * * `PERMISSION_DENIED` for access errors. | 1855 /// |
| 1792 * | 1856 /// Request parameters: |
| 1793 * Request parameters: | 1857 /// |
| 1794 * | 1858 /// [courseId] - Identifier of the course. |
| 1795 * [courseId] - Identifier of the course. | 1859 /// This identifier can be either the Classroom-assigned identifier or an |
| 1796 * This identifier can be either the Classroom-assigned identifier or an | 1860 /// alias. |
| 1797 * alias. | 1861 /// |
| 1798 * | 1862 /// [pageToken] - nextPageToken |
| 1799 * [pageToken] - nextPageToken | 1863 /// value returned from a previous |
| 1800 * value returned from a previous | 1864 /// list call, indicating that |
| 1801 * list call, indicating that | 1865 /// the subsequent page of results should be returned. |
| 1802 * the subsequent page of results should be returned. | 1866 /// |
| 1803 * | 1867 /// The list request must be |
| 1804 * The list request must be | 1868 /// otherwise identical to the one that resulted in this token. |
| 1805 * otherwise identical to the one that resulted in this token. | 1869 /// |
| 1806 * | 1870 /// [pageSize] - Maximum number of items to return. Zero means no maximum. |
| 1807 * [pageSize] - Maximum number of items to return. Zero means no maximum. | 1871 /// |
| 1808 * | 1872 /// The server may return fewer than the specified number of results. |
| 1809 * The server may return fewer than the specified number of results. | 1873 /// |
| 1810 * | 1874 /// Completes with a [ListStudentsResponse]. |
| 1811 * Completes with a [ListStudentsResponse]. | 1875 /// |
| 1812 * | 1876 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 1813 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1877 /// an error. |
| 1814 * error. | 1878 /// |
| 1815 * | 1879 /// If the used [http.Client] completes with an error when making a REST |
| 1816 * If the used [http.Client] completes with an error when making a REST call, | 1880 /// call, this method will complete with the same error. |
| 1817 * this method will complete with the same error. | 1881 async.Future<ListStudentsResponse> list(core.String courseId, |
| 1818 */ | 1882 {core.String pageToken, core.int pageSize}) { |
| 1819 async.Future<ListStudentsResponse> list(core.String courseId, {core.String pag
eToken, core.int pageSize}) { | |
| 1820 var _url = null; | 1883 var _url = null; |
| 1821 var _queryParams = new core.Map(); | 1884 var _queryParams = new core.Map(); |
| 1822 var _uploadMedia = null; | 1885 var _uploadMedia = null; |
| 1823 var _uploadOptions = null; | 1886 var _uploadOptions = null; |
| 1824 var _downloadOptions = commons.DownloadOptions.Metadata; | 1887 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1825 var _body = null; | 1888 var _body = null; |
| 1826 | 1889 |
| 1827 if (courseId == null) { | 1890 if (courseId == null) { |
| 1828 throw new core.ArgumentError("Parameter courseId is required."); | 1891 throw new core.ArgumentError("Parameter courseId is required."); |
| 1829 } | 1892 } |
| 1830 if (pageToken != null) { | 1893 if (pageToken != null) { |
| 1831 _queryParams["pageToken"] = [pageToken]; | 1894 _queryParams["pageToken"] = [pageToken]; |
| 1832 } | 1895 } |
| 1833 if (pageSize != null) { | 1896 if (pageSize != null) { |
| 1834 _queryParams["pageSize"] = ["${pageSize}"]; | 1897 _queryParams["pageSize"] = ["${pageSize}"]; |
| 1835 } | 1898 } |
| 1836 | 1899 |
| 1837 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$courseId') + '/studen
ts'; | 1900 _url = 'v1/courses/' + |
| 1901 commons.Escaper.ecapeVariable('$courseId') + |
| 1902 '/students'; |
| 1838 | 1903 |
| 1839 var _response = _requester.request(_url, | 1904 var _response = _requester.request(_url, "GET", |
| 1840 "GET", | 1905 body: _body, |
| 1841 body: _body, | 1906 queryParams: _queryParams, |
| 1842 queryParams: _queryParams, | 1907 uploadOptions: _uploadOptions, |
| 1843 uploadOptions: _uploadOptions, | 1908 uploadMedia: _uploadMedia, |
| 1844 uploadMedia: _uploadMedia, | 1909 downloadOptions: _downloadOptions); |
| 1845 downloadOptions: _downloadOptions); | |
| 1846 return _response.then((data) => new ListStudentsResponse.fromJson(data)); | 1910 return _response.then((data) => new ListStudentsResponse.fromJson(data)); |
| 1847 } | 1911 } |
| 1848 | |
| 1849 } | 1912 } |
| 1850 | 1913 |
| 1851 | |
| 1852 class CoursesTeachersResourceApi { | 1914 class CoursesTeachersResourceApi { |
| 1853 final commons.ApiRequester _requester; | 1915 final commons.ApiRequester _requester; |
| 1854 | 1916 |
| 1855 CoursesTeachersResourceApi(commons.ApiRequester client) : | 1917 CoursesTeachersResourceApi(commons.ApiRequester client) : _requester = client; |
| 1856 _requester = client; | |
| 1857 | 1918 |
| 1858 /** | 1919 /// Creates a teacher of a course. |
| 1859 * Creates a teacher of a course. | 1920 /// |
| 1860 * | 1921 /// This method returns the following error codes: |
| 1861 * This method returns the following error codes: | 1922 /// |
| 1862 * | 1923 /// * `PERMISSION_DENIED` if the requesting user is not permitted to create |
| 1863 * * `PERMISSION_DENIED` if the requesting user is not permitted to create | 1924 /// teachers in this course or for access errors. |
| 1864 * teachers in this course or for access errors. | 1925 /// * `NOT_FOUND` if the requested course ID does not exist. |
| 1865 * * `NOT_FOUND` if the requested course ID does not exist. | 1926 /// * `FAILED_PRECONDITION` if the requested user's account is disabled, |
| 1866 * * `FAILED_PRECONDITION` if the requested user's account is disabled, | 1927 /// for the following request errors: |
| 1867 * for the following request errors: | 1928 /// * CourseMemberLimitReached |
| 1868 * * CourseMemberLimitReached | 1929 /// * CourseNotModifiable |
| 1869 * * CourseNotModifiable | 1930 /// * CourseTeacherLimitReached |
| 1870 * * CourseTeacherLimitReached | 1931 /// * UserGroupsMembershipLimitReached |
| 1871 * * UserGroupsMembershipLimitReached | 1932 /// * `ALREADY_EXISTS` if the user is already a teacher or student in the |
| 1872 * * `ALREADY_EXISTS` if the user is already a teacher or student in the | 1933 /// course. |
| 1873 * course. | 1934 /// |
| 1874 * | 1935 /// [request] - The metadata request object. |
| 1875 * [request] - The metadata request object. | 1936 /// |
| 1876 * | 1937 /// Request parameters: |
| 1877 * Request parameters: | 1938 /// |
| 1878 * | 1939 /// [courseId] - Identifier of the course. |
| 1879 * [courseId] - Identifier of the course. | 1940 /// This identifier can be either the Classroom-assigned identifier or an |
| 1880 * This identifier can be either the Classroom-assigned identifier or an | 1941 /// alias. |
| 1881 * alias. | 1942 /// |
| 1882 * | 1943 /// Completes with a [Teacher]. |
| 1883 * Completes with a [Teacher]. | 1944 /// |
| 1884 * | 1945 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 1885 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 1946 /// an error. |
| 1886 * error. | 1947 /// |
| 1887 * | 1948 /// If the used [http.Client] completes with an error when making a REST |
| 1888 * If the used [http.Client] completes with an error when making a REST call, | 1949 /// call, this method will complete with the same error. |
| 1889 * this method will complete with the same error. | |
| 1890 */ | |
| 1891 async.Future<Teacher> create(Teacher request, core.String courseId) { | 1950 async.Future<Teacher> create(Teacher request, core.String courseId) { |
| 1892 var _url = null; | 1951 var _url = null; |
| 1893 var _queryParams = new core.Map(); | 1952 var _queryParams = new core.Map(); |
| 1894 var _uploadMedia = null; | 1953 var _uploadMedia = null; |
| 1895 var _uploadOptions = null; | 1954 var _uploadOptions = null; |
| 1896 var _downloadOptions = commons.DownloadOptions.Metadata; | 1955 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1897 var _body = null; | 1956 var _body = null; |
| 1898 | 1957 |
| 1899 if (request != null) { | 1958 if (request != null) { |
| 1900 _body = convert.JSON.encode((request).toJson()); | 1959 _body = convert.JSON.encode((request).toJson()); |
| 1901 } | 1960 } |
| 1902 if (courseId == null) { | 1961 if (courseId == null) { |
| 1903 throw new core.ArgumentError("Parameter courseId is required."); | 1962 throw new core.ArgumentError("Parameter courseId is required."); |
| 1904 } | 1963 } |
| 1905 | 1964 |
| 1906 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$courseId') + '/teache
rs'; | 1965 _url = 'v1/courses/' + |
| 1966 commons.Escaper.ecapeVariable('$courseId') + |
| 1967 '/teachers'; |
| 1907 | 1968 |
| 1908 var _response = _requester.request(_url, | 1969 var _response = _requester.request(_url, "POST", |
| 1909 "POST", | 1970 body: _body, |
| 1910 body: _body, | 1971 queryParams: _queryParams, |
| 1911 queryParams: _queryParams, | 1972 uploadOptions: _uploadOptions, |
| 1912 uploadOptions: _uploadOptions, | 1973 uploadMedia: _uploadMedia, |
| 1913 uploadMedia: _uploadMedia, | 1974 downloadOptions: _downloadOptions); |
| 1914 downloadOptions: _downloadOptions); | |
| 1915 return _response.then((data) => new Teacher.fromJson(data)); | 1975 return _response.then((data) => new Teacher.fromJson(data)); |
| 1916 } | 1976 } |
| 1917 | 1977 |
| 1918 /** | 1978 /// Deletes a teacher of a course. |
| 1919 * Deletes a teacher of a course. | 1979 /// |
| 1920 * | 1980 /// This method returns the following error codes: |
| 1921 * This method returns the following error codes: | 1981 /// |
| 1922 * | 1982 /// * `PERMISSION_DENIED` if the requesting user is not permitted to delete |
| 1923 * * `PERMISSION_DENIED` if the requesting user is not permitted to delete | 1983 /// teachers of this course or for access errors. |
| 1924 * teachers of this course or for access errors. | 1984 /// * `NOT_FOUND` if no teacher of this course has the requested ID or if the |
| 1925 * * `NOT_FOUND` if no teacher of this course has the requested ID or if the | 1985 /// course does not exist. |
| 1926 * course does not exist. | 1986 /// * `FAILED_PRECONDITION` if the requested ID belongs to the primary |
| 1927 * * `FAILED_PRECONDITION` if the requested ID belongs to the primary teacher | 1987 /// teacher |
| 1928 * of this course. | 1988 /// of this course. |
| 1929 * | 1989 /// |
| 1930 * Request parameters: | 1990 /// Request parameters: |
| 1931 * | 1991 /// |
| 1932 * [courseId] - Identifier of the course. | 1992 /// [courseId] - Identifier of the course. |
| 1933 * This identifier can be either the Classroom-assigned identifier or an | 1993 /// This identifier can be either the Classroom-assigned identifier or an |
| 1934 * alias. | 1994 /// alias. |
| 1935 * | 1995 /// |
| 1936 * [userId] - Identifier of the teacher to delete. The identifier can be one | 1996 /// [userId] - Identifier of the teacher to delete. The identifier can be one |
| 1937 * of the | 1997 /// of the |
| 1938 * following: | 1998 /// following: |
| 1939 * | 1999 /// |
| 1940 * * the numeric identifier for the user | 2000 /// * the numeric identifier for the user |
| 1941 * * the email address of the user | 2001 /// * the email address of the user |
| 1942 * * the string literal `"me"`, indicating the requesting user | 2002 /// * the string literal `"me"`, indicating the requesting user |
| 1943 * | 2003 /// |
| 1944 * Completes with a [Empty]. | 2004 /// Completes with a [Empty]. |
| 1945 * | 2005 /// |
| 1946 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2006 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 1947 * error. | 2007 /// an error. |
| 1948 * | 2008 /// |
| 1949 * If the used [http.Client] completes with an error when making a REST call, | 2009 /// If the used [http.Client] completes with an error when making a REST |
| 1950 * this method will complete with the same error. | 2010 /// call, this method will complete with the same error. |
| 1951 */ | |
| 1952 async.Future<Empty> delete(core.String courseId, core.String userId) { | 2011 async.Future<Empty> delete(core.String courseId, core.String userId) { |
| 1953 var _url = null; | 2012 var _url = null; |
| 1954 var _queryParams = new core.Map(); | 2013 var _queryParams = new core.Map(); |
| 1955 var _uploadMedia = null; | 2014 var _uploadMedia = null; |
| 1956 var _uploadOptions = null; | 2015 var _uploadOptions = null; |
| 1957 var _downloadOptions = commons.DownloadOptions.Metadata; | 2016 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 1958 var _body = null; | 2017 var _body = null; |
| 1959 | 2018 |
| 1960 if (courseId == null) { | 2019 if (courseId == null) { |
| 1961 throw new core.ArgumentError("Parameter courseId is required."); | 2020 throw new core.ArgumentError("Parameter courseId is required."); |
| 1962 } | 2021 } |
| 1963 if (userId == null) { | 2022 if (userId == null) { |
| 1964 throw new core.ArgumentError("Parameter userId is required."); | 2023 throw new core.ArgumentError("Parameter userId is required."); |
| 1965 } | 2024 } |
| 1966 | 2025 |
| 1967 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$courseId') + '/teache
rs/' + commons.Escaper.ecapeVariable('$userId'); | 2026 _url = 'v1/courses/' + |
| 2027 commons.Escaper.ecapeVariable('$courseId') + |
| 2028 '/teachers/' + |
| 2029 commons.Escaper.ecapeVariable('$userId'); |
| 1968 | 2030 |
| 1969 var _response = _requester.request(_url, | 2031 var _response = _requester.request(_url, "DELETE", |
| 1970 "DELETE", | 2032 body: _body, |
| 1971 body: _body, | 2033 queryParams: _queryParams, |
| 1972 queryParams: _queryParams, | 2034 uploadOptions: _uploadOptions, |
| 1973 uploadOptions: _uploadOptions, | 2035 uploadMedia: _uploadMedia, |
| 1974 uploadMedia: _uploadMedia, | 2036 downloadOptions: _downloadOptions); |
| 1975 downloadOptions: _downloadOptions); | |
| 1976 return _response.then((data) => new Empty.fromJson(data)); | 2037 return _response.then((data) => new Empty.fromJson(data)); |
| 1977 } | 2038 } |
| 1978 | 2039 |
| 1979 /** | 2040 /// Returns a teacher of a course. |
| 1980 * Returns a teacher of a course. | 2041 /// |
| 1981 * | 2042 /// This method returns the following error codes: |
| 1982 * This method returns the following error codes: | 2043 /// |
| 1983 * | 2044 /// * `PERMISSION_DENIED` if the requesting user is not permitted to view |
| 1984 * * `PERMISSION_DENIED` if the requesting user is not permitted to view | 2045 /// teachers of this course or for access errors. |
| 1985 * teachers of this course or for access errors. | 2046 /// * `NOT_FOUND` if no teacher of this course has the requested ID or if the |
| 1986 * * `NOT_FOUND` if no teacher of this course has the requested ID or if the | 2047 /// course does not exist. |
| 1987 * course does not exist. | 2048 /// |
| 1988 * | 2049 /// Request parameters: |
| 1989 * Request parameters: | 2050 /// |
| 1990 * | 2051 /// [courseId] - Identifier of the course. |
| 1991 * [courseId] - Identifier of the course. | 2052 /// This identifier can be either the Classroom-assigned identifier or an |
| 1992 * This identifier can be either the Classroom-assigned identifier or an | 2053 /// alias. |
| 1993 * alias. | 2054 /// |
| 1994 * | 2055 /// [userId] - Identifier of the teacher to return. The identifier can be one |
| 1995 * [userId] - Identifier of the teacher to return. The identifier can be one | 2056 /// of the |
| 1996 * of the | 2057 /// following: |
| 1997 * following: | 2058 /// |
| 1998 * | 2059 /// * the numeric identifier for the user |
| 1999 * * the numeric identifier for the user | 2060 /// * the email address of the user |
| 2000 * * the email address of the user | 2061 /// * the string literal `"me"`, indicating the requesting user |
| 2001 * * the string literal `"me"`, indicating the requesting user | 2062 /// |
| 2002 * | 2063 /// Completes with a [Teacher]. |
| 2003 * Completes with a [Teacher]. | 2064 /// |
| 2004 * | 2065 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 2005 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2066 /// an error. |
| 2006 * error. | 2067 /// |
| 2007 * | 2068 /// If the used [http.Client] completes with an error when making a REST |
| 2008 * If the used [http.Client] completes with an error when making a REST call, | 2069 /// call, this method will complete with the same error. |
| 2009 * this method will complete with the same error. | |
| 2010 */ | |
| 2011 async.Future<Teacher> get(core.String courseId, core.String userId) { | 2070 async.Future<Teacher> get(core.String courseId, core.String userId) { |
| 2012 var _url = null; | 2071 var _url = null; |
| 2013 var _queryParams = new core.Map(); | 2072 var _queryParams = new core.Map(); |
| 2014 var _uploadMedia = null; | 2073 var _uploadMedia = null; |
| 2015 var _uploadOptions = null; | 2074 var _uploadOptions = null; |
| 2016 var _downloadOptions = commons.DownloadOptions.Metadata; | 2075 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 2017 var _body = null; | 2076 var _body = null; |
| 2018 | 2077 |
| 2019 if (courseId == null) { | 2078 if (courseId == null) { |
| 2020 throw new core.ArgumentError("Parameter courseId is required."); | 2079 throw new core.ArgumentError("Parameter courseId is required."); |
| 2021 } | 2080 } |
| 2022 if (userId == null) { | 2081 if (userId == null) { |
| 2023 throw new core.ArgumentError("Parameter userId is required."); | 2082 throw new core.ArgumentError("Parameter userId is required."); |
| 2024 } | 2083 } |
| 2025 | 2084 |
| 2026 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$courseId') + '/teache
rs/' + commons.Escaper.ecapeVariable('$userId'); | 2085 _url = 'v1/courses/' + |
| 2086 commons.Escaper.ecapeVariable('$courseId') + |
| 2087 '/teachers/' + |
| 2088 commons.Escaper.ecapeVariable('$userId'); |
| 2027 | 2089 |
| 2028 var _response = _requester.request(_url, | 2090 var _response = _requester.request(_url, "GET", |
| 2029 "GET", | 2091 body: _body, |
| 2030 body: _body, | 2092 queryParams: _queryParams, |
| 2031 queryParams: _queryParams, | 2093 uploadOptions: _uploadOptions, |
| 2032 uploadOptions: _uploadOptions, | 2094 uploadMedia: _uploadMedia, |
| 2033 uploadMedia: _uploadMedia, | 2095 downloadOptions: _downloadOptions); |
| 2034 downloadOptions: _downloadOptions); | |
| 2035 return _response.then((data) => new Teacher.fromJson(data)); | 2096 return _response.then((data) => new Teacher.fromJson(data)); |
| 2036 } | 2097 } |
| 2037 | 2098 |
| 2038 /** | 2099 /// Returns a list of teachers of this course that the requester |
| 2039 * Returns a list of teachers of this course that the requester | 2100 /// is permitted to view. |
| 2040 * is permitted to view. | 2101 /// |
| 2041 * | 2102 /// This method returns the following error codes: |
| 2042 * This method returns the following error codes: | 2103 /// |
| 2043 * | 2104 /// * `NOT_FOUND` if the course does not exist. |
| 2044 * * `NOT_FOUND` if the course does not exist. | 2105 /// * `PERMISSION_DENIED` for access errors. |
| 2045 * * `PERMISSION_DENIED` for access errors. | 2106 /// |
| 2046 * | 2107 /// Request parameters: |
| 2047 * Request parameters: | 2108 /// |
| 2048 * | 2109 /// [courseId] - Identifier of the course. |
| 2049 * [courseId] - Identifier of the course. | 2110 /// This identifier can be either the Classroom-assigned identifier or an |
| 2050 * This identifier can be either the Classroom-assigned identifier or an | 2111 /// alias. |
| 2051 * alias. | 2112 /// |
| 2052 * | 2113 /// [pageToken] - nextPageToken |
| 2053 * [pageToken] - nextPageToken | 2114 /// value returned from a previous |
| 2054 * value returned from a previous | 2115 /// list call, indicating that |
| 2055 * list call, indicating that | 2116 /// the subsequent page of results should be returned. |
| 2056 * the subsequent page of results should be returned. | 2117 /// |
| 2057 * | 2118 /// The list request must be |
| 2058 * The list request must be | 2119 /// otherwise identical to the one that resulted in this token. |
| 2059 * otherwise identical to the one that resulted in this token. | 2120 /// |
| 2060 * | 2121 /// [pageSize] - Maximum number of items to return. Zero means no maximum. |
| 2061 * [pageSize] - Maximum number of items to return. Zero means no maximum. | 2122 /// |
| 2062 * | 2123 /// The server may return fewer than the specified number of results. |
| 2063 * The server may return fewer than the specified number of results. | 2124 /// |
| 2064 * | 2125 /// Completes with a [ListTeachersResponse]. |
| 2065 * Completes with a [ListTeachersResponse]. | 2126 /// |
| 2066 * | 2127 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 2067 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2128 /// an error. |
| 2068 * error. | 2129 /// |
| 2069 * | 2130 /// If the used [http.Client] completes with an error when making a REST |
| 2070 * If the used [http.Client] completes with an error when making a REST call, | 2131 /// call, this method will complete with the same error. |
| 2071 * this method will complete with the same error. | 2132 async.Future<ListTeachersResponse> list(core.String courseId, |
| 2072 */ | 2133 {core.String pageToken, core.int pageSize}) { |
| 2073 async.Future<ListTeachersResponse> list(core.String courseId, {core.String pag
eToken, core.int pageSize}) { | |
| 2074 var _url = null; | 2134 var _url = null; |
| 2075 var _queryParams = new core.Map(); | 2135 var _queryParams = new core.Map(); |
| 2076 var _uploadMedia = null; | 2136 var _uploadMedia = null; |
| 2077 var _uploadOptions = null; | 2137 var _uploadOptions = null; |
| 2078 var _downloadOptions = commons.DownloadOptions.Metadata; | 2138 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 2079 var _body = null; | 2139 var _body = null; |
| 2080 | 2140 |
| 2081 if (courseId == null) { | 2141 if (courseId == null) { |
| 2082 throw new core.ArgumentError("Parameter courseId is required."); | 2142 throw new core.ArgumentError("Parameter courseId is required."); |
| 2083 } | 2143 } |
| 2084 if (pageToken != null) { | 2144 if (pageToken != null) { |
| 2085 _queryParams["pageToken"] = [pageToken]; | 2145 _queryParams["pageToken"] = [pageToken]; |
| 2086 } | 2146 } |
| 2087 if (pageSize != null) { | 2147 if (pageSize != null) { |
| 2088 _queryParams["pageSize"] = ["${pageSize}"]; | 2148 _queryParams["pageSize"] = ["${pageSize}"]; |
| 2089 } | 2149 } |
| 2090 | 2150 |
| 2091 _url = 'v1/courses/' + commons.Escaper.ecapeVariable('$courseId') + '/teache
rs'; | 2151 _url = 'v1/courses/' + |
| 2152 commons.Escaper.ecapeVariable('$courseId') + |
| 2153 '/teachers'; |
| 2092 | 2154 |
| 2093 var _response = _requester.request(_url, | 2155 var _response = _requester.request(_url, "GET", |
| 2094 "GET", | 2156 body: _body, |
| 2095 body: _body, | 2157 queryParams: _queryParams, |
| 2096 queryParams: _queryParams, | 2158 uploadOptions: _uploadOptions, |
| 2097 uploadOptions: _uploadOptions, | 2159 uploadMedia: _uploadMedia, |
| 2098 uploadMedia: _uploadMedia, | 2160 downloadOptions: _downloadOptions); |
| 2099 downloadOptions: _downloadOptions); | |
| 2100 return _response.then((data) => new ListTeachersResponse.fromJson(data)); | 2161 return _response.then((data) => new ListTeachersResponse.fromJson(data)); |
| 2101 } | 2162 } |
| 2102 | |
| 2103 } | 2163 } |
| 2104 | 2164 |
| 2105 | |
| 2106 class InvitationsResourceApi { | 2165 class InvitationsResourceApi { |
| 2107 final commons.ApiRequester _requester; | 2166 final commons.ApiRequester _requester; |
| 2108 | 2167 |
| 2109 InvitationsResourceApi(commons.ApiRequester client) : | 2168 InvitationsResourceApi(commons.ApiRequester client) : _requester = client; |
| 2110 _requester = client; | |
| 2111 | 2169 |
| 2112 /** | 2170 /// Accepts an invitation, removing it and adding the invited user to the |
| 2113 * Accepts an invitation, removing it and adding the invited user to the | 2171 /// teachers or students (as appropriate) of the specified course. Only the |
| 2114 * teachers or students (as appropriate) of the specified course. Only the | 2172 /// invited user may accept an invitation. |
| 2115 * invited user may accept an invitation. | 2173 /// |
| 2116 * | 2174 /// This method returns the following error codes: |
| 2117 * This method returns the following error codes: | 2175 /// |
| 2118 * | 2176 /// * `PERMISSION_DENIED` if the requesting user is not permitted to accept |
| 2119 * * `PERMISSION_DENIED` if the requesting user is not permitted to accept the | 2177 /// the |
| 2120 * requested invitation or for access errors. | 2178 /// requested invitation or for access errors. |
| 2121 * * `FAILED_PRECONDITION` for the following request errors: | 2179 /// * `FAILED_PRECONDITION` for the following request errors: |
| 2122 * * CourseMemberLimitReached | 2180 /// * CourseMemberLimitReached |
| 2123 * * CourseNotModifiable | 2181 /// * CourseNotModifiable |
| 2124 * * CourseTeacherLimitReached | 2182 /// * CourseTeacherLimitReached |
| 2125 * * UserGroupsMembershipLimitReached | 2183 /// * UserGroupsMembershipLimitReached |
| 2126 * * `NOT_FOUND` if no invitation exists with the requested ID. | 2184 /// * `NOT_FOUND` if no invitation exists with the requested ID. |
| 2127 * | 2185 /// |
| 2128 * Request parameters: | 2186 /// Request parameters: |
| 2129 * | 2187 /// |
| 2130 * [id] - Identifier of the invitation to accept. | 2188 /// [id] - Identifier of the invitation to accept. |
| 2131 * | 2189 /// |
| 2132 * Completes with a [Empty]. | 2190 /// Completes with a [Empty]. |
| 2133 * | 2191 /// |
| 2134 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2192 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 2135 * error. | 2193 /// an error. |
| 2136 * | 2194 /// |
| 2137 * If the used [http.Client] completes with an error when making a REST call, | 2195 /// If the used [http.Client] completes with an error when making a REST |
| 2138 * this method will complete with the same error. | 2196 /// call, this method will complete with the same error. |
| 2139 */ | |
| 2140 async.Future<Empty> accept(core.String id) { | 2197 async.Future<Empty> accept(core.String id) { |
| 2141 var _url = null; | 2198 var _url = null; |
| 2142 var _queryParams = new core.Map(); | 2199 var _queryParams = new core.Map(); |
| 2143 var _uploadMedia = null; | 2200 var _uploadMedia = null; |
| 2144 var _uploadOptions = null; | 2201 var _uploadOptions = null; |
| 2145 var _downloadOptions = commons.DownloadOptions.Metadata; | 2202 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 2146 var _body = null; | 2203 var _body = null; |
| 2147 | 2204 |
| 2148 if (id == null) { | 2205 if (id == null) { |
| 2149 throw new core.ArgumentError("Parameter id is required."); | 2206 throw new core.ArgumentError("Parameter id is required."); |
| 2150 } | 2207 } |
| 2151 | 2208 |
| 2152 _url = 'v1/invitations/' + commons.Escaper.ecapeVariable('$id') + ':accept'; | 2209 _url = 'v1/invitations/' + commons.Escaper.ecapeVariable('$id') + ':accept'; |
| 2153 | 2210 |
| 2154 var _response = _requester.request(_url, | 2211 var _response = _requester.request(_url, "POST", |
| 2155 "POST", | 2212 body: _body, |
| 2156 body: _body, | 2213 queryParams: _queryParams, |
| 2157 queryParams: _queryParams, | 2214 uploadOptions: _uploadOptions, |
| 2158 uploadOptions: _uploadOptions, | 2215 uploadMedia: _uploadMedia, |
| 2159 uploadMedia: _uploadMedia, | 2216 downloadOptions: _downloadOptions); |
| 2160 downloadOptions: _downloadOptions); | |
| 2161 return _response.then((data) => new Empty.fromJson(data)); | 2217 return _response.then((data) => new Empty.fromJson(data)); |
| 2162 } | 2218 } |
| 2163 | 2219 |
| 2164 /** | 2220 /// Creates an invitation. Only one invitation for a user and course may |
| 2165 * Creates an invitation. Only one invitation for a user and course may exist | 2221 /// exist |
| 2166 * at a time. Delete and re-create an invitation to make changes. | 2222 /// at a time. Delete and re-create an invitation to make changes. |
| 2167 * | 2223 /// |
| 2168 * This method returns the following error codes: | 2224 /// This method returns the following error codes: |
| 2169 * | 2225 /// |
| 2170 * * `PERMISSION_DENIED` if the requesting user is not permitted to create | 2226 /// * `PERMISSION_DENIED` if the requesting user is not permitted to create |
| 2171 * invitations for this course or for access errors. | 2227 /// invitations for this course or for access errors. |
| 2172 * * `NOT_FOUND` if the course or the user does not exist. | 2228 /// * `NOT_FOUND` if the course or the user does not exist. |
| 2173 * * `FAILED_PRECONDITION` if the requested user's account is disabled or if | 2229 /// * `FAILED_PRECONDITION` if the requested user's account is disabled or if |
| 2174 * the user already has this role or a role with greater permissions. | 2230 /// the user already has this role or a role with greater permissions. |
| 2175 * * `ALREADY_EXISTS` if an invitation for the specified user and course | 2231 /// * `ALREADY_EXISTS` if an invitation for the specified user and course |
| 2176 * already exists. | 2232 /// already exists. |
| 2177 * | 2233 /// |
| 2178 * [request] - The metadata request object. | 2234 /// [request] - The metadata request object. |
| 2179 * | 2235 /// |
| 2180 * Request parameters: | 2236 /// Request parameters: |
| 2181 * | 2237 /// |
| 2182 * Completes with a [Invitation]. | 2238 /// Completes with a [Invitation]. |
| 2183 * | 2239 /// |
| 2184 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2240 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 2185 * error. | 2241 /// an error. |
| 2186 * | 2242 /// |
| 2187 * If the used [http.Client] completes with an error when making a REST call, | 2243 /// If the used [http.Client] completes with an error when making a REST |
| 2188 * this method will complete with the same error. | 2244 /// call, this method will complete with the same error. |
| 2189 */ | |
| 2190 async.Future<Invitation> create(Invitation request) { | 2245 async.Future<Invitation> create(Invitation request) { |
| 2191 var _url = null; | 2246 var _url = null; |
| 2192 var _queryParams = new core.Map(); | 2247 var _queryParams = new core.Map(); |
| 2193 var _uploadMedia = null; | 2248 var _uploadMedia = null; |
| 2194 var _uploadOptions = null; | 2249 var _uploadOptions = null; |
| 2195 var _downloadOptions = commons.DownloadOptions.Metadata; | 2250 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 2196 var _body = null; | 2251 var _body = null; |
| 2197 | 2252 |
| 2198 if (request != null) { | 2253 if (request != null) { |
| 2199 _body = convert.JSON.encode((request).toJson()); | 2254 _body = convert.JSON.encode((request).toJson()); |
| 2200 } | 2255 } |
| 2201 | 2256 |
| 2202 _url = 'v1/invitations'; | 2257 _url = 'v1/invitations'; |
| 2203 | 2258 |
| 2204 var _response = _requester.request(_url, | 2259 var _response = _requester.request(_url, "POST", |
| 2205 "POST", | 2260 body: _body, |
| 2206 body: _body, | 2261 queryParams: _queryParams, |
| 2207 queryParams: _queryParams, | 2262 uploadOptions: _uploadOptions, |
| 2208 uploadOptions: _uploadOptions, | 2263 uploadMedia: _uploadMedia, |
| 2209 uploadMedia: _uploadMedia, | 2264 downloadOptions: _downloadOptions); |
| 2210 downloadOptions: _downloadOptions); | |
| 2211 return _response.then((data) => new Invitation.fromJson(data)); | 2265 return _response.then((data) => new Invitation.fromJson(data)); |
| 2212 } | 2266 } |
| 2213 | 2267 |
| 2214 /** | 2268 /// Deletes an invitation. |
| 2215 * Deletes an invitation. | 2269 /// |
| 2216 * | 2270 /// This method returns the following error codes: |
| 2217 * This method returns the following error codes: | 2271 /// |
| 2218 * | 2272 /// * `PERMISSION_DENIED` if the requesting user is not permitted to delete |
| 2219 * * `PERMISSION_DENIED` if the requesting user is not permitted to delete the | 2273 /// the |
| 2220 * requested invitation or for access errors. | 2274 /// requested invitation or for access errors. |
| 2221 * * `NOT_FOUND` if no invitation exists with the requested ID. | 2275 /// * `NOT_FOUND` if no invitation exists with the requested ID. |
| 2222 * | 2276 /// |
| 2223 * Request parameters: | 2277 /// Request parameters: |
| 2224 * | 2278 /// |
| 2225 * [id] - Identifier of the invitation to delete. | 2279 /// [id] - Identifier of the invitation to delete. |
| 2226 * | 2280 /// |
| 2227 * Completes with a [Empty]. | 2281 /// Completes with a [Empty]. |
| 2228 * | 2282 /// |
| 2229 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2283 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 2230 * error. | 2284 /// an error. |
| 2231 * | 2285 /// |
| 2232 * If the used [http.Client] completes with an error when making a REST call, | 2286 /// If the used [http.Client] completes with an error when making a REST |
| 2233 * this method will complete with the same error. | 2287 /// call, this method will complete with the same error. |
| 2234 */ | |
| 2235 async.Future<Empty> delete(core.String id) { | 2288 async.Future<Empty> delete(core.String id) { |
| 2236 var _url = null; | 2289 var _url = null; |
| 2237 var _queryParams = new core.Map(); | 2290 var _queryParams = new core.Map(); |
| 2238 var _uploadMedia = null; | 2291 var _uploadMedia = null; |
| 2239 var _uploadOptions = null; | 2292 var _uploadOptions = null; |
| 2240 var _downloadOptions = commons.DownloadOptions.Metadata; | 2293 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 2241 var _body = null; | 2294 var _body = null; |
| 2242 | 2295 |
| 2243 if (id == null) { | 2296 if (id == null) { |
| 2244 throw new core.ArgumentError("Parameter id is required."); | 2297 throw new core.ArgumentError("Parameter id is required."); |
| 2245 } | 2298 } |
| 2246 | 2299 |
| 2247 _url = 'v1/invitations/' + commons.Escaper.ecapeVariable('$id'); | 2300 _url = 'v1/invitations/' + commons.Escaper.ecapeVariable('$id'); |
| 2248 | 2301 |
| 2249 var _response = _requester.request(_url, | 2302 var _response = _requester.request(_url, "DELETE", |
| 2250 "DELETE", | 2303 body: _body, |
| 2251 body: _body, | 2304 queryParams: _queryParams, |
| 2252 queryParams: _queryParams, | 2305 uploadOptions: _uploadOptions, |
| 2253 uploadOptions: _uploadOptions, | 2306 uploadMedia: _uploadMedia, |
| 2254 uploadMedia: _uploadMedia, | 2307 downloadOptions: _downloadOptions); |
| 2255 downloadOptions: _downloadOptions); | |
| 2256 return _response.then((data) => new Empty.fromJson(data)); | 2308 return _response.then((data) => new Empty.fromJson(data)); |
| 2257 } | 2309 } |
| 2258 | 2310 |
| 2259 /** | 2311 /// Returns an invitation. |
| 2260 * Returns an invitation. | 2312 /// |
| 2261 * | 2313 /// This method returns the following error codes: |
| 2262 * This method returns the following error codes: | 2314 /// |
| 2263 * | 2315 /// * `PERMISSION_DENIED` if the requesting user is not permitted to view the |
| 2264 * * `PERMISSION_DENIED` if the requesting user is not permitted to view the | 2316 /// requested invitation or for access errors. |
| 2265 * requested invitation or for access errors. | 2317 /// * `NOT_FOUND` if no invitation exists with the requested ID. |
| 2266 * * `NOT_FOUND` if no invitation exists with the requested ID. | 2318 /// |
| 2267 * | 2319 /// Request parameters: |
| 2268 * Request parameters: | 2320 /// |
| 2269 * | 2321 /// [id] - Identifier of the invitation to return. |
| 2270 * [id] - Identifier of the invitation to return. | 2322 /// |
| 2271 * | 2323 /// Completes with a [Invitation]. |
| 2272 * Completes with a [Invitation]. | 2324 /// |
| 2273 * | 2325 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 2274 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2326 /// an error. |
| 2275 * error. | 2327 /// |
| 2276 * | 2328 /// If the used [http.Client] completes with an error when making a REST |
| 2277 * If the used [http.Client] completes with an error when making a REST call, | 2329 /// call, this method will complete with the same error. |
| 2278 * this method will complete with the same error. | |
| 2279 */ | |
| 2280 async.Future<Invitation> get(core.String id) { | 2330 async.Future<Invitation> get(core.String id) { |
| 2281 var _url = null; | 2331 var _url = null; |
| 2282 var _queryParams = new core.Map(); | 2332 var _queryParams = new core.Map(); |
| 2283 var _uploadMedia = null; | 2333 var _uploadMedia = null; |
| 2284 var _uploadOptions = null; | 2334 var _uploadOptions = null; |
| 2285 var _downloadOptions = commons.DownloadOptions.Metadata; | 2335 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 2286 var _body = null; | 2336 var _body = null; |
| 2287 | 2337 |
| 2288 if (id == null) { | 2338 if (id == null) { |
| 2289 throw new core.ArgumentError("Parameter id is required."); | 2339 throw new core.ArgumentError("Parameter id is required."); |
| 2290 } | 2340 } |
| 2291 | 2341 |
| 2292 _url = 'v1/invitations/' + commons.Escaper.ecapeVariable('$id'); | 2342 _url = 'v1/invitations/' + commons.Escaper.ecapeVariable('$id'); |
| 2293 | 2343 |
| 2294 var _response = _requester.request(_url, | 2344 var _response = _requester.request(_url, "GET", |
| 2295 "GET", | 2345 body: _body, |
| 2296 body: _body, | 2346 queryParams: _queryParams, |
| 2297 queryParams: _queryParams, | 2347 uploadOptions: _uploadOptions, |
| 2298 uploadOptions: _uploadOptions, | 2348 uploadMedia: _uploadMedia, |
| 2299 uploadMedia: _uploadMedia, | 2349 downloadOptions: _downloadOptions); |
| 2300 downloadOptions: _downloadOptions); | |
| 2301 return _response.then((data) => new Invitation.fromJson(data)); | 2350 return _response.then((data) => new Invitation.fromJson(data)); |
| 2302 } | 2351 } |
| 2303 | 2352 |
| 2304 /** | 2353 /// Returns a list of invitations that the requesting user is permitted to |
| 2305 * Returns a list of invitations that the requesting user is permitted to | 2354 /// view, restricted to those that match the list request. |
| 2306 * view, restricted to those that match the list request. | 2355 /// |
| 2307 * | 2356 /// *Note:* At least one of `user_id` or `course_id` must be supplied. Both |
| 2308 * *Note:* At least one of `user_id` or `course_id` must be supplied. Both | 2357 /// fields can be supplied. |
| 2309 * fields can be supplied. | 2358 /// |
| 2310 * | 2359 /// This method returns the following error codes: |
| 2311 * This method returns the following error codes: | 2360 /// |
| 2312 * | 2361 /// * `PERMISSION_DENIED` for access errors. |
| 2313 * * `PERMISSION_DENIED` for access errors. | 2362 /// |
| 2314 * | 2363 /// Request parameters: |
| 2315 * Request parameters: | 2364 /// |
| 2316 * | 2365 /// [pageToken] - nextPageToken |
| 2317 * [pageToken] - nextPageToken | 2366 /// value returned from a previous |
| 2318 * value returned from a previous | 2367 /// list call, indicating |
| 2319 * list call, indicating | 2368 /// that the subsequent page of results should be returned. |
| 2320 * that the subsequent page of results should be returned. | 2369 /// |
| 2321 * | 2370 /// The list request must be |
| 2322 * The list request must be | 2371 /// otherwise identical to the one that resulted in this token. |
| 2323 * otherwise identical to the one that resulted in this token. | 2372 /// |
| 2324 * | 2373 /// [userId] - Restricts returned invitations to those for a specific user. |
| 2325 * [userId] - Restricts returned invitations to those for a specific user. The | 2374 /// The identifier |
| 2326 * identifier | 2375 /// can be one of the following: |
| 2327 * can be one of the following: | 2376 /// |
| 2328 * | 2377 /// * the numeric identifier for the user |
| 2329 * * the numeric identifier for the user | 2378 /// * the email address of the user |
| 2330 * * the email address of the user | 2379 /// * the string literal `"me"`, indicating the requesting user |
| 2331 * * the string literal `"me"`, indicating the requesting user | 2380 /// |
| 2332 * | 2381 /// [pageSize] - Maximum number of items to return. Zero means no maximum. |
| 2333 * [pageSize] - Maximum number of items to return. Zero means no maximum. | 2382 /// |
| 2334 * | 2383 /// The server may return fewer than the specified number of results. |
| 2335 * The server may return fewer than the specified number of results. | 2384 /// |
| 2336 * | 2385 /// [courseId] - Restricts returned invitations to those for a course with |
| 2337 * [courseId] - Restricts returned invitations to those for a course with the | 2386 /// the specified |
| 2338 * specified | 2387 /// identifier. |
| 2339 * identifier. | 2388 /// |
| 2340 * | 2389 /// Completes with a [ListInvitationsResponse]. |
| 2341 * Completes with a [ListInvitationsResponse]. | 2390 /// |
| 2342 * | 2391 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 2343 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2392 /// an error. |
| 2344 * error. | 2393 /// |
| 2345 * | 2394 /// If the used [http.Client] completes with an error when making a REST |
| 2346 * If the used [http.Client] completes with an error when making a REST call, | 2395 /// call, this method will complete with the same error. |
| 2347 * this method will complete with the same error. | 2396 async.Future<ListInvitationsResponse> list( |
| 2348 */ | 2397 {core.String pageToken, |
| 2349 async.Future<ListInvitationsResponse> list({core.String pageToken, core.String
userId, core.int pageSize, core.String courseId}) { | 2398 core.String userId, |
| 2399 core.int pageSize, |
| 2400 core.String courseId}) { |
| 2350 var _url = null; | 2401 var _url = null; |
| 2351 var _queryParams = new core.Map(); | 2402 var _queryParams = new core.Map(); |
| 2352 var _uploadMedia = null; | 2403 var _uploadMedia = null; |
| 2353 var _uploadOptions = null; | 2404 var _uploadOptions = null; |
| 2354 var _downloadOptions = commons.DownloadOptions.Metadata; | 2405 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 2355 var _body = null; | 2406 var _body = null; |
| 2356 | 2407 |
| 2357 if (pageToken != null) { | 2408 if (pageToken != null) { |
| 2358 _queryParams["pageToken"] = [pageToken]; | 2409 _queryParams["pageToken"] = [pageToken]; |
| 2359 } | 2410 } |
| 2360 if (userId != null) { | 2411 if (userId != null) { |
| 2361 _queryParams["userId"] = [userId]; | 2412 _queryParams["userId"] = [userId]; |
| 2362 } | 2413 } |
| 2363 if (pageSize != null) { | 2414 if (pageSize != null) { |
| 2364 _queryParams["pageSize"] = ["${pageSize}"]; | 2415 _queryParams["pageSize"] = ["${pageSize}"]; |
| 2365 } | 2416 } |
| 2366 if (courseId != null) { | 2417 if (courseId != null) { |
| 2367 _queryParams["courseId"] = [courseId]; | 2418 _queryParams["courseId"] = [courseId]; |
| 2368 } | 2419 } |
| 2369 | 2420 |
| 2370 _url = 'v1/invitations'; | 2421 _url = 'v1/invitations'; |
| 2371 | 2422 |
| 2372 var _response = _requester.request(_url, | 2423 var _response = _requester.request(_url, "GET", |
| 2373 "GET", | 2424 body: _body, |
| 2374 body: _body, | 2425 queryParams: _queryParams, |
| 2375 queryParams: _queryParams, | 2426 uploadOptions: _uploadOptions, |
| 2376 uploadOptions: _uploadOptions, | 2427 uploadMedia: _uploadMedia, |
| 2377 uploadMedia: _uploadMedia, | 2428 downloadOptions: _downloadOptions); |
| 2378 downloadOptions: _downloadOptions); | |
| 2379 return _response.then((data) => new ListInvitationsResponse.fromJson(data)); | 2429 return _response.then((data) => new ListInvitationsResponse.fromJson(data)); |
| 2380 } | 2430 } |
| 2381 | |
| 2382 } | 2431 } |
| 2383 | 2432 |
| 2384 | |
| 2385 class UserProfilesResourceApi { | 2433 class UserProfilesResourceApi { |
| 2386 final commons.ApiRequester _requester; | 2434 final commons.ApiRequester _requester; |
| 2387 | 2435 |
| 2388 UserProfilesGuardianInvitationsResourceApi get guardianInvitations => new User
ProfilesGuardianInvitationsResourceApi(_requester); | 2436 UserProfilesGuardianInvitationsResourceApi get guardianInvitations => |
| 2389 UserProfilesGuardiansResourceApi get guardians => new UserProfilesGuardiansRes
ourceApi(_requester); | 2437 new UserProfilesGuardianInvitationsResourceApi(_requester); |
| 2438 UserProfilesGuardiansResourceApi get guardians => |
| 2439 new UserProfilesGuardiansResourceApi(_requester); |
| 2390 | 2440 |
| 2391 UserProfilesResourceApi(commons.ApiRequester client) : | 2441 UserProfilesResourceApi(commons.ApiRequester client) : _requester = client; |
| 2392 _requester = client; | |
| 2393 | 2442 |
| 2394 /** | 2443 /// Returns a user profile. |
| 2395 * Returns a user profile. | 2444 /// |
| 2396 * | 2445 /// This method returns the following error codes: |
| 2397 * This method returns the following error codes: | 2446 /// |
| 2398 * | 2447 /// * `PERMISSION_DENIED` if the requesting user is not permitted to access |
| 2399 * * `PERMISSION_DENIED` if the requesting user is not permitted to access | 2448 /// this user profile, if no profile exists with the requested ID, or for |
| 2400 * this user profile, if no profile exists with the requested ID, or for | 2449 /// access errors. |
| 2401 * access errors. | 2450 /// |
| 2402 * | 2451 /// Request parameters: |
| 2403 * Request parameters: | 2452 /// |
| 2404 * | 2453 /// [userId] - Identifier of the profile to return. The identifier can be one |
| 2405 * [userId] - Identifier of the profile to return. The identifier can be one | 2454 /// of the |
| 2406 * of the | 2455 /// following: |
| 2407 * following: | 2456 /// |
| 2408 * | 2457 /// * the numeric identifier for the user |
| 2409 * * the numeric identifier for the user | 2458 /// * the email address of the user |
| 2410 * * the email address of the user | 2459 /// * the string literal `"me"`, indicating the requesting user |
| 2411 * * the string literal `"me"`, indicating the requesting user | 2460 /// |
| 2412 * | 2461 /// Completes with a [UserProfile]. |
| 2413 * Completes with a [UserProfile]. | 2462 /// |
| 2414 * | 2463 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 2415 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2464 /// an error. |
| 2416 * error. | 2465 /// |
| 2417 * | 2466 /// If the used [http.Client] completes with an error when making a REST |
| 2418 * If the used [http.Client] completes with an error when making a REST call, | 2467 /// call, this method will complete with the same error. |
| 2419 * this method will complete with the same error. | |
| 2420 */ | |
| 2421 async.Future<UserProfile> get(core.String userId) { | 2468 async.Future<UserProfile> get(core.String userId) { |
| 2422 var _url = null; | 2469 var _url = null; |
| 2423 var _queryParams = new core.Map(); | 2470 var _queryParams = new core.Map(); |
| 2424 var _uploadMedia = null; | 2471 var _uploadMedia = null; |
| 2425 var _uploadOptions = null; | 2472 var _uploadOptions = null; |
| 2426 var _downloadOptions = commons.DownloadOptions.Metadata; | 2473 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 2427 var _body = null; | 2474 var _body = null; |
| 2428 | 2475 |
| 2429 if (userId == null) { | 2476 if (userId == null) { |
| 2430 throw new core.ArgumentError("Parameter userId is required."); | 2477 throw new core.ArgumentError("Parameter userId is required."); |
| 2431 } | 2478 } |
| 2432 | 2479 |
| 2433 _url = 'v1/userProfiles/' + commons.Escaper.ecapeVariable('$userId'); | 2480 _url = 'v1/userProfiles/' + commons.Escaper.ecapeVariable('$userId'); |
| 2434 | 2481 |
| 2435 var _response = _requester.request(_url, | 2482 var _response = _requester.request(_url, "GET", |
| 2436 "GET", | 2483 body: _body, |
| 2437 body: _body, | 2484 queryParams: _queryParams, |
| 2438 queryParams: _queryParams, | 2485 uploadOptions: _uploadOptions, |
| 2439 uploadOptions: _uploadOptions, | 2486 uploadMedia: _uploadMedia, |
| 2440 uploadMedia: _uploadMedia, | 2487 downloadOptions: _downloadOptions); |
| 2441 downloadOptions: _downloadOptions); | |
| 2442 return _response.then((data) => new UserProfile.fromJson(data)); | 2488 return _response.then((data) => new UserProfile.fromJson(data)); |
| 2443 } | 2489 } |
| 2444 | |
| 2445 } | 2490 } |
| 2446 | 2491 |
| 2447 | |
| 2448 class UserProfilesGuardianInvitationsResourceApi { | 2492 class UserProfilesGuardianInvitationsResourceApi { |
| 2449 final commons.ApiRequester _requester; | 2493 final commons.ApiRequester _requester; |
| 2450 | 2494 |
| 2451 UserProfilesGuardianInvitationsResourceApi(commons.ApiRequester client) : | 2495 UserProfilesGuardianInvitationsResourceApi(commons.ApiRequester client) |
| 2452 _requester = client; | 2496 : _requester = client; |
| 2453 | 2497 |
| 2454 /** | 2498 /// Creates a guardian invitation, and sends an email to the guardian asking |
| 2455 * Creates a guardian invitation, and sends an email to the guardian asking | 2499 /// them to confirm that they are the student's guardian. |
| 2456 * them to confirm that they are the student's guardian. | 2500 /// |
| 2457 * | 2501 /// Once the guardian accepts the invitation, their `state` will change to |
| 2458 * Once the guardian accepts the invitation, their `state` will change to | 2502 /// `COMPLETED` and they will start receiving guardian notifications. A |
| 2459 * `COMPLETED` and they will start receiving guardian notifications. A | 2503 /// `Guardian` resource will also be created to represent the active |
| 2460 * `Guardian` resource will also be created to represent the active guardian. | 2504 /// guardian. |
| 2461 * | 2505 /// |
| 2462 * The request object must have the `student_id` and | 2506 /// The request object must have the `student_id` and |
| 2463 * `invited_email_address` fields set. Failing to set these fields, or | 2507 /// `invited_email_address` fields set. Failing to set these fields, or |
| 2464 * setting any other fields in the request, will result in an error. | 2508 /// setting any other fields in the request, will result in an error. |
| 2465 * | 2509 /// |
| 2466 * This method returns the following error codes: | 2510 /// This method returns the following error codes: |
| 2467 * | 2511 /// |
| 2468 * * `PERMISSION_DENIED` if the current user does not have permission to | 2512 /// * `PERMISSION_DENIED` if the current user does not have permission to |
| 2469 * manage guardians, if the guardian in question has already rejected | 2513 /// manage guardians, if the guardian in question has already rejected |
| 2470 * too many requests for that student, if guardians are not enabled for the | 2514 /// too many requests for that student, if guardians are not enabled for the |
| 2471 * domain in question, or for other access errors. | 2515 /// domain in question, or for other access errors. |
| 2472 * * `RESOURCE_EXHAUSTED` if the student or guardian has exceeded the guardian | 2516 /// * `RESOURCE_EXHAUSTED` if the student or guardian has exceeded the |
| 2473 * link limit. | 2517 /// guardian |
| 2474 * * `INVALID_ARGUMENT` if the guardian email address is not valid (for | 2518 /// link limit. |
| 2475 * example, if it is too long), or if the format of the student ID provided | 2519 /// * `INVALID_ARGUMENT` if the guardian email address is not valid (for |
| 2476 * cannot be recognized (it is not an email address, nor a `user_id` from | 2520 /// example, if it is too long), or if the format of the student ID provided |
| 2477 * this API). This error will also be returned if read-only fields are set, | 2521 /// cannot be recognized (it is not an email address, nor a `user_id` from |
| 2478 * or if the `state` field is set to to a value other than `PENDING`. | 2522 /// this API). This error will also be returned if read-only fields are set, |
| 2479 * * `NOT_FOUND` if the student ID provided is a valid student ID, but | 2523 /// or if the `state` field is set to to a value other than `PENDING`. |
| 2480 * Classroom has no record of that student. | 2524 /// * `NOT_FOUND` if the student ID provided is a valid student ID, but |
| 2481 * * `ALREADY_EXISTS` if there is already a pending guardian invitation for | 2525 /// Classroom has no record of that student. |
| 2482 * the student and `invited_email_address` provided, or if the provided | 2526 /// * `ALREADY_EXISTS` if there is already a pending guardian invitation for |
| 2483 * `invited_email_address` matches the Google account of an existing | 2527 /// the student and `invited_email_address` provided, or if the provided |
| 2484 * `Guardian` for this user. | 2528 /// `invited_email_address` matches the Google account of an existing |
| 2485 * | 2529 /// `Guardian` for this user. |
| 2486 * [request] - The metadata request object. | 2530 /// |
| 2487 * | 2531 /// [request] - The metadata request object. |
| 2488 * Request parameters: | 2532 /// |
| 2489 * | 2533 /// Request parameters: |
| 2490 * [studentId] - ID of the student (in standard format) | 2534 /// |
| 2491 * | 2535 /// [studentId] - ID of the student (in standard format) |
| 2492 * Completes with a [GuardianInvitation]. | 2536 /// |
| 2493 * | 2537 /// Completes with a [GuardianInvitation]. |
| 2494 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2538 /// |
| 2495 * error. | 2539 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 2496 * | 2540 /// an error. |
| 2497 * If the used [http.Client] completes with an error when making a REST call, | 2541 /// |
| 2498 * this method will complete with the same error. | 2542 /// If the used [http.Client] completes with an error when making a REST |
| 2499 */ | 2543 /// call, this method will complete with the same error. |
| 2500 async.Future<GuardianInvitation> create(GuardianInvitation request, core.Strin
g studentId) { | 2544 async.Future<GuardianInvitation> create( |
| 2545 GuardianInvitation request, core.String studentId) { |
| 2501 var _url = null; | 2546 var _url = null; |
| 2502 var _queryParams = new core.Map(); | 2547 var _queryParams = new core.Map(); |
| 2503 var _uploadMedia = null; | 2548 var _uploadMedia = null; |
| 2504 var _uploadOptions = null; | 2549 var _uploadOptions = null; |
| 2505 var _downloadOptions = commons.DownloadOptions.Metadata; | 2550 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 2506 var _body = null; | 2551 var _body = null; |
| 2507 | 2552 |
| 2508 if (request != null) { | 2553 if (request != null) { |
| 2509 _body = convert.JSON.encode((request).toJson()); | 2554 _body = convert.JSON.encode((request).toJson()); |
| 2510 } | 2555 } |
| 2511 if (studentId == null) { | 2556 if (studentId == null) { |
| 2512 throw new core.ArgumentError("Parameter studentId is required."); | 2557 throw new core.ArgumentError("Parameter studentId is required."); |
| 2513 } | 2558 } |
| 2514 | 2559 |
| 2515 _url = 'v1/userProfiles/' + commons.Escaper.ecapeVariable('$studentId') + '/
guardianInvitations'; | 2560 _url = 'v1/userProfiles/' + |
| 2561 commons.Escaper.ecapeVariable('$studentId') + |
| 2562 '/guardianInvitations'; |
| 2516 | 2563 |
| 2517 var _response = _requester.request(_url, | 2564 var _response = _requester.request(_url, "POST", |
| 2518 "POST", | 2565 body: _body, |
| 2519 body: _body, | 2566 queryParams: _queryParams, |
| 2520 queryParams: _queryParams, | 2567 uploadOptions: _uploadOptions, |
| 2521 uploadOptions: _uploadOptions, | 2568 uploadMedia: _uploadMedia, |
| 2522 uploadMedia: _uploadMedia, | 2569 downloadOptions: _downloadOptions); |
| 2523 downloadOptions: _downloadOptions); | |
| 2524 return _response.then((data) => new GuardianInvitation.fromJson(data)); | 2570 return _response.then((data) => new GuardianInvitation.fromJson(data)); |
| 2525 } | 2571 } |
| 2526 | 2572 |
| 2527 /** | 2573 /// Returns a specific guardian invitation. |
| 2528 * Returns a specific guardian invitation. | 2574 /// |
| 2529 * | 2575 /// This method returns the following error codes: |
| 2530 * This method returns the following error codes: | 2576 /// |
| 2531 * | 2577 /// * `PERMISSION_DENIED` if the requesting user is not permitted to view |
| 2532 * * `PERMISSION_DENIED` if the requesting user is not permitted to view | 2578 /// guardian invitations for the student identified by the `student_id`, if |
| 2533 * guardian invitations for the student identified by the `student_id`, if | 2579 /// guardians are not enabled for the domain in question, or for other |
| 2534 * guardians are not enabled for the domain in question, or for other | 2580 /// access errors. |
| 2535 * access errors. | 2581 /// * `INVALID_ARGUMENT` if a `student_id` is specified, but its format |
| 2536 * * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot | 2582 /// cannot |
| 2537 * be recognized (it is not an email address, nor a `student_id` from the | 2583 /// be recognized (it is not an email address, nor a `student_id` from the |
| 2538 * API, nor the literal string `me`). | 2584 /// API, nor the literal string `me`). |
| 2539 * * `NOT_FOUND` if Classroom cannot find any record of the given student or | 2585 /// * `NOT_FOUND` if Classroom cannot find any record of the given student or |
| 2540 * `invitation_id`. May also be returned if the student exists, but the | 2586 /// `invitation_id`. May also be returned if the student exists, but the |
| 2541 * requesting user does not have access to see that student. | 2587 /// requesting user does not have access to see that student. |
| 2542 * | 2588 /// |
| 2543 * Request parameters: | 2589 /// Request parameters: |
| 2544 * | 2590 /// |
| 2545 * [studentId] - The ID of the student whose guardian invitation is being | 2591 /// [studentId] - The ID of the student whose guardian invitation is being |
| 2546 * requested. | 2592 /// requested. |
| 2547 * | 2593 /// |
| 2548 * [invitationId] - The `id` field of the `GuardianInvitation` being | 2594 /// [invitationId] - The `id` field of the `GuardianInvitation` being |
| 2549 * requested. | 2595 /// requested. |
| 2550 * | 2596 /// |
| 2551 * Completes with a [GuardianInvitation]. | 2597 /// Completes with a [GuardianInvitation]. |
| 2552 * | 2598 /// |
| 2553 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2599 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 2554 * error. | 2600 /// an error. |
| 2555 * | 2601 /// |
| 2556 * If the used [http.Client] completes with an error when making a REST call, | 2602 /// If the used [http.Client] completes with an error when making a REST |
| 2557 * this method will complete with the same error. | 2603 /// call, this method will complete with the same error. |
| 2558 */ | 2604 async.Future<GuardianInvitation> get( |
| 2559 async.Future<GuardianInvitation> get(core.String studentId, core.String invita
tionId) { | 2605 core.String studentId, core.String invitationId) { |
| 2560 var _url = null; | 2606 var _url = null; |
| 2561 var _queryParams = new core.Map(); | 2607 var _queryParams = new core.Map(); |
| 2562 var _uploadMedia = null; | 2608 var _uploadMedia = null; |
| 2563 var _uploadOptions = null; | 2609 var _uploadOptions = null; |
| 2564 var _downloadOptions = commons.DownloadOptions.Metadata; | 2610 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 2565 var _body = null; | 2611 var _body = null; |
| 2566 | 2612 |
| 2567 if (studentId == null) { | 2613 if (studentId == null) { |
| 2568 throw new core.ArgumentError("Parameter studentId is required."); | 2614 throw new core.ArgumentError("Parameter studentId is required."); |
| 2569 } | 2615 } |
| 2570 if (invitationId == null) { | 2616 if (invitationId == null) { |
| 2571 throw new core.ArgumentError("Parameter invitationId is required."); | 2617 throw new core.ArgumentError("Parameter invitationId is required."); |
| 2572 } | 2618 } |
| 2573 | 2619 |
| 2574 _url = 'v1/userProfiles/' + commons.Escaper.ecapeVariable('$studentId') + '/
guardianInvitations/' + commons.Escaper.ecapeVariable('$invitationId'); | 2620 _url = 'v1/userProfiles/' + |
| 2621 commons.Escaper.ecapeVariable('$studentId') + |
| 2622 '/guardianInvitations/' + |
| 2623 commons.Escaper.ecapeVariable('$invitationId'); |
| 2575 | 2624 |
| 2576 var _response = _requester.request(_url, | 2625 var _response = _requester.request(_url, "GET", |
| 2577 "GET", | 2626 body: _body, |
| 2578 body: _body, | 2627 queryParams: _queryParams, |
| 2579 queryParams: _queryParams, | 2628 uploadOptions: _uploadOptions, |
| 2580 uploadOptions: _uploadOptions, | 2629 uploadMedia: _uploadMedia, |
| 2581 uploadMedia: _uploadMedia, | 2630 downloadOptions: _downloadOptions); |
| 2582 downloadOptions: _downloadOptions); | |
| 2583 return _response.then((data) => new GuardianInvitation.fromJson(data)); | 2631 return _response.then((data) => new GuardianInvitation.fromJson(data)); |
| 2584 } | 2632 } |
| 2585 | 2633 |
| 2586 /** | 2634 /// Returns a list of guardian invitations that the requesting user is |
| 2587 * Returns a list of guardian invitations that the requesting user is | 2635 /// permitted to view, filtered by the parameters provided. |
| 2588 * permitted to view, filtered by the parameters provided. | 2636 /// |
| 2589 * | 2637 /// This method returns the following error codes: |
| 2590 * This method returns the following error codes: | 2638 /// |
| 2591 * | 2639 /// * `PERMISSION_DENIED` if a `student_id` is specified, and the requesting |
| 2592 * * `PERMISSION_DENIED` if a `student_id` is specified, and the requesting | 2640 /// user is not permitted to view guardian invitations for that student, if |
| 2593 * user is not permitted to view guardian invitations for that student, if | 2641 /// `"-"` is specified as the `student_id` and the user is not a domain |
| 2594 * `"-"` is specified as the `student_id` and the user is not a domain | 2642 /// administrator, if guardians are not enabled for the domain in question, |
| 2595 * administrator, if guardians are not enabled for the domain in question, | 2643 /// or for other access errors. |
| 2596 * or for other access errors. | 2644 /// * `INVALID_ARGUMENT` if a `student_id` is specified, but its format |
| 2597 * * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot | 2645 /// cannot |
| 2598 * be recognized (it is not an email address, nor a `student_id` from the | 2646 /// be recognized (it is not an email address, nor a `student_id` from the |
| 2599 * API, nor the literal string `me`). May also be returned if an invalid | 2647 /// API, nor the literal string `me`). May also be returned if an invalid |
| 2600 * `page_token` or `state` is provided. | 2648 /// `page_token` or `state` is provided. |
| 2601 * * `NOT_FOUND` if a `student_id` is specified, and its format can be | 2649 /// * `NOT_FOUND` if a `student_id` is specified, and its format can be |
| 2602 * recognized, but Classroom has no record of that student. | 2650 /// recognized, but Classroom has no record of that student. |
| 2603 * | 2651 /// |
| 2604 * Request parameters: | 2652 /// Request parameters: |
| 2605 * | 2653 /// |
| 2606 * [studentId] - The ID of the student whose guardian invitations are to be | 2654 /// [studentId] - The ID of the student whose guardian invitations are to be |
| 2607 * returned. | 2655 /// returned. |
| 2608 * The identifier can be one of the following: | 2656 /// The identifier can be one of the following: |
| 2609 * | 2657 /// |
| 2610 * * the numeric identifier for the user | 2658 /// * the numeric identifier for the user |
| 2611 * * the email address of the user | 2659 /// * the email address of the user |
| 2612 * * the string literal `"me"`, indicating the requesting user | 2660 /// * the string literal `"me"`, indicating the requesting user |
| 2613 * * the string literal `"-"`, indicating that results should be returned for | 2661 /// * the string literal `"-"`, indicating that results should be returned |
| 2614 * all students that the requesting user is permitted to view guardian | 2662 /// for |
| 2615 * invitations. | 2663 /// all students that the requesting user is permitted to view guardian |
| 2616 * | 2664 /// invitations. |
| 2617 * [pageSize] - Maximum number of items to return. Zero or unspecified | 2665 /// |
| 2618 * indicates that the | 2666 /// [pageToken] - nextPageToken |
| 2619 * server may assign a maximum. | 2667 /// value returned from a previous |
| 2620 * | 2668 /// list call, |
| 2621 * The server may return fewer than the specified number of results. | 2669 /// indicating that the subsequent page of results should be returned. |
| 2622 * | 2670 /// |
| 2623 * [states] - If specified, only results with the specified `state` values | 2671 /// The list request |
| 2624 * will be | 2672 /// must be otherwise identical to the one that resulted in this token. |
| 2625 * returned. Otherwise, results with a `state` of `PENDING` will be returned. | 2673 /// |
| 2626 * | 2674 /// [pageSize] - Maximum number of items to return. Zero or unspecified |
| 2627 * [invitedEmailAddress] - If specified, only results with the specified | 2675 /// indicates that the |
| 2628 * `invited_email_address` | 2676 /// server may assign a maximum. |
| 2629 * will be returned. | 2677 /// |
| 2630 * | 2678 /// The server may return fewer than the specified number of results. |
| 2631 * [pageToken] - nextPageToken | 2679 /// |
| 2632 * value returned from a previous | 2680 /// [states] - If specified, only results with the specified `state` values |
| 2633 * list call, | 2681 /// will be |
| 2634 * indicating that the subsequent page of results should be returned. | 2682 /// returned. Otherwise, results with a `state` of `PENDING` will be |
| 2635 * | 2683 /// returned. |
| 2636 * The list request | 2684 /// |
| 2637 * must be otherwise identical to the one that resulted in this token. | 2685 /// [invitedEmailAddress] - If specified, only results with the specified |
| 2638 * | 2686 /// `invited_email_address` |
| 2639 * Completes with a [ListGuardianInvitationsResponse]. | 2687 /// will be returned. |
| 2640 * | 2688 /// |
| 2641 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2689 /// Completes with a [ListGuardianInvitationsResponse]. |
| 2642 * error. | 2690 /// |
| 2643 * | 2691 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 2644 * If the used [http.Client] completes with an error when making a REST call, | 2692 /// an error. |
| 2645 * this method will complete with the same error. | 2693 /// |
| 2646 */ | 2694 /// If the used [http.Client] completes with an error when making a REST |
| 2647 async.Future<ListGuardianInvitationsResponse> list(core.String studentId, {cor
e.int pageSize, core.List<core.String> states, core.String invitedEmailAddress,
core.String pageToken}) { | 2695 /// call, this method will complete with the same error. |
| 2696 async.Future<ListGuardianInvitationsResponse> list(core.String studentId, |
| 2697 {core.String pageToken, |
| 2698 core.int pageSize, |
| 2699 core.List<core.String> states, |
| 2700 core.String invitedEmailAddress}) { |
| 2648 var _url = null; | 2701 var _url = null; |
| 2649 var _queryParams = new core.Map(); | 2702 var _queryParams = new core.Map(); |
| 2650 var _uploadMedia = null; | 2703 var _uploadMedia = null; |
| 2651 var _uploadOptions = null; | 2704 var _uploadOptions = null; |
| 2652 var _downloadOptions = commons.DownloadOptions.Metadata; | 2705 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 2653 var _body = null; | 2706 var _body = null; |
| 2654 | 2707 |
| 2655 if (studentId == null) { | 2708 if (studentId == null) { |
| 2656 throw new core.ArgumentError("Parameter studentId is required."); | 2709 throw new core.ArgumentError("Parameter studentId is required."); |
| 2657 } | 2710 } |
| 2711 if (pageToken != null) { |
| 2712 _queryParams["pageToken"] = [pageToken]; |
| 2713 } |
| 2658 if (pageSize != null) { | 2714 if (pageSize != null) { |
| 2659 _queryParams["pageSize"] = ["${pageSize}"]; | 2715 _queryParams["pageSize"] = ["${pageSize}"]; |
| 2660 } | 2716 } |
| 2661 if (states != null) { | 2717 if (states != null) { |
| 2662 _queryParams["states"] = states; | 2718 _queryParams["states"] = states; |
| 2663 } | 2719 } |
| 2664 if (invitedEmailAddress != null) { | 2720 if (invitedEmailAddress != null) { |
| 2665 _queryParams["invitedEmailAddress"] = [invitedEmailAddress]; | 2721 _queryParams["invitedEmailAddress"] = [invitedEmailAddress]; |
| 2666 } | 2722 } |
| 2667 if (pageToken != null) { | |
| 2668 _queryParams["pageToken"] = [pageToken]; | |
| 2669 } | |
| 2670 | 2723 |
| 2671 _url = 'v1/userProfiles/' + commons.Escaper.ecapeVariable('$studentId') + '/
guardianInvitations'; | 2724 _url = 'v1/userProfiles/' + |
| 2725 commons.Escaper.ecapeVariable('$studentId') + |
| 2726 '/guardianInvitations'; |
| 2672 | 2727 |
| 2673 var _response = _requester.request(_url, | 2728 var _response = _requester.request(_url, "GET", |
| 2674 "GET", | 2729 body: _body, |
| 2675 body: _body, | 2730 queryParams: _queryParams, |
| 2676 queryParams: _queryParams, | 2731 uploadOptions: _uploadOptions, |
| 2677 uploadOptions: _uploadOptions, | 2732 uploadMedia: _uploadMedia, |
| 2678 uploadMedia: _uploadMedia, | 2733 downloadOptions: _downloadOptions); |
| 2679 downloadOptions: _downloadOptions); | 2734 return _response |
| 2680 return _response.then((data) => new ListGuardianInvitationsResponse.fromJson
(data)); | 2735 .then((data) => new ListGuardianInvitationsResponse.fromJson(data)); |
| 2681 } | 2736 } |
| 2682 | 2737 |
| 2683 /** | 2738 /// Modifies a guardian invitation. |
| 2684 * Modifies a guardian invitation. | 2739 /// |
| 2685 * | 2740 /// Currently, the only valid modification is to change the `state` from |
| 2686 * Currently, the only valid modification is to change the `state` from | 2741 /// `PENDING` to `COMPLETE`. This has the effect of withdrawing the |
| 2687 * `PENDING` to `COMPLETE`. This has the effect of withdrawing the invitation. | 2742 /// invitation. |
| 2688 * | 2743 /// |
| 2689 * This method returns the following error codes: | 2744 /// This method returns the following error codes: |
| 2690 * | 2745 /// |
| 2691 * * `PERMISSION_DENIED` if the current user does not have permission to | 2746 /// * `PERMISSION_DENIED` if the current user does not have permission to |
| 2692 * manage guardians, if guardians are not enabled for the domain in question | 2747 /// manage guardians, if guardians are not enabled for the domain in question |
| 2693 * or for other access errors. | 2748 /// or for other access errors. |
| 2694 * * `FAILED_PRECONDITION` if the guardian link is not in the `PENDING` state. | 2749 /// * `FAILED_PRECONDITION` if the guardian link is not in the `PENDING` |
| 2695 * * `INVALID_ARGUMENT` if the format of the student ID provided | 2750 /// state. |
| 2696 * cannot be recognized (it is not an email address, nor a `user_id` from | 2751 /// * `INVALID_ARGUMENT` if the format of the student ID provided |
| 2697 * this API), or if the passed `GuardianInvitation` has a `state` other than | 2752 /// cannot be recognized (it is not an email address, nor a `user_id` from |
| 2698 * `COMPLETE`, or if it modifies fields other than `state`. | 2753 /// this API), or if the passed `GuardianInvitation` has a `state` other than |
| 2699 * * `NOT_FOUND` if the student ID provided is a valid student ID, but | 2754 /// `COMPLETE`, or if it modifies fields other than `state`. |
| 2700 * Classroom has no record of that student, or if the `id` field does not | 2755 /// * `NOT_FOUND` if the student ID provided is a valid student ID, but |
| 2701 * refer to a guardian invitation known to Classroom. | 2756 /// Classroom has no record of that student, or if the `id` field does not |
| 2702 * | 2757 /// refer to a guardian invitation known to Classroom. |
| 2703 * [request] - The metadata request object. | 2758 /// |
| 2704 * | 2759 /// [request] - The metadata request object. |
| 2705 * Request parameters: | 2760 /// |
| 2706 * | 2761 /// Request parameters: |
| 2707 * [studentId] - The ID of the student whose guardian invitation is to be | 2762 /// |
| 2708 * modified. | 2763 /// [studentId] - The ID of the student whose guardian invitation is to be |
| 2709 * | 2764 /// modified. |
| 2710 * [invitationId] - The `id` field of the `GuardianInvitation` to be modified. | 2765 /// |
| 2711 * | 2766 /// [invitationId] - The `id` field of the `GuardianInvitation` to be |
| 2712 * [updateMask] - Mask that identifies which fields on the course to update. | 2767 /// modified. |
| 2713 * This field is required to do an update. The update will fail if invalid | 2768 /// |
| 2714 * fields are specified. The following fields are valid: | 2769 /// [updateMask] - Mask that identifies which fields on the course to update. |
| 2715 * | 2770 /// This field is required to do an update. The update will fail if invalid |
| 2716 * * `state` | 2771 /// fields are specified. The following fields are valid: |
| 2717 * | 2772 /// |
| 2718 * When set in a query parameter, this field should be specified as | 2773 /// * `state` |
| 2719 * | 2774 /// |
| 2720 * `updateMask=<field1>,<field2>,...` | 2775 /// When set in a query parameter, this field should be specified as |
| 2721 * | 2776 /// |
| 2722 * Completes with a [GuardianInvitation]. | 2777 /// `updateMask=<field1>,<field2>,...` |
| 2723 * | 2778 /// |
| 2724 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2779 /// Completes with a [GuardianInvitation]. |
| 2725 * error. | 2780 /// |
| 2726 * | 2781 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 2727 * If the used [http.Client] completes with an error when making a REST call, | 2782 /// an error. |
| 2728 * this method will complete with the same error. | 2783 /// |
| 2729 */ | 2784 /// If the used [http.Client] completes with an error when making a REST |
| 2730 async.Future<GuardianInvitation> patch(GuardianInvitation request, core.String
studentId, core.String invitationId, {core.String updateMask}) { | 2785 /// call, this method will complete with the same error. |
| 2786 async.Future<GuardianInvitation> patch(GuardianInvitation request, |
| 2787 core.String studentId, core.String invitationId, |
| 2788 {core.String updateMask}) { |
| 2731 var _url = null; | 2789 var _url = null; |
| 2732 var _queryParams = new core.Map(); | 2790 var _queryParams = new core.Map(); |
| 2733 var _uploadMedia = null; | 2791 var _uploadMedia = null; |
| 2734 var _uploadOptions = null; | 2792 var _uploadOptions = null; |
| 2735 var _downloadOptions = commons.DownloadOptions.Metadata; | 2793 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 2736 var _body = null; | 2794 var _body = null; |
| 2737 | 2795 |
| 2738 if (request != null) { | 2796 if (request != null) { |
| 2739 _body = convert.JSON.encode((request).toJson()); | 2797 _body = convert.JSON.encode((request).toJson()); |
| 2740 } | 2798 } |
| 2741 if (studentId == null) { | 2799 if (studentId == null) { |
| 2742 throw new core.ArgumentError("Parameter studentId is required."); | 2800 throw new core.ArgumentError("Parameter studentId is required."); |
| 2743 } | 2801 } |
| 2744 if (invitationId == null) { | 2802 if (invitationId == null) { |
| 2745 throw new core.ArgumentError("Parameter invitationId is required."); | 2803 throw new core.ArgumentError("Parameter invitationId is required."); |
| 2746 } | 2804 } |
| 2747 if (updateMask != null) { | 2805 if (updateMask != null) { |
| 2748 _queryParams["updateMask"] = [updateMask]; | 2806 _queryParams["updateMask"] = [updateMask]; |
| 2749 } | 2807 } |
| 2750 | 2808 |
| 2751 _url = 'v1/userProfiles/' + commons.Escaper.ecapeVariable('$studentId') + '/
guardianInvitations/' + commons.Escaper.ecapeVariable('$invitationId'); | 2809 _url = 'v1/userProfiles/' + |
| 2810 commons.Escaper.ecapeVariable('$studentId') + |
| 2811 '/guardianInvitations/' + |
| 2812 commons.Escaper.ecapeVariable('$invitationId'); |
| 2752 | 2813 |
| 2753 var _response = _requester.request(_url, | 2814 var _response = _requester.request(_url, "PATCH", |
| 2754 "PATCH", | 2815 body: _body, |
| 2755 body: _body, | 2816 queryParams: _queryParams, |
| 2756 queryParams: _queryParams, | 2817 uploadOptions: _uploadOptions, |
| 2757 uploadOptions: _uploadOptions, | 2818 uploadMedia: _uploadMedia, |
| 2758 uploadMedia: _uploadMedia, | 2819 downloadOptions: _downloadOptions); |
| 2759 downloadOptions: _downloadOptions); | |
| 2760 return _response.then((data) => new GuardianInvitation.fromJson(data)); | 2820 return _response.then((data) => new GuardianInvitation.fromJson(data)); |
| 2761 } | 2821 } |
| 2762 | |
| 2763 } | 2822 } |
| 2764 | 2823 |
| 2765 | |
| 2766 class UserProfilesGuardiansResourceApi { | 2824 class UserProfilesGuardiansResourceApi { |
| 2767 final commons.ApiRequester _requester; | 2825 final commons.ApiRequester _requester; |
| 2768 | 2826 |
| 2769 UserProfilesGuardiansResourceApi(commons.ApiRequester client) : | 2827 UserProfilesGuardiansResourceApi(commons.ApiRequester client) |
| 2770 _requester = client; | 2828 : _requester = client; |
| 2771 | 2829 |
| 2772 /** | 2830 /// Deletes a guardian. |
| 2773 * Deletes a guardian. | 2831 /// |
| 2774 * | 2832 /// The guardian will no longer receive guardian notifications and the |
| 2775 * The guardian will no longer receive guardian notifications and the guardian | 2833 /// guardian |
| 2776 * will no longer be accessible via the API. | 2834 /// will no longer be accessible via the API. |
| 2777 * | 2835 /// |
| 2778 * This method returns the following error codes: | 2836 /// This method returns the following error codes: |
| 2779 * | 2837 /// |
| 2780 * * `PERMISSION_DENIED` if no user that matches the provided `student_id` | 2838 /// * `PERMISSION_DENIED` if no user that matches the provided `student_id` |
| 2781 * is visible to the requesting user, if the requesting user is not | 2839 /// is visible to the requesting user, if the requesting user is not |
| 2782 * permitted to manage guardians for the student identified by the | 2840 /// permitted to manage guardians for the student identified by the |
| 2783 * `student_id`, if guardians are not enabled for the domain in question, | 2841 /// `student_id`, if guardians are not enabled for the domain in question, |
| 2784 * or for other access errors. | 2842 /// or for other access errors. |
| 2785 * * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot | 2843 /// * `INVALID_ARGUMENT` if a `student_id` is specified, but its format |
| 2786 * be recognized (it is not an email address, nor a `student_id` from the | 2844 /// cannot |
| 2787 * API). | 2845 /// be recognized (it is not an email address, nor a `student_id` from the |
| 2788 * * `NOT_FOUND` if the requesting user is permitted to modify guardians for | 2846 /// API). |
| 2789 * the requested `student_id`, but no `Guardian` record exists for that | 2847 /// * `NOT_FOUND` if the requesting user is permitted to modify guardians for |
| 2790 * student with the provided `guardian_id`. | 2848 /// the requested `student_id`, but no `Guardian` record exists for that |
| 2791 * | 2849 /// student with the provided `guardian_id`. |
| 2792 * Request parameters: | 2850 /// |
| 2793 * | 2851 /// Request parameters: |
| 2794 * [studentId] - The student whose guardian is to be deleted. One of the | 2852 /// |
| 2795 * following: | 2853 /// [studentId] - The student whose guardian is to be deleted. One of the |
| 2796 * | 2854 /// following: |
| 2797 * * the numeric identifier for the user | 2855 /// |
| 2798 * * the email address of the user | 2856 /// * the numeric identifier for the user |
| 2799 * * the string literal `"me"`, indicating the requesting user | 2857 /// * the email address of the user |
| 2800 * | 2858 /// * the string literal `"me"`, indicating the requesting user |
| 2801 * [guardianId] - The `id` field from a `Guardian`. | 2859 /// |
| 2802 * | 2860 /// [guardianId] - The `id` field from a `Guardian`. |
| 2803 * Completes with a [Empty]. | 2861 /// |
| 2804 * | 2862 /// Completes with a [Empty]. |
| 2805 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2863 /// |
| 2806 * error. | 2864 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 2807 * | 2865 /// an error. |
| 2808 * If the used [http.Client] completes with an error when making a REST call, | 2866 /// |
| 2809 * this method will complete with the same error. | 2867 /// If the used [http.Client] completes with an error when making a REST |
| 2810 */ | 2868 /// call, this method will complete with the same error. |
| 2811 async.Future<Empty> delete(core.String studentId, core.String guardianId) { | 2869 async.Future<Empty> delete(core.String studentId, core.String guardianId) { |
| 2812 var _url = null; | 2870 var _url = null; |
| 2813 var _queryParams = new core.Map(); | 2871 var _queryParams = new core.Map(); |
| 2814 var _uploadMedia = null; | 2872 var _uploadMedia = null; |
| 2815 var _uploadOptions = null; | 2873 var _uploadOptions = null; |
| 2816 var _downloadOptions = commons.DownloadOptions.Metadata; | 2874 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 2817 var _body = null; | 2875 var _body = null; |
| 2818 | 2876 |
| 2819 if (studentId == null) { | 2877 if (studentId == null) { |
| 2820 throw new core.ArgumentError("Parameter studentId is required."); | 2878 throw new core.ArgumentError("Parameter studentId is required."); |
| 2821 } | 2879 } |
| 2822 if (guardianId == null) { | 2880 if (guardianId == null) { |
| 2823 throw new core.ArgumentError("Parameter guardianId is required."); | 2881 throw new core.ArgumentError("Parameter guardianId is required."); |
| 2824 } | 2882 } |
| 2825 | 2883 |
| 2826 _url = 'v1/userProfiles/' + commons.Escaper.ecapeVariable('$studentId') + '/
guardians/' + commons.Escaper.ecapeVariable('$guardianId'); | 2884 _url = 'v1/userProfiles/' + |
| 2885 commons.Escaper.ecapeVariable('$studentId') + |
| 2886 '/guardians/' + |
| 2887 commons.Escaper.ecapeVariable('$guardianId'); |
| 2827 | 2888 |
| 2828 var _response = _requester.request(_url, | 2889 var _response = _requester.request(_url, "DELETE", |
| 2829 "DELETE", | 2890 body: _body, |
| 2830 body: _body, | 2891 queryParams: _queryParams, |
| 2831 queryParams: _queryParams, | 2892 uploadOptions: _uploadOptions, |
| 2832 uploadOptions: _uploadOptions, | 2893 uploadMedia: _uploadMedia, |
| 2833 uploadMedia: _uploadMedia, | 2894 downloadOptions: _downloadOptions); |
| 2834 downloadOptions: _downloadOptions); | |
| 2835 return _response.then((data) => new Empty.fromJson(data)); | 2895 return _response.then((data) => new Empty.fromJson(data)); |
| 2836 } | 2896 } |
| 2837 | 2897 |
| 2838 /** | 2898 /// Returns a specific guardian. |
| 2839 * Returns a specific guardian. | 2899 /// |
| 2840 * | 2900 /// This method returns the following error codes: |
| 2841 * This method returns the following error codes: | 2901 /// |
| 2842 * | 2902 /// * `PERMISSION_DENIED` if no user that matches the provided `student_id` |
| 2843 * * `PERMISSION_DENIED` if no user that matches the provided `student_id` | 2903 /// is visible to the requesting user, if the requesting user is not |
| 2844 * is visible to the requesting user, if the requesting user is not | 2904 /// permitted to view guardian information for the student identified by the |
| 2845 * permitted to view guardian information for the student identified by the | 2905 /// `student_id`, if guardians are not enabled for the domain in question, |
| 2846 * `student_id`, if guardians are not enabled for the domain in question, | 2906 /// or for other access errors. |
| 2847 * or for other access errors. | 2907 /// * `INVALID_ARGUMENT` if a `student_id` is specified, but its format |
| 2848 * * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot | 2908 /// cannot |
| 2849 * be recognized (it is not an email address, nor a `student_id` from the | 2909 /// be recognized (it is not an email address, nor a `student_id` from the |
| 2850 * API, nor the literal string `me`). | 2910 /// API, nor the literal string `me`). |
| 2851 * * `NOT_FOUND` if the requesting user is permitted to view guardians for | 2911 /// * `NOT_FOUND` if the requesting user is permitted to view guardians for |
| 2852 * the requested `student_id`, but no `Guardian` record exists for that | 2912 /// the requested `student_id`, but no `Guardian` record exists for that |
| 2853 * student that matches the provided `guardian_id`. | 2913 /// student that matches the provided `guardian_id`. |
| 2854 * | 2914 /// |
| 2855 * Request parameters: | 2915 /// Request parameters: |
| 2856 * | 2916 /// |
| 2857 * [studentId] - The student whose guardian is being requested. One of the | 2917 /// [studentId] - The student whose guardian is being requested. One of the |
| 2858 * following: | 2918 /// following: |
| 2859 * | 2919 /// |
| 2860 * * the numeric identifier for the user | 2920 /// * the numeric identifier for the user |
| 2861 * * the email address of the user | 2921 /// * the email address of the user |
| 2862 * * the string literal `"me"`, indicating the requesting user | 2922 /// * the string literal `"me"`, indicating the requesting user |
| 2863 * | 2923 /// |
| 2864 * [guardianId] - The `id` field from a `Guardian`. | 2924 /// [guardianId] - The `id` field from a `Guardian`. |
| 2865 * | 2925 /// |
| 2866 * Completes with a [Guardian]. | 2926 /// Completes with a [Guardian]. |
| 2867 * | 2927 /// |
| 2868 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 2928 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 2869 * error. | 2929 /// an error. |
| 2870 * | 2930 /// |
| 2871 * If the used [http.Client] completes with an error when making a REST call, | 2931 /// If the used [http.Client] completes with an error when making a REST |
| 2872 * this method will complete with the same error. | 2932 /// call, this method will complete with the same error. |
| 2873 */ | |
| 2874 async.Future<Guardian> get(core.String studentId, core.String guardianId) { | 2933 async.Future<Guardian> get(core.String studentId, core.String guardianId) { |
| 2875 var _url = null; | 2934 var _url = null; |
| 2876 var _queryParams = new core.Map(); | 2935 var _queryParams = new core.Map(); |
| 2877 var _uploadMedia = null; | 2936 var _uploadMedia = null; |
| 2878 var _uploadOptions = null; | 2937 var _uploadOptions = null; |
| 2879 var _downloadOptions = commons.DownloadOptions.Metadata; | 2938 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 2880 var _body = null; | 2939 var _body = null; |
| 2881 | 2940 |
| 2882 if (studentId == null) { | 2941 if (studentId == null) { |
| 2883 throw new core.ArgumentError("Parameter studentId is required."); | 2942 throw new core.ArgumentError("Parameter studentId is required."); |
| 2884 } | 2943 } |
| 2885 if (guardianId == null) { | 2944 if (guardianId == null) { |
| 2886 throw new core.ArgumentError("Parameter guardianId is required."); | 2945 throw new core.ArgumentError("Parameter guardianId is required."); |
| 2887 } | 2946 } |
| 2888 | 2947 |
| 2889 _url = 'v1/userProfiles/' + commons.Escaper.ecapeVariable('$studentId') + '/
guardians/' + commons.Escaper.ecapeVariable('$guardianId'); | 2948 _url = 'v1/userProfiles/' + |
| 2949 commons.Escaper.ecapeVariable('$studentId') + |
| 2950 '/guardians/' + |
| 2951 commons.Escaper.ecapeVariable('$guardianId'); |
| 2890 | 2952 |
| 2891 var _response = _requester.request(_url, | 2953 var _response = _requester.request(_url, "GET", |
| 2892 "GET", | 2954 body: _body, |
| 2893 body: _body, | 2955 queryParams: _queryParams, |
| 2894 queryParams: _queryParams, | 2956 uploadOptions: _uploadOptions, |
| 2895 uploadOptions: _uploadOptions, | 2957 uploadMedia: _uploadMedia, |
| 2896 uploadMedia: _uploadMedia, | 2958 downloadOptions: _downloadOptions); |
| 2897 downloadOptions: _downloadOptions); | |
| 2898 return _response.then((data) => new Guardian.fromJson(data)); | 2959 return _response.then((data) => new Guardian.fromJson(data)); |
| 2899 } | 2960 } |
| 2900 | 2961 |
| 2901 /** | 2962 /// Returns a list of guardians that the requesting user is permitted to |
| 2902 * Returns a list of guardians that the requesting user is permitted to | 2963 /// view, restricted to those that match the request. |
| 2903 * view, restricted to those that match the request. | 2964 /// |
| 2904 * | 2965 /// To list guardians for any student that the requesting user may view |
| 2905 * To list guardians for any student that the requesting user may view | 2966 /// guardians for, use the literal character `-` for the student ID. |
| 2906 * guardians for, use the literal character `-` for the student ID. | 2967 /// |
| 2907 * | 2968 /// This method returns the following error codes: |
| 2908 * This method returns the following error codes: | 2969 /// |
| 2909 * | 2970 /// * `PERMISSION_DENIED` if a `student_id` is specified, and the requesting |
| 2910 * * `PERMISSION_DENIED` if a `student_id` is specified, and the requesting | 2971 /// user is not permitted to view guardian information for that student, if |
| 2911 * user is not permitted to view guardian information for that student, if | 2972 /// `"-"` is specified as the `student_id` and the user is not a domain |
| 2912 * `"-"` is specified as the `student_id` and the user is not a domain | 2973 /// administrator, if guardians are not enabled for the domain in question, |
| 2913 * administrator, if guardians are not enabled for the domain in question, | 2974 /// if the `invited_email_address` filter is set by a user who is not a |
| 2914 * if the `invited_email_address` filter is set by a user who is not a | 2975 /// domain administrator, or for other access errors. |
| 2915 * domain administrator, or for other access errors. | 2976 /// * `INVALID_ARGUMENT` if a `student_id` is specified, but its format |
| 2916 * * `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot | 2977 /// cannot |
| 2917 * be recognized (it is not an email address, nor a `student_id` from the | 2978 /// be recognized (it is not an email address, nor a `student_id` from the |
| 2918 * API, nor the literal string `me`). May also be returned if an invalid | 2979 /// API, nor the literal string `me`). May also be returned if an invalid |
| 2919 * `page_token` is provided. | 2980 /// `page_token` is provided. |
| 2920 * * `NOT_FOUND` if a `student_id` is specified, and its format can be | 2981 /// * `NOT_FOUND` if a `student_id` is specified, and its format can be |
| 2921 * recognized, but Classroom has no record of that student. | 2982 /// recognized, but Classroom has no record of that student. |
| 2922 * | 2983 /// |
| 2923 * Request parameters: | 2984 /// Request parameters: |
| 2924 * | 2985 /// |
| 2925 * [studentId] - Filter results by the student who the guardian is linked to. | 2986 /// [studentId] - Filter results by the student who the guardian is linked |
| 2926 * The identifier can be one of the following: | 2987 /// to. |
| 2927 * | 2988 /// The identifier can be one of the following: |
| 2928 * * the numeric identifier for the user | 2989 /// |
| 2929 * * the email address of the user | 2990 /// * the numeric identifier for the user |
| 2930 * * the string literal `"me"`, indicating the requesting user | 2991 /// * the email address of the user |
| 2931 * * the string literal `"-"`, indicating that results should be returned for | 2992 /// * the string literal `"me"`, indicating the requesting user |
| 2932 * all students that the requesting user has access to view. | 2993 /// * the string literal `"-"`, indicating that results should be returned |
| 2933 * | 2994 /// for |
| 2934 * [pageToken] - nextPageToken | 2995 /// all students that the requesting user has access to view. |
| 2935 * value returned from a previous | 2996 /// |
| 2936 * list call, | 2997 /// [pageToken] - nextPageToken |
| 2937 * indicating that the subsequent page of results should be returned. | 2998 /// value returned from a previous |
| 2938 * | 2999 /// list call, |
| 2939 * The list request | 3000 /// indicating that the subsequent page of results should be returned. |
| 2940 * must be otherwise identical to the one that resulted in this token. | 3001 /// |
| 2941 * | 3002 /// The list request |
| 2942 * [pageSize] - Maximum number of items to return. Zero or unspecified | 3003 /// must be otherwise identical to the one that resulted in this token. |
| 2943 * indicates that the | 3004 /// |
| 2944 * server may assign a maximum. | 3005 /// [pageSize] - Maximum number of items to return. Zero or unspecified |
| 2945 * | 3006 /// indicates that the |
| 2946 * The server may return fewer than the specified number of results. | 3007 /// server may assign a maximum. |
| 2947 * | 3008 /// |
| 2948 * [invitedEmailAddress] - Filter results by the email address that the | 3009 /// The server may return fewer than the specified number of results. |
| 2949 * original invitation was sent | 3010 /// |
| 2950 * to, resulting in this guardian link. | 3011 /// [invitedEmailAddress] - Filter results by the email address that the |
| 2951 * This filter can only be used by domain administrators. | 3012 /// original invitation was sent |
| 2952 * | 3013 /// to, resulting in this guardian link. |
| 2953 * Completes with a [ListGuardiansResponse]. | 3014 /// This filter can only be used by domain administrators. |
| 2954 * | 3015 /// |
| 2955 * Completes with a [commons.ApiRequestError] if the API endpoint returned an | 3016 /// Completes with a [ListGuardiansResponse]. |
| 2956 * error. | 3017 /// |
| 2957 * | 3018 /// Completes with a [commons.ApiRequestError] if the API endpoint returned |
| 2958 * If the used [http.Client] completes with an error when making a REST call, | 3019 /// an error. |
| 2959 * this method will complete with the same error. | 3020 /// |
| 2960 */ | 3021 /// If the used [http.Client] completes with an error when making a REST |
| 2961 async.Future<ListGuardiansResponse> list(core.String studentId, {core.String p
ageToken, core.int pageSize, core.String invitedEmailAddress}) { | 3022 /// call, this method will complete with the same error. |
| 3023 async.Future<ListGuardiansResponse> list(core.String studentId, |
| 3024 {core.String pageToken, |
| 3025 core.int pageSize, |
| 3026 core.String invitedEmailAddress}) { |
| 2962 var _url = null; | 3027 var _url = null; |
| 2963 var _queryParams = new core.Map(); | 3028 var _queryParams = new core.Map(); |
| 2964 var _uploadMedia = null; | 3029 var _uploadMedia = null; |
| 2965 var _uploadOptions = null; | 3030 var _uploadOptions = null; |
| 2966 var _downloadOptions = commons.DownloadOptions.Metadata; | 3031 var _downloadOptions = commons.DownloadOptions.Metadata; |
| 2967 var _body = null; | 3032 var _body = null; |
| 2968 | 3033 |
| 2969 if (studentId == null) { | 3034 if (studentId == null) { |
| 2970 throw new core.ArgumentError("Parameter studentId is required."); | 3035 throw new core.ArgumentError("Parameter studentId is required."); |
| 2971 } | 3036 } |
| 2972 if (pageToken != null) { | 3037 if (pageToken != null) { |
| 2973 _queryParams["pageToken"] = [pageToken]; | 3038 _queryParams["pageToken"] = [pageToken]; |
| 2974 } | 3039 } |
| 2975 if (pageSize != null) { | 3040 if (pageSize != null) { |
| 2976 _queryParams["pageSize"] = ["${pageSize}"]; | 3041 _queryParams["pageSize"] = ["${pageSize}"]; |
| 2977 } | 3042 } |
| 2978 if (invitedEmailAddress != null) { | 3043 if (invitedEmailAddress != null) { |
| 2979 _queryParams["invitedEmailAddress"] = [invitedEmailAddress]; | 3044 _queryParams["invitedEmailAddress"] = [invitedEmailAddress]; |
| 2980 } | 3045 } |
| 2981 | 3046 |
| 2982 _url = 'v1/userProfiles/' + commons.Escaper.ecapeVariable('$studentId') + '/
guardians'; | 3047 _url = 'v1/userProfiles/' + |
| 3048 commons.Escaper.ecapeVariable('$studentId') + |
| 3049 '/guardians'; |
| 2983 | 3050 |
| 2984 var _response = _requester.request(_url, | 3051 var _response = _requester.request(_url, "GET", |
| 2985 "GET", | 3052 body: _body, |
| 2986 body: _body, | 3053 queryParams: _queryParams, |
| 2987 queryParams: _queryParams, | 3054 uploadOptions: _uploadOptions, |
| 2988 uploadOptions: _uploadOptions, | 3055 uploadMedia: _uploadMedia, |
| 2989 uploadMedia: _uploadMedia, | 3056 downloadOptions: _downloadOptions); |
| 2990 downloadOptions: _downloadOptions); | |
| 2991 return _response.then((data) => new ListGuardiansResponse.fromJson(data)); | 3057 return _response.then((data) => new ListGuardiansResponse.fromJson(data)); |
| 2992 } | 3058 } |
| 2993 | |
| 2994 } | 3059 } |
| 2995 | 3060 |
| 2996 | 3061 /// Additional details for assignments. |
| 2997 | |
| 2998 /** Additional details for assignments. */ | |
| 2999 class Assignment { | 3062 class Assignment { |
| 3000 /** | 3063 /// Drive folder where attachments from student submissions are placed. |
| 3001 * Drive folder where attachments from student submissions are placed. | 3064 /// This is only populated for course teachers and administrators. |
| 3002 * This is only populated for course teachers and administrators. | |
| 3003 */ | |
| 3004 DriveFolder studentWorkFolder; | 3065 DriveFolder studentWorkFolder; |
| 3005 | 3066 |
| 3006 Assignment(); | 3067 Assignment(); |
| 3007 | 3068 |
| 3008 Assignment.fromJson(core.Map _json) { | 3069 Assignment.fromJson(core.Map _json) { |
| 3009 if (_json.containsKey("studentWorkFolder")) { | 3070 if (_json.containsKey("studentWorkFolder")) { |
| 3010 studentWorkFolder = new DriveFolder.fromJson(_json["studentWorkFolder"]); | 3071 studentWorkFolder = new DriveFolder.fromJson(_json["studentWorkFolder"]); |
| 3011 } | 3072 } |
| 3012 } | 3073 } |
| 3013 | 3074 |
| 3014 core.Map<core.String, core.Object> toJson() { | 3075 core.Map<core.String, core.Object> toJson() { |
| 3015 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3076 final core.Map<core.String, core.Object> _json = |
| 3077 new core.Map<core.String, core.Object>(); |
| 3016 if (studentWorkFolder != null) { | 3078 if (studentWorkFolder != null) { |
| 3017 _json["studentWorkFolder"] = (studentWorkFolder).toJson(); | 3079 _json["studentWorkFolder"] = (studentWorkFolder).toJson(); |
| 3018 } | 3080 } |
| 3019 return _json; | 3081 return _json; |
| 3020 } | 3082 } |
| 3021 } | 3083 } |
| 3022 | 3084 |
| 3023 /** Student work for an assignment. */ | 3085 /// Student work for an assignment. |
| 3024 class AssignmentSubmission { | 3086 class AssignmentSubmission { |
| 3025 /** | 3087 /// Attachments added by the student. |
| 3026 * Attachments added by the student. | 3088 /// Drive files that correspond to materials with a share mode of |
| 3027 * Drive files that correspond to materials with a share mode of | 3089 /// STUDENT_COPY may not exist yet if the student has not accessed the |
| 3028 * STUDENT_COPY may not exist yet if the student has not accessed the | 3090 /// assignment in Classroom. |
| 3029 * assignment in Classroom. | 3091 /// |
| 3030 * | 3092 /// Some attachment metadata is only populated if the requesting user has |
| 3031 * Some attachment metadata is only populated if the requesting user has | 3093 /// permission to access it. Identifier and alternate_link fields are always |
| 3032 * permission to access it. Identifier and alternate_link fields are always | 3094 /// available, but others (e.g. title) may not be. |
| 3033 * available, but others (e.g. title) may not be. | |
| 3034 */ | |
| 3035 core.List<Attachment> attachments; | 3095 core.List<Attachment> attachments; |
| 3036 | 3096 |
| 3037 AssignmentSubmission(); | 3097 AssignmentSubmission(); |
| 3038 | 3098 |
| 3039 AssignmentSubmission.fromJson(core.Map _json) { | 3099 AssignmentSubmission.fromJson(core.Map _json) { |
| 3040 if (_json.containsKey("attachments")) { | 3100 if (_json.containsKey("attachments")) { |
| 3041 attachments = _json["attachments"].map((value) => new Attachment.fromJson(
value)).toList(); | 3101 attachments = _json["attachments"] |
| 3102 .map((value) => new Attachment.fromJson(value)) |
| 3103 .toList(); |
| 3042 } | 3104 } |
| 3043 } | 3105 } |
| 3044 | 3106 |
| 3045 core.Map<core.String, core.Object> toJson() { | 3107 core.Map<core.String, core.Object> toJson() { |
| 3046 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3108 final core.Map<core.String, core.Object> _json = |
| 3109 new core.Map<core.String, core.Object>(); |
| 3047 if (attachments != null) { | 3110 if (attachments != null) { |
| 3048 _json["attachments"] = attachments.map((value) => (value).toJson()).toList
(); | 3111 _json["attachments"] = |
| 3112 attachments.map((value) => (value).toJson()).toList(); |
| 3049 } | 3113 } |
| 3050 return _json; | 3114 return _json; |
| 3051 } | 3115 } |
| 3052 } | 3116 } |
| 3053 | 3117 |
| 3054 /** | 3118 /// Attachment added to student assignment work. |
| 3055 * Attachment added to student assignment work. | 3119 /// |
| 3056 * | 3120 /// When creating attachments, setting the `form` field is not supported. |
| 3057 * When creating attachments, setting the `form` field is not supported. | |
| 3058 */ | |
| 3059 class Attachment { | 3121 class Attachment { |
| 3060 /** Google Drive file attachment. */ | 3122 /// Google Drive file attachment. |
| 3061 DriveFile driveFile; | 3123 DriveFile driveFile; |
| 3062 /** Google Forms attachment. */ | 3124 |
| 3125 /// Google Forms attachment. |
| 3063 Form form; | 3126 Form form; |
| 3064 /** Link attachment. */ | 3127 |
| 3128 /// Link attachment. |
| 3065 Link link; | 3129 Link link; |
| 3066 /** Youtube video attachment. */ | 3130 |
| 3131 /// Youtube video attachment. |
| 3067 YouTubeVideo youTubeVideo; | 3132 YouTubeVideo youTubeVideo; |
| 3068 | 3133 |
| 3069 Attachment(); | 3134 Attachment(); |
| 3070 | 3135 |
| 3071 Attachment.fromJson(core.Map _json) { | 3136 Attachment.fromJson(core.Map _json) { |
| 3072 if (_json.containsKey("driveFile")) { | 3137 if (_json.containsKey("driveFile")) { |
| 3073 driveFile = new DriveFile.fromJson(_json["driveFile"]); | 3138 driveFile = new DriveFile.fromJson(_json["driveFile"]); |
| 3074 } | 3139 } |
| 3075 if (_json.containsKey("form")) { | 3140 if (_json.containsKey("form")) { |
| 3076 form = new Form.fromJson(_json["form"]); | 3141 form = new Form.fromJson(_json["form"]); |
| 3077 } | 3142 } |
| 3078 if (_json.containsKey("link")) { | 3143 if (_json.containsKey("link")) { |
| 3079 link = new Link.fromJson(_json["link"]); | 3144 link = new Link.fromJson(_json["link"]); |
| 3080 } | 3145 } |
| 3081 if (_json.containsKey("youTubeVideo")) { | 3146 if (_json.containsKey("youTubeVideo")) { |
| 3082 youTubeVideo = new YouTubeVideo.fromJson(_json["youTubeVideo"]); | 3147 youTubeVideo = new YouTubeVideo.fromJson(_json["youTubeVideo"]); |
| 3083 } | 3148 } |
| 3084 } | 3149 } |
| 3085 | 3150 |
| 3086 core.Map<core.String, core.Object> toJson() { | 3151 core.Map<core.String, core.Object> toJson() { |
| 3087 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3152 final core.Map<core.String, core.Object> _json = |
| 3153 new core.Map<core.String, core.Object>(); |
| 3088 if (driveFile != null) { | 3154 if (driveFile != null) { |
| 3089 _json["driveFile"] = (driveFile).toJson(); | 3155 _json["driveFile"] = (driveFile).toJson(); |
| 3090 } | 3156 } |
| 3091 if (form != null) { | 3157 if (form != null) { |
| 3092 _json["form"] = (form).toJson(); | 3158 _json["form"] = (form).toJson(); |
| 3093 } | 3159 } |
| 3094 if (link != null) { | 3160 if (link != null) { |
| 3095 _json["link"] = (link).toJson(); | 3161 _json["link"] = (link).toJson(); |
| 3096 } | 3162 } |
| 3097 if (youTubeVideo != null) { | 3163 if (youTubeVideo != null) { |
| 3098 _json["youTubeVideo"] = (youTubeVideo).toJson(); | 3164 _json["youTubeVideo"] = (youTubeVideo).toJson(); |
| 3099 } | 3165 } |
| 3100 return _json; | 3166 return _json; |
| 3101 } | 3167 } |
| 3102 } | 3168 } |
| 3103 | 3169 |
| 3104 /** A Course in Classroom. */ | 3170 /// A Course in Classroom. |
| 3105 class Course { | 3171 class Course { |
| 3106 /** | 3172 /// Absolute link to this course in the Classroom web UI. |
| 3107 * Absolute link to this course in the Classroom web UI. | 3173 /// |
| 3108 * | 3174 /// Read-only. |
| 3109 * Read-only. | |
| 3110 */ | |
| 3111 core.String alternateLink; | 3175 core.String alternateLink; |
| 3112 /** | 3176 |
| 3113 * The Calendar ID for a calendar that all course members can see, to which | 3177 /// The Calendar ID for a calendar that all course members can see, to which |
| 3114 * Classroom adds events for course work and announcements in the course. | 3178 /// Classroom adds events for course work and announcements in the course. |
| 3115 * | 3179 /// |
| 3116 * Read-only. | 3180 /// Read-only. |
| 3117 */ | |
| 3118 core.String calendarId; | 3181 core.String calendarId; |
| 3119 /** | 3182 |
| 3120 * The email address of a Google group containing all members of the course. | 3183 /// The email address of a Google group containing all members of the course. |
| 3121 * This group does not accept email and can only be used for permissions. | 3184 /// This group does not accept email and can only be used for permissions. |
| 3122 * | 3185 /// |
| 3123 * Read-only. | 3186 /// Read-only. |
| 3124 */ | |
| 3125 core.String courseGroupEmail; | 3187 core.String courseGroupEmail; |
| 3126 /** | 3188 |
| 3127 * Sets of materials that appear on the "about" page of this course. | 3189 /// Sets of materials that appear on the "about" page of this course. |
| 3128 * | 3190 /// |
| 3129 * Read-only. | 3191 /// Read-only. |
| 3130 */ | |
| 3131 core.List<CourseMaterialSet> courseMaterialSets; | 3192 core.List<CourseMaterialSet> courseMaterialSets; |
| 3132 /** | 3193 |
| 3133 * State of the course. | 3194 /// State of the course. |
| 3134 * If unspecified, the default state is `PROVISIONED`. | 3195 /// If unspecified, the default state is `PROVISIONED`. |
| 3135 * Possible string values are: | 3196 /// Possible string values are: |
| 3136 * - "COURSE_STATE_UNSPECIFIED" : No course state. No returned Course message | 3197 /// - "COURSE_STATE_UNSPECIFIED" : No course state. No returned Course |
| 3137 * will use this value. | 3198 /// message will use this value. |
| 3138 * - "ACTIVE" : The course is active. | 3199 /// - "ACTIVE" : The course is active. |
| 3139 * - "ARCHIVED" : The course has been archived. You cannot modify it except to | 3200 /// - "ARCHIVED" : The course has been archived. You cannot modify it except |
| 3140 * change it | 3201 /// to change it |
| 3141 * to a different state. | 3202 /// to a different state. |
| 3142 * - "PROVISIONED" : The course has been created, but not yet activated. It is | 3203 /// - "PROVISIONED" : The course has been created, but not yet activated. It |
| 3143 * accessible by | 3204 /// is accessible by |
| 3144 * the primary teacher and domain administrators, who may modify it or | 3205 /// the primary teacher and domain administrators, who may modify it or |
| 3145 * change it to the `ACTIVE` or `DECLINED` states. | 3206 /// change it to the `ACTIVE` or `DECLINED` states. |
| 3146 * A course may only be changed to `PROVISIONED` if it is in the `DECLINED` | 3207 /// A course may only be changed to `PROVISIONED` if it is in the `DECLINED` |
| 3147 * state. | 3208 /// state. |
| 3148 * - "DECLINED" : The course has been created, but declined. It is accessible | 3209 /// - "DECLINED" : The course has been created, but declined. It is |
| 3149 * by the | 3210 /// accessible by the |
| 3150 * course owner and domain administrators, though it will not be | 3211 /// course owner and domain administrators, though it will not be |
| 3151 * displayed in the web UI. You cannot modify the course except to change it | 3212 /// displayed in the web UI. You cannot modify the course except to change it |
| 3152 * to the `PROVISIONED` state. | 3213 /// to the `PROVISIONED` state. |
| 3153 * A course may only be changed to `DECLINED` if it is in the `PROVISIONED` | 3214 /// A course may only be changed to `DECLINED` if it is in the `PROVISIONED` |
| 3154 * state. | 3215 /// state. |
| 3155 * - "SUSPENDED" : The course has been suspended. You cannot modify the | 3216 /// - "SUSPENDED" : The course has been suspended. You cannot modify the |
| 3156 * course, and only the | 3217 /// course, and only the |
| 3157 * user identified by the `owner_id` can view the course. | 3218 /// user identified by the `owner_id` can view the course. |
| 3158 * A course may be placed in this state if it potentially violates the | 3219 /// A course may be placed in this state if it potentially violates the |
| 3159 * Terms of Service. | 3220 /// Terms of Service. |
| 3160 */ | |
| 3161 core.String courseState; | 3221 core.String courseState; |
| 3162 /** | 3222 |
| 3163 * Creation time of the course. | 3223 /// Creation time of the course. |
| 3164 * Specifying this field in a course update mask results in an error. | 3224 /// Specifying this field in a course update mask results in an error. |
| 3165 * | 3225 /// |
| 3166 * Read-only. | 3226 /// Read-only. |
| 3167 */ | |
| 3168 core.String creationTime; | 3227 core.String creationTime; |
| 3169 /** | 3228 |
| 3170 * Optional description. | 3229 /// Optional description. |
| 3171 * For example, "We'll be learning about the structure of living | 3230 /// For example, "We'll be learning about the structure of living |
| 3172 * creatures from a combination of textbooks, guest lectures, and lab work. | 3231 /// creatures from a combination of textbooks, guest lectures, and lab work. |
| 3173 * Expect to be excited!" | 3232 /// Expect to be excited!" |
| 3174 * If set, this field must be a valid UTF-8 string and no longer than 30,000 | 3233 /// If set, this field must be a valid UTF-8 string and no longer than 30,000 |
| 3175 * characters. | 3234 /// characters. |
| 3176 */ | |
| 3177 core.String description; | 3235 core.String description; |
| 3178 /** | 3236 |
| 3179 * Optional heading for the description. | 3237 /// Optional heading for the description. |
| 3180 * For example, "Welcome to 10th Grade Biology." | 3238 /// For example, "Welcome to 10th Grade Biology." |
| 3181 * If set, this field must be a valid UTF-8 string and no longer than 3600 | 3239 /// If set, this field must be a valid UTF-8 string and no longer than 3600 |
| 3182 * characters. | 3240 /// characters. |
| 3183 */ | |
| 3184 core.String descriptionHeading; | 3241 core.String descriptionHeading; |
| 3185 /** | 3242 |
| 3186 * Enrollment code to use when joining this course. | 3243 /// Enrollment code to use when joining this course. |
| 3187 * Specifying this field in a course update mask results in an error. | 3244 /// Specifying this field in a course update mask results in an error. |
| 3188 * | 3245 /// |
| 3189 * Read-only. | 3246 /// Read-only. |
| 3190 */ | |
| 3191 core.String enrollmentCode; | 3247 core.String enrollmentCode; |
| 3192 /** | 3248 |
| 3193 * Whether or not guardian notifications are enabled for this course. | 3249 /// Whether or not guardian notifications are enabled for this course. |
| 3194 * | 3250 /// |
| 3195 * Read-only. | 3251 /// Read-only. |
| 3196 */ | |
| 3197 core.bool guardiansEnabled; | 3252 core.bool guardiansEnabled; |
| 3198 /** | 3253 |
| 3199 * Identifier for this course assigned by Classroom. | 3254 /// Identifier for this course assigned by Classroom. |
| 3200 * | 3255 /// |
| 3201 * When | 3256 /// When |
| 3202 * creating a course, | 3257 /// creating a course, |
| 3203 * you may optionally set this identifier to an | 3258 /// you may optionally set this identifier to an |
| 3204 * alias string in the | 3259 /// alias string in the |
| 3205 * request to create a corresponding alias. The `id` is still assigned by | 3260 /// request to create a corresponding alias. The `id` is still assigned by |
| 3206 * Classroom and cannot be updated after the course is created. | 3261 /// Classroom and cannot be updated after the course is created. |
| 3207 * | 3262 /// |
| 3208 * Specifying this field in a course update mask results in an error. | 3263 /// Specifying this field in a course update mask results in an error. |
| 3209 */ | |
| 3210 core.String id; | 3264 core.String id; |
| 3211 /** | 3265 |
| 3212 * Name of the course. | 3266 /// Name of the course. |
| 3213 * For example, "10th Grade Biology". | 3267 /// For example, "10th Grade Biology". |
| 3214 * The name is required. It must be between 1 and 750 characters and a valid | 3268 /// The name is required. It must be between 1 and 750 characters and a valid |
| 3215 * UTF-8 string. | 3269 /// UTF-8 string. |
| 3216 */ | |
| 3217 core.String name; | 3270 core.String name; |
| 3218 /** | 3271 |
| 3219 * The identifier of the owner of a course. | 3272 /// The identifier of the owner of a course. |
| 3220 * | 3273 /// |
| 3221 * When specified as a parameter of a | 3274 /// When specified as a parameter of a |
| 3222 * create course request, this | 3275 /// create course request, this |
| 3223 * field is required. | 3276 /// field is required. |
| 3224 * The identifier can be one of the following: | 3277 /// The identifier can be one of the following: |
| 3225 * | 3278 /// |
| 3226 * * the numeric identifier for the user | 3279 /// * the numeric identifier for the user |
| 3227 * * the email address of the user | 3280 /// * the email address of the user |
| 3228 * * the string literal `"me"`, indicating the requesting user | 3281 /// * the string literal `"me"`, indicating the requesting user |
| 3229 * | 3282 /// |
| 3230 * This must be set in a create request. Admins can also specify this field | 3283 /// This must be set in a create request. Admins can also specify this field |
| 3231 * in a patch course request to | 3284 /// in a patch course request to |
| 3232 * transfer ownership. In other contexts, it is read-only. | 3285 /// transfer ownership. In other contexts, it is read-only. |
| 3233 */ | |
| 3234 core.String ownerId; | 3286 core.String ownerId; |
| 3235 /** | 3287 |
| 3236 * Optional room location. | 3288 /// Optional room location. |
| 3237 * For example, "301". | 3289 /// For example, "301". |
| 3238 * If set, this field must be a valid UTF-8 string and no longer than 650 | 3290 /// If set, this field must be a valid UTF-8 string and no longer than 650 |
| 3239 * characters. | 3291 /// characters. |
| 3240 */ | |
| 3241 core.String room; | 3292 core.String room; |
| 3242 /** | 3293 |
| 3243 * Section of the course. | 3294 /// Section of the course. |
| 3244 * For example, "Period 2". | 3295 /// For example, "Period 2". |
| 3245 * If set, this field must be a valid UTF-8 string and no longer than 2800 | 3296 /// If set, this field must be a valid UTF-8 string and no longer than 2800 |
| 3246 * characters. | 3297 /// characters. |
| 3247 */ | |
| 3248 core.String section; | 3298 core.String section; |
| 3249 /** | 3299 |
| 3250 * Information about a Drive Folder that is shared with all teachers of the | 3300 /// Information about a Drive Folder that is shared with all teachers of the |
| 3251 * course. | 3301 /// course. |
| 3252 * | 3302 /// |
| 3253 * This field will only be set for teachers of the course and domain | 3303 /// This field will only be set for teachers of the course and domain |
| 3254 * administrators. | 3304 /// administrators. |
| 3255 * | 3305 /// |
| 3256 * Read-only. | 3306 /// Read-only. |
| 3257 */ | |
| 3258 DriveFolder teacherFolder; | 3307 DriveFolder teacherFolder; |
| 3259 /** | 3308 |
| 3260 * The email address of a Google group containing all teachers of the course. | 3309 /// The email address of a Google group containing all teachers of the |
| 3261 * This group does not accept email and can only be used for permissions. | 3310 /// course. |
| 3262 * | 3311 /// This group does not accept email and can only be used for permissions. |
| 3263 * Read-only. | 3312 /// |
| 3264 */ | 3313 /// Read-only. |
| 3265 core.String teacherGroupEmail; | 3314 core.String teacherGroupEmail; |
| 3266 /** | 3315 |
| 3267 * Time of the most recent update to this course. | 3316 /// Time of the most recent update to this course. |
| 3268 * Specifying this field in a course update mask results in an error. | 3317 /// Specifying this field in a course update mask results in an error. |
| 3269 * | 3318 /// |
| 3270 * Read-only. | 3319 /// Read-only. |
| 3271 */ | |
| 3272 core.String updateTime; | 3320 core.String updateTime; |
| 3273 | 3321 |
| 3274 Course(); | 3322 Course(); |
| 3275 | 3323 |
| 3276 Course.fromJson(core.Map _json) { | 3324 Course.fromJson(core.Map _json) { |
| 3277 if (_json.containsKey("alternateLink")) { | 3325 if (_json.containsKey("alternateLink")) { |
| 3278 alternateLink = _json["alternateLink"]; | 3326 alternateLink = _json["alternateLink"]; |
| 3279 } | 3327 } |
| 3280 if (_json.containsKey("calendarId")) { | 3328 if (_json.containsKey("calendarId")) { |
| 3281 calendarId = _json["calendarId"]; | 3329 calendarId = _json["calendarId"]; |
| 3282 } | 3330 } |
| 3283 if (_json.containsKey("courseGroupEmail")) { | 3331 if (_json.containsKey("courseGroupEmail")) { |
| 3284 courseGroupEmail = _json["courseGroupEmail"]; | 3332 courseGroupEmail = _json["courseGroupEmail"]; |
| 3285 } | 3333 } |
| 3286 if (_json.containsKey("courseMaterialSets")) { | 3334 if (_json.containsKey("courseMaterialSets")) { |
| 3287 courseMaterialSets = _json["courseMaterialSets"].map((value) => new Course
MaterialSet.fromJson(value)).toList(); | 3335 courseMaterialSets = _json["courseMaterialSets"] |
| 3336 .map((value) => new CourseMaterialSet.fromJson(value)) |
| 3337 .toList(); |
| 3288 } | 3338 } |
| 3289 if (_json.containsKey("courseState")) { | 3339 if (_json.containsKey("courseState")) { |
| 3290 courseState = _json["courseState"]; | 3340 courseState = _json["courseState"]; |
| 3291 } | 3341 } |
| 3292 if (_json.containsKey("creationTime")) { | 3342 if (_json.containsKey("creationTime")) { |
| 3293 creationTime = _json["creationTime"]; | 3343 creationTime = _json["creationTime"]; |
| 3294 } | 3344 } |
| 3295 if (_json.containsKey("description")) { | 3345 if (_json.containsKey("description")) { |
| 3296 description = _json["description"]; | 3346 description = _json["description"]; |
| 3297 } | 3347 } |
| (...skipping 26 matching lines...) Expand all Loading... |
| 3324 } | 3374 } |
| 3325 if (_json.containsKey("teacherGroupEmail")) { | 3375 if (_json.containsKey("teacherGroupEmail")) { |
| 3326 teacherGroupEmail = _json["teacherGroupEmail"]; | 3376 teacherGroupEmail = _json["teacherGroupEmail"]; |
| 3327 } | 3377 } |
| 3328 if (_json.containsKey("updateTime")) { | 3378 if (_json.containsKey("updateTime")) { |
| 3329 updateTime = _json["updateTime"]; | 3379 updateTime = _json["updateTime"]; |
| 3330 } | 3380 } |
| 3331 } | 3381 } |
| 3332 | 3382 |
| 3333 core.Map<core.String, core.Object> toJson() { | 3383 core.Map<core.String, core.Object> toJson() { |
| 3334 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3384 final core.Map<core.String, core.Object> _json = |
| 3385 new core.Map<core.String, core.Object>(); |
| 3335 if (alternateLink != null) { | 3386 if (alternateLink != null) { |
| 3336 _json["alternateLink"] = alternateLink; | 3387 _json["alternateLink"] = alternateLink; |
| 3337 } | 3388 } |
| 3338 if (calendarId != null) { | 3389 if (calendarId != null) { |
| 3339 _json["calendarId"] = calendarId; | 3390 _json["calendarId"] = calendarId; |
| 3340 } | 3391 } |
| 3341 if (courseGroupEmail != null) { | 3392 if (courseGroupEmail != null) { |
| 3342 _json["courseGroupEmail"] = courseGroupEmail; | 3393 _json["courseGroupEmail"] = courseGroupEmail; |
| 3343 } | 3394 } |
| 3344 if (courseMaterialSets != null) { | 3395 if (courseMaterialSets != null) { |
| 3345 _json["courseMaterialSets"] = courseMaterialSets.map((value) => (value).to
Json()).toList(); | 3396 _json["courseMaterialSets"] = |
| 3397 courseMaterialSets.map((value) => (value).toJson()).toList(); |
| 3346 } | 3398 } |
| 3347 if (courseState != null) { | 3399 if (courseState != null) { |
| 3348 _json["courseState"] = courseState; | 3400 _json["courseState"] = courseState; |
| 3349 } | 3401 } |
| 3350 if (creationTime != null) { | 3402 if (creationTime != null) { |
| 3351 _json["creationTime"] = creationTime; | 3403 _json["creationTime"] = creationTime; |
| 3352 } | 3404 } |
| 3353 if (description != null) { | 3405 if (description != null) { |
| 3354 _json["description"] = description; | 3406 _json["description"] = description; |
| 3355 } | 3407 } |
| (...skipping 27 matching lines...) Expand all Loading... |
| 3383 if (teacherGroupEmail != null) { | 3435 if (teacherGroupEmail != null) { |
| 3384 _json["teacherGroupEmail"] = teacherGroupEmail; | 3436 _json["teacherGroupEmail"] = teacherGroupEmail; |
| 3385 } | 3437 } |
| 3386 if (updateTime != null) { | 3438 if (updateTime != null) { |
| 3387 _json["updateTime"] = updateTime; | 3439 _json["updateTime"] = updateTime; |
| 3388 } | 3440 } |
| 3389 return _json; | 3441 return _json; |
| 3390 } | 3442 } |
| 3391 } | 3443 } |
| 3392 | 3444 |
| 3393 /** | 3445 /// Alternative identifier for a course. |
| 3394 * Alternative identifier for a course. | 3446 /// |
| 3395 * | 3447 /// An alias uniquely identifies a course. It must be unique within one of the |
| 3396 * An alias uniquely identifies a course. It must be unique within one of the | 3448 /// following scopes: |
| 3397 * following scopes: | 3449 /// |
| 3398 * | 3450 /// * domain: A domain-scoped alias is visible to all users within the alias |
| 3399 * * domain: A domain-scoped alias is visible to all users within the alias | 3451 /// creator's domain and can be created only by a domain admin. A domain-scoped |
| 3400 * creator's domain and can be created only by a domain admin. A domain-scoped | 3452 /// alias is often used when a course has an identifier external to Classroom. |
| 3401 * alias is often used when a course has an identifier external to Classroom. | 3453 /// |
| 3402 * | 3454 /// * project: A project-scoped alias is visible to any request from an |
| 3403 * * project: A project-scoped alias is visible to any request from an | 3455 /// application using the Developer Console project ID that created the alias |
| 3404 * application using the Developer Console project ID that created the alias | 3456 /// and can be created by any project. A project-scoped alias is often used |
| 3405 * and can be created by any project. A project-scoped alias is often used when | 3457 /// when |
| 3406 * an application has alternative identifiers. A random value can also be used | 3458 /// an application has alternative identifiers. A random value can also be used |
| 3407 * to avoid duplicate courses in the event of transmission failures, as retrying | 3459 /// to avoid duplicate courses in the event of transmission failures, as |
| 3408 * a request will return `ALREADY_EXISTS` if a previous one has succeeded. | 3460 /// retrying |
| 3409 */ | 3461 /// a request will return `ALREADY_EXISTS` if a previous one has succeeded. |
| 3410 class CourseAlias { | 3462 class CourseAlias { |
| 3411 /** | 3463 /// Alias string. The format of the string indicates the desired alias |
| 3412 * Alias string. The format of the string indicates the desired alias scoping. | 3464 /// scoping. |
| 3413 * | 3465 /// |
| 3414 * * `d:<name>` indicates a domain-scoped alias. | 3466 /// * `d:<name>` indicates a domain-scoped alias. |
| 3415 * Example: `d:math_101` | 3467 /// Example: `d:math_101` |
| 3416 * * `p:<name>` indicates a project-scoped alias. | 3468 /// * `p:<name>` indicates a project-scoped alias. |
| 3417 * Example: `p:abc123` | 3469 /// Example: `p:abc123` |
| 3418 * | 3470 /// |
| 3419 * This field has a maximum length of 256 characters. | 3471 /// This field has a maximum length of 256 characters. |
| 3420 */ | |
| 3421 core.String alias; | 3472 core.String alias; |
| 3422 | 3473 |
| 3423 CourseAlias(); | 3474 CourseAlias(); |
| 3424 | 3475 |
| 3425 CourseAlias.fromJson(core.Map _json) { | 3476 CourseAlias.fromJson(core.Map _json) { |
| 3426 if (_json.containsKey("alias")) { | 3477 if (_json.containsKey("alias")) { |
| 3427 alias = _json["alias"]; | 3478 alias = _json["alias"]; |
| 3428 } | 3479 } |
| 3429 } | 3480 } |
| 3430 | 3481 |
| 3431 core.Map<core.String, core.Object> toJson() { | 3482 core.Map<core.String, core.Object> toJson() { |
| 3432 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3483 final core.Map<core.String, core.Object> _json = |
| 3484 new core.Map<core.String, core.Object>(); |
| 3433 if (alias != null) { | 3485 if (alias != null) { |
| 3434 _json["alias"] = alias; | 3486 _json["alias"] = alias; |
| 3435 } | 3487 } |
| 3436 return _json; | 3488 return _json; |
| 3437 } | 3489 } |
| 3438 } | 3490 } |
| 3439 | 3491 |
| 3440 /** A material attached to a course as part of a material set. */ | 3492 /// A material attached to a course as part of a material set. |
| 3441 class CourseMaterial { | 3493 class CourseMaterial { |
| 3442 /** Google Drive file attachment. */ | 3494 /// Google Drive file attachment. |
| 3443 DriveFile driveFile; | 3495 DriveFile driveFile; |
| 3444 /** Google Forms attachment. */ | 3496 |
| 3497 /// Google Forms attachment. |
| 3445 Form form; | 3498 Form form; |
| 3446 /** Link atatchment. */ | 3499 |
| 3500 /// Link atatchment. |
| 3447 Link link; | 3501 Link link; |
| 3448 /** Youtube video attachment. */ | 3502 |
| 3503 /// Youtube video attachment. |
| 3449 YouTubeVideo youTubeVideo; | 3504 YouTubeVideo youTubeVideo; |
| 3450 | 3505 |
| 3451 CourseMaterial(); | 3506 CourseMaterial(); |
| 3452 | 3507 |
| 3453 CourseMaterial.fromJson(core.Map _json) { | 3508 CourseMaterial.fromJson(core.Map _json) { |
| 3454 if (_json.containsKey("driveFile")) { | 3509 if (_json.containsKey("driveFile")) { |
| 3455 driveFile = new DriveFile.fromJson(_json["driveFile"]); | 3510 driveFile = new DriveFile.fromJson(_json["driveFile"]); |
| 3456 } | 3511 } |
| 3457 if (_json.containsKey("form")) { | 3512 if (_json.containsKey("form")) { |
| 3458 form = new Form.fromJson(_json["form"]); | 3513 form = new Form.fromJson(_json["form"]); |
| 3459 } | 3514 } |
| 3460 if (_json.containsKey("link")) { | 3515 if (_json.containsKey("link")) { |
| 3461 link = new Link.fromJson(_json["link"]); | 3516 link = new Link.fromJson(_json["link"]); |
| 3462 } | 3517 } |
| 3463 if (_json.containsKey("youTubeVideo")) { | 3518 if (_json.containsKey("youTubeVideo")) { |
| 3464 youTubeVideo = new YouTubeVideo.fromJson(_json["youTubeVideo"]); | 3519 youTubeVideo = new YouTubeVideo.fromJson(_json["youTubeVideo"]); |
| 3465 } | 3520 } |
| 3466 } | 3521 } |
| 3467 | 3522 |
| 3468 core.Map<core.String, core.Object> toJson() { | 3523 core.Map<core.String, core.Object> toJson() { |
| 3469 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3524 final core.Map<core.String, core.Object> _json = |
| 3525 new core.Map<core.String, core.Object>(); |
| 3470 if (driveFile != null) { | 3526 if (driveFile != null) { |
| 3471 _json["driveFile"] = (driveFile).toJson(); | 3527 _json["driveFile"] = (driveFile).toJson(); |
| 3472 } | 3528 } |
| 3473 if (form != null) { | 3529 if (form != null) { |
| 3474 _json["form"] = (form).toJson(); | 3530 _json["form"] = (form).toJson(); |
| 3475 } | 3531 } |
| 3476 if (link != null) { | 3532 if (link != null) { |
| 3477 _json["link"] = (link).toJson(); | 3533 _json["link"] = (link).toJson(); |
| 3478 } | 3534 } |
| 3479 if (youTubeVideo != null) { | 3535 if (youTubeVideo != null) { |
| 3480 _json["youTubeVideo"] = (youTubeVideo).toJson(); | 3536 _json["youTubeVideo"] = (youTubeVideo).toJson(); |
| 3481 } | 3537 } |
| 3482 return _json; | 3538 return _json; |
| 3483 } | 3539 } |
| 3484 } | 3540 } |
| 3485 | 3541 |
| 3486 /** | 3542 /// A set of materials that appears on the "About" page of the course. |
| 3487 * A set of materials that appears on the "About" page of the course. | 3543 /// These materials might include a syllabus, schedule, or other background |
| 3488 * These materials might include a syllabus, schedule, or other background | 3544 /// information relating to the course as a whole. |
| 3489 * information relating to the course as a whole. | |
| 3490 */ | |
| 3491 class CourseMaterialSet { | 3545 class CourseMaterialSet { |
| 3492 /** Materials attached to this set. */ | 3546 /// Materials attached to this set. |
| 3493 core.List<CourseMaterial> materials; | 3547 core.List<CourseMaterial> materials; |
| 3494 /** Title for this set. */ | 3548 |
| 3549 /// Title for this set. |
| 3495 core.String title; | 3550 core.String title; |
| 3496 | 3551 |
| 3497 CourseMaterialSet(); | 3552 CourseMaterialSet(); |
| 3498 | 3553 |
| 3499 CourseMaterialSet.fromJson(core.Map _json) { | 3554 CourseMaterialSet.fromJson(core.Map _json) { |
| 3500 if (_json.containsKey("materials")) { | 3555 if (_json.containsKey("materials")) { |
| 3501 materials = _json["materials"].map((value) => new CourseMaterial.fromJson(
value)).toList(); | 3556 materials = _json["materials"] |
| 3557 .map((value) => new CourseMaterial.fromJson(value)) |
| 3558 .toList(); |
| 3502 } | 3559 } |
| 3503 if (_json.containsKey("title")) { | 3560 if (_json.containsKey("title")) { |
| 3504 title = _json["title"]; | 3561 title = _json["title"]; |
| 3505 } | 3562 } |
| 3506 } | 3563 } |
| 3507 | 3564 |
| 3508 core.Map<core.String, core.Object> toJson() { | 3565 core.Map<core.String, core.Object> toJson() { |
| 3509 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3566 final core.Map<core.String, core.Object> _json = |
| 3567 new core.Map<core.String, core.Object>(); |
| 3510 if (materials != null) { | 3568 if (materials != null) { |
| 3511 _json["materials"] = materials.map((value) => (value).toJson()).toList(); | 3569 _json["materials"] = materials.map((value) => (value).toJson()).toList(); |
| 3512 } | 3570 } |
| 3513 if (title != null) { | 3571 if (title != null) { |
| 3514 _json["title"] = title; | 3572 _json["title"] = title; |
| 3515 } | 3573 } |
| 3516 return _json; | 3574 return _json; |
| 3517 } | 3575 } |
| 3518 } | 3576 } |
| 3519 | 3577 |
| 3520 /** Course work created by a teacher for students of the course. */ | 3578 /// Course work created by a teacher for students of the course. |
| 3521 class CourseWork { | 3579 class CourseWork { |
| 3522 /** | 3580 /// Absolute link to this course work in the Classroom web UI. |
| 3523 * Absolute link to this course work in the Classroom web UI. | 3581 /// This is only populated if `state` is `PUBLISHED`. |
| 3524 * This is only populated if `state` is `PUBLISHED`. | 3582 /// |
| 3525 * | 3583 /// Read-only. |
| 3526 * Read-only. | |
| 3527 */ | |
| 3528 core.String alternateLink; | 3584 core.String alternateLink; |
| 3529 /** | 3585 |
| 3530 * Assignment details. | 3586 /// Assignment details. |
| 3531 * This is populated only when `work_type` is `ASSIGNMENT`. | 3587 /// This is populated only when `work_type` is `ASSIGNMENT`. |
| 3532 * | 3588 /// |
| 3533 * Read-only. | 3589 /// Read-only. |
| 3534 */ | |
| 3535 Assignment assignment; | 3590 Assignment assignment; |
| 3536 /** | 3591 |
| 3537 * Whether this course work item is associated with the Developer Console | 3592 /// Whether this course work item is associated with the Developer Console |
| 3538 * project making the request. | 3593 /// project making the request. |
| 3539 * | 3594 /// |
| 3540 * See google.classroom.Work.CreateCourseWork for more | 3595 /// See google.classroom.Work.CreateCourseWork for more |
| 3541 * details. | 3596 /// details. |
| 3542 * | 3597 /// |
| 3543 * Read-only. | 3598 /// Read-only. |
| 3544 */ | |
| 3545 core.bool associatedWithDeveloper; | 3599 core.bool associatedWithDeveloper; |
| 3546 /** | 3600 |
| 3547 * Identifier of the course. | 3601 /// Identifier of the course. |
| 3548 * | 3602 /// |
| 3549 * Read-only. | 3603 /// Read-only. |
| 3550 */ | |
| 3551 core.String courseId; | 3604 core.String courseId; |
| 3552 /** | 3605 |
| 3553 * Timestamp when this course work was created. | 3606 /// Timestamp when this course work was created. |
| 3554 * | 3607 /// |
| 3555 * Read-only. | 3608 /// Read-only. |
| 3556 */ | |
| 3557 core.String creationTime; | 3609 core.String creationTime; |
| 3558 /** | 3610 |
| 3559 * Optional description of this course work. | 3611 /// Optional description of this course work. |
| 3560 * If set, the description must be a valid UTF-8 string containing no more | 3612 /// If set, the description must be a valid UTF-8 string containing no more |
| 3561 * than 30,000 characters. | 3613 /// than 30,000 characters. |
| 3562 */ | |
| 3563 core.String description; | 3614 core.String description; |
| 3564 /** | 3615 |
| 3565 * Optional date, in UTC, that submissions for this this course work are due. | 3616 /// Optional date, in UTC, that submissions for this this course work are |
| 3566 * This must be specified if `due_time` is specified. | 3617 /// due. |
| 3567 */ | 3618 /// This must be specified if `due_time` is specified. |
| 3568 Date dueDate; | 3619 Date dueDate; |
| 3569 /** | 3620 |
| 3570 * Optional time of day, in UTC, that submissions for this this course work | 3621 /// Optional time of day, in UTC, that submissions for this this course work |
| 3571 * are due. | 3622 /// are due. |
| 3572 * This must be specified if `due_date` is specified. | 3623 /// This must be specified if `due_date` is specified. |
| 3573 */ | |
| 3574 TimeOfDay dueTime; | 3624 TimeOfDay dueTime; |
| 3575 /** | 3625 |
| 3576 * Classroom-assigned identifier of this course work, unique per course. | 3626 /// Classroom-assigned identifier of this course work, unique per course. |
| 3577 * | 3627 /// |
| 3578 * Read-only. | 3628 /// Read-only. |
| 3579 */ | |
| 3580 core.String id; | 3629 core.String id; |
| 3581 /** | 3630 |
| 3582 * Additional materials. | 3631 /// Additional materials. |
| 3583 * | 3632 /// |
| 3584 * CourseWork must have no more than 20 material items. | 3633 /// CourseWork must have no more than 20 material items. |
| 3585 */ | |
| 3586 core.List<Material> materials; | 3634 core.List<Material> materials; |
| 3587 /** | 3635 |
| 3588 * Maximum grade for this course work. | 3636 /// Maximum grade for this course work. |
| 3589 * If zero or unspecified, this assignment is considered ungraded. | 3637 /// If zero or unspecified, this assignment is considered ungraded. |
| 3590 * This must be a non-negative integer value. | 3638 /// This must be a non-negative integer value. |
| 3591 */ | |
| 3592 core.double maxPoints; | 3639 core.double maxPoints; |
| 3593 /** | 3640 |
| 3594 * Multiple choice question details. | 3641 /// Multiple choice question details. |
| 3595 * For read operations, this field is populated only when `work_type` is | 3642 /// For read operations, this field is populated only when `work_type` is |
| 3596 * `MULTIPLE_CHOICE_QUESTION`. | 3643 /// `MULTIPLE_CHOICE_QUESTION`. |
| 3597 * For write operations, this field must be specified when creating course | 3644 /// For write operations, this field must be specified when creating course |
| 3598 * work with a `work_type` of `MULTIPLE_CHOICE_QUESTION`, and it must not be | 3645 /// work with a `work_type` of `MULTIPLE_CHOICE_QUESTION`, and it must not be |
| 3599 * set otherwise. | 3646 /// set otherwise. |
| 3600 */ | |
| 3601 MultipleChoiceQuestion multipleChoiceQuestion; | 3647 MultipleChoiceQuestion multipleChoiceQuestion; |
| 3602 /** Optional timestamp when this course work is scheduled to be published. */ | 3648 |
| 3649 /// Optional timestamp when this course work is scheduled to be published. |
| 3603 core.String scheduledTime; | 3650 core.String scheduledTime; |
| 3604 /** | 3651 |
| 3605 * Status of this course work. | 3652 /// Status of this course work. |
| 3606 * If unspecified, the default state is `DRAFT`. | 3653 /// If unspecified, the default state is `DRAFT`. |
| 3607 * Possible string values are: | 3654 /// Possible string values are: |
| 3608 * - "COURSE_WORK_STATE_UNSPECIFIED" : No state specified. This is never | 3655 /// - "COURSE_WORK_STATE_UNSPECIFIED" : No state specified. This is never |
| 3609 * returned. | 3656 /// returned. |
| 3610 * - "PUBLISHED" : Status for work that has been published. | 3657 /// - "PUBLISHED" : Status for work that has been published. |
| 3611 * This is the default state. | 3658 /// This is the default state. |
| 3612 * - "DRAFT" : Status for work that is not yet published. | 3659 /// - "DRAFT" : Status for work that is not yet published. |
| 3613 * Work in this state is visible only to course teachers and domain | 3660 /// Work in this state is visible only to course teachers and domain |
| 3614 * administrators. | 3661 /// administrators. |
| 3615 * - "DELETED" : Status for work that was published but is now deleted. | 3662 /// - "DELETED" : Status for work that was published but is now deleted. |
| 3616 * Work in this state is visible only to course teachers and domain | 3663 /// Work in this state is visible only to course teachers and domain |
| 3617 * administrators. | 3664 /// administrators. |
| 3618 * Work in this state is deleted after some time. | 3665 /// Work in this state is deleted after some time. |
| 3619 */ | |
| 3620 core.String state; | 3666 core.String state; |
| 3621 /** | 3667 |
| 3622 * Setting to determine when students are allowed to modify submissions. | 3668 /// Setting to determine when students are allowed to modify submissions. |
| 3623 * If unspecified, the default value is `MODIFIABLE_UNTIL_TURNED_IN`. | 3669 /// If unspecified, the default value is `MODIFIABLE_UNTIL_TURNED_IN`. |
| 3624 * Possible string values are: | 3670 /// Possible string values are: |
| 3625 * - "SUBMISSION_MODIFICATION_MODE_UNSPECIFIED" : No modification mode | 3671 /// - "SUBMISSION_MODIFICATION_MODE_UNSPECIFIED" : No modification mode |
| 3626 * specified. This is never returned. | 3672 /// specified. This is never returned. |
| 3627 * - "MODIFIABLE_UNTIL_TURNED_IN" : Submisisons can be modified before being | 3673 /// - "MODIFIABLE_UNTIL_TURNED_IN" : Submisisons can be modified before being |
| 3628 * turned in. | 3674 /// turned in. |
| 3629 * - "MODIFIABLE" : Submisisons can be modified at any time. | 3675 /// - "MODIFIABLE" : Submisisons can be modified at any time. |
| 3630 */ | |
| 3631 core.String submissionModificationMode; | 3676 core.String submissionModificationMode; |
| 3632 /** | 3677 |
| 3633 * Title of this course work. | 3678 /// Title of this course work. |
| 3634 * The title must be a valid UTF-8 string containing between 1 and 3000 | 3679 /// The title must be a valid UTF-8 string containing between 1 and 3000 |
| 3635 * characters. | 3680 /// characters. |
| 3636 */ | |
| 3637 core.String title; | 3681 core.String title; |
| 3638 /** | 3682 |
| 3639 * Timestamp of the most recent change to this course work. | 3683 /// Timestamp of the most recent change to this course work. |
| 3640 * | 3684 /// |
| 3641 * Read-only. | 3685 /// Read-only. |
| 3642 */ | |
| 3643 core.String updateTime; | 3686 core.String updateTime; |
| 3644 /** | 3687 |
| 3645 * Type of this course work. | 3688 /// Type of this course work. |
| 3646 * | 3689 /// |
| 3647 * The type is set when the course work is created and cannot be changed. | 3690 /// The type is set when the course work is created and cannot be changed. |
| 3648 * Possible string values are: | 3691 /// Possible string values are: |
| 3649 * - "COURSE_WORK_TYPE_UNSPECIFIED" : No work type specified. This is never | 3692 /// - "COURSE_WORK_TYPE_UNSPECIFIED" : No work type specified. This is never |
| 3650 * returned. | 3693 /// returned. |
| 3651 * - "ASSIGNMENT" : An assignment. | 3694 /// - "ASSIGNMENT" : An assignment. |
| 3652 * - "SHORT_ANSWER_QUESTION" : A short answer question. | 3695 /// - "SHORT_ANSWER_QUESTION" : A short answer question. |
| 3653 * - "MULTIPLE_CHOICE_QUESTION" : A multiple-choice question. | 3696 /// - "MULTIPLE_CHOICE_QUESTION" : A multiple-choice question. |
| 3654 */ | |
| 3655 core.String workType; | 3697 core.String workType; |
| 3656 | 3698 |
| 3657 CourseWork(); | 3699 CourseWork(); |
| 3658 | 3700 |
| 3659 CourseWork.fromJson(core.Map _json) { | 3701 CourseWork.fromJson(core.Map _json) { |
| 3660 if (_json.containsKey("alternateLink")) { | 3702 if (_json.containsKey("alternateLink")) { |
| 3661 alternateLink = _json["alternateLink"]; | 3703 alternateLink = _json["alternateLink"]; |
| 3662 } | 3704 } |
| 3663 if (_json.containsKey("assignment")) { | 3705 if (_json.containsKey("assignment")) { |
| 3664 assignment = new Assignment.fromJson(_json["assignment"]); | 3706 assignment = new Assignment.fromJson(_json["assignment"]); |
| (...skipping 13 matching lines...) Expand all Loading... |
| 3678 if (_json.containsKey("dueDate")) { | 3720 if (_json.containsKey("dueDate")) { |
| 3679 dueDate = new Date.fromJson(_json["dueDate"]); | 3721 dueDate = new Date.fromJson(_json["dueDate"]); |
| 3680 } | 3722 } |
| 3681 if (_json.containsKey("dueTime")) { | 3723 if (_json.containsKey("dueTime")) { |
| 3682 dueTime = new TimeOfDay.fromJson(_json["dueTime"]); | 3724 dueTime = new TimeOfDay.fromJson(_json["dueTime"]); |
| 3683 } | 3725 } |
| 3684 if (_json.containsKey("id")) { | 3726 if (_json.containsKey("id")) { |
| 3685 id = _json["id"]; | 3727 id = _json["id"]; |
| 3686 } | 3728 } |
| 3687 if (_json.containsKey("materials")) { | 3729 if (_json.containsKey("materials")) { |
| 3688 materials = _json["materials"].map((value) => new Material.fromJson(value)
).toList(); | 3730 materials = _json["materials"] |
| 3731 .map((value) => new Material.fromJson(value)) |
| 3732 .toList(); |
| 3689 } | 3733 } |
| 3690 if (_json.containsKey("maxPoints")) { | 3734 if (_json.containsKey("maxPoints")) { |
| 3691 maxPoints = _json["maxPoints"]; | 3735 maxPoints = _json["maxPoints"]; |
| 3692 } | 3736 } |
| 3693 if (_json.containsKey("multipleChoiceQuestion")) { | 3737 if (_json.containsKey("multipleChoiceQuestion")) { |
| 3694 multipleChoiceQuestion = new MultipleChoiceQuestion.fromJson(_json["multip
leChoiceQuestion"]); | 3738 multipleChoiceQuestion = |
| 3739 new MultipleChoiceQuestion.fromJson(_json["multipleChoiceQuestion"]); |
| 3695 } | 3740 } |
| 3696 if (_json.containsKey("scheduledTime")) { | 3741 if (_json.containsKey("scheduledTime")) { |
| 3697 scheduledTime = _json["scheduledTime"]; | 3742 scheduledTime = _json["scheduledTime"]; |
| 3698 } | 3743 } |
| 3699 if (_json.containsKey("state")) { | 3744 if (_json.containsKey("state")) { |
| 3700 state = _json["state"]; | 3745 state = _json["state"]; |
| 3701 } | 3746 } |
| 3702 if (_json.containsKey("submissionModificationMode")) { | 3747 if (_json.containsKey("submissionModificationMode")) { |
| 3703 submissionModificationMode = _json["submissionModificationMode"]; | 3748 submissionModificationMode = _json["submissionModificationMode"]; |
| 3704 } | 3749 } |
| 3705 if (_json.containsKey("title")) { | 3750 if (_json.containsKey("title")) { |
| 3706 title = _json["title"]; | 3751 title = _json["title"]; |
| 3707 } | 3752 } |
| 3708 if (_json.containsKey("updateTime")) { | 3753 if (_json.containsKey("updateTime")) { |
| 3709 updateTime = _json["updateTime"]; | 3754 updateTime = _json["updateTime"]; |
| 3710 } | 3755 } |
| 3711 if (_json.containsKey("workType")) { | 3756 if (_json.containsKey("workType")) { |
| 3712 workType = _json["workType"]; | 3757 workType = _json["workType"]; |
| 3713 } | 3758 } |
| 3714 } | 3759 } |
| 3715 | 3760 |
| 3716 core.Map<core.String, core.Object> toJson() { | 3761 core.Map<core.String, core.Object> toJson() { |
| 3717 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3762 final core.Map<core.String, core.Object> _json = |
| 3763 new core.Map<core.String, core.Object>(); |
| 3718 if (alternateLink != null) { | 3764 if (alternateLink != null) { |
| 3719 _json["alternateLink"] = alternateLink; | 3765 _json["alternateLink"] = alternateLink; |
| 3720 } | 3766 } |
| 3721 if (assignment != null) { | 3767 if (assignment != null) { |
| 3722 _json["assignment"] = (assignment).toJson(); | 3768 _json["assignment"] = (assignment).toJson(); |
| 3723 } | 3769 } |
| 3724 if (associatedWithDeveloper != null) { | 3770 if (associatedWithDeveloper != null) { |
| 3725 _json["associatedWithDeveloper"] = associatedWithDeveloper; | 3771 _json["associatedWithDeveloper"] = associatedWithDeveloper; |
| 3726 } | 3772 } |
| 3727 if (courseId != null) { | 3773 if (courseId != null) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3766 if (updateTime != null) { | 3812 if (updateTime != null) { |
| 3767 _json["updateTime"] = updateTime; | 3813 _json["updateTime"] = updateTime; |
| 3768 } | 3814 } |
| 3769 if (workType != null) { | 3815 if (workType != null) { |
| 3770 _json["workType"] = workType; | 3816 _json["workType"] = workType; |
| 3771 } | 3817 } |
| 3772 return _json; | 3818 return _json; |
| 3773 } | 3819 } |
| 3774 } | 3820 } |
| 3775 | 3821 |
| 3776 /** | 3822 /// Represents a whole calendar date, e.g. date of birth. The time of day and |
| 3777 * Represents a whole calendar date, e.g. date of birth. The time of day and | 3823 /// time zone are either specified elsewhere or are not significant. The date |
| 3778 * time zone are either specified elsewhere or are not significant. The date | 3824 /// is relative to the Proleptic Gregorian Calendar. The day may be 0 to |
| 3779 * is relative to the Proleptic Gregorian Calendar. The day may be 0 to | 3825 /// represent a year and month where the day is not significant, e.g. credit |
| 3780 * represent a year and month where the day is not significant, e.g. credit card | 3826 /// card |
| 3781 * expiration date. The year may be 0 to represent a month and day independent | 3827 /// expiration date. The year may be 0 to represent a month and day independent |
| 3782 * of year, e.g. anniversary date. Related types are google.type.TimeOfDay | 3828 /// of year, e.g. anniversary date. Related types are google.type.TimeOfDay |
| 3783 * and `google.protobuf.Timestamp`. | 3829 /// and `google.protobuf.Timestamp`. |
| 3784 */ | |
| 3785 class Date { | 3830 class Date { |
| 3786 /** | 3831 /// Day of month. Must be from 1 to 31 and valid for the year and month, or 0 |
| 3787 * Day of month. Must be from 1 to 31 and valid for the year and month, or 0 | 3832 /// if specifying a year/month where the day is not significant. |
| 3788 * if specifying a year/month where the day is not significant. | |
| 3789 */ | |
| 3790 core.int day; | 3833 core.int day; |
| 3791 /** Month of year. Must be from 1 to 12. */ | 3834 |
| 3835 /// Month of year. Must be from 1 to 12. |
| 3792 core.int month; | 3836 core.int month; |
| 3793 /** | 3837 |
| 3794 * Year of date. Must be from 1 to 9999, or 0 if specifying a date without | 3838 /// Year of date. Must be from 1 to 9999, or 0 if specifying a date without |
| 3795 * a year. | 3839 /// a year. |
| 3796 */ | |
| 3797 core.int year; | 3840 core.int year; |
| 3798 | 3841 |
| 3799 Date(); | 3842 Date(); |
| 3800 | 3843 |
| 3801 Date.fromJson(core.Map _json) { | 3844 Date.fromJson(core.Map _json) { |
| 3802 if (_json.containsKey("day")) { | 3845 if (_json.containsKey("day")) { |
| 3803 day = _json["day"]; | 3846 day = _json["day"]; |
| 3804 } | 3847 } |
| 3805 if (_json.containsKey("month")) { | 3848 if (_json.containsKey("month")) { |
| 3806 month = _json["month"]; | 3849 month = _json["month"]; |
| 3807 } | 3850 } |
| 3808 if (_json.containsKey("year")) { | 3851 if (_json.containsKey("year")) { |
| 3809 year = _json["year"]; | 3852 year = _json["year"]; |
| 3810 } | 3853 } |
| 3811 } | 3854 } |
| 3812 | 3855 |
| 3813 core.Map<core.String, core.Object> toJson() { | 3856 core.Map<core.String, core.Object> toJson() { |
| 3814 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3857 final core.Map<core.String, core.Object> _json = |
| 3858 new core.Map<core.String, core.Object>(); |
| 3815 if (day != null) { | 3859 if (day != null) { |
| 3816 _json["day"] = day; | 3860 _json["day"] = day; |
| 3817 } | 3861 } |
| 3818 if (month != null) { | 3862 if (month != null) { |
| 3819 _json["month"] = month; | 3863 _json["month"] = month; |
| 3820 } | 3864 } |
| 3821 if (year != null) { | 3865 if (year != null) { |
| 3822 _json["year"] = year; | 3866 _json["year"] = year; |
| 3823 } | 3867 } |
| 3824 return _json; | 3868 return _json; |
| 3825 } | 3869 } |
| 3826 } | 3870 } |
| 3827 | 3871 |
| 3828 /** Representation of a Google Drive file. */ | 3872 /// Representation of a Google Drive file. |
| 3829 class DriveFile { | 3873 class DriveFile { |
| 3830 /** | 3874 /// URL that can be used to access the Drive item. |
| 3831 * URL that can be used to access the Drive item. | 3875 /// |
| 3832 * | 3876 /// Read-only. |
| 3833 * Read-only. | |
| 3834 */ | |
| 3835 core.String alternateLink; | 3877 core.String alternateLink; |
| 3836 /** Drive API resource ID. */ | 3878 |
| 3879 /// Drive API resource ID. |
| 3837 core.String id; | 3880 core.String id; |
| 3838 /** | 3881 |
| 3839 * URL of a thumbnail image of the Drive item. | 3882 /// URL of a thumbnail image of the Drive item. |
| 3840 * | 3883 /// |
| 3841 * Read-only. | 3884 /// Read-only. |
| 3842 */ | |
| 3843 core.String thumbnailUrl; | 3885 core.String thumbnailUrl; |
| 3844 /** | 3886 |
| 3845 * Title of the Drive item. | 3887 /// Title of the Drive item. |
| 3846 * | 3888 /// |
| 3847 * Read-only. | 3889 /// Read-only. |
| 3848 */ | |
| 3849 core.String title; | 3890 core.String title; |
| 3850 | 3891 |
| 3851 DriveFile(); | 3892 DriveFile(); |
| 3852 | 3893 |
| 3853 DriveFile.fromJson(core.Map _json) { | 3894 DriveFile.fromJson(core.Map _json) { |
| 3854 if (_json.containsKey("alternateLink")) { | 3895 if (_json.containsKey("alternateLink")) { |
| 3855 alternateLink = _json["alternateLink"]; | 3896 alternateLink = _json["alternateLink"]; |
| 3856 } | 3897 } |
| 3857 if (_json.containsKey("id")) { | 3898 if (_json.containsKey("id")) { |
| 3858 id = _json["id"]; | 3899 id = _json["id"]; |
| 3859 } | 3900 } |
| 3860 if (_json.containsKey("thumbnailUrl")) { | 3901 if (_json.containsKey("thumbnailUrl")) { |
| 3861 thumbnailUrl = _json["thumbnailUrl"]; | 3902 thumbnailUrl = _json["thumbnailUrl"]; |
| 3862 } | 3903 } |
| 3863 if (_json.containsKey("title")) { | 3904 if (_json.containsKey("title")) { |
| 3864 title = _json["title"]; | 3905 title = _json["title"]; |
| 3865 } | 3906 } |
| 3866 } | 3907 } |
| 3867 | 3908 |
| 3868 core.Map<core.String, core.Object> toJson() { | 3909 core.Map<core.String, core.Object> toJson() { |
| 3869 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3910 final core.Map<core.String, core.Object> _json = |
| 3911 new core.Map<core.String, core.Object>(); |
| 3870 if (alternateLink != null) { | 3912 if (alternateLink != null) { |
| 3871 _json["alternateLink"] = alternateLink; | 3913 _json["alternateLink"] = alternateLink; |
| 3872 } | 3914 } |
| 3873 if (id != null) { | 3915 if (id != null) { |
| 3874 _json["id"] = id; | 3916 _json["id"] = id; |
| 3875 } | 3917 } |
| 3876 if (thumbnailUrl != null) { | 3918 if (thumbnailUrl != null) { |
| 3877 _json["thumbnailUrl"] = thumbnailUrl; | 3919 _json["thumbnailUrl"] = thumbnailUrl; |
| 3878 } | 3920 } |
| 3879 if (title != null) { | 3921 if (title != null) { |
| 3880 _json["title"] = title; | 3922 _json["title"] = title; |
| 3881 } | 3923 } |
| 3882 return _json; | 3924 return _json; |
| 3883 } | 3925 } |
| 3884 } | 3926 } |
| 3885 | 3927 |
| 3886 /** Representation of a Google Drive folder. */ | 3928 /// Representation of a Google Drive folder. |
| 3887 class DriveFolder { | 3929 class DriveFolder { |
| 3888 /** | 3930 /// URL that can be used to access the Drive folder. |
| 3889 * URL that can be used to access the Drive folder. | 3931 /// |
| 3890 * | 3932 /// Read-only. |
| 3891 * Read-only. | |
| 3892 */ | |
| 3893 core.String alternateLink; | 3933 core.String alternateLink; |
| 3894 /** Drive API resource ID. */ | 3934 |
| 3935 /// Drive API resource ID. |
| 3895 core.String id; | 3936 core.String id; |
| 3896 /** | 3937 |
| 3897 * Title of the Drive folder. | 3938 /// Title of the Drive folder. |
| 3898 * | 3939 /// |
| 3899 * Read-only. | 3940 /// Read-only. |
| 3900 */ | |
| 3901 core.String title; | 3941 core.String title; |
| 3902 | 3942 |
| 3903 DriveFolder(); | 3943 DriveFolder(); |
| 3904 | 3944 |
| 3905 DriveFolder.fromJson(core.Map _json) { | 3945 DriveFolder.fromJson(core.Map _json) { |
| 3906 if (_json.containsKey("alternateLink")) { | 3946 if (_json.containsKey("alternateLink")) { |
| 3907 alternateLink = _json["alternateLink"]; | 3947 alternateLink = _json["alternateLink"]; |
| 3908 } | 3948 } |
| 3909 if (_json.containsKey("id")) { | 3949 if (_json.containsKey("id")) { |
| 3910 id = _json["id"]; | 3950 id = _json["id"]; |
| 3911 } | 3951 } |
| 3912 if (_json.containsKey("title")) { | 3952 if (_json.containsKey("title")) { |
| 3913 title = _json["title"]; | 3953 title = _json["title"]; |
| 3914 } | 3954 } |
| 3915 } | 3955 } |
| 3916 | 3956 |
| 3917 core.Map<core.String, core.Object> toJson() { | 3957 core.Map<core.String, core.Object> toJson() { |
| 3918 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3958 final core.Map<core.String, core.Object> _json = |
| 3959 new core.Map<core.String, core.Object>(); |
| 3919 if (alternateLink != null) { | 3960 if (alternateLink != null) { |
| 3920 _json["alternateLink"] = alternateLink; | 3961 _json["alternateLink"] = alternateLink; |
| 3921 } | 3962 } |
| 3922 if (id != null) { | 3963 if (id != null) { |
| 3923 _json["id"] = id; | 3964 _json["id"] = id; |
| 3924 } | 3965 } |
| 3925 if (title != null) { | 3966 if (title != null) { |
| 3926 _json["title"] = title; | 3967 _json["title"] = title; |
| 3927 } | 3968 } |
| 3928 return _json; | 3969 return _json; |
| 3929 } | 3970 } |
| 3930 } | 3971 } |
| 3931 | 3972 |
| 3932 /** | 3973 /// A generic empty message that you can re-use to avoid defining duplicated |
| 3933 * A generic empty message that you can re-use to avoid defining duplicated | 3974 /// empty messages in your APIs. A typical example is to use it as the request |
| 3934 * empty messages in your APIs. A typical example is to use it as the request | 3975 /// or the response type of an API method. For instance: |
| 3935 * or the response type of an API method. For instance: | 3976 /// |
| 3936 * | 3977 /// service Foo { |
| 3937 * service Foo { | 3978 /// rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); |
| 3938 * rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); | 3979 /// } |
| 3939 * } | 3980 /// |
| 3940 * | 3981 /// The JSON representation for `Empty` is empty JSON object `{}`. |
| 3941 * The JSON representation for `Empty` is empty JSON object `{}`. | |
| 3942 */ | |
| 3943 class Empty { | 3982 class Empty { |
| 3944 | |
| 3945 Empty(); | 3983 Empty(); |
| 3946 | 3984 |
| 3947 Empty.fromJson(core.Map _json) { | 3985 Empty.fromJson(core.Map _json) {} |
| 3948 } | |
| 3949 | 3986 |
| 3950 core.Map<core.String, core.Object> toJson() { | 3987 core.Map<core.String, core.Object> toJson() { |
| 3951 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 3988 final core.Map<core.String, core.Object> _json = |
| 3989 new core.Map<core.String, core.Object>(); |
| 3952 return _json; | 3990 return _json; |
| 3953 } | 3991 } |
| 3954 } | 3992 } |
| 3955 | 3993 |
| 3956 /** Google Forms item. */ | 3994 /// Google Forms item. |
| 3957 class Form { | 3995 class Form { |
| 3958 /** URL of the form. */ | 3996 /// URL of the form. |
| 3959 core.String formUrl; | 3997 core.String formUrl; |
| 3960 /** | 3998 |
| 3961 * URL of the form responses document. | 3999 /// URL of the form responses document. |
| 3962 * Only set if respsonses have been recorded and only when the | 4000 /// Only set if respsonses have been recorded and only when the |
| 3963 * requesting user is an editor of the form. | 4001 /// requesting user is an editor of the form. |
| 3964 * | 4002 /// |
| 3965 * Read-only. | 4003 /// Read-only. |
| 3966 */ | |
| 3967 core.String responseUrl; | 4004 core.String responseUrl; |
| 3968 /** | 4005 |
| 3969 * URL of a thumbnail image of the Form. | 4006 /// URL of a thumbnail image of the Form. |
| 3970 * | 4007 /// |
| 3971 * Read-only. | 4008 /// Read-only. |
| 3972 */ | |
| 3973 core.String thumbnailUrl; | 4009 core.String thumbnailUrl; |
| 3974 /** | 4010 |
| 3975 * Title of the Form. | 4011 /// Title of the Form. |
| 3976 * | 4012 /// |
| 3977 * Read-only. | 4013 /// Read-only. |
| 3978 */ | |
| 3979 core.String title; | 4014 core.String title; |
| 3980 | 4015 |
| 3981 Form(); | 4016 Form(); |
| 3982 | 4017 |
| 3983 Form.fromJson(core.Map _json) { | 4018 Form.fromJson(core.Map _json) { |
| 3984 if (_json.containsKey("formUrl")) { | 4019 if (_json.containsKey("formUrl")) { |
| 3985 formUrl = _json["formUrl"]; | 4020 formUrl = _json["formUrl"]; |
| 3986 } | 4021 } |
| 3987 if (_json.containsKey("responseUrl")) { | 4022 if (_json.containsKey("responseUrl")) { |
| 3988 responseUrl = _json["responseUrl"]; | 4023 responseUrl = _json["responseUrl"]; |
| 3989 } | 4024 } |
| 3990 if (_json.containsKey("thumbnailUrl")) { | 4025 if (_json.containsKey("thumbnailUrl")) { |
| 3991 thumbnailUrl = _json["thumbnailUrl"]; | 4026 thumbnailUrl = _json["thumbnailUrl"]; |
| 3992 } | 4027 } |
| 3993 if (_json.containsKey("title")) { | 4028 if (_json.containsKey("title")) { |
| 3994 title = _json["title"]; | 4029 title = _json["title"]; |
| 3995 } | 4030 } |
| 3996 } | 4031 } |
| 3997 | 4032 |
| 3998 core.Map<core.String, core.Object> toJson() { | 4033 core.Map<core.String, core.Object> toJson() { |
| 3999 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4034 final core.Map<core.String, core.Object> _json = |
| 4035 new core.Map<core.String, core.Object>(); |
| 4000 if (formUrl != null) { | 4036 if (formUrl != null) { |
| 4001 _json["formUrl"] = formUrl; | 4037 _json["formUrl"] = formUrl; |
| 4002 } | 4038 } |
| 4003 if (responseUrl != null) { | 4039 if (responseUrl != null) { |
| 4004 _json["responseUrl"] = responseUrl; | 4040 _json["responseUrl"] = responseUrl; |
| 4005 } | 4041 } |
| 4006 if (thumbnailUrl != null) { | 4042 if (thumbnailUrl != null) { |
| 4007 _json["thumbnailUrl"] = thumbnailUrl; | 4043 _json["thumbnailUrl"] = thumbnailUrl; |
| 4008 } | 4044 } |
| 4009 if (title != null) { | 4045 if (title != null) { |
| 4010 _json["title"] = title; | 4046 _json["title"] = title; |
| 4011 } | 4047 } |
| 4012 return _json; | 4048 return _json; |
| 4013 } | 4049 } |
| 4014 } | 4050 } |
| 4015 | 4051 |
| 4016 /** Global user permission description. */ | 4052 /// Global user permission description. |
| 4017 class GlobalPermission { | 4053 class GlobalPermission { |
| 4018 /** | 4054 /// Permission value. |
| 4019 * Permission value. | 4055 /// Possible string values are: |
| 4020 * Possible string values are: | 4056 /// - "PERMISSION_UNSPECIFIED" : No permission is specified. This is not |
| 4021 * - "PERMISSION_UNSPECIFIED" : No permission is specified. This is not | 4057 /// returned and is not a |
| 4022 * returned and is not a | 4058 /// valid value. |
| 4023 * valid value. | 4059 /// - "CREATE_COURSE" : User is permitted to create a course. |
| 4024 * - "CREATE_COURSE" : User is permitted to create a course. | |
| 4025 */ | |
| 4026 core.String permission; | 4060 core.String permission; |
| 4027 | 4061 |
| 4028 GlobalPermission(); | 4062 GlobalPermission(); |
| 4029 | 4063 |
| 4030 GlobalPermission.fromJson(core.Map _json) { | 4064 GlobalPermission.fromJson(core.Map _json) { |
| 4031 if (_json.containsKey("permission")) { | 4065 if (_json.containsKey("permission")) { |
| 4032 permission = _json["permission"]; | 4066 permission = _json["permission"]; |
| 4033 } | 4067 } |
| 4034 } | 4068 } |
| 4035 | 4069 |
| 4036 core.Map<core.String, core.Object> toJson() { | 4070 core.Map<core.String, core.Object> toJson() { |
| 4037 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4071 final core.Map<core.String, core.Object> _json = |
| 4072 new core.Map<core.String, core.Object>(); |
| 4038 if (permission != null) { | 4073 if (permission != null) { |
| 4039 _json["permission"] = permission; | 4074 _json["permission"] = permission; |
| 4040 } | 4075 } |
| 4041 return _json; | 4076 return _json; |
| 4042 } | 4077 } |
| 4043 } | 4078 } |
| 4044 | 4079 |
| 4045 /** The history of each grade on this submission. */ | 4080 /// The history of each grade on this submission. |
| 4046 class GradeHistory { | 4081 class GradeHistory { |
| 4047 /** The teacher who made the grade change. */ | 4082 /// The teacher who made the grade change. |
| 4048 core.String actorUserId; | 4083 core.String actorUserId; |
| 4049 /** | 4084 |
| 4050 * The type of grade change at this time in the submission grade history. | 4085 /// The type of grade change at this time in the submission grade history. |
| 4051 * Possible string values are: | 4086 /// Possible string values are: |
| 4052 * - "UNKNOWN_GRADE_CHANGE_TYPE" : No grade change type specified. This should | 4087 /// - "UNKNOWN_GRADE_CHANGE_TYPE" : No grade change type specified. This |
| 4053 * never be returned. | 4088 /// should never be returned. |
| 4054 * - "DRAFT_GRADE_POINTS_EARNED_CHANGE" : A change in the numerator of the | 4089 /// - "DRAFT_GRADE_POINTS_EARNED_CHANGE" : A change in the numerator of the |
| 4055 * draft grade. | 4090 /// draft grade. |
| 4056 * - "ASSIGNED_GRADE_POINTS_EARNED_CHANGE" : A change in the numerator of the | 4091 /// - "ASSIGNED_GRADE_POINTS_EARNED_CHANGE" : A change in the numerator of |
| 4057 * assigned grade. | 4092 /// the assigned grade. |
| 4058 * - "MAX_POINTS_CHANGE" : A change in the denominator of the grade. | 4093 /// - "MAX_POINTS_CHANGE" : A change in the denominator of the grade. |
| 4059 */ | |
| 4060 core.String gradeChangeType; | 4094 core.String gradeChangeType; |
| 4061 /** When the grade of the submission was changed. */ | 4095 |
| 4096 /// When the grade of the submission was changed. |
| 4062 core.String gradeTimestamp; | 4097 core.String gradeTimestamp; |
| 4063 /** | 4098 |
| 4064 * The denominator of the grade at this time in the submission grade | 4099 /// The denominator of the grade at this time in the submission grade |
| 4065 * history. | 4100 /// history. |
| 4066 */ | |
| 4067 core.double maxPoints; | 4101 core.double maxPoints; |
| 4068 /** | 4102 |
| 4069 * The numerator of the grade at this time in the submission grade history. | 4103 /// The numerator of the grade at this time in the submission grade history. |
| 4070 */ | |
| 4071 core.double pointsEarned; | 4104 core.double pointsEarned; |
| 4072 | 4105 |
| 4073 GradeHistory(); | 4106 GradeHistory(); |
| 4074 | 4107 |
| 4075 GradeHistory.fromJson(core.Map _json) { | 4108 GradeHistory.fromJson(core.Map _json) { |
| 4076 if (_json.containsKey("actorUserId")) { | 4109 if (_json.containsKey("actorUserId")) { |
| 4077 actorUserId = _json["actorUserId"]; | 4110 actorUserId = _json["actorUserId"]; |
| 4078 } | 4111 } |
| 4079 if (_json.containsKey("gradeChangeType")) { | 4112 if (_json.containsKey("gradeChangeType")) { |
| 4080 gradeChangeType = _json["gradeChangeType"]; | 4113 gradeChangeType = _json["gradeChangeType"]; |
| 4081 } | 4114 } |
| 4082 if (_json.containsKey("gradeTimestamp")) { | 4115 if (_json.containsKey("gradeTimestamp")) { |
| 4083 gradeTimestamp = _json["gradeTimestamp"]; | 4116 gradeTimestamp = _json["gradeTimestamp"]; |
| 4084 } | 4117 } |
| 4085 if (_json.containsKey("maxPoints")) { | 4118 if (_json.containsKey("maxPoints")) { |
| 4086 maxPoints = _json["maxPoints"]; | 4119 maxPoints = _json["maxPoints"]; |
| 4087 } | 4120 } |
| 4088 if (_json.containsKey("pointsEarned")) { | 4121 if (_json.containsKey("pointsEarned")) { |
| 4089 pointsEarned = _json["pointsEarned"]; | 4122 pointsEarned = _json["pointsEarned"]; |
| 4090 } | 4123 } |
| 4091 } | 4124 } |
| 4092 | 4125 |
| 4093 core.Map<core.String, core.Object> toJson() { | 4126 core.Map<core.String, core.Object> toJson() { |
| 4094 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4127 final core.Map<core.String, core.Object> _json = |
| 4128 new core.Map<core.String, core.Object>(); |
| 4095 if (actorUserId != null) { | 4129 if (actorUserId != null) { |
| 4096 _json["actorUserId"] = actorUserId; | 4130 _json["actorUserId"] = actorUserId; |
| 4097 } | 4131 } |
| 4098 if (gradeChangeType != null) { | 4132 if (gradeChangeType != null) { |
| 4099 _json["gradeChangeType"] = gradeChangeType; | 4133 _json["gradeChangeType"] = gradeChangeType; |
| 4100 } | 4134 } |
| 4101 if (gradeTimestamp != null) { | 4135 if (gradeTimestamp != null) { |
| 4102 _json["gradeTimestamp"] = gradeTimestamp; | 4136 _json["gradeTimestamp"] = gradeTimestamp; |
| 4103 } | 4137 } |
| 4104 if (maxPoints != null) { | 4138 if (maxPoints != null) { |
| 4105 _json["maxPoints"] = maxPoints; | 4139 _json["maxPoints"] = maxPoints; |
| 4106 } | 4140 } |
| 4107 if (pointsEarned != null) { | 4141 if (pointsEarned != null) { |
| 4108 _json["pointsEarned"] = pointsEarned; | 4142 _json["pointsEarned"] = pointsEarned; |
| 4109 } | 4143 } |
| 4110 return _json; | 4144 return _json; |
| 4111 } | 4145 } |
| 4112 } | 4146 } |
| 4113 | 4147 |
| 4114 /** | 4148 /// Association between a student and a guardian of that student. The guardian |
| 4115 * Association between a student and a guardian of that student. The guardian | 4149 /// may receive information about the student's course work. |
| 4116 * may receive information about the student's course work. | |
| 4117 */ | |
| 4118 class Guardian { | 4150 class Guardian { |
| 4119 /** Identifier for the guardian. */ | 4151 /// Identifier for the guardian. |
| 4120 core.String guardianId; | 4152 core.String guardianId; |
| 4121 /** User profile for the guardian. */ | 4153 |
| 4154 /// User profile for the guardian. |
| 4122 UserProfile guardianProfile; | 4155 UserProfile guardianProfile; |
| 4123 /** | 4156 |
| 4124 * The email address to which the initial guardian invitation was sent. | 4157 /// The email address to which the initial guardian invitation was sent. |
| 4125 * This field is only visible to domain administrators. | 4158 /// This field is only visible to domain administrators. |
| 4126 */ | |
| 4127 core.String invitedEmailAddress; | 4159 core.String invitedEmailAddress; |
| 4128 /** Identifier for the student to whom the guardian relationship applies. */ | 4160 |
| 4161 /// Identifier for the student to whom the guardian relationship applies. |
| 4129 core.String studentId; | 4162 core.String studentId; |
| 4130 | 4163 |
| 4131 Guardian(); | 4164 Guardian(); |
| 4132 | 4165 |
| 4133 Guardian.fromJson(core.Map _json) { | 4166 Guardian.fromJson(core.Map _json) { |
| 4134 if (_json.containsKey("guardianId")) { | 4167 if (_json.containsKey("guardianId")) { |
| 4135 guardianId = _json["guardianId"]; | 4168 guardianId = _json["guardianId"]; |
| 4136 } | 4169 } |
| 4137 if (_json.containsKey("guardianProfile")) { | 4170 if (_json.containsKey("guardianProfile")) { |
| 4138 guardianProfile = new UserProfile.fromJson(_json["guardianProfile"]); | 4171 guardianProfile = new UserProfile.fromJson(_json["guardianProfile"]); |
| 4139 } | 4172 } |
| 4140 if (_json.containsKey("invitedEmailAddress")) { | 4173 if (_json.containsKey("invitedEmailAddress")) { |
| 4141 invitedEmailAddress = _json["invitedEmailAddress"]; | 4174 invitedEmailAddress = _json["invitedEmailAddress"]; |
| 4142 } | 4175 } |
| 4143 if (_json.containsKey("studentId")) { | 4176 if (_json.containsKey("studentId")) { |
| 4144 studentId = _json["studentId"]; | 4177 studentId = _json["studentId"]; |
| 4145 } | 4178 } |
| 4146 } | 4179 } |
| 4147 | 4180 |
| 4148 core.Map<core.String, core.Object> toJson() { | 4181 core.Map<core.String, core.Object> toJson() { |
| 4149 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4182 final core.Map<core.String, core.Object> _json = |
| 4183 new core.Map<core.String, core.Object>(); |
| 4150 if (guardianId != null) { | 4184 if (guardianId != null) { |
| 4151 _json["guardianId"] = guardianId; | 4185 _json["guardianId"] = guardianId; |
| 4152 } | 4186 } |
| 4153 if (guardianProfile != null) { | 4187 if (guardianProfile != null) { |
| 4154 _json["guardianProfile"] = (guardianProfile).toJson(); | 4188 _json["guardianProfile"] = (guardianProfile).toJson(); |
| 4155 } | 4189 } |
| 4156 if (invitedEmailAddress != null) { | 4190 if (invitedEmailAddress != null) { |
| 4157 _json["invitedEmailAddress"] = invitedEmailAddress; | 4191 _json["invitedEmailAddress"] = invitedEmailAddress; |
| 4158 } | 4192 } |
| 4159 if (studentId != null) { | 4193 if (studentId != null) { |
| 4160 _json["studentId"] = studentId; | 4194 _json["studentId"] = studentId; |
| 4161 } | 4195 } |
| 4162 return _json; | 4196 return _json; |
| 4163 } | 4197 } |
| 4164 } | 4198 } |
| 4165 | 4199 |
| 4166 /** | 4200 /// An invitation to become the guardian of a specified user, sent to a |
| 4167 * An invitation to become the guardian of a specified user, sent to a specified | 4201 /// specified |
| 4168 * email address. | 4202 /// email address. |
| 4169 */ | |
| 4170 class GuardianInvitation { | 4203 class GuardianInvitation { |
| 4171 /** | 4204 /// The time that this invitation was created. |
| 4172 * The time that this invitation was created. | 4205 /// |
| 4173 * | 4206 /// Read-only. |
| 4174 * Read-only. | |
| 4175 */ | |
| 4176 core.String creationTime; | 4207 core.String creationTime; |
| 4177 /** | 4208 |
| 4178 * Unique identifier for this invitation. | 4209 /// Unique identifier for this invitation. |
| 4179 * | 4210 /// |
| 4180 * Read-only. | 4211 /// Read-only. |
| 4181 */ | |
| 4182 core.String invitationId; | 4212 core.String invitationId; |
| 4183 /** | 4213 |
| 4184 * Email address that the invitation was sent to. | 4214 /// Email address that the invitation was sent to. |
| 4185 * This field is only visible to domain administrators. | 4215 /// This field is only visible to domain administrators. |
| 4186 */ | |
| 4187 core.String invitedEmailAddress; | 4216 core.String invitedEmailAddress; |
| 4188 /** | 4217 |
| 4189 * The state that this invitation is in. | 4218 /// The state that this invitation is in. |
| 4190 * Possible string values are: | 4219 /// Possible string values are: |
| 4191 * - "GUARDIAN_INVITATION_STATE_UNSPECIFIED" : Should never be returned. | 4220 /// - "GUARDIAN_INVITATION_STATE_UNSPECIFIED" : Should never be returned. |
| 4192 * - "PENDING" : The invitation is active and awaiting a response. | 4221 /// - "PENDING" : The invitation is active and awaiting a response. |
| 4193 * - "COMPLETE" : The invitation is no longer active. It may have been | 4222 /// - "COMPLETE" : The invitation is no longer active. It may have been |
| 4194 * accepted, declined, | 4223 /// accepted, declined, |
| 4195 * withdrawn or it may have expired. | 4224 /// withdrawn or it may have expired. |
| 4196 */ | |
| 4197 core.String state; | 4225 core.String state; |
| 4198 /** ID of the student (in standard format) */ | 4226 |
| 4227 /// ID of the student (in standard format) |
| 4199 core.String studentId; | 4228 core.String studentId; |
| 4200 | 4229 |
| 4201 GuardianInvitation(); | 4230 GuardianInvitation(); |
| 4202 | 4231 |
| 4203 GuardianInvitation.fromJson(core.Map _json) { | 4232 GuardianInvitation.fromJson(core.Map _json) { |
| 4204 if (_json.containsKey("creationTime")) { | 4233 if (_json.containsKey("creationTime")) { |
| 4205 creationTime = _json["creationTime"]; | 4234 creationTime = _json["creationTime"]; |
| 4206 } | 4235 } |
| 4207 if (_json.containsKey("invitationId")) { | 4236 if (_json.containsKey("invitationId")) { |
| 4208 invitationId = _json["invitationId"]; | 4237 invitationId = _json["invitationId"]; |
| 4209 } | 4238 } |
| 4210 if (_json.containsKey("invitedEmailAddress")) { | 4239 if (_json.containsKey("invitedEmailAddress")) { |
| 4211 invitedEmailAddress = _json["invitedEmailAddress"]; | 4240 invitedEmailAddress = _json["invitedEmailAddress"]; |
| 4212 } | 4241 } |
| 4213 if (_json.containsKey("state")) { | 4242 if (_json.containsKey("state")) { |
| 4214 state = _json["state"]; | 4243 state = _json["state"]; |
| 4215 } | 4244 } |
| 4216 if (_json.containsKey("studentId")) { | 4245 if (_json.containsKey("studentId")) { |
| 4217 studentId = _json["studentId"]; | 4246 studentId = _json["studentId"]; |
| 4218 } | 4247 } |
| 4219 } | 4248 } |
| 4220 | 4249 |
| 4221 core.Map<core.String, core.Object> toJson() { | 4250 core.Map<core.String, core.Object> toJson() { |
| 4222 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4251 final core.Map<core.String, core.Object> _json = |
| 4252 new core.Map<core.String, core.Object>(); |
| 4223 if (creationTime != null) { | 4253 if (creationTime != null) { |
| 4224 _json["creationTime"] = creationTime; | 4254 _json["creationTime"] = creationTime; |
| 4225 } | 4255 } |
| 4226 if (invitationId != null) { | 4256 if (invitationId != null) { |
| 4227 _json["invitationId"] = invitationId; | 4257 _json["invitationId"] = invitationId; |
| 4228 } | 4258 } |
| 4229 if (invitedEmailAddress != null) { | 4259 if (invitedEmailAddress != null) { |
| 4230 _json["invitedEmailAddress"] = invitedEmailAddress; | 4260 _json["invitedEmailAddress"] = invitedEmailAddress; |
| 4231 } | 4261 } |
| 4232 if (state != null) { | 4262 if (state != null) { |
| 4233 _json["state"] = state; | 4263 _json["state"] = state; |
| 4234 } | 4264 } |
| 4235 if (studentId != null) { | 4265 if (studentId != null) { |
| 4236 _json["studentId"] = studentId; | 4266 _json["studentId"] = studentId; |
| 4237 } | 4267 } |
| 4238 return _json; | 4268 return _json; |
| 4239 } | 4269 } |
| 4240 } | 4270 } |
| 4241 | 4271 |
| 4242 /** An invitation to join a course. */ | 4272 /// An invitation to join a course. |
| 4243 class Invitation { | 4273 class Invitation { |
| 4244 /** Identifier of the course to invite the user to. */ | 4274 /// Identifier of the course to invite the user to. |
| 4245 core.String courseId; | 4275 core.String courseId; |
| 4246 /** | 4276 |
| 4247 * Identifier assigned by Classroom. | 4277 /// Identifier assigned by Classroom. |
| 4248 * | 4278 /// |
| 4249 * Read-only. | 4279 /// Read-only. |
| 4250 */ | |
| 4251 core.String id; | 4280 core.String id; |
| 4252 /** | 4281 |
| 4253 * Role to invite the user to have. | 4282 /// Role to invite the user to have. |
| 4254 * Must not be `COURSE_ROLE_UNSPECIFIED`. | 4283 /// Must not be `COURSE_ROLE_UNSPECIFIED`. |
| 4255 * Possible string values are: | 4284 /// Possible string values are: |
| 4256 * - "COURSE_ROLE_UNSPECIFIED" : No course role. | 4285 /// - "COURSE_ROLE_UNSPECIFIED" : No course role. |
| 4257 * - "STUDENT" : Student in the course. | 4286 /// - "STUDENT" : Student in the course. |
| 4258 * - "TEACHER" : Teacher of the course. | 4287 /// - "TEACHER" : Teacher of the course. |
| 4259 * - "OWNER" : Owner of the course. | 4288 /// - "OWNER" : Owner of the course. |
| 4260 */ | |
| 4261 core.String role; | 4289 core.String role; |
| 4262 /** | 4290 |
| 4263 * Identifier of the invited user. | 4291 /// Identifier of the invited user. |
| 4264 * | 4292 /// |
| 4265 * When specified as a parameter of a request, this identifier can be set to | 4293 /// When specified as a parameter of a request, this identifier can be set to |
| 4266 * one of the following: | 4294 /// one of the following: |
| 4267 * | 4295 /// |
| 4268 * * the numeric identifier for the user | 4296 /// * the numeric identifier for the user |
| 4269 * * the email address of the user | 4297 /// * the email address of the user |
| 4270 * * the string literal `"me"`, indicating the requesting user | 4298 /// * the string literal `"me"`, indicating the requesting user |
| 4271 */ | |
| 4272 core.String userId; | 4299 core.String userId; |
| 4273 | 4300 |
| 4274 Invitation(); | 4301 Invitation(); |
| 4275 | 4302 |
| 4276 Invitation.fromJson(core.Map _json) { | 4303 Invitation.fromJson(core.Map _json) { |
| 4277 if (_json.containsKey("courseId")) { | 4304 if (_json.containsKey("courseId")) { |
| 4278 courseId = _json["courseId"]; | 4305 courseId = _json["courseId"]; |
| 4279 } | 4306 } |
| 4280 if (_json.containsKey("id")) { | 4307 if (_json.containsKey("id")) { |
| 4281 id = _json["id"]; | 4308 id = _json["id"]; |
| 4282 } | 4309 } |
| 4283 if (_json.containsKey("role")) { | 4310 if (_json.containsKey("role")) { |
| 4284 role = _json["role"]; | 4311 role = _json["role"]; |
| 4285 } | 4312 } |
| 4286 if (_json.containsKey("userId")) { | 4313 if (_json.containsKey("userId")) { |
| 4287 userId = _json["userId"]; | 4314 userId = _json["userId"]; |
| 4288 } | 4315 } |
| 4289 } | 4316 } |
| 4290 | 4317 |
| 4291 core.Map<core.String, core.Object> toJson() { | 4318 core.Map<core.String, core.Object> toJson() { |
| 4292 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4319 final core.Map<core.String, core.Object> _json = |
| 4320 new core.Map<core.String, core.Object>(); |
| 4293 if (courseId != null) { | 4321 if (courseId != null) { |
| 4294 _json["courseId"] = courseId; | 4322 _json["courseId"] = courseId; |
| 4295 } | 4323 } |
| 4296 if (id != null) { | 4324 if (id != null) { |
| 4297 _json["id"] = id; | 4325 _json["id"] = id; |
| 4298 } | 4326 } |
| 4299 if (role != null) { | 4327 if (role != null) { |
| 4300 _json["role"] = role; | 4328 _json["role"] = role; |
| 4301 } | 4329 } |
| 4302 if (userId != null) { | 4330 if (userId != null) { |
| 4303 _json["userId"] = userId; | 4331 _json["userId"] = userId; |
| 4304 } | 4332 } |
| 4305 return _json; | 4333 return _json; |
| 4306 } | 4334 } |
| 4307 } | 4335 } |
| 4308 | 4336 |
| 4309 /** URL item. */ | 4337 /// URL item. |
| 4310 class Link { | 4338 class Link { |
| 4311 /** | 4339 /// URL of a thumbnail image of the target URL. |
| 4312 * URL of a thumbnail image of the target URL. | 4340 /// |
| 4313 * | 4341 /// Read-only. |
| 4314 * Read-only. | |
| 4315 */ | |
| 4316 core.String thumbnailUrl; | 4342 core.String thumbnailUrl; |
| 4317 /** | 4343 |
| 4318 * Title of the target of the URL. | 4344 /// Title of the target of the URL. |
| 4319 * | 4345 /// |
| 4320 * Read-only. | 4346 /// Read-only. |
| 4321 */ | |
| 4322 core.String title; | 4347 core.String title; |
| 4323 /** | 4348 |
| 4324 * URL to link to. | 4349 /// URL to link to. |
| 4325 * This must be a valid UTF-8 string containing between 1 and 2024 characters. | 4350 /// This must be a valid UTF-8 string containing between 1 and 2024 |
| 4326 */ | 4351 /// characters. |
| 4327 core.String url; | 4352 core.String url; |
| 4328 | 4353 |
| 4329 Link(); | 4354 Link(); |
| 4330 | 4355 |
| 4331 Link.fromJson(core.Map _json) { | 4356 Link.fromJson(core.Map _json) { |
| 4332 if (_json.containsKey("thumbnailUrl")) { | 4357 if (_json.containsKey("thumbnailUrl")) { |
| 4333 thumbnailUrl = _json["thumbnailUrl"]; | 4358 thumbnailUrl = _json["thumbnailUrl"]; |
| 4334 } | 4359 } |
| 4335 if (_json.containsKey("title")) { | 4360 if (_json.containsKey("title")) { |
| 4336 title = _json["title"]; | 4361 title = _json["title"]; |
| 4337 } | 4362 } |
| 4338 if (_json.containsKey("url")) { | 4363 if (_json.containsKey("url")) { |
| 4339 url = _json["url"]; | 4364 url = _json["url"]; |
| 4340 } | 4365 } |
| 4341 } | 4366 } |
| 4342 | 4367 |
| 4343 core.Map<core.String, core.Object> toJson() { | 4368 core.Map<core.String, core.Object> toJson() { |
| 4344 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4369 final core.Map<core.String, core.Object> _json = |
| 4370 new core.Map<core.String, core.Object>(); |
| 4345 if (thumbnailUrl != null) { | 4371 if (thumbnailUrl != null) { |
| 4346 _json["thumbnailUrl"] = thumbnailUrl; | 4372 _json["thumbnailUrl"] = thumbnailUrl; |
| 4347 } | 4373 } |
| 4348 if (title != null) { | 4374 if (title != null) { |
| 4349 _json["title"] = title; | 4375 _json["title"] = title; |
| 4350 } | 4376 } |
| 4351 if (url != null) { | 4377 if (url != null) { |
| 4352 _json["url"] = url; | 4378 _json["url"] = url; |
| 4353 } | 4379 } |
| 4354 return _json; | 4380 return _json; |
| 4355 } | 4381 } |
| 4356 } | 4382 } |
| 4357 | 4383 |
| 4358 /** Response when listing course aliases. */ | 4384 /// Response when listing course aliases. |
| 4359 class ListCourseAliasesResponse { | 4385 class ListCourseAliasesResponse { |
| 4360 /** The course aliases. */ | 4386 /// The course aliases. |
| 4361 core.List<CourseAlias> aliases; | 4387 core.List<CourseAlias> aliases; |
| 4362 /** | 4388 |
| 4363 * Token identifying the next page of results to return. If empty, no further | 4389 /// Token identifying the next page of results to return. If empty, no |
| 4364 * results are available. | 4390 /// further |
| 4365 */ | 4391 /// results are available. |
| 4366 core.String nextPageToken; | 4392 core.String nextPageToken; |
| 4367 | 4393 |
| 4368 ListCourseAliasesResponse(); | 4394 ListCourseAliasesResponse(); |
| 4369 | 4395 |
| 4370 ListCourseAliasesResponse.fromJson(core.Map _json) { | 4396 ListCourseAliasesResponse.fromJson(core.Map _json) { |
| 4371 if (_json.containsKey("aliases")) { | 4397 if (_json.containsKey("aliases")) { |
| 4372 aliases = _json["aliases"].map((value) => new CourseAlias.fromJson(value))
.toList(); | 4398 aliases = _json["aliases"] |
| 4399 .map((value) => new CourseAlias.fromJson(value)) |
| 4400 .toList(); |
| 4373 } | 4401 } |
| 4374 if (_json.containsKey("nextPageToken")) { | 4402 if (_json.containsKey("nextPageToken")) { |
| 4375 nextPageToken = _json["nextPageToken"]; | 4403 nextPageToken = _json["nextPageToken"]; |
| 4376 } | 4404 } |
| 4377 } | 4405 } |
| 4378 | 4406 |
| 4379 core.Map<core.String, core.Object> toJson() { | 4407 core.Map<core.String, core.Object> toJson() { |
| 4380 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4408 final core.Map<core.String, core.Object> _json = |
| 4409 new core.Map<core.String, core.Object>(); |
| 4381 if (aliases != null) { | 4410 if (aliases != null) { |
| 4382 _json["aliases"] = aliases.map((value) => (value).toJson()).toList(); | 4411 _json["aliases"] = aliases.map((value) => (value).toJson()).toList(); |
| 4383 } | 4412 } |
| 4384 if (nextPageToken != null) { | 4413 if (nextPageToken != null) { |
| 4385 _json["nextPageToken"] = nextPageToken; | 4414 _json["nextPageToken"] = nextPageToken; |
| 4386 } | 4415 } |
| 4387 return _json; | 4416 return _json; |
| 4388 } | 4417 } |
| 4389 } | 4418 } |
| 4390 | 4419 |
| 4391 /** Response when listing course work. */ | 4420 /// Response when listing course work. |
| 4392 class ListCourseWorkResponse { | 4421 class ListCourseWorkResponse { |
| 4393 /** Course work items that match the request. */ | 4422 /// Course work items that match the request. |
| 4394 core.List<CourseWork> courseWork; | 4423 core.List<CourseWork> courseWork; |
| 4395 /** | 4424 |
| 4396 * Token identifying the next page of results to return. If empty, no further | 4425 /// Token identifying the next page of results to return. If empty, no |
| 4397 * results are available. | 4426 /// further |
| 4398 */ | 4427 /// results are available. |
| 4399 core.String nextPageToken; | 4428 core.String nextPageToken; |
| 4400 | 4429 |
| 4401 ListCourseWorkResponse(); | 4430 ListCourseWorkResponse(); |
| 4402 | 4431 |
| 4403 ListCourseWorkResponse.fromJson(core.Map _json) { | 4432 ListCourseWorkResponse.fromJson(core.Map _json) { |
| 4404 if (_json.containsKey("courseWork")) { | 4433 if (_json.containsKey("courseWork")) { |
| 4405 courseWork = _json["courseWork"].map((value) => new CourseWork.fromJson(va
lue)).toList(); | 4434 courseWork = _json["courseWork"] |
| 4435 .map((value) => new CourseWork.fromJson(value)) |
| 4436 .toList(); |
| 4406 } | 4437 } |
| 4407 if (_json.containsKey("nextPageToken")) { | 4438 if (_json.containsKey("nextPageToken")) { |
| 4408 nextPageToken = _json["nextPageToken"]; | 4439 nextPageToken = _json["nextPageToken"]; |
| 4409 } | 4440 } |
| 4410 } | 4441 } |
| 4411 | 4442 |
| 4412 core.Map<core.String, core.Object> toJson() { | 4443 core.Map<core.String, core.Object> toJson() { |
| 4413 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4444 final core.Map<core.String, core.Object> _json = |
| 4445 new core.Map<core.String, core.Object>(); |
| 4414 if (courseWork != null) { | 4446 if (courseWork != null) { |
| 4415 _json["courseWork"] = courseWork.map((value) => (value).toJson()).toList()
; | 4447 _json["courseWork"] = |
| 4448 courseWork.map((value) => (value).toJson()).toList(); |
| 4416 } | 4449 } |
| 4417 if (nextPageToken != null) { | 4450 if (nextPageToken != null) { |
| 4418 _json["nextPageToken"] = nextPageToken; | 4451 _json["nextPageToken"] = nextPageToken; |
| 4419 } | 4452 } |
| 4420 return _json; | 4453 return _json; |
| 4421 } | 4454 } |
| 4422 } | 4455 } |
| 4423 | 4456 |
| 4424 /** Response when listing courses. */ | 4457 /// Response when listing courses. |
| 4425 class ListCoursesResponse { | 4458 class ListCoursesResponse { |
| 4426 /** Courses that match the list request. */ | 4459 /// Courses that match the list request. |
| 4427 core.List<Course> courses; | 4460 core.List<Course> courses; |
| 4428 /** | 4461 |
| 4429 * Token identifying the next page of results to return. If empty, no further | 4462 /// Token identifying the next page of results to return. If empty, no |
| 4430 * results are available. | 4463 /// further |
| 4431 */ | 4464 /// results are available. |
| 4432 core.String nextPageToken; | 4465 core.String nextPageToken; |
| 4433 | 4466 |
| 4434 ListCoursesResponse(); | 4467 ListCoursesResponse(); |
| 4435 | 4468 |
| 4436 ListCoursesResponse.fromJson(core.Map _json) { | 4469 ListCoursesResponse.fromJson(core.Map _json) { |
| 4437 if (_json.containsKey("courses")) { | 4470 if (_json.containsKey("courses")) { |
| 4438 courses = _json["courses"].map((value) => new Course.fromJson(value)).toLi
st(); | 4471 courses = |
| 4472 _json["courses"].map((value) => new Course.fromJson(value)).toList(); |
| 4439 } | 4473 } |
| 4440 if (_json.containsKey("nextPageToken")) { | 4474 if (_json.containsKey("nextPageToken")) { |
| 4441 nextPageToken = _json["nextPageToken"]; | 4475 nextPageToken = _json["nextPageToken"]; |
| 4442 } | 4476 } |
| 4443 } | 4477 } |
| 4444 | 4478 |
| 4445 core.Map<core.String, core.Object> toJson() { | 4479 core.Map<core.String, core.Object> toJson() { |
| 4446 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4480 final core.Map<core.String, core.Object> _json = |
| 4481 new core.Map<core.String, core.Object>(); |
| 4447 if (courses != null) { | 4482 if (courses != null) { |
| 4448 _json["courses"] = courses.map((value) => (value).toJson()).toList(); | 4483 _json["courses"] = courses.map((value) => (value).toJson()).toList(); |
| 4449 } | 4484 } |
| 4450 if (nextPageToken != null) { | 4485 if (nextPageToken != null) { |
| 4451 _json["nextPageToken"] = nextPageToken; | 4486 _json["nextPageToken"] = nextPageToken; |
| 4452 } | 4487 } |
| 4453 return _json; | 4488 return _json; |
| 4454 } | 4489 } |
| 4455 } | 4490 } |
| 4456 | 4491 |
| 4457 /** Response when listing guardian invitations. */ | 4492 /// Response when listing guardian invitations. |
| 4458 class ListGuardianInvitationsResponse { | 4493 class ListGuardianInvitationsResponse { |
| 4459 /** Guardian invitations that matched the list request. */ | 4494 /// Guardian invitations that matched the list request. |
| 4460 core.List<GuardianInvitation> guardianInvitations; | 4495 core.List<GuardianInvitation> guardianInvitations; |
| 4461 /** | 4496 |
| 4462 * Token identifying the next page of results to return. If empty, no further | 4497 /// Token identifying the next page of results to return. If empty, no |
| 4463 * results are available. | 4498 /// further |
| 4464 */ | 4499 /// results are available. |
| 4465 core.String nextPageToken; | 4500 core.String nextPageToken; |
| 4466 | 4501 |
| 4467 ListGuardianInvitationsResponse(); | 4502 ListGuardianInvitationsResponse(); |
| 4468 | 4503 |
| 4469 ListGuardianInvitationsResponse.fromJson(core.Map _json) { | 4504 ListGuardianInvitationsResponse.fromJson(core.Map _json) { |
| 4470 if (_json.containsKey("guardianInvitations")) { | 4505 if (_json.containsKey("guardianInvitations")) { |
| 4471 guardianInvitations = _json["guardianInvitations"].map((value) => new Guar
dianInvitation.fromJson(value)).toList(); | 4506 guardianInvitations = _json["guardianInvitations"] |
| 4507 .map((value) => new GuardianInvitation.fromJson(value)) |
| 4508 .toList(); |
| 4472 } | 4509 } |
| 4473 if (_json.containsKey("nextPageToken")) { | 4510 if (_json.containsKey("nextPageToken")) { |
| 4474 nextPageToken = _json["nextPageToken"]; | 4511 nextPageToken = _json["nextPageToken"]; |
| 4475 } | 4512 } |
| 4476 } | 4513 } |
| 4477 | 4514 |
| 4478 core.Map<core.String, core.Object> toJson() { | 4515 core.Map<core.String, core.Object> toJson() { |
| 4479 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4516 final core.Map<core.String, core.Object> _json = |
| 4517 new core.Map<core.String, core.Object>(); |
| 4480 if (guardianInvitations != null) { | 4518 if (guardianInvitations != null) { |
| 4481 _json["guardianInvitations"] = guardianInvitations.map((value) => (value).
toJson()).toList(); | 4519 _json["guardianInvitations"] = |
| 4520 guardianInvitations.map((value) => (value).toJson()).toList(); |
| 4482 } | 4521 } |
| 4483 if (nextPageToken != null) { | 4522 if (nextPageToken != null) { |
| 4484 _json["nextPageToken"] = nextPageToken; | 4523 _json["nextPageToken"] = nextPageToken; |
| 4485 } | 4524 } |
| 4486 return _json; | 4525 return _json; |
| 4487 } | 4526 } |
| 4488 } | 4527 } |
| 4489 | 4528 |
| 4490 /** Response when listing guardians. */ | 4529 /// Response when listing guardians. |
| 4491 class ListGuardiansResponse { | 4530 class ListGuardiansResponse { |
| 4492 /** | 4531 /// Guardians on this page of results that met the criteria specified in |
| 4493 * Guardians on this page of results that met the criteria specified in | 4532 /// the request. |
| 4494 * the request. | |
| 4495 */ | |
| 4496 core.List<Guardian> guardians; | 4533 core.List<Guardian> guardians; |
| 4497 /** | 4534 |
| 4498 * Token identifying the next page of results to return. If empty, no further | 4535 /// Token identifying the next page of results to return. If empty, no |
| 4499 * results are available. | 4536 /// further |
| 4500 */ | 4537 /// results are available. |
| 4501 core.String nextPageToken; | 4538 core.String nextPageToken; |
| 4502 | 4539 |
| 4503 ListGuardiansResponse(); | 4540 ListGuardiansResponse(); |
| 4504 | 4541 |
| 4505 ListGuardiansResponse.fromJson(core.Map _json) { | 4542 ListGuardiansResponse.fromJson(core.Map _json) { |
| 4506 if (_json.containsKey("guardians")) { | 4543 if (_json.containsKey("guardians")) { |
| 4507 guardians = _json["guardians"].map((value) => new Guardian.fromJson(value)
).toList(); | 4544 guardians = _json["guardians"] |
| 4545 .map((value) => new Guardian.fromJson(value)) |
| 4546 .toList(); |
| 4508 } | 4547 } |
| 4509 if (_json.containsKey("nextPageToken")) { | 4548 if (_json.containsKey("nextPageToken")) { |
| 4510 nextPageToken = _json["nextPageToken"]; | 4549 nextPageToken = _json["nextPageToken"]; |
| 4511 } | 4550 } |
| 4512 } | 4551 } |
| 4513 | 4552 |
| 4514 core.Map<core.String, core.Object> toJson() { | 4553 core.Map<core.String, core.Object> toJson() { |
| 4515 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4554 final core.Map<core.String, core.Object> _json = |
| 4555 new core.Map<core.String, core.Object>(); |
| 4516 if (guardians != null) { | 4556 if (guardians != null) { |
| 4517 _json["guardians"] = guardians.map((value) => (value).toJson()).toList(); | 4557 _json["guardians"] = guardians.map((value) => (value).toJson()).toList(); |
| 4518 } | 4558 } |
| 4519 if (nextPageToken != null) { | 4559 if (nextPageToken != null) { |
| 4520 _json["nextPageToken"] = nextPageToken; | 4560 _json["nextPageToken"] = nextPageToken; |
| 4521 } | 4561 } |
| 4522 return _json; | 4562 return _json; |
| 4523 } | 4563 } |
| 4524 } | 4564 } |
| 4525 | 4565 |
| 4526 /** Response when listing invitations. */ | 4566 /// Response when listing invitations. |
| 4527 class ListInvitationsResponse { | 4567 class ListInvitationsResponse { |
| 4528 /** Invitations that match the list request. */ | 4568 /// Invitations that match the list request. |
| 4529 core.List<Invitation> invitations; | 4569 core.List<Invitation> invitations; |
| 4530 /** | 4570 |
| 4531 * Token identifying the next page of results to return. If empty, no further | 4571 /// Token identifying the next page of results to return. If empty, no |
| 4532 * results are available. | 4572 /// further |
| 4533 */ | 4573 /// results are available. |
| 4534 core.String nextPageToken; | 4574 core.String nextPageToken; |
| 4535 | 4575 |
| 4536 ListInvitationsResponse(); | 4576 ListInvitationsResponse(); |
| 4537 | 4577 |
| 4538 ListInvitationsResponse.fromJson(core.Map _json) { | 4578 ListInvitationsResponse.fromJson(core.Map _json) { |
| 4539 if (_json.containsKey("invitations")) { | 4579 if (_json.containsKey("invitations")) { |
| 4540 invitations = _json["invitations"].map((value) => new Invitation.fromJson(
value)).toList(); | 4580 invitations = _json["invitations"] |
| 4581 .map((value) => new Invitation.fromJson(value)) |
| 4582 .toList(); |
| 4541 } | 4583 } |
| 4542 if (_json.containsKey("nextPageToken")) { | 4584 if (_json.containsKey("nextPageToken")) { |
| 4543 nextPageToken = _json["nextPageToken"]; | 4585 nextPageToken = _json["nextPageToken"]; |
| 4544 } | 4586 } |
| 4545 } | 4587 } |
| 4546 | 4588 |
| 4547 core.Map<core.String, core.Object> toJson() { | 4589 core.Map<core.String, core.Object> toJson() { |
| 4548 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4590 final core.Map<core.String, core.Object> _json = |
| 4591 new core.Map<core.String, core.Object>(); |
| 4549 if (invitations != null) { | 4592 if (invitations != null) { |
| 4550 _json["invitations"] = invitations.map((value) => (value).toJson()).toList
(); | 4593 _json["invitations"] = |
| 4594 invitations.map((value) => (value).toJson()).toList(); |
| 4551 } | 4595 } |
| 4552 if (nextPageToken != null) { | 4596 if (nextPageToken != null) { |
| 4553 _json["nextPageToken"] = nextPageToken; | 4597 _json["nextPageToken"] = nextPageToken; |
| 4554 } | 4598 } |
| 4555 return _json; | 4599 return _json; |
| 4556 } | 4600 } |
| 4557 } | 4601 } |
| 4558 | 4602 |
| 4559 /** Response when listing student submissions. */ | 4603 /// Response when listing student submissions. |
| 4560 class ListStudentSubmissionsResponse { | 4604 class ListStudentSubmissionsResponse { |
| 4561 /** | 4605 /// Token identifying the next page of results to return. If empty, no |
| 4562 * Token identifying the next page of results to return. If empty, no further | 4606 /// further |
| 4563 * results are available. | 4607 /// results are available. |
| 4564 */ | |
| 4565 core.String nextPageToken; | 4608 core.String nextPageToken; |
| 4566 /** Student work that matches the request. */ | 4609 |
| 4610 /// Student work that matches the request. |
| 4567 core.List<StudentSubmission> studentSubmissions; | 4611 core.List<StudentSubmission> studentSubmissions; |
| 4568 | 4612 |
| 4569 ListStudentSubmissionsResponse(); | 4613 ListStudentSubmissionsResponse(); |
| 4570 | 4614 |
| 4571 ListStudentSubmissionsResponse.fromJson(core.Map _json) { | 4615 ListStudentSubmissionsResponse.fromJson(core.Map _json) { |
| 4572 if (_json.containsKey("nextPageToken")) { | 4616 if (_json.containsKey("nextPageToken")) { |
| 4573 nextPageToken = _json["nextPageToken"]; | 4617 nextPageToken = _json["nextPageToken"]; |
| 4574 } | 4618 } |
| 4575 if (_json.containsKey("studentSubmissions")) { | 4619 if (_json.containsKey("studentSubmissions")) { |
| 4576 studentSubmissions = _json["studentSubmissions"].map((value) => new Studen
tSubmission.fromJson(value)).toList(); | 4620 studentSubmissions = _json["studentSubmissions"] |
| 4621 .map((value) => new StudentSubmission.fromJson(value)) |
| 4622 .toList(); |
| 4577 } | 4623 } |
| 4578 } | 4624 } |
| 4579 | 4625 |
| 4580 core.Map<core.String, core.Object> toJson() { | 4626 core.Map<core.String, core.Object> toJson() { |
| 4581 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4627 final core.Map<core.String, core.Object> _json = |
| 4628 new core.Map<core.String, core.Object>(); |
| 4582 if (nextPageToken != null) { | 4629 if (nextPageToken != null) { |
| 4583 _json["nextPageToken"] = nextPageToken; | 4630 _json["nextPageToken"] = nextPageToken; |
| 4584 } | 4631 } |
| 4585 if (studentSubmissions != null) { | 4632 if (studentSubmissions != null) { |
| 4586 _json["studentSubmissions"] = studentSubmissions.map((value) => (value).to
Json()).toList(); | 4633 _json["studentSubmissions"] = |
| 4634 studentSubmissions.map((value) => (value).toJson()).toList(); |
| 4587 } | 4635 } |
| 4588 return _json; | 4636 return _json; |
| 4589 } | 4637 } |
| 4590 } | 4638 } |
| 4591 | 4639 |
| 4592 /** Response when listing students. */ | 4640 /// Response when listing students. |
| 4593 class ListStudentsResponse { | 4641 class ListStudentsResponse { |
| 4594 /** | 4642 /// Token identifying the next page of results to return. If empty, no |
| 4595 * Token identifying the next page of results to return. If empty, no further | 4643 /// further |
| 4596 * results are available. | 4644 /// results are available. |
| 4597 */ | |
| 4598 core.String nextPageToken; | 4645 core.String nextPageToken; |
| 4599 /** Students who match the list request. */ | 4646 |
| 4647 /// Students who match the list request. |
| 4600 core.List<Student> students; | 4648 core.List<Student> students; |
| 4601 | 4649 |
| 4602 ListStudentsResponse(); | 4650 ListStudentsResponse(); |
| 4603 | 4651 |
| 4604 ListStudentsResponse.fromJson(core.Map _json) { | 4652 ListStudentsResponse.fromJson(core.Map _json) { |
| 4605 if (_json.containsKey("nextPageToken")) { | 4653 if (_json.containsKey("nextPageToken")) { |
| 4606 nextPageToken = _json["nextPageToken"]; | 4654 nextPageToken = _json["nextPageToken"]; |
| 4607 } | 4655 } |
| 4608 if (_json.containsKey("students")) { | 4656 if (_json.containsKey("students")) { |
| 4609 students = _json["students"].map((value) => new Student.fromJson(value)).t
oList(); | 4657 students = _json["students"] |
| 4658 .map((value) => new Student.fromJson(value)) |
| 4659 .toList(); |
| 4610 } | 4660 } |
| 4611 } | 4661 } |
| 4612 | 4662 |
| 4613 core.Map<core.String, core.Object> toJson() { | 4663 core.Map<core.String, core.Object> toJson() { |
| 4614 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4664 final core.Map<core.String, core.Object> _json = |
| 4665 new core.Map<core.String, core.Object>(); |
| 4615 if (nextPageToken != null) { | 4666 if (nextPageToken != null) { |
| 4616 _json["nextPageToken"] = nextPageToken; | 4667 _json["nextPageToken"] = nextPageToken; |
| 4617 } | 4668 } |
| 4618 if (students != null) { | 4669 if (students != null) { |
| 4619 _json["students"] = students.map((value) => (value).toJson()).toList(); | 4670 _json["students"] = students.map((value) => (value).toJson()).toList(); |
| 4620 } | 4671 } |
| 4621 return _json; | 4672 return _json; |
| 4622 } | 4673 } |
| 4623 } | 4674 } |
| 4624 | 4675 |
| 4625 /** Response when listing teachers. */ | 4676 /// Response when listing teachers. |
| 4626 class ListTeachersResponse { | 4677 class ListTeachersResponse { |
| 4627 /** | 4678 /// Token identifying the next page of results to return. If empty, no |
| 4628 * Token identifying the next page of results to return. If empty, no further | 4679 /// further |
| 4629 * results are available. | 4680 /// results are available. |
| 4630 */ | |
| 4631 core.String nextPageToken; | 4681 core.String nextPageToken; |
| 4632 /** Teachers who match the list request. */ | 4682 |
| 4683 /// Teachers who match the list request. |
| 4633 core.List<Teacher> teachers; | 4684 core.List<Teacher> teachers; |
| 4634 | 4685 |
| 4635 ListTeachersResponse(); | 4686 ListTeachersResponse(); |
| 4636 | 4687 |
| 4637 ListTeachersResponse.fromJson(core.Map _json) { | 4688 ListTeachersResponse.fromJson(core.Map _json) { |
| 4638 if (_json.containsKey("nextPageToken")) { | 4689 if (_json.containsKey("nextPageToken")) { |
| 4639 nextPageToken = _json["nextPageToken"]; | 4690 nextPageToken = _json["nextPageToken"]; |
| 4640 } | 4691 } |
| 4641 if (_json.containsKey("teachers")) { | 4692 if (_json.containsKey("teachers")) { |
| 4642 teachers = _json["teachers"].map((value) => new Teacher.fromJson(value)).t
oList(); | 4693 teachers = _json["teachers"] |
| 4694 .map((value) => new Teacher.fromJson(value)) |
| 4695 .toList(); |
| 4643 } | 4696 } |
| 4644 } | 4697 } |
| 4645 | 4698 |
| 4646 core.Map<core.String, core.Object> toJson() { | 4699 core.Map<core.String, core.Object> toJson() { |
| 4647 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4700 final core.Map<core.String, core.Object> _json = |
| 4701 new core.Map<core.String, core.Object>(); |
| 4648 if (nextPageToken != null) { | 4702 if (nextPageToken != null) { |
| 4649 _json["nextPageToken"] = nextPageToken; | 4703 _json["nextPageToken"] = nextPageToken; |
| 4650 } | 4704 } |
| 4651 if (teachers != null) { | 4705 if (teachers != null) { |
| 4652 _json["teachers"] = teachers.map((value) => (value).toJson()).toList(); | 4706 _json["teachers"] = teachers.map((value) => (value).toJson()).toList(); |
| 4653 } | 4707 } |
| 4654 return _json; | 4708 return _json; |
| 4655 } | 4709 } |
| 4656 } | 4710 } |
| 4657 | 4711 |
| 4658 /** | 4712 /// Material attached to course work. |
| 4659 * Material attached to course work. | 4713 /// |
| 4660 * | 4714 /// When creating attachments, setting the `form` field is not supported. |
| 4661 * When creating attachments, setting the `form` field is not supported. | |
| 4662 */ | |
| 4663 class Material { | 4715 class Material { |
| 4664 /** Google Drive file material. */ | 4716 /// Google Drive file material. |
| 4665 SharedDriveFile driveFile; | 4717 SharedDriveFile driveFile; |
| 4666 /** Google Forms material. */ | 4718 |
| 4719 /// Google Forms material. |
| 4667 Form form; | 4720 Form form; |
| 4668 /** | 4721 |
| 4669 * Link material. On creation, will be upgraded to a more appropriate type | 4722 /// Link material. On creation, will be upgraded to a more appropriate type |
| 4670 * if possible, and this will be reflected in the response. | 4723 /// if possible, and this will be reflected in the response. |
| 4671 */ | |
| 4672 Link link; | 4724 Link link; |
| 4673 /** YouTube video material. */ | 4725 |
| 4726 /// YouTube video material. |
| 4674 YouTubeVideo youtubeVideo; | 4727 YouTubeVideo youtubeVideo; |
| 4675 | 4728 |
| 4676 Material(); | 4729 Material(); |
| 4677 | 4730 |
| 4678 Material.fromJson(core.Map _json) { | 4731 Material.fromJson(core.Map _json) { |
| 4679 if (_json.containsKey("driveFile")) { | 4732 if (_json.containsKey("driveFile")) { |
| 4680 driveFile = new SharedDriveFile.fromJson(_json["driveFile"]); | 4733 driveFile = new SharedDriveFile.fromJson(_json["driveFile"]); |
| 4681 } | 4734 } |
| 4682 if (_json.containsKey("form")) { | 4735 if (_json.containsKey("form")) { |
| 4683 form = new Form.fromJson(_json["form"]); | 4736 form = new Form.fromJson(_json["form"]); |
| 4684 } | 4737 } |
| 4685 if (_json.containsKey("link")) { | 4738 if (_json.containsKey("link")) { |
| 4686 link = new Link.fromJson(_json["link"]); | 4739 link = new Link.fromJson(_json["link"]); |
| 4687 } | 4740 } |
| 4688 if (_json.containsKey("youtubeVideo")) { | 4741 if (_json.containsKey("youtubeVideo")) { |
| 4689 youtubeVideo = new YouTubeVideo.fromJson(_json["youtubeVideo"]); | 4742 youtubeVideo = new YouTubeVideo.fromJson(_json["youtubeVideo"]); |
| 4690 } | 4743 } |
| 4691 } | 4744 } |
| 4692 | 4745 |
| 4693 core.Map<core.String, core.Object> toJson() { | 4746 core.Map<core.String, core.Object> toJson() { |
| 4694 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4747 final core.Map<core.String, core.Object> _json = |
| 4748 new core.Map<core.String, core.Object>(); |
| 4695 if (driveFile != null) { | 4749 if (driveFile != null) { |
| 4696 _json["driveFile"] = (driveFile).toJson(); | 4750 _json["driveFile"] = (driveFile).toJson(); |
| 4697 } | 4751 } |
| 4698 if (form != null) { | 4752 if (form != null) { |
| 4699 _json["form"] = (form).toJson(); | 4753 _json["form"] = (form).toJson(); |
| 4700 } | 4754 } |
| 4701 if (link != null) { | 4755 if (link != null) { |
| 4702 _json["link"] = (link).toJson(); | 4756 _json["link"] = (link).toJson(); |
| 4703 } | 4757 } |
| 4704 if (youtubeVideo != null) { | 4758 if (youtubeVideo != null) { |
| 4705 _json["youtubeVideo"] = (youtubeVideo).toJson(); | 4759 _json["youtubeVideo"] = (youtubeVideo).toJson(); |
| 4706 } | 4760 } |
| 4707 return _json; | 4761 return _json; |
| 4708 } | 4762 } |
| 4709 } | 4763 } |
| 4710 | 4764 |
| 4711 /** Request to modify the attachments of a student submission. */ | 4765 /// Request to modify the attachments of a student submission. |
| 4712 class ModifyAttachmentsRequest { | 4766 class ModifyAttachmentsRequest { |
| 4713 /** | 4767 /// Attachments to add. |
| 4714 * Attachments to add. | 4768 /// A student submission may not have more than 20 attachments. |
| 4715 * A student submission may not have more than 20 attachments. | 4769 /// |
| 4716 * | 4770 /// Form attachments are not supported. |
| 4717 * Form attachments are not supported. | |
| 4718 */ | |
| 4719 core.List<Attachment> addAttachments; | 4771 core.List<Attachment> addAttachments; |
| 4720 | 4772 |
| 4721 ModifyAttachmentsRequest(); | 4773 ModifyAttachmentsRequest(); |
| 4722 | 4774 |
| 4723 ModifyAttachmentsRequest.fromJson(core.Map _json) { | 4775 ModifyAttachmentsRequest.fromJson(core.Map _json) { |
| 4724 if (_json.containsKey("addAttachments")) { | 4776 if (_json.containsKey("addAttachments")) { |
| 4725 addAttachments = _json["addAttachments"].map((value) => new Attachment.fro
mJson(value)).toList(); | 4777 addAttachments = _json["addAttachments"] |
| 4778 .map((value) => new Attachment.fromJson(value)) |
| 4779 .toList(); |
| 4726 } | 4780 } |
| 4727 } | 4781 } |
| 4728 | 4782 |
| 4729 core.Map<core.String, core.Object> toJson() { | 4783 core.Map<core.String, core.Object> toJson() { |
| 4730 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4784 final core.Map<core.String, core.Object> _json = |
| 4785 new core.Map<core.String, core.Object>(); |
| 4731 if (addAttachments != null) { | 4786 if (addAttachments != null) { |
| 4732 _json["addAttachments"] = addAttachments.map((value) => (value).toJson()).
toList(); | 4787 _json["addAttachments"] = |
| 4788 addAttachments.map((value) => (value).toJson()).toList(); |
| 4733 } | 4789 } |
| 4734 return _json; | 4790 return _json; |
| 4735 } | 4791 } |
| 4736 } | 4792 } |
| 4737 | 4793 |
| 4738 /** Additional details for multiple-choice questions. */ | 4794 /// Additional details for multiple-choice questions. |
| 4739 class MultipleChoiceQuestion { | 4795 class MultipleChoiceQuestion { |
| 4740 /** Possible choices. */ | 4796 /// Possible choices. |
| 4741 core.List<core.String> choices; | 4797 core.List<core.String> choices; |
| 4742 | 4798 |
| 4743 MultipleChoiceQuestion(); | 4799 MultipleChoiceQuestion(); |
| 4744 | 4800 |
| 4745 MultipleChoiceQuestion.fromJson(core.Map _json) { | 4801 MultipleChoiceQuestion.fromJson(core.Map _json) { |
| 4746 if (_json.containsKey("choices")) { | 4802 if (_json.containsKey("choices")) { |
| 4747 choices = _json["choices"]; | 4803 choices = _json["choices"]; |
| 4748 } | 4804 } |
| 4749 } | 4805 } |
| 4750 | 4806 |
| 4751 core.Map<core.String, core.Object> toJson() { | 4807 core.Map<core.String, core.Object> toJson() { |
| 4752 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4808 final core.Map<core.String, core.Object> _json = |
| 4809 new core.Map<core.String, core.Object>(); |
| 4753 if (choices != null) { | 4810 if (choices != null) { |
| 4754 _json["choices"] = choices; | 4811 _json["choices"] = choices; |
| 4755 } | 4812 } |
| 4756 return _json; | 4813 return _json; |
| 4757 } | 4814 } |
| 4758 } | 4815 } |
| 4759 | 4816 |
| 4760 /** Student work for a multiple-choice question. */ | 4817 /// Student work for a multiple-choice question. |
| 4761 class MultipleChoiceSubmission { | 4818 class MultipleChoiceSubmission { |
| 4762 /** Student's select choice. */ | 4819 /// Student's select choice. |
| 4763 core.String answer; | 4820 core.String answer; |
| 4764 | 4821 |
| 4765 MultipleChoiceSubmission(); | 4822 MultipleChoiceSubmission(); |
| 4766 | 4823 |
| 4767 MultipleChoiceSubmission.fromJson(core.Map _json) { | 4824 MultipleChoiceSubmission.fromJson(core.Map _json) { |
| 4768 if (_json.containsKey("answer")) { | 4825 if (_json.containsKey("answer")) { |
| 4769 answer = _json["answer"]; | 4826 answer = _json["answer"]; |
| 4770 } | 4827 } |
| 4771 } | 4828 } |
| 4772 | 4829 |
| 4773 core.Map<core.String, core.Object> toJson() { | 4830 core.Map<core.String, core.Object> toJson() { |
| 4774 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4831 final core.Map<core.String, core.Object> _json = |
| 4832 new core.Map<core.String, core.Object>(); |
| 4775 if (answer != null) { | 4833 if (answer != null) { |
| 4776 _json["answer"] = answer; | 4834 _json["answer"] = answer; |
| 4777 } | 4835 } |
| 4778 return _json; | 4836 return _json; |
| 4779 } | 4837 } |
| 4780 } | 4838 } |
| 4781 | 4839 |
| 4782 /** Details of the user's name. */ | 4840 /// Details of the user's name. |
| 4783 class Name { | 4841 class Name { |
| 4784 /** | 4842 /// The user's last name. |
| 4785 * The user's last name. | 4843 /// |
| 4786 * | 4844 /// Read-only. |
| 4787 * Read-only. | |
| 4788 */ | |
| 4789 core.String familyName; | 4845 core.String familyName; |
| 4790 /** | 4846 |
| 4791 * The user's full name formed by concatenating the first and last name | 4847 /// The user's full name formed by concatenating the first and last name |
| 4792 * values. | 4848 /// values. |
| 4793 * | 4849 /// |
| 4794 * Read-only. | 4850 /// Read-only. |
| 4795 */ | |
| 4796 core.String fullName; | 4851 core.String fullName; |
| 4797 /** | 4852 |
| 4798 * The user's first name. | 4853 /// The user's first name. |
| 4799 * | 4854 /// |
| 4800 * Read-only. | 4855 /// Read-only. |
| 4801 */ | |
| 4802 core.String givenName; | 4856 core.String givenName; |
| 4803 | 4857 |
| 4804 Name(); | 4858 Name(); |
| 4805 | 4859 |
| 4806 Name.fromJson(core.Map _json) { | 4860 Name.fromJson(core.Map _json) { |
| 4807 if (_json.containsKey("familyName")) { | 4861 if (_json.containsKey("familyName")) { |
| 4808 familyName = _json["familyName"]; | 4862 familyName = _json["familyName"]; |
| 4809 } | 4863 } |
| 4810 if (_json.containsKey("fullName")) { | 4864 if (_json.containsKey("fullName")) { |
| 4811 fullName = _json["fullName"]; | 4865 fullName = _json["fullName"]; |
| 4812 } | 4866 } |
| 4813 if (_json.containsKey("givenName")) { | 4867 if (_json.containsKey("givenName")) { |
| 4814 givenName = _json["givenName"]; | 4868 givenName = _json["givenName"]; |
| 4815 } | 4869 } |
| 4816 } | 4870 } |
| 4817 | 4871 |
| 4818 core.Map<core.String, core.Object> toJson() { | 4872 core.Map<core.String, core.Object> toJson() { |
| 4819 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4873 final core.Map<core.String, core.Object> _json = |
| 4874 new core.Map<core.String, core.Object>(); |
| 4820 if (familyName != null) { | 4875 if (familyName != null) { |
| 4821 _json["familyName"] = familyName; | 4876 _json["familyName"] = familyName; |
| 4822 } | 4877 } |
| 4823 if (fullName != null) { | 4878 if (fullName != null) { |
| 4824 _json["fullName"] = fullName; | 4879 _json["fullName"] = fullName; |
| 4825 } | 4880 } |
| 4826 if (givenName != null) { | 4881 if (givenName != null) { |
| 4827 _json["givenName"] = givenName; | 4882 _json["givenName"] = givenName; |
| 4828 } | 4883 } |
| 4829 return _json; | 4884 return _json; |
| 4830 } | 4885 } |
| 4831 } | 4886 } |
| 4832 | 4887 |
| 4833 /** Request to reclaim a student submission. */ | 4888 /// Request to reclaim a student submission. |
| 4834 class ReclaimStudentSubmissionRequest { | 4889 class ReclaimStudentSubmissionRequest { |
| 4835 | |
| 4836 ReclaimStudentSubmissionRequest(); | 4890 ReclaimStudentSubmissionRequest(); |
| 4837 | 4891 |
| 4838 ReclaimStudentSubmissionRequest.fromJson(core.Map _json) { | 4892 ReclaimStudentSubmissionRequest.fromJson(core.Map _json) {} |
| 4839 } | |
| 4840 | 4893 |
| 4841 core.Map<core.String, core.Object> toJson() { | 4894 core.Map<core.String, core.Object> toJson() { |
| 4842 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4895 final core.Map<core.String, core.Object> _json = |
| 4896 new core.Map<core.String, core.Object>(); |
| 4843 return _json; | 4897 return _json; |
| 4844 } | 4898 } |
| 4845 } | 4899 } |
| 4846 | 4900 |
| 4847 /** Request to return a student submission. */ | 4901 /// Request to return a student submission. |
| 4848 class ReturnStudentSubmissionRequest { | 4902 class ReturnStudentSubmissionRequest { |
| 4849 | |
| 4850 ReturnStudentSubmissionRequest(); | 4903 ReturnStudentSubmissionRequest(); |
| 4851 | 4904 |
| 4852 ReturnStudentSubmissionRequest.fromJson(core.Map _json) { | 4905 ReturnStudentSubmissionRequest.fromJson(core.Map _json) {} |
| 4853 } | |
| 4854 | 4906 |
| 4855 core.Map<core.String, core.Object> toJson() { | 4907 core.Map<core.String, core.Object> toJson() { |
| 4856 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4908 final core.Map<core.String, core.Object> _json = |
| 4909 new core.Map<core.String, core.Object>(); |
| 4857 return _json; | 4910 return _json; |
| 4858 } | 4911 } |
| 4859 } | 4912 } |
| 4860 | 4913 |
| 4861 /** Drive file that is used as material for course work. */ | 4914 /// Drive file that is used as material for course work. |
| 4862 class SharedDriveFile { | 4915 class SharedDriveFile { |
| 4863 /** Drive file details. */ | 4916 /// Drive file details. |
| 4864 DriveFile driveFile; | 4917 DriveFile driveFile; |
| 4865 /** | 4918 |
| 4866 * Mechanism by which students access the Drive item. | 4919 /// Mechanism by which students access the Drive item. |
| 4867 * Possible string values are: | 4920 /// Possible string values are: |
| 4868 * - "UNKNOWN_SHARE_MODE" : No sharing mode specified. This should never be | 4921 /// - "UNKNOWN_SHARE_MODE" : No sharing mode specified. This should never be |
| 4869 * returned. | 4922 /// returned. |
| 4870 * - "VIEW" : Students can view the shared file. | 4923 /// - "VIEW" : Students can view the shared file. |
| 4871 * - "EDIT" : Students can edit the shared file. | 4924 /// - "EDIT" : Students can edit the shared file. |
| 4872 * - "STUDENT_COPY" : Students have a personal copy of the shared file. | 4925 /// - "STUDENT_COPY" : Students have a personal copy of the shared file. |
| 4873 */ | |
| 4874 core.String shareMode; | 4926 core.String shareMode; |
| 4875 | 4927 |
| 4876 SharedDriveFile(); | 4928 SharedDriveFile(); |
| 4877 | 4929 |
| 4878 SharedDriveFile.fromJson(core.Map _json) { | 4930 SharedDriveFile.fromJson(core.Map _json) { |
| 4879 if (_json.containsKey("driveFile")) { | 4931 if (_json.containsKey("driveFile")) { |
| 4880 driveFile = new DriveFile.fromJson(_json["driveFile"]); | 4932 driveFile = new DriveFile.fromJson(_json["driveFile"]); |
| 4881 } | 4933 } |
| 4882 if (_json.containsKey("shareMode")) { | 4934 if (_json.containsKey("shareMode")) { |
| 4883 shareMode = _json["shareMode"]; | 4935 shareMode = _json["shareMode"]; |
| 4884 } | 4936 } |
| 4885 } | 4937 } |
| 4886 | 4938 |
| 4887 core.Map<core.String, core.Object> toJson() { | 4939 core.Map<core.String, core.Object> toJson() { |
| 4888 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4940 final core.Map<core.String, core.Object> _json = |
| 4941 new core.Map<core.String, core.Object>(); |
| 4889 if (driveFile != null) { | 4942 if (driveFile != null) { |
| 4890 _json["driveFile"] = (driveFile).toJson(); | 4943 _json["driveFile"] = (driveFile).toJson(); |
| 4891 } | 4944 } |
| 4892 if (shareMode != null) { | 4945 if (shareMode != null) { |
| 4893 _json["shareMode"] = shareMode; | 4946 _json["shareMode"] = shareMode; |
| 4894 } | 4947 } |
| 4895 return _json; | 4948 return _json; |
| 4896 } | 4949 } |
| 4897 } | 4950 } |
| 4898 | 4951 |
| 4899 /** Student work for a short answer question. */ | 4952 /// Student work for a short answer question. |
| 4900 class ShortAnswerSubmission { | 4953 class ShortAnswerSubmission { |
| 4901 /** Student response to a short-answer question. */ | 4954 /// Student response to a short-answer question. |
| 4902 core.String answer; | 4955 core.String answer; |
| 4903 | 4956 |
| 4904 ShortAnswerSubmission(); | 4957 ShortAnswerSubmission(); |
| 4905 | 4958 |
| 4906 ShortAnswerSubmission.fromJson(core.Map _json) { | 4959 ShortAnswerSubmission.fromJson(core.Map _json) { |
| 4907 if (_json.containsKey("answer")) { | 4960 if (_json.containsKey("answer")) { |
| 4908 answer = _json["answer"]; | 4961 answer = _json["answer"]; |
| 4909 } | 4962 } |
| 4910 } | 4963 } |
| 4911 | 4964 |
| 4912 core.Map<core.String, core.Object> toJson() { | 4965 core.Map<core.String, core.Object> toJson() { |
| 4913 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 4966 final core.Map<core.String, core.Object> _json = |
| 4967 new core.Map<core.String, core.Object>(); |
| 4914 if (answer != null) { | 4968 if (answer != null) { |
| 4915 _json["answer"] = answer; | 4969 _json["answer"] = answer; |
| 4916 } | 4970 } |
| 4917 return _json; | 4971 return _json; |
| 4918 } | 4972 } |
| 4919 } | 4973 } |
| 4920 | 4974 |
| 4921 /** The history of each state this submission has been in. */ | 4975 /// The history of each state this submission has been in. |
| 4922 class StateHistory { | 4976 class StateHistory { |
| 4923 /** The teacher or student who made the change */ | 4977 /// The teacher or student who made the change |
| 4924 core.String actorUserId; | 4978 core.String actorUserId; |
| 4925 /** | 4979 |
| 4926 * The workflow pipeline stage. | 4980 /// The workflow pipeline stage. |
| 4927 * Possible string values are: | 4981 /// Possible string values are: |
| 4928 * - "STATE_UNSPECIFIED" : No state specified. This should never be returned. | 4982 /// - "STATE_UNSPECIFIED" : No state specified. This should never be |
| 4929 * - "CREATED" : The Submission has been created. | 4983 /// returned. |
| 4930 * - "TURNED_IN" : The student has turned in an assigned document, which may | 4984 /// - "CREATED" : The Submission has been created. |
| 4931 * or may not be | 4985 /// - "TURNED_IN" : The student has turned in an assigned document, which may |
| 4932 * a template. | 4986 /// or may not be |
| 4933 * - "RETURNED" : The teacher has returned the assigned document to the | 4987 /// a template. |
| 4934 * student. | 4988 /// - "RETURNED" : The teacher has returned the assigned document to the |
| 4935 * - "RECLAIMED_BY_STUDENT" : The student turned in the assigned document, and | 4989 /// student. |
| 4936 * then chose to | 4990 /// - "RECLAIMED_BY_STUDENT" : The student turned in the assigned document, |
| 4937 * "unsubmit" the assignment, giving the student control again as the | 4991 /// and then chose to |
| 4938 * owner. | 4992 /// "unsubmit" the assignment, giving the student control again as the |
| 4939 * - "STUDENT_EDITED_AFTER_TURN_IN" : The student edited their submission | 4993 /// owner. |
| 4940 * after turning it in. Currently, | 4994 /// - "STUDENT_EDITED_AFTER_TURN_IN" : The student edited their submission |
| 4941 * only used by Questions, when the student edits their answer. | 4995 /// after turning it in. Currently, |
| 4942 */ | 4996 /// only used by Questions, when the student edits their answer. |
| 4943 core.String state; | 4997 core.String state; |
| 4944 /** When the submission entered this state. */ | 4998 |
| 4999 /// When the submission entered this state. |
| 4945 core.String stateTimestamp; | 5000 core.String stateTimestamp; |
| 4946 | 5001 |
| 4947 StateHistory(); | 5002 StateHistory(); |
| 4948 | 5003 |
| 4949 StateHistory.fromJson(core.Map _json) { | 5004 StateHistory.fromJson(core.Map _json) { |
| 4950 if (_json.containsKey("actorUserId")) { | 5005 if (_json.containsKey("actorUserId")) { |
| 4951 actorUserId = _json["actorUserId"]; | 5006 actorUserId = _json["actorUserId"]; |
| 4952 } | 5007 } |
| 4953 if (_json.containsKey("state")) { | 5008 if (_json.containsKey("state")) { |
| 4954 state = _json["state"]; | 5009 state = _json["state"]; |
| 4955 } | 5010 } |
| 4956 if (_json.containsKey("stateTimestamp")) { | 5011 if (_json.containsKey("stateTimestamp")) { |
| 4957 stateTimestamp = _json["stateTimestamp"]; | 5012 stateTimestamp = _json["stateTimestamp"]; |
| 4958 } | 5013 } |
| 4959 } | 5014 } |
| 4960 | 5015 |
| 4961 core.Map<core.String, core.Object> toJson() { | 5016 core.Map<core.String, core.Object> toJson() { |
| 4962 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 5017 final core.Map<core.String, core.Object> _json = |
| 5018 new core.Map<core.String, core.Object>(); |
| 4963 if (actorUserId != null) { | 5019 if (actorUserId != null) { |
| 4964 _json["actorUserId"] = actorUserId; | 5020 _json["actorUserId"] = actorUserId; |
| 4965 } | 5021 } |
| 4966 if (state != null) { | 5022 if (state != null) { |
| 4967 _json["state"] = state; | 5023 _json["state"] = state; |
| 4968 } | 5024 } |
| 4969 if (stateTimestamp != null) { | 5025 if (stateTimestamp != null) { |
| 4970 _json["stateTimestamp"] = stateTimestamp; | 5026 _json["stateTimestamp"] = stateTimestamp; |
| 4971 } | 5027 } |
| 4972 return _json; | 5028 return _json; |
| 4973 } | 5029 } |
| 4974 } | 5030 } |
| 4975 | 5031 |
| 4976 /** Student in a course. */ | 5032 /// Student in a course. |
| 4977 class Student { | 5033 class Student { |
| 4978 /** | 5034 /// Identifier of the course. |
| 4979 * Identifier of the course. | 5035 /// |
| 4980 * | 5036 /// Read-only. |
| 4981 * Read-only. | |
| 4982 */ | |
| 4983 core.String courseId; | 5037 core.String courseId; |
| 4984 /** | 5038 |
| 4985 * Global user information for the student. | 5039 /// Global user information for the student. |
| 4986 * | 5040 /// |
| 4987 * Read-only. | 5041 /// Read-only. |
| 4988 */ | |
| 4989 UserProfile profile; | 5042 UserProfile profile; |
| 4990 /** | 5043 |
| 4991 * Information about a Drive Folder for this student's work in this course. | 5044 /// Information about a Drive Folder for this student's work in this course. |
| 4992 * Only visible to the student and domain administrators. | 5045 /// Only visible to the student and domain administrators. |
| 4993 * | 5046 /// |
| 4994 * Read-only. | 5047 /// Read-only. |
| 4995 */ | |
| 4996 DriveFolder studentWorkFolder; | 5048 DriveFolder studentWorkFolder; |
| 4997 /** | 5049 |
| 4998 * Identifier of the user. | 5050 /// Identifier of the user. |
| 4999 * | 5051 /// |
| 5000 * When specified as a parameter of a request, this identifier can be one of | 5052 /// When specified as a parameter of a request, this identifier can be one of |
| 5001 * the following: | 5053 /// the following: |
| 5002 * | 5054 /// |
| 5003 * * the numeric identifier for the user | 5055 /// * the numeric identifier for the user |
| 5004 * * the email address of the user | 5056 /// * the email address of the user |
| 5005 * * the string literal `"me"`, indicating the requesting user | 5057 /// * the string literal `"me"`, indicating the requesting user |
| 5006 */ | |
| 5007 core.String userId; | 5058 core.String userId; |
| 5008 | 5059 |
| 5009 Student(); | 5060 Student(); |
| 5010 | 5061 |
| 5011 Student.fromJson(core.Map _json) { | 5062 Student.fromJson(core.Map _json) { |
| 5012 if (_json.containsKey("courseId")) { | 5063 if (_json.containsKey("courseId")) { |
| 5013 courseId = _json["courseId"]; | 5064 courseId = _json["courseId"]; |
| 5014 } | 5065 } |
| 5015 if (_json.containsKey("profile")) { | 5066 if (_json.containsKey("profile")) { |
| 5016 profile = new UserProfile.fromJson(_json["profile"]); | 5067 profile = new UserProfile.fromJson(_json["profile"]); |
| 5017 } | 5068 } |
| 5018 if (_json.containsKey("studentWorkFolder")) { | 5069 if (_json.containsKey("studentWorkFolder")) { |
| 5019 studentWorkFolder = new DriveFolder.fromJson(_json["studentWorkFolder"]); | 5070 studentWorkFolder = new DriveFolder.fromJson(_json["studentWorkFolder"]); |
| 5020 } | 5071 } |
| 5021 if (_json.containsKey("userId")) { | 5072 if (_json.containsKey("userId")) { |
| 5022 userId = _json["userId"]; | 5073 userId = _json["userId"]; |
| 5023 } | 5074 } |
| 5024 } | 5075 } |
| 5025 | 5076 |
| 5026 core.Map<core.String, core.Object> toJson() { | 5077 core.Map<core.String, core.Object> toJson() { |
| 5027 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 5078 final core.Map<core.String, core.Object> _json = |
| 5079 new core.Map<core.String, core.Object>(); |
| 5028 if (courseId != null) { | 5080 if (courseId != null) { |
| 5029 _json["courseId"] = courseId; | 5081 _json["courseId"] = courseId; |
| 5030 } | 5082 } |
| 5031 if (profile != null) { | 5083 if (profile != null) { |
| 5032 _json["profile"] = (profile).toJson(); | 5084 _json["profile"] = (profile).toJson(); |
| 5033 } | 5085 } |
| 5034 if (studentWorkFolder != null) { | 5086 if (studentWorkFolder != null) { |
| 5035 _json["studentWorkFolder"] = (studentWorkFolder).toJson(); | 5087 _json["studentWorkFolder"] = (studentWorkFolder).toJson(); |
| 5036 } | 5088 } |
| 5037 if (userId != null) { | 5089 if (userId != null) { |
| 5038 _json["userId"] = userId; | 5090 _json["userId"] = userId; |
| 5039 } | 5091 } |
| 5040 return _json; | 5092 return _json; |
| 5041 } | 5093 } |
| 5042 } | 5094 } |
| 5043 | 5095 |
| 5044 /** | 5096 /// Student submission for course work. |
| 5045 * Student submission for course work. | 5097 /// |
| 5046 * | 5098 /// StudentSubmission items are generated when a CourseWork item is created. |
| 5047 * StudentSubmission items are generated when a CourseWork item is created. | 5099 /// |
| 5048 * | 5100 /// StudentSubmissions that have never been accessed (i.e. with `state` = NEW) |
| 5049 * StudentSubmissions that have never been accessed (i.e. with `state` = NEW) | 5101 /// may not have a creation time or update time. |
| 5050 * may not have a creation time or update time. | |
| 5051 */ | |
| 5052 class StudentSubmission { | 5102 class StudentSubmission { |
| 5053 /** | 5103 /// Absolute link to the submission in the Classroom web UI. |
| 5054 * Absolute link to the submission in the Classroom web UI. | 5104 /// |
| 5055 * | 5105 /// Read-only. |
| 5056 * Read-only. | |
| 5057 */ | |
| 5058 core.String alternateLink; | 5106 core.String alternateLink; |
| 5059 /** | 5107 |
| 5060 * Optional grade. If unset, no grade was set. | 5108 /// Optional grade. If unset, no grade was set. |
| 5061 * This value must be non-negative. Decimal (i.e. non-integer) values are | 5109 /// This value must be non-negative. Decimal (i.e. non-integer) values are |
| 5062 * allowed, but will be rounded to two decimal places. | 5110 /// allowed, but will be rounded to two decimal places. |
| 5063 * | 5111 /// |
| 5064 * This may be modified only by course teachers. | 5112 /// This may be modified only by course teachers. |
| 5065 */ | |
| 5066 core.double assignedGrade; | 5113 core.double assignedGrade; |
| 5067 /** Submission content when course_work_type is ASSIGNMENT . */ | 5114 |
| 5115 /// Submission content when course_work_type is ASSIGNMENT . |
| 5068 AssignmentSubmission assignmentSubmission; | 5116 AssignmentSubmission assignmentSubmission; |
| 5069 /** | 5117 |
| 5070 * Whether this student submission is associated with the Developer Console | 5118 /// Whether this student submission is associated with the Developer Console |
| 5071 * project making the request. | 5119 /// project making the request. |
| 5072 * | 5120 /// |
| 5073 * See google.classroom.Work.CreateCourseWork for more | 5121 /// See google.classroom.Work.CreateCourseWork for more |
| 5074 * details. | 5122 /// details. |
| 5075 * | 5123 /// |
| 5076 * Read-only. | 5124 /// Read-only. |
| 5077 */ | |
| 5078 core.bool associatedWithDeveloper; | 5125 core.bool associatedWithDeveloper; |
| 5079 /** | 5126 |
| 5080 * Identifier of the course. | 5127 /// Identifier of the course. |
| 5081 * | 5128 /// |
| 5082 * Read-only. | 5129 /// Read-only. |
| 5083 */ | |
| 5084 core.String courseId; | 5130 core.String courseId; |
| 5085 /** | 5131 |
| 5086 * Identifier for the course work this corresponds to. | 5132 /// Identifier for the course work this corresponds to. |
| 5087 * | 5133 /// |
| 5088 * Read-only. | 5134 /// Read-only. |
| 5089 */ | |
| 5090 core.String courseWorkId; | 5135 core.String courseWorkId; |
| 5091 /** | 5136 |
| 5092 * Type of course work this submission is for. | 5137 /// Type of course work this submission is for. |
| 5093 * | 5138 /// |
| 5094 * Read-only. | 5139 /// Read-only. |
| 5095 * Possible string values are: | 5140 /// Possible string values are: |
| 5096 * - "COURSE_WORK_TYPE_UNSPECIFIED" : No work type specified. This is never | 5141 /// - "COURSE_WORK_TYPE_UNSPECIFIED" : No work type specified. This is never |
| 5097 * returned. | 5142 /// returned. |
| 5098 * - "ASSIGNMENT" : An assignment. | 5143 /// - "ASSIGNMENT" : An assignment. |
| 5099 * - "SHORT_ANSWER_QUESTION" : A short answer question. | 5144 /// - "SHORT_ANSWER_QUESTION" : A short answer question. |
| 5100 * - "MULTIPLE_CHOICE_QUESTION" : A multiple-choice question. | 5145 /// - "MULTIPLE_CHOICE_QUESTION" : A multiple-choice question. |
| 5101 */ | |
| 5102 core.String courseWorkType; | 5146 core.String courseWorkType; |
| 5103 /** | 5147 |
| 5104 * Creation time of this submission. | 5148 /// Creation time of this submission. |
| 5105 * This may be unset if the student has not accessed this item. | 5149 /// This may be unset if the student has not accessed this item. |
| 5106 * | 5150 /// |
| 5107 * Read-only. | 5151 /// Read-only. |
| 5108 */ | |
| 5109 core.String creationTime; | 5152 core.String creationTime; |
| 5110 /** | 5153 |
| 5111 * Optional pending grade. If unset, no grade was set. | 5154 /// Optional pending grade. If unset, no grade was set. |
| 5112 * This value must be non-negative. Decimal (i.e. non-integer) values are | 5155 /// This value must be non-negative. Decimal (i.e. non-integer) values are |
| 5113 * allowed, but will be rounded to two decimal places. | 5156 /// allowed, but will be rounded to two decimal places. |
| 5114 * | 5157 /// |
| 5115 * This is only visible to and modifiable by course teachers. | 5158 /// This is only visible to and modifiable by course teachers. |
| 5116 */ | |
| 5117 core.double draftGrade; | 5159 core.double draftGrade; |
| 5118 /** | 5160 |
| 5119 * Classroom-assigned Identifier for the student submission. | 5161 /// Classroom-assigned Identifier for the student submission. |
| 5120 * This is unique among submissions for the relevant course work. | 5162 /// This is unique among submissions for the relevant course work. |
| 5121 * | 5163 /// |
| 5122 * Read-only. | 5164 /// Read-only. |
| 5123 */ | |
| 5124 core.String id; | 5165 core.String id; |
| 5125 /** | 5166 |
| 5126 * Whether this submission is late. | 5167 /// Whether this submission is late. |
| 5127 * | 5168 /// |
| 5128 * Read-only. | 5169 /// Read-only. |
| 5129 */ | |
| 5130 core.bool late; | 5170 core.bool late; |
| 5131 /** Submission content when course_work_type is MULTIPLE_CHOICE_QUESTION. */ | 5171 |
| 5172 /// Submission content when course_work_type is MULTIPLE_CHOICE_QUESTION. |
| 5132 MultipleChoiceSubmission multipleChoiceSubmission; | 5173 MultipleChoiceSubmission multipleChoiceSubmission; |
| 5133 /** Submission content when course_work_type is SHORT_ANSWER_QUESTION. */ | 5174 |
| 5175 /// Submission content when course_work_type is SHORT_ANSWER_QUESTION. |
| 5134 ShortAnswerSubmission shortAnswerSubmission; | 5176 ShortAnswerSubmission shortAnswerSubmission; |
| 5135 /** | 5177 |
| 5136 * State of this submission. | 5178 /// State of this submission. |
| 5137 * | 5179 /// |
| 5138 * Read-only. | 5180 /// Read-only. |
| 5139 * Possible string values are: | 5181 /// Possible string values are: |
| 5140 * - "SUBMISSION_STATE_UNSPECIFIED" : No state specified. This should never be | 5182 /// - "SUBMISSION_STATE_UNSPECIFIED" : No state specified. This should never |
| 5141 * returned. | 5183 /// be returned. |
| 5142 * - "NEW" : The student has never accessed this submission. Attachments are | 5184 /// - "NEW" : The student has never accessed this submission. Attachments are |
| 5143 * not | 5185 /// not |
| 5144 * returned and timestamps is not set. | 5186 /// returned and timestamps is not set. |
| 5145 * - "CREATED" : Has been created. | 5187 /// - "CREATED" : Has been created. |
| 5146 * - "TURNED_IN" : Has been turned in to the teacher. | 5188 /// - "TURNED_IN" : Has been turned in to the teacher. |
| 5147 * - "RETURNED" : Has been returned to the student. | 5189 /// - "RETURNED" : Has been returned to the student. |
| 5148 * - "RECLAIMED_BY_STUDENT" : Student chose to "unsubmit" the assignment. | 5190 /// - "RECLAIMED_BY_STUDENT" : Student chose to "unsubmit" the assignment. |
| 5149 */ | |
| 5150 core.String state; | 5191 core.String state; |
| 5151 /** | 5192 |
| 5152 * The history of the submission (includes state and grade histories). | 5193 /// The history of the submission (includes state and grade histories). |
| 5153 * | 5194 /// |
| 5154 * Read-only. | 5195 /// Read-only. |
| 5155 */ | |
| 5156 core.List<SubmissionHistory> submissionHistory; | 5196 core.List<SubmissionHistory> submissionHistory; |
| 5157 /** | 5197 |
| 5158 * Last update time of this submission. | 5198 /// Last update time of this submission. |
| 5159 * This may be unset if the student has not accessed this item. | 5199 /// This may be unset if the student has not accessed this item. |
| 5160 * | 5200 /// |
| 5161 * Read-only. | 5201 /// Read-only. |
| 5162 */ | |
| 5163 core.String updateTime; | 5202 core.String updateTime; |
| 5164 /** | 5203 |
| 5165 * Identifier for the student that owns this submission. | 5204 /// Identifier for the student that owns this submission. |
| 5166 * | 5205 /// |
| 5167 * Read-only. | 5206 /// Read-only. |
| 5168 */ | |
| 5169 core.String userId; | 5207 core.String userId; |
| 5170 | 5208 |
| 5171 StudentSubmission(); | 5209 StudentSubmission(); |
| 5172 | 5210 |
| 5173 StudentSubmission.fromJson(core.Map _json) { | 5211 StudentSubmission.fromJson(core.Map _json) { |
| 5174 if (_json.containsKey("alternateLink")) { | 5212 if (_json.containsKey("alternateLink")) { |
| 5175 alternateLink = _json["alternateLink"]; | 5213 alternateLink = _json["alternateLink"]; |
| 5176 } | 5214 } |
| 5177 if (_json.containsKey("assignedGrade")) { | 5215 if (_json.containsKey("assignedGrade")) { |
| 5178 assignedGrade = _json["assignedGrade"]; | 5216 assignedGrade = _json["assignedGrade"]; |
| 5179 } | 5217 } |
| 5180 if (_json.containsKey("assignmentSubmission")) { | 5218 if (_json.containsKey("assignmentSubmission")) { |
| 5181 assignmentSubmission = new AssignmentSubmission.fromJson(_json["assignment
Submission"]); | 5219 assignmentSubmission = |
| 5220 new AssignmentSubmission.fromJson(_json["assignmentSubmission"]); |
| 5182 } | 5221 } |
| 5183 if (_json.containsKey("associatedWithDeveloper")) { | 5222 if (_json.containsKey("associatedWithDeveloper")) { |
| 5184 associatedWithDeveloper = _json["associatedWithDeveloper"]; | 5223 associatedWithDeveloper = _json["associatedWithDeveloper"]; |
| 5185 } | 5224 } |
| 5186 if (_json.containsKey("courseId")) { | 5225 if (_json.containsKey("courseId")) { |
| 5187 courseId = _json["courseId"]; | 5226 courseId = _json["courseId"]; |
| 5188 } | 5227 } |
| 5189 if (_json.containsKey("courseWorkId")) { | 5228 if (_json.containsKey("courseWorkId")) { |
| 5190 courseWorkId = _json["courseWorkId"]; | 5229 courseWorkId = _json["courseWorkId"]; |
| 5191 } | 5230 } |
| 5192 if (_json.containsKey("courseWorkType")) { | 5231 if (_json.containsKey("courseWorkType")) { |
| 5193 courseWorkType = _json["courseWorkType"]; | 5232 courseWorkType = _json["courseWorkType"]; |
| 5194 } | 5233 } |
| 5195 if (_json.containsKey("creationTime")) { | 5234 if (_json.containsKey("creationTime")) { |
| 5196 creationTime = _json["creationTime"]; | 5235 creationTime = _json["creationTime"]; |
| 5197 } | 5236 } |
| 5198 if (_json.containsKey("draftGrade")) { | 5237 if (_json.containsKey("draftGrade")) { |
| 5199 draftGrade = _json["draftGrade"]; | 5238 draftGrade = _json["draftGrade"]; |
| 5200 } | 5239 } |
| 5201 if (_json.containsKey("id")) { | 5240 if (_json.containsKey("id")) { |
| 5202 id = _json["id"]; | 5241 id = _json["id"]; |
| 5203 } | 5242 } |
| 5204 if (_json.containsKey("late")) { | 5243 if (_json.containsKey("late")) { |
| 5205 late = _json["late"]; | 5244 late = _json["late"]; |
| 5206 } | 5245 } |
| 5207 if (_json.containsKey("multipleChoiceSubmission")) { | 5246 if (_json.containsKey("multipleChoiceSubmission")) { |
| 5208 multipleChoiceSubmission = new MultipleChoiceSubmission.fromJson(_json["mu
ltipleChoiceSubmission"]); | 5247 multipleChoiceSubmission = new MultipleChoiceSubmission.fromJson( |
| 5248 _json["multipleChoiceSubmission"]); |
| 5209 } | 5249 } |
| 5210 if (_json.containsKey("shortAnswerSubmission")) { | 5250 if (_json.containsKey("shortAnswerSubmission")) { |
| 5211 shortAnswerSubmission = new ShortAnswerSubmission.fromJson(_json["shortAns
werSubmission"]); | 5251 shortAnswerSubmission = |
| 5252 new ShortAnswerSubmission.fromJson(_json["shortAnswerSubmission"]); |
| 5212 } | 5253 } |
| 5213 if (_json.containsKey("state")) { | 5254 if (_json.containsKey("state")) { |
| 5214 state = _json["state"]; | 5255 state = _json["state"]; |
| 5215 } | 5256 } |
| 5216 if (_json.containsKey("submissionHistory")) { | 5257 if (_json.containsKey("submissionHistory")) { |
| 5217 submissionHistory = _json["submissionHistory"].map((value) => new Submissi
onHistory.fromJson(value)).toList(); | 5258 submissionHistory = _json["submissionHistory"] |
| 5259 .map((value) => new SubmissionHistory.fromJson(value)) |
| 5260 .toList(); |
| 5218 } | 5261 } |
| 5219 if (_json.containsKey("updateTime")) { | 5262 if (_json.containsKey("updateTime")) { |
| 5220 updateTime = _json["updateTime"]; | 5263 updateTime = _json["updateTime"]; |
| 5221 } | 5264 } |
| 5222 if (_json.containsKey("userId")) { | 5265 if (_json.containsKey("userId")) { |
| 5223 userId = _json["userId"]; | 5266 userId = _json["userId"]; |
| 5224 } | 5267 } |
| 5225 } | 5268 } |
| 5226 | 5269 |
| 5227 core.Map<core.String, core.Object> toJson() { | 5270 core.Map<core.String, core.Object> toJson() { |
| 5228 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 5271 final core.Map<core.String, core.Object> _json = |
| 5272 new core.Map<core.String, core.Object>(); |
| 5229 if (alternateLink != null) { | 5273 if (alternateLink != null) { |
| 5230 _json["alternateLink"] = alternateLink; | 5274 _json["alternateLink"] = alternateLink; |
| 5231 } | 5275 } |
| 5232 if (assignedGrade != null) { | 5276 if (assignedGrade != null) { |
| 5233 _json["assignedGrade"] = assignedGrade; | 5277 _json["assignedGrade"] = assignedGrade; |
| 5234 } | 5278 } |
| 5235 if (assignmentSubmission != null) { | 5279 if (assignmentSubmission != null) { |
| 5236 _json["assignmentSubmission"] = (assignmentSubmission).toJson(); | 5280 _json["assignmentSubmission"] = (assignmentSubmission).toJson(); |
| 5237 } | 5281 } |
| 5238 if (associatedWithDeveloper != null) { | 5282 if (associatedWithDeveloper != null) { |
| (...skipping 23 matching lines...) Expand all Loading... |
| 5262 if (multipleChoiceSubmission != null) { | 5306 if (multipleChoiceSubmission != null) { |
| 5263 _json["multipleChoiceSubmission"] = (multipleChoiceSubmission).toJson(); | 5307 _json["multipleChoiceSubmission"] = (multipleChoiceSubmission).toJson(); |
| 5264 } | 5308 } |
| 5265 if (shortAnswerSubmission != null) { | 5309 if (shortAnswerSubmission != null) { |
| 5266 _json["shortAnswerSubmission"] = (shortAnswerSubmission).toJson(); | 5310 _json["shortAnswerSubmission"] = (shortAnswerSubmission).toJson(); |
| 5267 } | 5311 } |
| 5268 if (state != null) { | 5312 if (state != null) { |
| 5269 _json["state"] = state; | 5313 _json["state"] = state; |
| 5270 } | 5314 } |
| 5271 if (submissionHistory != null) { | 5315 if (submissionHistory != null) { |
| 5272 _json["submissionHistory"] = submissionHistory.map((value) => (value).toJs
on()).toList(); | 5316 _json["submissionHistory"] = |
| 5317 submissionHistory.map((value) => (value).toJson()).toList(); |
| 5273 } | 5318 } |
| 5274 if (updateTime != null) { | 5319 if (updateTime != null) { |
| 5275 _json["updateTime"] = updateTime; | 5320 _json["updateTime"] = updateTime; |
| 5276 } | 5321 } |
| 5277 if (userId != null) { | 5322 if (userId != null) { |
| 5278 _json["userId"] = userId; | 5323 _json["userId"] = userId; |
| 5279 } | 5324 } |
| 5280 return _json; | 5325 return _json; |
| 5281 } | 5326 } |
| 5282 } | 5327 } |
| 5283 | 5328 |
| 5284 /** | 5329 /// The history of the submission. This currently includes state and grade |
| 5285 * The history of the submission. This currently includes state and grade | 5330 /// histories. |
| 5286 * histories. | |
| 5287 */ | |
| 5288 class SubmissionHistory { | 5331 class SubmissionHistory { |
| 5289 /** The grade history information of the submission, if present. */ | 5332 /// The grade history information of the submission, if present. |
| 5290 GradeHistory gradeHistory; | 5333 GradeHistory gradeHistory; |
| 5291 /** The state history information of the submission, if present. */ | 5334 |
| 5335 /// The state history information of the submission, if present. |
| 5292 StateHistory stateHistory; | 5336 StateHistory stateHistory; |
| 5293 | 5337 |
| 5294 SubmissionHistory(); | 5338 SubmissionHistory(); |
| 5295 | 5339 |
| 5296 SubmissionHistory.fromJson(core.Map _json) { | 5340 SubmissionHistory.fromJson(core.Map _json) { |
| 5297 if (_json.containsKey("gradeHistory")) { | 5341 if (_json.containsKey("gradeHistory")) { |
| 5298 gradeHistory = new GradeHistory.fromJson(_json["gradeHistory"]); | 5342 gradeHistory = new GradeHistory.fromJson(_json["gradeHistory"]); |
| 5299 } | 5343 } |
| 5300 if (_json.containsKey("stateHistory")) { | 5344 if (_json.containsKey("stateHistory")) { |
| 5301 stateHistory = new StateHistory.fromJson(_json["stateHistory"]); | 5345 stateHistory = new StateHistory.fromJson(_json["stateHistory"]); |
| 5302 } | 5346 } |
| 5303 } | 5347 } |
| 5304 | 5348 |
| 5305 core.Map<core.String, core.Object> toJson() { | 5349 core.Map<core.String, core.Object> toJson() { |
| 5306 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 5350 final core.Map<core.String, core.Object> _json = |
| 5351 new core.Map<core.String, core.Object>(); |
| 5307 if (gradeHistory != null) { | 5352 if (gradeHistory != null) { |
| 5308 _json["gradeHistory"] = (gradeHistory).toJson(); | 5353 _json["gradeHistory"] = (gradeHistory).toJson(); |
| 5309 } | 5354 } |
| 5310 if (stateHistory != null) { | 5355 if (stateHistory != null) { |
| 5311 _json["stateHistory"] = (stateHistory).toJson(); | 5356 _json["stateHistory"] = (stateHistory).toJson(); |
| 5312 } | 5357 } |
| 5313 return _json; | 5358 return _json; |
| 5314 } | 5359 } |
| 5315 } | 5360 } |
| 5316 | 5361 |
| 5317 /** Teacher of a course. */ | 5362 /// Teacher of a course. |
| 5318 class Teacher { | 5363 class Teacher { |
| 5319 /** | 5364 /// Identifier of the course. |
| 5320 * Identifier of the course. | 5365 /// |
| 5321 * | 5366 /// Read-only. |
| 5322 * Read-only. | |
| 5323 */ | |
| 5324 core.String courseId; | 5367 core.String courseId; |
| 5325 /** | 5368 |
| 5326 * Global user information for the teacher. | 5369 /// Global user information for the teacher. |
| 5327 * | 5370 /// |
| 5328 * Read-only. | 5371 /// Read-only. |
| 5329 */ | |
| 5330 UserProfile profile; | 5372 UserProfile profile; |
| 5331 /** | 5373 |
| 5332 * Identifier of the user. | 5374 /// Identifier of the user. |
| 5333 * | 5375 /// |
| 5334 * When specified as a parameter of a request, this identifier can be one of | 5376 /// When specified as a parameter of a request, this identifier can be one of |
| 5335 * the following: | 5377 /// the following: |
| 5336 * | 5378 /// |
| 5337 * * the numeric identifier for the user | 5379 /// * the numeric identifier for the user |
| 5338 * * the email address of the user | 5380 /// * the email address of the user |
| 5339 * * the string literal `"me"`, indicating the requesting user | 5381 /// * the string literal `"me"`, indicating the requesting user |
| 5340 */ | |
| 5341 core.String userId; | 5382 core.String userId; |
| 5342 | 5383 |
| 5343 Teacher(); | 5384 Teacher(); |
| 5344 | 5385 |
| 5345 Teacher.fromJson(core.Map _json) { | 5386 Teacher.fromJson(core.Map _json) { |
| 5346 if (_json.containsKey("courseId")) { | 5387 if (_json.containsKey("courseId")) { |
| 5347 courseId = _json["courseId"]; | 5388 courseId = _json["courseId"]; |
| 5348 } | 5389 } |
| 5349 if (_json.containsKey("profile")) { | 5390 if (_json.containsKey("profile")) { |
| 5350 profile = new UserProfile.fromJson(_json["profile"]); | 5391 profile = new UserProfile.fromJson(_json["profile"]); |
| 5351 } | 5392 } |
| 5352 if (_json.containsKey("userId")) { | 5393 if (_json.containsKey("userId")) { |
| 5353 userId = _json["userId"]; | 5394 userId = _json["userId"]; |
| 5354 } | 5395 } |
| 5355 } | 5396 } |
| 5356 | 5397 |
| 5357 core.Map<core.String, core.Object> toJson() { | 5398 core.Map<core.String, core.Object> toJson() { |
| 5358 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 5399 final core.Map<core.String, core.Object> _json = |
| 5400 new core.Map<core.String, core.Object>(); |
| 5359 if (courseId != null) { | 5401 if (courseId != null) { |
| 5360 _json["courseId"] = courseId; | 5402 _json["courseId"] = courseId; |
| 5361 } | 5403 } |
| 5362 if (profile != null) { | 5404 if (profile != null) { |
| 5363 _json["profile"] = (profile).toJson(); | 5405 _json["profile"] = (profile).toJson(); |
| 5364 } | 5406 } |
| 5365 if (userId != null) { | 5407 if (userId != null) { |
| 5366 _json["userId"] = userId; | 5408 _json["userId"] = userId; |
| 5367 } | 5409 } |
| 5368 return _json; | 5410 return _json; |
| 5369 } | 5411 } |
| 5370 } | 5412 } |
| 5371 | 5413 |
| 5372 /** | 5414 /// Represents a time of day. The date and time zone are either not significant |
| 5373 * Represents a time of day. The date and time zone are either not significant | 5415 /// or are specified elsewhere. An API may choose to allow leap seconds. |
| 5374 * or are specified elsewhere. An API may choose to allow leap seconds. Related | 5416 /// Related |
| 5375 * types are google.type.Date and `google.protobuf.Timestamp`. | 5417 /// types are google.type.Date and `google.protobuf.Timestamp`. |
| 5376 */ | |
| 5377 class TimeOfDay { | 5418 class TimeOfDay { |
| 5378 /** | 5419 /// Hours of day in 24 hour format. Should be from 0 to 23. An API may choose |
| 5379 * Hours of day in 24 hour format. Should be from 0 to 23. An API may choose | 5420 /// to allow the value "24:00:00" for scenarios like business closing time. |
| 5380 * to allow the value "24:00:00" for scenarios like business closing time. | |
| 5381 */ | |
| 5382 core.int hours; | 5421 core.int hours; |
| 5383 /** Minutes of hour of day. Must be from 0 to 59. */ | 5422 |
| 5423 /// Minutes of hour of day. Must be from 0 to 59. |
| 5384 core.int minutes; | 5424 core.int minutes; |
| 5385 /** Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. */ | 5425 |
| 5426 /// Fractions of seconds in nanoseconds. Must be from 0 to 999,999,999. |
| 5386 core.int nanos; | 5427 core.int nanos; |
| 5387 /** | 5428 |
| 5388 * Seconds of minutes of the time. Must normally be from 0 to 59. An API may | 5429 /// Seconds of minutes of the time. Must normally be from 0 to 59. An API may |
| 5389 * allow the value 60 if it allows leap-seconds. | 5430 /// allow the value 60 if it allows leap-seconds. |
| 5390 */ | |
| 5391 core.int seconds; | 5431 core.int seconds; |
| 5392 | 5432 |
| 5393 TimeOfDay(); | 5433 TimeOfDay(); |
| 5394 | 5434 |
| 5395 TimeOfDay.fromJson(core.Map _json) { | 5435 TimeOfDay.fromJson(core.Map _json) { |
| 5396 if (_json.containsKey("hours")) { | 5436 if (_json.containsKey("hours")) { |
| 5397 hours = _json["hours"]; | 5437 hours = _json["hours"]; |
| 5398 } | 5438 } |
| 5399 if (_json.containsKey("minutes")) { | 5439 if (_json.containsKey("minutes")) { |
| 5400 minutes = _json["minutes"]; | 5440 minutes = _json["minutes"]; |
| 5401 } | 5441 } |
| 5402 if (_json.containsKey("nanos")) { | 5442 if (_json.containsKey("nanos")) { |
| 5403 nanos = _json["nanos"]; | 5443 nanos = _json["nanos"]; |
| 5404 } | 5444 } |
| 5405 if (_json.containsKey("seconds")) { | 5445 if (_json.containsKey("seconds")) { |
| 5406 seconds = _json["seconds"]; | 5446 seconds = _json["seconds"]; |
| 5407 } | 5447 } |
| 5408 } | 5448 } |
| 5409 | 5449 |
| 5410 core.Map<core.String, core.Object> toJson() { | 5450 core.Map<core.String, core.Object> toJson() { |
| 5411 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 5451 final core.Map<core.String, core.Object> _json = |
| 5452 new core.Map<core.String, core.Object>(); |
| 5412 if (hours != null) { | 5453 if (hours != null) { |
| 5413 _json["hours"] = hours; | 5454 _json["hours"] = hours; |
| 5414 } | 5455 } |
| 5415 if (minutes != null) { | 5456 if (minutes != null) { |
| 5416 _json["minutes"] = minutes; | 5457 _json["minutes"] = minutes; |
| 5417 } | 5458 } |
| 5418 if (nanos != null) { | 5459 if (nanos != null) { |
| 5419 _json["nanos"] = nanos; | 5460 _json["nanos"] = nanos; |
| 5420 } | 5461 } |
| 5421 if (seconds != null) { | 5462 if (seconds != null) { |
| 5422 _json["seconds"] = seconds; | 5463 _json["seconds"] = seconds; |
| 5423 } | 5464 } |
| 5424 return _json; | 5465 return _json; |
| 5425 } | 5466 } |
| 5426 } | 5467 } |
| 5427 | 5468 |
| 5428 /** Request to turn in a student submission. */ | 5469 /// Request to turn in a student submission. |
| 5429 class TurnInStudentSubmissionRequest { | 5470 class TurnInStudentSubmissionRequest { |
| 5430 | |
| 5431 TurnInStudentSubmissionRequest(); | 5471 TurnInStudentSubmissionRequest(); |
| 5432 | 5472 |
| 5433 TurnInStudentSubmissionRequest.fromJson(core.Map _json) { | 5473 TurnInStudentSubmissionRequest.fromJson(core.Map _json) {} |
| 5434 } | |
| 5435 | 5474 |
| 5436 core.Map<core.String, core.Object> toJson() { | 5475 core.Map<core.String, core.Object> toJson() { |
| 5437 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 5476 final core.Map<core.String, core.Object> _json = |
| 5477 new core.Map<core.String, core.Object>(); |
| 5438 return _json; | 5478 return _json; |
| 5439 } | 5479 } |
| 5440 } | 5480 } |
| 5441 | 5481 |
| 5442 /** Global information for a user. */ | 5482 /// Global information for a user. |
| 5443 class UserProfile { | 5483 class UserProfile { |
| 5444 /** | 5484 /// Email address of the user. |
| 5445 * Email address of the user. | 5485 /// |
| 5446 * | 5486 /// Read-only. |
| 5447 * Read-only. | |
| 5448 */ | |
| 5449 core.String emailAddress; | 5487 core.String emailAddress; |
| 5450 /** | 5488 |
| 5451 * Identifier of the user. | 5489 /// Identifier of the user. |
| 5452 * | 5490 /// |
| 5453 * Read-only. | 5491 /// Read-only. |
| 5454 */ | |
| 5455 core.String id; | 5492 core.String id; |
| 5456 /** | 5493 |
| 5457 * Name of the user. | 5494 /// Name of the user. |
| 5458 * | 5495 /// |
| 5459 * Read-only. | 5496 /// Read-only. |
| 5460 */ | |
| 5461 Name name; | 5497 Name name; |
| 5462 /** | 5498 |
| 5463 * Global permissions of the user. | 5499 /// Global permissions of the user. |
| 5464 * | 5500 /// |
| 5465 * Read-only. | 5501 /// Read-only. |
| 5466 */ | |
| 5467 core.List<GlobalPermission> permissions; | 5502 core.List<GlobalPermission> permissions; |
| 5468 /** | 5503 |
| 5469 * URL of user's profile photo. | 5504 /// URL of user's profile photo. |
| 5470 * | 5505 /// |
| 5471 * Read-only. | 5506 /// Read-only. |
| 5472 */ | |
| 5473 core.String photoUrl; | 5507 core.String photoUrl; |
| 5474 /** | 5508 |
| 5475 * Represents whether a G Suite for Education user's domain administrator has | 5509 /// Represents whether a G Suite for Education user's domain administrator |
| 5476 * explicitly verified them as being a teacher. If the user is not a member of | 5510 /// has |
| 5477 * a G Suite for Education domain, than this field will always be false. | 5511 /// explicitly verified them as being a teacher. If the user is not a member |
| 5478 * | 5512 /// of |
| 5479 * Read-only | 5513 /// a G Suite for Education domain, than this field will always be false. |
| 5480 */ | 5514 /// |
| 5515 /// Read-only |
| 5481 core.bool verifiedTeacher; | 5516 core.bool verifiedTeacher; |
| 5482 | 5517 |
| 5483 UserProfile(); | 5518 UserProfile(); |
| 5484 | 5519 |
| 5485 UserProfile.fromJson(core.Map _json) { | 5520 UserProfile.fromJson(core.Map _json) { |
| 5486 if (_json.containsKey("emailAddress")) { | 5521 if (_json.containsKey("emailAddress")) { |
| 5487 emailAddress = _json["emailAddress"]; | 5522 emailAddress = _json["emailAddress"]; |
| 5488 } | 5523 } |
| 5489 if (_json.containsKey("id")) { | 5524 if (_json.containsKey("id")) { |
| 5490 id = _json["id"]; | 5525 id = _json["id"]; |
| 5491 } | 5526 } |
| 5492 if (_json.containsKey("name")) { | 5527 if (_json.containsKey("name")) { |
| 5493 name = new Name.fromJson(_json["name"]); | 5528 name = new Name.fromJson(_json["name"]); |
| 5494 } | 5529 } |
| 5495 if (_json.containsKey("permissions")) { | 5530 if (_json.containsKey("permissions")) { |
| 5496 permissions = _json["permissions"].map((value) => new GlobalPermission.fro
mJson(value)).toList(); | 5531 permissions = _json["permissions"] |
| 5532 .map((value) => new GlobalPermission.fromJson(value)) |
| 5533 .toList(); |
| 5497 } | 5534 } |
| 5498 if (_json.containsKey("photoUrl")) { | 5535 if (_json.containsKey("photoUrl")) { |
| 5499 photoUrl = _json["photoUrl"]; | 5536 photoUrl = _json["photoUrl"]; |
| 5500 } | 5537 } |
| 5501 if (_json.containsKey("verifiedTeacher")) { | 5538 if (_json.containsKey("verifiedTeacher")) { |
| 5502 verifiedTeacher = _json["verifiedTeacher"]; | 5539 verifiedTeacher = _json["verifiedTeacher"]; |
| 5503 } | 5540 } |
| 5504 } | 5541 } |
| 5505 | 5542 |
| 5506 core.Map<core.String, core.Object> toJson() { | 5543 core.Map<core.String, core.Object> toJson() { |
| 5507 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 5544 final core.Map<core.String, core.Object> _json = |
| 5545 new core.Map<core.String, core.Object>(); |
| 5508 if (emailAddress != null) { | 5546 if (emailAddress != null) { |
| 5509 _json["emailAddress"] = emailAddress; | 5547 _json["emailAddress"] = emailAddress; |
| 5510 } | 5548 } |
| 5511 if (id != null) { | 5549 if (id != null) { |
| 5512 _json["id"] = id; | 5550 _json["id"] = id; |
| 5513 } | 5551 } |
| 5514 if (name != null) { | 5552 if (name != null) { |
| 5515 _json["name"] = (name).toJson(); | 5553 _json["name"] = (name).toJson(); |
| 5516 } | 5554 } |
| 5517 if (permissions != null) { | 5555 if (permissions != null) { |
| 5518 _json["permissions"] = permissions.map((value) => (value).toJson()).toList
(); | 5556 _json["permissions"] = |
| 5557 permissions.map((value) => (value).toJson()).toList(); |
| 5519 } | 5558 } |
| 5520 if (photoUrl != null) { | 5559 if (photoUrl != null) { |
| 5521 _json["photoUrl"] = photoUrl; | 5560 _json["photoUrl"] = photoUrl; |
| 5522 } | 5561 } |
| 5523 if (verifiedTeacher != null) { | 5562 if (verifiedTeacher != null) { |
| 5524 _json["verifiedTeacher"] = verifiedTeacher; | 5563 _json["verifiedTeacher"] = verifiedTeacher; |
| 5525 } | 5564 } |
| 5526 return _json; | 5565 return _json; |
| 5527 } | 5566 } |
| 5528 } | 5567 } |
| 5529 | 5568 |
| 5530 /** YouTube video item. */ | 5569 /// YouTube video item. |
| 5531 class YouTubeVideo { | 5570 class YouTubeVideo { |
| 5532 /** | 5571 /// URL that can be used to view the YouTube video. |
| 5533 * URL that can be used to view the YouTube video. | 5572 /// |
| 5534 * | 5573 /// Read-only. |
| 5535 * Read-only. | |
| 5536 */ | |
| 5537 core.String alternateLink; | 5574 core.String alternateLink; |
| 5538 /** YouTube API resource ID. */ | 5575 |
| 5576 /// YouTube API resource ID. |
| 5539 core.String id; | 5577 core.String id; |
| 5540 /** | 5578 |
| 5541 * URL of a thumbnail image of the YouTube video. | 5579 /// URL of a thumbnail image of the YouTube video. |
| 5542 * | 5580 /// |
| 5543 * Read-only. | 5581 /// Read-only. |
| 5544 */ | |
| 5545 core.String thumbnailUrl; | 5582 core.String thumbnailUrl; |
| 5546 /** | 5583 |
| 5547 * Title of the YouTube video. | 5584 /// Title of the YouTube video. |
| 5548 * | 5585 /// |
| 5549 * Read-only. | 5586 /// Read-only. |
| 5550 */ | |
| 5551 core.String title; | 5587 core.String title; |
| 5552 | 5588 |
| 5553 YouTubeVideo(); | 5589 YouTubeVideo(); |
| 5554 | 5590 |
| 5555 YouTubeVideo.fromJson(core.Map _json) { | 5591 YouTubeVideo.fromJson(core.Map _json) { |
| 5556 if (_json.containsKey("alternateLink")) { | 5592 if (_json.containsKey("alternateLink")) { |
| 5557 alternateLink = _json["alternateLink"]; | 5593 alternateLink = _json["alternateLink"]; |
| 5558 } | 5594 } |
| 5559 if (_json.containsKey("id")) { | 5595 if (_json.containsKey("id")) { |
| 5560 id = _json["id"]; | 5596 id = _json["id"]; |
| 5561 } | 5597 } |
| 5562 if (_json.containsKey("thumbnailUrl")) { | 5598 if (_json.containsKey("thumbnailUrl")) { |
| 5563 thumbnailUrl = _json["thumbnailUrl"]; | 5599 thumbnailUrl = _json["thumbnailUrl"]; |
| 5564 } | 5600 } |
| 5565 if (_json.containsKey("title")) { | 5601 if (_json.containsKey("title")) { |
| 5566 title = _json["title"]; | 5602 title = _json["title"]; |
| 5567 } | 5603 } |
| 5568 } | 5604 } |
| 5569 | 5605 |
| 5570 core.Map<core.String, core.Object> toJson() { | 5606 core.Map<core.String, core.Object> toJson() { |
| 5571 final core.Map<core.String, core.Object> _json = new core.Map<core.String, c
ore.Object>(); | 5607 final core.Map<core.String, core.Object> _json = |
| 5608 new core.Map<core.String, core.Object>(); |
| 5572 if (alternateLink != null) { | 5609 if (alternateLink != null) { |
| 5573 _json["alternateLink"] = alternateLink; | 5610 _json["alternateLink"] = alternateLink; |
| 5574 } | 5611 } |
| 5575 if (id != null) { | 5612 if (id != null) { |
| 5576 _json["id"] = id; | 5613 _json["id"] = id; |
| 5577 } | 5614 } |
| 5578 if (thumbnailUrl != null) { | 5615 if (thumbnailUrl != null) { |
| 5579 _json["thumbnailUrl"] = thumbnailUrl; | 5616 _json["thumbnailUrl"] = thumbnailUrl; |
| 5580 } | 5617 } |
| 5581 if (title != null) { | 5618 if (title != null) { |
| 5582 _json["title"] = title; | 5619 _json["title"] = title; |
| 5583 } | 5620 } |
| 5584 return _json; | 5621 return _json; |
| 5585 } | 5622 } |
| 5586 } | 5623 } |
| OLD | NEW |