> ## Documentation Index
> Fetch the complete documentation index at: https://docs.corsair.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Google Classroom API reference

> API reference for Google Classroom: every `googleclassroom.api.*` operation with input and output types.

> [!NOTE]
>
> **New to Corsair?** See [API access](https://docs.corsair.dev/concepts/api.md), [authentication](https://docs.corsair.dev/concepts/auth.md), and [error handling](https://docs.corsair.dev/concepts/error-handling).

## Courses

### aliases.create

`courses.aliases.create`

Creates an alias for a course. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to create the alias or for access errors. \* `NOT_FOUND` if the course does not exist. \* `ALREADY_EXISTS` if the alias already exists. \* `FAILED_PRECONDITION` if the alias requested does not make sense for the requesting user or course (for example, if a user not in a domain attempts to access a domain-scoped alias).

**Risk:** `write`

```ts theme={null}
await corsair.googleclassroom.api.courses.aliases.create({ pathParams: {"courseId":"courseId-123"}, query: {}, body: {"alias":"p:biology"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   alias: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `alias` | `string` | No | Alias string. The format of the string indicates the desired alias scoping. \* `d:` indicates a domain-scoped alias. Example: `d:math_101` \* `p:` indicates a project-scoped alias. Example: `p:abc123` This field has a maximum length of 256 characters. |

***

### aliases.delete

`courses.aliases.delete`

Deletes an alias of a course. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to remove the alias or for access errors. \* `NOT_FOUND` if the alias does not exist. \* `FAILED_PRECONDITION` if the alias requested does not make sense for the requesting user or course (for example, if a user not in a domain attempts to delete a domain-scoped alias).

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.courses.aliases.delete({ pathParams: {"courseId":"courseId-123","alias":"alias-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   alias: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output:** *empty object*

***

### aliases.list

`courses.aliases.list`

Returns a list of aliases for a course. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to access the course or for access errors. \* `NOT_FOUND` if the course does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.aliases.list({ pathParams: {"courseId":"courseId-123"}, query: {"pageSize":1} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   pageSize?: number,
>   pageToken?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `aliases` | `object[]` | No | The course aliases. |
| `nextPageToken` | `string` | No | Token identifying the next page of results to return. If empty, no further results are available. |

> [accordion] aliases full type
>
> ```ts theme={null}
> {
>   alias?: string
> }[]
> ```

***

### announcements.addOnAttachments.create

`courses.announcements.addOnAttachments.create`

Creates an add-on attachment under a post. Requires the add-on to have permission to create new attachments on the post. This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if one of the identified resources does not exist.

**Risk:** `write`

```ts theme={null}
await corsair.googleclassroom.api.courses.announcements.addOnAttachments.create({ pathParams: {"courseId":"courseId-123","itemId":"itemId-123"}, query: {}, body: {"title":"Learning activity","teacherViewUri":{"uri":"https://corsair.dev/classroom"},"studentViewUri":{"uri":"https://corsair.dev/classroom"}} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

addOnToken may be omitted for partner-first creation when the creating project matches the project that created the parent post. Google enforces the project and authorization conditions.

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   itemId: string,
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   postId?: string,
>   addOnToken?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   dueTime?: {
>     hours?: number,
>     minutes?: number,
>     seconds?: number,
>     nanos?: number
>   },
>   copyHistory?: {
>     courseId?: string,
>     postId?: string,
>     itemId?: string,
>     attachmentId?: string
>   }[],
>   gradeSyncEnabled?: boolean,
>   title: string,
>   studentViewUri: {
>     uri: string
>   },
>   itemId?: string,
>   dueDate?: {
>     year?: number,
>     month?: number,
>     day?: number
>   },
>   studentWorkReviewUri?: {
>     uri: string
>   },
>   postId?: string,
>   teacherViewUri: {
>     uri: string
>   },
>   maxPoints?: number,
>   id?: string,
>   courseId?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `dueTime` | `object` | No | Time of day, in UTC, that work on this attachment is due. This must be specified if `due_date` is specified. |
| `copyHistory` | `object[]` | No | Output only. Identifiers of attachments that were previous copies of this attachment. If the attachment was previously copied by virtue of its parent post being copied, this enumerates the identifiers of attachments that were its previous copies in ascending chronological order of copy. |
| `gradeSyncEnabled` | `boolean` | No | Output only. Whether changes to `pointsEarned` values on this attachment's student submissions will be copied to the `pointsEarned` field on the students' CourseWork submissions. This field can be `true` for at most one add-on attachment per stream item. |
| `title` | `string` | No | Required. Title of this attachment. The title must be between 1 and 1000 characters. |
| `studentViewUri` | `object` | No | Required. URI to show the student view of the attachment. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, and `attachmentId` query parameters set. |
| `itemId` | `string` | No | Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached. Unique per course. |
| `dueDate` | `object` | No | Date, in UTC, that work on this attachment is due. This must be specified if `due_time` is specified. |
| `studentWorkReviewUri` | `object` | No | URI for the teacher to see student work on the attachment, if applicable. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, `attachmentId`, and `submissionId` query parameters set. This is the same `submissionId` returned in the [`AddOnContext.studentContext`](https://developers.google.com/workspace/classroom/reference/rest/v1/AddOnContext#StudentContext) field when a student views the attachment. If the URI is omitted or removed, `max_points` will also be discarded. |
| `postId` | `string` | No | Immutable. Deprecated, use `item_id` instead. |
| `teacherViewUri` | `object` | No | Required. URI to show the teacher view of the attachment. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, and `attachmentId` query parameters set. |
| `maxPoints` | `number` | No | Maximum grade for this attachment. Can only be set if `studentWorkReviewUri` is set. Set to a non-zero value to indicate that the attachment supports grade passback. If set, this must be a non-negative integer value. When set to zero, the attachment will not support grade passback. |
| `id` | `string` | No | Immutable. Classroom-assigned identifier for this attachment, unique per post. |
| `courseId` | `string` | No | Immutable. Identifier of the course. |

> [accordion] dueTime full type
>
> ```ts theme={null}
> {
>   hours?: number,
>   minutes?: number,
>   seconds?: number,
>   nanos?: number
> }
> ```

> [accordion] copyHistory full type
>
> ```ts theme={null}
> {
>   courseId?: string,
>   postId?: string,
>   itemId?: string,
>   attachmentId?: string
> }[]
> ```

> [accordion] studentViewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

> [accordion] dueDate full type
>
> ```ts theme={null}
> {
>   year?: number,
>   month?: number,
>   day?: number
> }
> ```

> [accordion] studentWorkReviewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

> [accordion] teacherViewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

***

### announcements.addOnAttachments.delete

`courses.announcements.addOnAttachments.delete`

Deletes an add-on attachment. Requires the add-on to have been the original creator of the attachment. This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if one of the identified resources does not exist.

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.courses.announcements.addOnAttachments.delete({ pathParams: {"itemId":"itemId-123","attachmentId":"attachmentId-123","courseId":"courseId-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   attachmentId: string,
>   courseId: string,
>   itemId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   postId?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output:** *empty object*

***

### announcements.addOnAttachments.get

`courses.announcements.addOnAttachments.get`

Returns an add-on attachment. Requires the add-on requesting the attachment to be the original creator of the attachment. This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if one of the identified resources does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.announcements.addOnAttachments.get({ pathParams: {"attachmentId":"attachmentId-123","courseId":"courseId-123","itemId":"itemId-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   itemId: string,
>   attachmentId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   postId?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `dueTime` | `object` | No | Time of day, in UTC, that work on this attachment is due. This must be specified if `due_date` is specified. |
| `copyHistory` | `object[]` | No | Output only. Identifiers of attachments that were previous copies of this attachment. If the attachment was previously copied by virtue of its parent post being copied, this enumerates the identifiers of attachments that were its previous copies in ascending chronological order of copy. |
| `gradeSyncEnabled` | `boolean` | No | Output only. Whether changes to `pointsEarned` values on this attachment's student submissions will be copied to the `pointsEarned` field on the students' CourseWork submissions. This field can be `true` for at most one add-on attachment per stream item. |
| `title` | `string` | No | Required. Title of this attachment. The title must be between 1 and 1000 characters. |
| `studentViewUri` | `object` | No | Required. URI to show the student view of the attachment. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, and `attachmentId` query parameters set. |
| `itemId` | `string` | No | Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached. Unique per course. |
| `dueDate` | `object` | No | Date, in UTC, that work on this attachment is due. This must be specified if `due_time` is specified. |
| `studentWorkReviewUri` | `object` | No | URI for the teacher to see student work on the attachment, if applicable. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, `attachmentId`, and `submissionId` query parameters set. This is the same `submissionId` returned in the [`AddOnContext.studentContext`](https://developers.google.com/workspace/classroom/reference/rest/v1/AddOnContext#StudentContext) field when a student views the attachment. If the URI is omitted or removed, `max_points` will also be discarded. |
| `postId` | `string` | No | Immutable. Deprecated, use `item_id` instead. |
| `teacherViewUri` | `object` | No | Required. URI to show the teacher view of the attachment. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, and `attachmentId` query parameters set. |
| `maxPoints` | `number` | No | Maximum grade for this attachment. Can only be set if `studentWorkReviewUri` is set. Set to a non-zero value to indicate that the attachment supports grade passback. If set, this must be a non-negative integer value. When set to zero, the attachment will not support grade passback. |
| `id` | `string` | No | Immutable. Classroom-assigned identifier for this attachment, unique per post. |
| `courseId` | `string` | No | Immutable. Identifier of the course. |

> [accordion] dueTime full type
>
> ```ts theme={null}
> {
>   hours?: number,
>   minutes?: number,
>   seconds?: number,
>   nanos?: number
> }
> ```

> [accordion] copyHistory full type
>
> ```ts theme={null}
> {
>   courseId?: string,
>   postId?: string,
>   itemId?: string,
>   attachmentId?: string
> }[]
> ```

> [accordion] studentViewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

> [accordion] dueDate full type
>
> ```ts theme={null}
> {
>   year?: number,
>   month?: number,
>   day?: number
> }
> ```

> [accordion] studentWorkReviewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

> [accordion] teacherViewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

***

### announcements.addOnAttachments.list

`courses.announcements.addOnAttachments.list`

Returns all attachments created by an add-on under the post. Requires the add-on to have active attachments on the post or have permission to create new attachments on the post. This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if one of the identified resources does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.announcements.addOnAttachments.list({ pathParams: {"courseId":"courseId-123","itemId":"itemId-123"}, query: {"pageSize":1} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   itemId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   pageToken?: string,
>   pageSize?: number,
>   postId?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `addOnAttachments` | `object[]` | No | Attachments under the given post. |
| `nextPageToken` | `string` | No | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted, there are no subsequent pages. |

> [accordion] addOnAttachments full type
>
> ```ts theme={null}
> {
>   dueTime?: {
>     hours?: number,
>     minutes?: number,
>     seconds?: number,
>     nanos?: number
>   },
>   copyHistory?: {
>     courseId?: string,
>     postId?: string,
>     itemId?: string,
>     attachmentId?: string
>   }[],
>   gradeSyncEnabled?: boolean,
>   title?: string,
>   studentViewUri?: {
>     uri?: string
>   },
>   itemId?: string,
>   dueDate?: {
>     year?: number,
>     month?: number,
>     day?: number
>   },
>   studentWorkReviewUri?: {
>     uri?: string
>   },
>   postId?: string,
>   teacherViewUri?: {
>     uri?: string
>   },
>   maxPoints?: number,
>   id?: string,
>   courseId?: string
> }[]
> ```

***

### announcements.addOnAttachments.patch

`courses.announcements.addOnAttachments.patch`

Updates an add-on attachment. Requires the add-on to have been the original creator of the attachment. This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if one of the identified resources does not exist.

**Risk:** `write`

```ts theme={null}
await corsair.googleclassroom.api.courses.announcements.addOnAttachments.patch({ pathParams: {"attachmentId":"attachmentId-123","courseId":"courseId-123","itemId":"itemId-123"}, query: {"updateMask":"title","postId":"post-123"}, body: {"title":"Learning activity"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   itemId: string,
>   attachmentId: string,
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   postId: string,
>   updateMask: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   dueTime?: {
>     hours?: number,
>     minutes?: number,
>     seconds?: number,
>     nanos?: number
>   },
>   copyHistory?: {
>     courseId?: string,
>     postId?: string,
>     itemId?: string,
>     attachmentId?: string
>   }[],
>   gradeSyncEnabled?: boolean,
>   title?: string,
>   studentViewUri?: {
>     uri: string
>   },
>   itemId?: string,
>   dueDate?: {
>     year?: number,
>     month?: number,
>     day?: number
>   },
>   studentWorkReviewUri?: {
>     uri: string
>   },
>   postId?: string,
>   teacherViewUri?: {
>     uri: string
>   },
>   maxPoints?: number,
>   id?: string,
>   courseId?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `dueTime` | `object` | No | Time of day, in UTC, that work on this attachment is due. This must be specified if `due_date` is specified. |
| `copyHistory` | `object[]` | No | Output only. Identifiers of attachments that were previous copies of this attachment. If the attachment was previously copied by virtue of its parent post being copied, this enumerates the identifiers of attachments that were its previous copies in ascending chronological order of copy. |
| `gradeSyncEnabled` | `boolean` | No | Output only. Whether changes to `pointsEarned` values on this attachment's student submissions will be copied to the `pointsEarned` field on the students' CourseWork submissions. This field can be `true` for at most one add-on attachment per stream item. |
| `title` | `string` | No | Required. Title of this attachment. The title must be between 1 and 1000 characters. |
| `studentViewUri` | `object` | No | Required. URI to show the student view of the attachment. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, and `attachmentId` query parameters set. |
| `itemId` | `string` | No | Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached. Unique per course. |
| `dueDate` | `object` | No | Date, in UTC, that work on this attachment is due. This must be specified if `due_time` is specified. |
| `studentWorkReviewUri` | `object` | No | URI for the teacher to see student work on the attachment, if applicable. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, `attachmentId`, and `submissionId` query parameters set. This is the same `submissionId` returned in the [`AddOnContext.studentContext`](https://developers.google.com/workspace/classroom/reference/rest/v1/AddOnContext#StudentContext) field when a student views the attachment. If the URI is omitted or removed, `max_points` will also be discarded. |
| `postId` | `string` | No | Immutable. Deprecated, use `item_id` instead. |
| `teacherViewUri` | `object` | No | Required. URI to show the teacher view of the attachment. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, and `attachmentId` query parameters set. |
| `maxPoints` | `number` | No | Maximum grade for this attachment. Can only be set if `studentWorkReviewUri` is set. Set to a non-zero value to indicate that the attachment supports grade passback. If set, this must be a non-negative integer value. When set to zero, the attachment will not support grade passback. |
| `id` | `string` | No | Immutable. Classroom-assigned identifier for this attachment, unique per post. |
| `courseId` | `string` | No | Immutable. Identifier of the course. |

> [accordion] dueTime full type
>
> ```ts theme={null}
> {
>   hours?: number,
>   minutes?: number,
>   seconds?: number,
>   nanos?: number
> }
> ```

> [accordion] copyHistory full type
>
> ```ts theme={null}
> {
>   courseId?: string,
>   postId?: string,
>   itemId?: string,
>   attachmentId?: string
> }[]
> ```

> [accordion] studentViewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

> [accordion] dueDate full type
>
> ```ts theme={null}
> {
>   year?: number,
>   month?: number,
>   day?: number
> }
> ```

> [accordion] studentWorkReviewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

> [accordion] teacherViewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

***

### announcements.create

`courses.announcements.create`

Creates an announcement. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course, create announcements in the requested course, share a Drive attachment, or for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if the requested course does not exist. \* `FAILED_PRECONDITION` for the following request error: \* AttachmentNotVisible

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.courses.announcements.create({ pathParams: {"courseId":"courseId-123"}, query: {}, body: {"text":"Class update"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   text: string,
>   materials?: {
>     gem?: {
>       id?: string,
>       url?: string,
>       title?: string
>     },
>     youtubeVideo?: {
>       id?: string,
>       title?: string,
>       alternateLink?: string,
>       thumbnailUrl?: string
>     },
>     form?: {
>       title?: string,
>       formUrl?: string,
>       responseUrl?: string,
>       thumbnailUrl?: string
>     },
>     driveFile?: {
>       driveFile?: {
>         thumbnailUrl?: string,
>         alternateLink?: string,
>         id?: string,
>         title?: string
>       },
>       shareMode?: UNKNOWN_SHARE_MODE | VIEW | EDIT | STUDENT_COPY
>     },
>     notebook?: {
>       url?: string,
>       id?: string,
>       title?: string
>     },
>     link?: {
>       url?: string,
>       thumbnailUrl?: string,
>       title?: string
>     }
>   }[],
>   state?: PUBLISHED | DRAFT,
>   scheduledTime?: string,
>   assigneeMode?: ALL_STUDENTS | INDIVIDUAL_STUDENTS,
>   individualStudentsOptions?: {
>     studentIds?: string[]
>   }
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `materials` | `object[]` | No | Additional materials. Announcements must have no more than 20 material items. |
| `assigneeMode` | `ASSIGNEE_MODE_UNSPECIFIED \| ALL_STUDENTS \| INDIVIDUAL_STUDENTS \| string` | No | Assignee mode of the announcement. If unspecified, the default value is `ALL_STUDENTS`. |
| `scheduledTime` | `string` | No | Optional timestamp when this announcement is scheduled to be published. |
| `id` | `string` | No | Classroom-assigned identifier of this announcement, unique per course. Read-only. |
| `individualStudentsOptions` | `object` | No | Identifiers of students with access to the announcement. This field is set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students specified in this field can see the announcement. |
| `creationTime` | `string` | No | Timestamp when this announcement was created. Read-only. |
| `updateTime` | `string` | No | Timestamp of the most recent change to this announcement. Read-only. |
| `state` | `ANNOUNCEMENT_STATE_UNSPECIFIED \| PUBLISHED \| DRAFT \| DELETED \| string` | No | Status of this announcement. If unspecified, the default state is `DRAFT`. |
| `courseId` | `string` | No | Identifier of the course. Read-only. |
| `alternateLink` | `string` | No | Absolute link to this announcement in the Classroom web UI. This is only populated if `state` is `PUBLISHED`. Read-only. |
| `creatorUserId` | `string` | No | Identifier for the user that created the announcement. Read-only. |
| `text` | `string` | No | Description of this announcement. The text must be a valid UTF-8 string containing no more than 30,000 characters. |

> [accordion] materials full type
>
> ```ts theme={null}
> {
>   gem?: {
>     id?: string,
>     url?: string,
>     title?: string
>   },
>   youtubeVideo?: {
>     id?: string,
>     title?: string,
>     alternateLink?: string,
>     thumbnailUrl?: string
>   },
>   form?: {
>     title?: string,
>     formUrl?: string,
>     responseUrl?: string,
>     thumbnailUrl?: string
>   },
>   driveFile?: {
>     driveFile?: {
>       thumbnailUrl?: string,
>       alternateLink?: string,
>       id?: string,
>       title?: string
>     },
>     shareMode?: UNKNOWN_SHARE_MODE | VIEW | EDIT | STUDENT_COPY | string
>   },
>   notebook?: {
>     url?: string,
>     id?: string,
>     title?: string
>   },
>   link?: {
>     url?: string,
>     thumbnailUrl?: string,
>     title?: string
>   }
> }[]
> ```

> [accordion] individualStudentsOptions full type
>
> ```ts theme={null}
> {
>   studentIds?: string[]
> }
> ```

***

### announcements.delete

`courses.announcements.delete`

Deletes an announcement. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding announcement item. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting developer project did not create the corresponding announcement, if the requesting user is not permitted to delete the requested course or for access errors. \* `FAILED_PRECONDITION` if the requested announcement has already been deleted. \* `NOT_FOUND` if no course exists with the requested ID.

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.courses.announcements.delete({ pathParams: {"courseId":"courseId-123","id":"id-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   id: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output:** *empty object*

***

### announcements.get

`courses.announcements.get`

Returns an announcement. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or announcement, or for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if the requested course or announcement does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.announcements.get({ pathParams: {"id":"id-123","courseId":"courseId-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   id: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `materials` | `object[]` | No | Additional materials. Announcements must have no more than 20 material items. |
| `assigneeMode` | `ASSIGNEE_MODE_UNSPECIFIED \| ALL_STUDENTS \| INDIVIDUAL_STUDENTS \| string` | No | Assignee mode of the announcement. If unspecified, the default value is `ALL_STUDENTS`. |
| `scheduledTime` | `string` | No | Optional timestamp when this announcement is scheduled to be published. |
| `id` | `string` | No | Classroom-assigned identifier of this announcement, unique per course. Read-only. |
| `individualStudentsOptions` | `object` | No | Identifiers of students with access to the announcement. This field is set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students specified in this field can see the announcement. |
| `creationTime` | `string` | No | Timestamp when this announcement was created. Read-only. |
| `updateTime` | `string` | No | Timestamp of the most recent change to this announcement. Read-only. |
| `state` | `ANNOUNCEMENT_STATE_UNSPECIFIED \| PUBLISHED \| DRAFT \| DELETED \| string` | No | Status of this announcement. If unspecified, the default state is `DRAFT`. |
| `courseId` | `string` | No | Identifier of the course. Read-only. |
| `alternateLink` | `string` | No | Absolute link to this announcement in the Classroom web UI. This is only populated if `state` is `PUBLISHED`. Read-only. |
| `creatorUserId` | `string` | No | Identifier for the user that created the announcement. Read-only. |
| `text` | `string` | No | Description of this announcement. The text must be a valid UTF-8 string containing no more than 30,000 characters. |

> [accordion] materials full type
>
> ```ts theme={null}
> {
>   gem?: {
>     id?: string,
>     url?: string,
>     title?: string
>   },
>   youtubeVideo?: {
>     id?: string,
>     title?: string,
>     alternateLink?: string,
>     thumbnailUrl?: string
>   },
>   form?: {
>     title?: string,
>     formUrl?: string,
>     responseUrl?: string,
>     thumbnailUrl?: string
>   },
>   driveFile?: {
>     driveFile?: {
>       thumbnailUrl?: string,
>       alternateLink?: string,
>       id?: string,
>       title?: string
>     },
>     shareMode?: UNKNOWN_SHARE_MODE | VIEW | EDIT | STUDENT_COPY | string
>   },
>   notebook?: {
>     url?: string,
>     id?: string,
>     title?: string
>   },
>   link?: {
>     url?: string,
>     thumbnailUrl?: string,
>     title?: string
>   }
> }[]
> ```

> [accordion] individualStudentsOptions full type
>
> ```ts theme={null}
> {
>   studentIds?: string[]
> }
> ```

***

### announcements.getAddOnContext

`courses.announcements.getAddOnContext`

Gets metadata for Classroom add-ons in the context of a specific post. To maintain the integrity of its own data and permissions model, an add-on should call this to validate query parameters and the requesting user's role whenever the add-on is opened in an [iframe](https://developers.google.com/workspace/classroom/add-ons/get-started/iframes/iframes-overview). This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if one of the identified resources does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.announcements.getAddOnContext({ pathParams: {"courseId":"courseId-123","itemId":"itemId-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

attachmentId is optional only for the Attachment Discovery iframe. addOnToken is required when the add-on has no attachment on the post and the calling project differs from the post's creating project; Google enforces this.

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   itemId: string,
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   postId?: string,
>   attachmentId?: string,
>   addOnToken?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `supportsStudentWork` | `boolean` | No | Optional. Whether the post allows the teacher to see student work and passback grades. |
| `teacherContext` | `object` | No | Add-on context corresponding to the requesting user's role as a teacher. Its presence implies that the requesting user is a teacher in the course. |
| `studentContext` | `object` | No | Add-on context corresponding to the requesting user's role as a student. Its presence implies that the requesting user is a student in the course. |
| `courseId` | `string` | No | Immutable. Identifier of the course. |
| `postId` | `string` | No | Immutable. Deprecated, use `item_id` instead. |
| `itemId` | `string` | No | Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached. |

> [accordion] teacherContext full type
>
> ```ts theme={null}
> {
> }
> ```

> [accordion] studentContext full type
>
> ```ts theme={null}
> {
>   submissionId?: string
> }
> ```

***

### announcements.list

`courses.announcements.list`

Returns a list of announcements that the requester is permitted to view. Course students may only view `PUBLISHED` announcements. Course teachers and domain administrators may view all announcements. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if the requested course does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.announcements.list({ pathParams: {"courseId":"courseId-123"}, query: {"pageSize":1,"announcementStates":["PUBLISHED"],"orderBy":"updateTime desc"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   orderBy?: string,
>   pageSize?: number,
>   announcementStates?: (ANNOUNCEMENT_STATE_UNSPECIFIED | PUBLISHED | DRAFT | DELETED)[],
>   pageToken?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `nextPageToken` | `string` | No | Token identifying the next page of results to return. If empty, no further results are available. |
| `announcements` | `object[]` | No | Announcement items that match the request. |

> [accordion] announcements full type
>
> ```ts theme={null}
> {
>   materials?: {
>     gem?: {
>       id?: string,
>       url?: string,
>       title?: string
>     },
>     youtubeVideo?: {
>       id?: string,
>       title?: string,
>       alternateLink?: string,
>       thumbnailUrl?: string
>     },
>     form?: {
>       title?: string,
>       formUrl?: string,
>       responseUrl?: string,
>       thumbnailUrl?: string
>     },
>     driveFile?: {
>       driveFile?: {
>         thumbnailUrl?: string,
>         alternateLink?: string,
>         id?: string,
>         title?: string
>       },
>       shareMode?: UNKNOWN_SHARE_MODE | VIEW | EDIT | STUDENT_COPY | string
>     },
>     notebook?: {
>       url?: string,
>       id?: string,
>       title?: string
>     },
>     link?: {
>       url?: string,
>       thumbnailUrl?: string,
>       title?: string
>     }
>   }[],
>   assigneeMode?: ASSIGNEE_MODE_UNSPECIFIED | ALL_STUDENTS | INDIVIDUAL_STUDENTS | string,
>   scheduledTime?: string,
>   id?: string,
>   individualStudentsOptions?: {
>     studentIds?: string[]
>   },
>   creationTime?: string,
>   updateTime?: string,
>   state?: ANNOUNCEMENT_STATE_UNSPECIFIED | PUBLISHED | DRAFT | DELETED | string,
>   courseId?: string,
>   alternateLink?: string,
>   creatorUserId?: string,
>   text?: string
> }[]
> ```

***

### announcements.modifyAssignees

`courses.announcements.modifyAssignees`

Modifies assignee mode and options of an announcement. Only a teacher of the course that contains the announcement may call this method. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work or for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if the requested course or course work does not exist. \* `FAILED_PRECONDITION` for the following request error: \* EmptyAssignees

**Risk:** `write`

```ts theme={null}
await corsair.googleclassroom.api.courses.announcements.modifyAssignees({ pathParams: {"id":"id-123","courseId":"courseId-123"}, query: {}, body: {"assigneeMode":"ALL_STUDENTS","modifyIndividualStudentsOptions":{}} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   id: string,
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   modifyIndividualStudentsOptions?: {
>     removeStudentIds?: string[],
>     addStudentIds?: string[]
>   },
>   assigneeMode: ALL_STUDENTS | INDIVIDUAL_STUDENTS
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `materials` | `object[]` | No | Additional materials. Announcements must have no more than 20 material items. |
| `assigneeMode` | `ASSIGNEE_MODE_UNSPECIFIED \| ALL_STUDENTS \| INDIVIDUAL_STUDENTS \| string` | No | Assignee mode of the announcement. If unspecified, the default value is `ALL_STUDENTS`. |
| `scheduledTime` | `string` | No | Optional timestamp when this announcement is scheduled to be published. |
| `id` | `string` | No | Classroom-assigned identifier of this announcement, unique per course. Read-only. |
| `individualStudentsOptions` | `object` | No | Identifiers of students with access to the announcement. This field is set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students specified in this field can see the announcement. |
| `creationTime` | `string` | No | Timestamp when this announcement was created. Read-only. |
| `updateTime` | `string` | No | Timestamp of the most recent change to this announcement. Read-only. |
| `state` | `ANNOUNCEMENT_STATE_UNSPECIFIED \| PUBLISHED \| DRAFT \| DELETED \| string` | No | Status of this announcement. If unspecified, the default state is `DRAFT`. |
| `courseId` | `string` | No | Identifier of the course. Read-only. |
| `alternateLink` | `string` | No | Absolute link to this announcement in the Classroom web UI. This is only populated if `state` is `PUBLISHED`. Read-only. |
| `creatorUserId` | `string` | No | Identifier for the user that created the announcement. Read-only. |
| `text` | `string` | No | Description of this announcement. The text must be a valid UTF-8 string containing no more than 30,000 characters. |

> [accordion] materials full type
>
> ```ts theme={null}
> {
>   gem?: {
>     id?: string,
>     url?: string,
>     title?: string
>   },
>   youtubeVideo?: {
>     id?: string,
>     title?: string,
>     alternateLink?: string,
>     thumbnailUrl?: string
>   },
>   form?: {
>     title?: string,
>     formUrl?: string,
>     responseUrl?: string,
>     thumbnailUrl?: string
>   },
>   driveFile?: {
>     driveFile?: {
>       thumbnailUrl?: string,
>       alternateLink?: string,
>       id?: string,
>       title?: string
>     },
>     shareMode?: UNKNOWN_SHARE_MODE | VIEW | EDIT | STUDENT_COPY | string
>   },
>   notebook?: {
>     url?: string,
>     id?: string,
>     title?: string
>   },
>   link?: {
>     url?: string,
>     thumbnailUrl?: string,
>     title?: string
>   }
> }[]
> ```

> [accordion] individualStudentsOptions full type
>
> ```ts theme={null}
> {
>   studentIds?: string[]
> }
> ```

***

### announcements.patch

`courses.announcements.patch`

Updates one or more fields of an announcement. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting developer project did not create the corresponding announcement or for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `FAILED_PRECONDITION` if the requested announcement has already been deleted. \* `NOT_FOUND` if the requested course or announcement does not exist

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.courses.announcements.patch({ pathParams: {"courseId":"courseId-123","id":"id-123"}, query: {"updateMask":"text"}, body: {"text":"Class update"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   id: string,
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   updateMask: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   materials?: {
>     gem?: {
>       id?: string,
>       url?: string,
>       title?: string
>     },
>     youtubeVideo?: {
>       id?: string,
>       title?: string,
>       alternateLink?: string,
>       thumbnailUrl?: string
>     },
>     form?: {
>       title?: string,
>       formUrl?: string,
>       responseUrl?: string,
>       thumbnailUrl?: string
>     },
>     driveFile?: {
>       driveFile?: {
>         thumbnailUrl?: string,
>         alternateLink?: string,
>         id?: string,
>         title?: string
>       },
>       shareMode?: UNKNOWN_SHARE_MODE | VIEW | EDIT | STUDENT_COPY
>     },
>     notebook?: {
>       url?: string,
>       id?: string,
>       title?: string
>     },
>     link?: {
>       url?: string,
>       thumbnailUrl?: string,
>       title?: string
>     }
>   }[],
>   assigneeMode?: ASSIGNEE_MODE_UNSPECIFIED | ALL_STUDENTS | INDIVIDUAL_STUDENTS,
>   scheduledTime?: string,
>   id?: string,
>   individualStudentsOptions?: {
>     studentIds?: string[]
>   },
>   creationTime?: string,
>   updateTime?: string,
>   state?: ANNOUNCEMENT_STATE_UNSPECIFIED | PUBLISHED | DRAFT | DELETED,
>   courseId?: string,
>   alternateLink?: string,
>   creatorUserId?: string,
>   text?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `materials` | `object[]` | No | Additional materials. Announcements must have no more than 20 material items. |
| `assigneeMode` | `ASSIGNEE_MODE_UNSPECIFIED \| ALL_STUDENTS \| INDIVIDUAL_STUDENTS \| string` | No | Assignee mode of the announcement. If unspecified, the default value is `ALL_STUDENTS`. |
| `scheduledTime` | `string` | No | Optional timestamp when this announcement is scheduled to be published. |
| `id` | `string` | No | Classroom-assigned identifier of this announcement, unique per course. Read-only. |
| `individualStudentsOptions` | `object` | No | Identifiers of students with access to the announcement. This field is set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students specified in this field can see the announcement. |
| `creationTime` | `string` | No | Timestamp when this announcement was created. Read-only. |
| `updateTime` | `string` | No | Timestamp of the most recent change to this announcement. Read-only. |
| `state` | `ANNOUNCEMENT_STATE_UNSPECIFIED \| PUBLISHED \| DRAFT \| DELETED \| string` | No | Status of this announcement. If unspecified, the default state is `DRAFT`. |
| `courseId` | `string` | No | Identifier of the course. Read-only. |
| `alternateLink` | `string` | No | Absolute link to this announcement in the Classroom web UI. This is only populated if `state` is `PUBLISHED`. Read-only. |
| `creatorUserId` | `string` | No | Identifier for the user that created the announcement. Read-only. |
| `text` | `string` | No | Description of this announcement. The text must be a valid UTF-8 string containing no more than 30,000 characters. |

> [accordion] materials full type
>
> ```ts theme={null}
> {
>   gem?: {
>     id?: string,
>     url?: string,
>     title?: string
>   },
>   youtubeVideo?: {
>     id?: string,
>     title?: string,
>     alternateLink?: string,
>     thumbnailUrl?: string
>   },
>   form?: {
>     title?: string,
>     formUrl?: string,
>     responseUrl?: string,
>     thumbnailUrl?: string
>   },
>   driveFile?: {
>     driveFile?: {
>       thumbnailUrl?: string,
>       alternateLink?: string,
>       id?: string,
>       title?: string
>     },
>     shareMode?: UNKNOWN_SHARE_MODE | VIEW | EDIT | STUDENT_COPY | string
>   },
>   notebook?: {
>     url?: string,
>     id?: string,
>     title?: string
>   },
>   link?: {
>     url?: string,
>     thumbnailUrl?: string,
>     title?: string
>   }
> }[]
> ```

> [accordion] individualStudentsOptions full type
>
> ```ts theme={null}
> {
>   studentIds?: string[]
> }
> ```

***

### courseWork.addOnAttachments.create

`courses.courseWork.addOnAttachments.create`

Creates an add-on attachment under a post. Requires the add-on to have permission to create new attachments on the post. This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if one of the identified resources does not exist.

**Risk:** `write`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWork.addOnAttachments.create({ pathParams: {"itemId":"itemId-123","courseId":"courseId-123"}, query: {}, body: {"title":"Learning activity","teacherViewUri":{"uri":"https://corsair.dev/classroom"},"studentViewUri":{"uri":"https://corsair.dev/classroom"}} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

addOnToken may be omitted for partner-first creation when the creating project matches the project that created the parent post. Google enforces the project and authorization conditions.

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   itemId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   addOnToken?: string,
>   postId?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   dueTime?: {
>     hours?: number,
>     minutes?: number,
>     seconds?: number,
>     nanos?: number
>   },
>   copyHistory?: {
>     courseId?: string,
>     postId?: string,
>     itemId?: string,
>     attachmentId?: string
>   }[],
>   gradeSyncEnabled?: boolean,
>   title: string,
>   studentViewUri: {
>     uri: string
>   },
>   itemId?: string,
>   dueDate?: {
>     year?: number,
>     month?: number,
>     day?: number
>   },
>   studentWorkReviewUri?: {
>     uri: string
>   },
>   postId?: string,
>   teacherViewUri: {
>     uri: string
>   },
>   maxPoints?: number,
>   id?: string,
>   courseId?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `dueTime` | `object` | No | Time of day, in UTC, that work on this attachment is due. This must be specified if `due_date` is specified. |
| `copyHistory` | `object[]` | No | Output only. Identifiers of attachments that were previous copies of this attachment. If the attachment was previously copied by virtue of its parent post being copied, this enumerates the identifiers of attachments that were its previous copies in ascending chronological order of copy. |
| `gradeSyncEnabled` | `boolean` | No | Output only. Whether changes to `pointsEarned` values on this attachment's student submissions will be copied to the `pointsEarned` field on the students' CourseWork submissions. This field can be `true` for at most one add-on attachment per stream item. |
| `title` | `string` | No | Required. Title of this attachment. The title must be between 1 and 1000 characters. |
| `studentViewUri` | `object` | No | Required. URI to show the student view of the attachment. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, and `attachmentId` query parameters set. |
| `itemId` | `string` | No | Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached. Unique per course. |
| `dueDate` | `object` | No | Date, in UTC, that work on this attachment is due. This must be specified if `due_time` is specified. |
| `studentWorkReviewUri` | `object` | No | URI for the teacher to see student work on the attachment, if applicable. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, `attachmentId`, and `submissionId` query parameters set. This is the same `submissionId` returned in the [`AddOnContext.studentContext`](https://developers.google.com/workspace/classroom/reference/rest/v1/AddOnContext#StudentContext) field when a student views the attachment. If the URI is omitted or removed, `max_points` will also be discarded. |
| `postId` | `string` | No | Immutable. Deprecated, use `item_id` instead. |
| `teacherViewUri` | `object` | No | Required. URI to show the teacher view of the attachment. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, and `attachmentId` query parameters set. |
| `maxPoints` | `number` | No | Maximum grade for this attachment. Can only be set if `studentWorkReviewUri` is set. Set to a non-zero value to indicate that the attachment supports grade passback. If set, this must be a non-negative integer value. When set to zero, the attachment will not support grade passback. |
| `id` | `string` | No | Immutable. Classroom-assigned identifier for this attachment, unique per post. |
| `courseId` | `string` | No | Immutable. Identifier of the course. |

> [accordion] dueTime full type
>
> ```ts theme={null}
> {
>   hours?: number,
>   minutes?: number,
>   seconds?: number,
>   nanos?: number
> }
> ```

> [accordion] copyHistory full type
>
> ```ts theme={null}
> {
>   courseId?: string,
>   postId?: string,
>   itemId?: string,
>   attachmentId?: string
> }[]
> ```

> [accordion] studentViewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

> [accordion] dueDate full type
>
> ```ts theme={null}
> {
>   year?: number,
>   month?: number,
>   day?: number
> }
> ```

> [accordion] studentWorkReviewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

> [accordion] teacherViewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

***

### courseWork.addOnAttachments.delete

`courses.courseWork.addOnAttachments.delete`

Deletes an add-on attachment. Requires the add-on to have been the original creator of the attachment. This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if one of the identified resources does not exist.

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWork.addOnAttachments.delete({ pathParams: {"itemId":"itemId-123","attachmentId":"attachmentId-123","courseId":"courseId-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   itemId: string,
>   attachmentId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   postId?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output:** *empty object*

***

### courseWork.addOnAttachments.get

`courses.courseWork.addOnAttachments.get`

Returns an add-on attachment. Requires the add-on requesting the attachment to be the original creator of the attachment. This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if one of the identified resources does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWork.addOnAttachments.get({ pathParams: {"itemId":"itemId-123","attachmentId":"attachmentId-123","courseId":"courseId-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   itemId: string,
>   courseId: string,
>   attachmentId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   postId?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `dueTime` | `object` | No | Time of day, in UTC, that work on this attachment is due. This must be specified if `due_date` is specified. |
| `copyHistory` | `object[]` | No | Output only. Identifiers of attachments that were previous copies of this attachment. If the attachment was previously copied by virtue of its parent post being copied, this enumerates the identifiers of attachments that were its previous copies in ascending chronological order of copy. |
| `gradeSyncEnabled` | `boolean` | No | Output only. Whether changes to `pointsEarned` values on this attachment's student submissions will be copied to the `pointsEarned` field on the students' CourseWork submissions. This field can be `true` for at most one add-on attachment per stream item. |
| `title` | `string` | No | Required. Title of this attachment. The title must be between 1 and 1000 characters. |
| `studentViewUri` | `object` | No | Required. URI to show the student view of the attachment. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, and `attachmentId` query parameters set. |
| `itemId` | `string` | No | Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached. Unique per course. |
| `dueDate` | `object` | No | Date, in UTC, that work on this attachment is due. This must be specified if `due_time` is specified. |
| `studentWorkReviewUri` | `object` | No | URI for the teacher to see student work on the attachment, if applicable. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, `attachmentId`, and `submissionId` query parameters set. This is the same `submissionId` returned in the [`AddOnContext.studentContext`](https://developers.google.com/workspace/classroom/reference/rest/v1/AddOnContext#StudentContext) field when a student views the attachment. If the URI is omitted or removed, `max_points` will also be discarded. |
| `postId` | `string` | No | Immutable. Deprecated, use `item_id` instead. |
| `teacherViewUri` | `object` | No | Required. URI to show the teacher view of the attachment. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, and `attachmentId` query parameters set. |
| `maxPoints` | `number` | No | Maximum grade for this attachment. Can only be set if `studentWorkReviewUri` is set. Set to a non-zero value to indicate that the attachment supports grade passback. If set, this must be a non-negative integer value. When set to zero, the attachment will not support grade passback. |
| `id` | `string` | No | Immutable. Classroom-assigned identifier for this attachment, unique per post. |
| `courseId` | `string` | No | Immutable. Identifier of the course. |

> [accordion] dueTime full type
>
> ```ts theme={null}
> {
>   hours?: number,
>   minutes?: number,
>   seconds?: number,
>   nanos?: number
> }
> ```

> [accordion] copyHistory full type
>
> ```ts theme={null}
> {
>   courseId?: string,
>   postId?: string,
>   itemId?: string,
>   attachmentId?: string
> }[]
> ```

> [accordion] studentViewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

> [accordion] dueDate full type
>
> ```ts theme={null}
> {
>   year?: number,
>   month?: number,
>   day?: number
> }
> ```

> [accordion] studentWorkReviewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

> [accordion] teacherViewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

***

### courseWork.addOnAttachments.list

`courses.courseWork.addOnAttachments.list`

Returns all attachments created by an add-on under the post. Requires the add-on to have active attachments on the post or have permission to create new attachments on the post. This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if one of the identified resources does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWork.addOnAttachments.list({ pathParams: {"courseId":"courseId-123","itemId":"itemId-123"}, query: {"pageSize":1} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   itemId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   pageSize?: number,
>   postId?: string,
>   pageToken?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `addOnAttachments` | `object[]` | No | Attachments under the given post. |
| `nextPageToken` | `string` | No | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted, there are no subsequent pages. |

> [accordion] addOnAttachments full type
>
> ```ts theme={null}
> {
>   dueTime?: {
>     hours?: number,
>     minutes?: number,
>     seconds?: number,
>     nanos?: number
>   },
>   copyHistory?: {
>     courseId?: string,
>     postId?: string,
>     itemId?: string,
>     attachmentId?: string
>   }[],
>   gradeSyncEnabled?: boolean,
>   title?: string,
>   studentViewUri?: {
>     uri?: string
>   },
>   itemId?: string,
>   dueDate?: {
>     year?: number,
>     month?: number,
>     day?: number
>   },
>   studentWorkReviewUri?: {
>     uri?: string
>   },
>   postId?: string,
>   teacherViewUri?: {
>     uri?: string
>   },
>   maxPoints?: number,
>   id?: string,
>   courseId?: string
> }[]
> ```

***

### courseWork.addOnAttachments.patch

`courses.courseWork.addOnAttachments.patch`

Updates an add-on attachment. Requires the add-on to have been the original creator of the attachment. This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if one of the identified resources does not exist.

**Risk:** `write`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWork.addOnAttachments.patch({ pathParams: {"courseId":"courseId-123","itemId":"itemId-123","attachmentId":"attachmentId-123"}, query: {"postId":"post-123","updateMask":"title"}, body: {"title":"Learning activity"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   attachmentId: string,
>   courseId: string,
>   itemId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   updateMask: string,
>   postId: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   dueTime?: {
>     hours?: number,
>     minutes?: number,
>     seconds?: number,
>     nanos?: number
>   },
>   copyHistory?: {
>     courseId?: string,
>     postId?: string,
>     itemId?: string,
>     attachmentId?: string
>   }[],
>   gradeSyncEnabled?: boolean,
>   title?: string,
>   studentViewUri?: {
>     uri: string
>   },
>   itemId?: string,
>   dueDate?: {
>     year?: number,
>     month?: number,
>     day?: number
>   },
>   studentWorkReviewUri?: {
>     uri: string
>   },
>   postId?: string,
>   teacherViewUri?: {
>     uri: string
>   },
>   maxPoints?: number,
>   id?: string,
>   courseId?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `dueTime` | `object` | No | Time of day, in UTC, that work on this attachment is due. This must be specified if `due_date` is specified. |
| `copyHistory` | `object[]` | No | Output only. Identifiers of attachments that were previous copies of this attachment. If the attachment was previously copied by virtue of its parent post being copied, this enumerates the identifiers of attachments that were its previous copies in ascending chronological order of copy. |
| `gradeSyncEnabled` | `boolean` | No | Output only. Whether changes to `pointsEarned` values on this attachment's student submissions will be copied to the `pointsEarned` field on the students' CourseWork submissions. This field can be `true` for at most one add-on attachment per stream item. |
| `title` | `string` | No | Required. Title of this attachment. The title must be between 1 and 1000 characters. |
| `studentViewUri` | `object` | No | Required. URI to show the student view of the attachment. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, and `attachmentId` query parameters set. |
| `itemId` | `string` | No | Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached. Unique per course. |
| `dueDate` | `object` | No | Date, in UTC, that work on this attachment is due. This must be specified if `due_time` is specified. |
| `studentWorkReviewUri` | `object` | No | URI for the teacher to see student work on the attachment, if applicable. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, `attachmentId`, and `submissionId` query parameters set. This is the same `submissionId` returned in the [`AddOnContext.studentContext`](https://developers.google.com/workspace/classroom/reference/rest/v1/AddOnContext#StudentContext) field when a student views the attachment. If the URI is omitted or removed, `max_points` will also be discarded. |
| `postId` | `string` | No | Immutable. Deprecated, use `item_id` instead. |
| `teacherViewUri` | `object` | No | Required. URI to show the teacher view of the attachment. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, and `attachmentId` query parameters set. |
| `maxPoints` | `number` | No | Maximum grade for this attachment. Can only be set if `studentWorkReviewUri` is set. Set to a non-zero value to indicate that the attachment supports grade passback. If set, this must be a non-negative integer value. When set to zero, the attachment will not support grade passback. |
| `id` | `string` | No | Immutable. Classroom-assigned identifier for this attachment, unique per post. |
| `courseId` | `string` | No | Immutable. Identifier of the course. |

> [accordion] dueTime full type
>
> ```ts theme={null}
> {
>   hours?: number,
>   minutes?: number,
>   seconds?: number,
>   nanos?: number
> }
> ```

> [accordion] copyHistory full type
>
> ```ts theme={null}
> {
>   courseId?: string,
>   postId?: string,
>   itemId?: string,
>   attachmentId?: string
> }[]
> ```

> [accordion] studentViewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

> [accordion] dueDate full type
>
> ```ts theme={null}
> {
>   year?: number,
>   month?: number,
>   day?: number
> }
> ```

> [accordion] studentWorkReviewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

> [accordion] teacherViewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

***

### courseWork.addOnAttachments.studentSubmissions.get

`courses.courseWork.addOnAttachments.studentSubmissions.get`

Returns a student submission for an add-on attachment. This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if one of the identified resources does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWork.addOnAttachments.studentSubmissions.get({ pathParams: {"submissionId":"submissionId-123","itemId":"itemId-123","attachmentId":"attachmentId-123","courseId":"courseId-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   submissionId: string,
>   attachmentId: string,
>   itemId: string,
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   postId?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `postSubmissionState` | `SUBMISSION_STATE_UNSPECIFIED \| NEW \| CREATED \| TURNED_IN \| RETURNED \| RECLAIMED_BY_STUDENT \| string` | No | Submission state of add-on attachment's parent post (i.e. assignment). |
| `pointsEarned` | `number` | No | Student grade on this attachment. If unset, no grade was set. |
| `courseWorkSubmissionId` | `string` | No | Output only. Identifier of the course work submission under which this attachment submission was made. |
| `userId` | `string` | No | Identifier for the student that owns this submission. Requires the user to be a teacher in the course and have permission to read student submissions. See [`courseWork.studentSubmissions.get`](https://developers.google.com/workspace/classroom/reference/rest/v1/courses.courseWork.studentSubmissions/get#authorization-scopes) for the list of acceptable OAuth scopes for this field. Read-only. |
| `id` | `string` | No | Output only. Classroom-assigned identifier for this student submission. This is unique among submissions for the relevant course work and add-on attachment combination. |

***

### courseWork.addOnAttachments.studentSubmissions.list

`courses.courseWork.addOnAttachments.studentSubmissions.list`

Returns a list of student submissions that the requester is permitted to view. This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if one of the identified resources does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWork.addOnAttachments.studentSubmissions.list({ pathParams: {"itemId":"itemId-123","attachmentId":"attachmentId-123","courseId":"courseId-123"}, query: {"pageSize":1} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   itemId: string,
>   courseId: string,
>   attachmentId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   pageSize?: number,
>   pageToken?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `nextPageToken` | `string` | No | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted, there are no subsequent pages. |
| `addOnAttachmentStudentSubmissions` | `object[]` | No | Add-on attachment student submissions that match the request. |

> [accordion] addOnAttachmentStudentSubmissions full type
>
> ```ts theme={null}
> {
>   postSubmissionState?: SUBMISSION_STATE_UNSPECIFIED | NEW | CREATED | TURNED_IN | RETURNED | RECLAIMED_BY_STUDENT | string,
>   pointsEarned?: number,
>   courseWorkSubmissionId?: string,
>   userId?: string,
>   id?: string
> }[]
> ```

***

### courseWork.addOnAttachments.studentSubmissions.patch

`courses.courseWork.addOnAttachments.studentSubmissions.patch`

Updates data associated with an add-on attachment submission. Requires the add-on to have been the original creator of the attachment and the attachment to have a positive `max_points` value set. This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if one of the identified resources does not exist.

**Risk:** `write`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWork.addOnAttachments.studentSubmissions.patch({ pathParams: {"submissionId":"submissionId-123","attachmentId":"attachmentId-123","courseId":"courseId-123","itemId":"itemId-123"}, query: {"postId":"post-123","updateMask":"pointsEarned"}, body: {"pointsEarned":1} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

To clear a passback grade, include pointsEarned in updateMask and omit pointsEarned from the request body.

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   submissionId: string,
>   attachmentId: string,
>   courseId: string,
>   itemId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   updateMask: string,
>   postId?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   pointsEarned?: number
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `postSubmissionState` | `SUBMISSION_STATE_UNSPECIFIED \| NEW \| CREATED \| TURNED_IN \| RETURNED \| RECLAIMED_BY_STUDENT \| string` | No | Submission state of add-on attachment's parent post (i.e. assignment). |
| `pointsEarned` | `number` | No | Student grade on this attachment. If unset, no grade was set. |
| `courseWorkSubmissionId` | `string` | No | Output only. Identifier of the course work submission under which this attachment submission was made. |
| `userId` | `string` | No | Identifier for the student that owns this submission. Requires the user to be a teacher in the course and have permission to read student submissions. See [`courseWork.studentSubmissions.get`](https://developers.google.com/workspace/classroom/reference/rest/v1/courses.courseWork.studentSubmissions/get#authorization-scopes) for the list of acceptable OAuth scopes for this field. Read-only. |
| `id` | `string` | No | Output only. Classroom-assigned identifier for this student submission. This is unique among submissions for the relevant course work and add-on attachment combination. |

***

### courseWork.create

`courses.courseWork.create`

Creates course work. The resulting course work (and corresponding student submissions) are associated with the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to make the request. Classroom API requests to modify course work and student submissions must be made with an OAuth client ID from the associated Developer Console project. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course, create course work in the requested course, share a Drive attachment, or for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if the requested course does not exist. \* `FAILED_PRECONDITION` for the following request error: \* AttachmentNotVisible

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWork.create({ pathParams: {"courseId":"courseId-123"}, query: {}, body: {"title":"Assignment","workType":"ASSIGNMENT"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   gradingPeriodId?: string,
>   creationTime?: string,
>   state?: COURSE_WORK_STATE_UNSPECIFIED | PUBLISHED | DRAFT | DELETED,
>   dueDate?: {
>     year?: number,
>     month?: number,
>     day?: number
>   },
>   topicId?: string,
>   gradeCategory?: {
>     defaultGradeDenominator?: number,
>     id?: string,
>     weight?: number,
>     name?: string
>   },
>   materials?: {
>     gem?: {
>       id?: string,
>       url?: string,
>       title?: string
>     },
>     youtubeVideo?: {
>       id?: string,
>       title?: string,
>       alternateLink?: string,
>       thumbnailUrl?: string
>     },
>     form?: {
>       title?: string,
>       formUrl?: string,
>       responseUrl?: string,
>       thumbnailUrl?: string
>     },
>     driveFile?: {
>       driveFile?: {
>         thumbnailUrl?: string,
>         alternateLink?: string,
>         id?: string,
>         title?: string
>       },
>       shareMode?: UNKNOWN_SHARE_MODE | VIEW | EDIT | STUDENT_COPY
>     },
>     notebook?: {
>       url?: string,
>       id?: string,
>       title?: string
>     },
>     link?: {
>       url?: string,
>       thumbnailUrl?: string,
>       title?: string
>     }
>   }[],
>   assigneeMode?: ASSIGNEE_MODE_UNSPECIFIED | ALL_STUDENTS | INDIVIDUAL_STUDENTS,
>   associatedWithDeveloper?: boolean,
>   updateTime?: string,
>   description?: string,
>   dueTime?: {
>     hours?: number,
>     minutes?: number,
>     seconds?: number,
>     nanos?: number
>   },
>   multipleChoiceQuestion?: {
>     choices?: string[]
>   },
>   maxPoints?: number,
>   assignment?: {
>     studentWorkFolder?: {
>       title?: string,
>       alternateLink?: string,
>       id?: string
>     }
>   },
>   courseId?: string,
>   submissionModificationMode?: SUBMISSION_MODIFICATION_MODE_UNSPECIFIED | MODIFIABLE_UNTIL_TURNED_IN | MODIFIABLE,
>   id?: string,
>   workType: ASSIGNMENT | SHORT_ANSWER_QUESTION | MULTIPLE_CHOICE_QUESTION,
>   title: string,
>   scheduledTime?: string,
>   individualStudentsOptions?: {
>     studentIds?: string[]
>   },
>   alternateLink?: string,
>   creatorUserId?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `gradingPeriodId` | `string` | No | Identifier of the grading period associated with the coursework. \* At creation, if unspecified, the grading period ID will be set based on the `dueDate` (or `scheduledTime` if no `dueDate` is set). \* To indicate no association to any grading period, set this field to an empty string (""). \* If specified, it must match an existing grading period ID in the course. |
| `creationTime` | `string` | No | Timestamp when this course work was created. Read-only. |
| `state` | `COURSE_WORK_STATE_UNSPECIFIED \| PUBLISHED \| DRAFT \| DELETED \| string` | No | Status of this course work. If unspecified, the default state is `DRAFT`. |
| `dueDate` | `object` | No | Optional date, in UTC, that submissions for this course work are due. This must be specified if `due_time` is specified. |
| `topicId` | `string` | No | Identifier for the topic that this coursework is associated with. Must match an existing topic in the course. |
| `gradeCategory` | `object` | No | The category that this coursework's grade contributes to. Present only when a category has been chosen for the coursework. May be used in calculating the overall grade. Read-only. |
| `materials` | `object[]` | No | Additional materials. CourseWork must have no more than 20 material items. |
| `assigneeMode` | `ASSIGNEE_MODE_UNSPECIFIED \| ALL_STUDENTS \| INDIVIDUAL_STUDENTS \| string` | No | Assignee mode of the coursework. If unspecified, the default value is `ALL_STUDENTS`. |
| `associatedWithDeveloper` | `boolean` | No | Whether this course work item is associated with the Developer Console project making the request. See CreateCourseWork for more details. Read-only. |
| `updateTime` | `string` | No | Timestamp of the most recent change to this course work. Read-only. |
| `description` | `string` | No | Optional description of this course work. If set, the description must be a valid UTF-8 string containing no more than 30,000 characters. |
| `dueTime` | `object` | No | Optional time of day, in UTC, that submissions for this course work are due. This must be specified if `due_date` is specified. |
| `multipleChoiceQuestion` | `object` | No | Multiple choice question details. For read operations, this field is populated only when `work_type` is `MULTIPLE_CHOICE_QUESTION`. For write operations, this field must be specified when creating course work with a `work_type` of `MULTIPLE_CHOICE_QUESTION`, and it must not be set otherwise. |
| `maxPoints` | `number` | No | Maximum grade for this course work. If zero or unspecified, this assignment is considered ungraded. This must be a non-negative integer value. |
| `assignment` | `object` | No | Assignment details. This is populated only when `work_type` is `ASSIGNMENT`. Read-only. |
| `courseId` | `string` | No | Identifier of the course. Read-only. |
| `submissionModificationMode` | `SUBMISSION_MODIFICATION_MODE_UNSPECIFIED \| MODIFIABLE_UNTIL_TURNED_IN \| MODIFIABLE \| string` | No | Setting to determine when students are allowed to modify submissions. If unspecified, the default value is `MODIFIABLE_UNTIL_TURNED_IN`. |
| `id` | `string` | No | Classroom-assigned identifier of this course work, unique per course. Read-only. |
| `workType` | `COURSE_WORK_TYPE_UNSPECIFIED \| ASSIGNMENT \| SHORT_ANSWER_QUESTION \| MULTIPLE_CHOICE_QUESTION \| string` | No | Type of this course work. The type is set when the course work is created and cannot be changed. |
| `title` | `string` | No | Title of this course work. The title must be a valid UTF-8 string containing between 1 and 3000 characters. |
| `scheduledTime` | `string` | No | Optional timestamp when this course work is scheduled to be published. |
| `individualStudentsOptions` | `object` | No | Identifiers of students with access to the coursework. This field is set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students specified in this field are assigned the coursework. |
| `alternateLink` | `string` | No | Absolute link to this course work in the Classroom web UI. This is only populated if `state` is `PUBLISHED`. Read-only. |
| `creatorUserId` | `string` | No | Identifier for the user that created the coursework. Read-only. |

> [accordion] dueDate full type
>
> ```ts theme={null}
> {
>   year?: number,
>   month?: number,
>   day?: number
> }
> ```

> [accordion] gradeCategory full type
>
> ```ts theme={null}
> {
>   defaultGradeDenominator?: number,
>   id?: string,
>   weight?: number,
>   name?: string
> }
> ```

> [accordion] materials full type
>
> ```ts theme={null}
> {
>   gem?: {
>     id?: string,
>     url?: string,
>     title?: string
>   },
>   youtubeVideo?: {
>     id?: string,
>     title?: string,
>     alternateLink?: string,
>     thumbnailUrl?: string
>   },
>   form?: {
>     title?: string,
>     formUrl?: string,
>     responseUrl?: string,
>     thumbnailUrl?: string
>   },
>   driveFile?: {
>     driveFile?: {
>       thumbnailUrl?: string,
>       alternateLink?: string,
>       id?: string,
>       title?: string
>     },
>     shareMode?: UNKNOWN_SHARE_MODE | VIEW | EDIT | STUDENT_COPY | string
>   },
>   notebook?: {
>     url?: string,
>     id?: string,
>     title?: string
>   },
>   link?: {
>     url?: string,
>     thumbnailUrl?: string,
>     title?: string
>   }
> }[]
> ```

> [accordion] dueTime full type
>
> ```ts theme={null}
> {
>   hours?: number,
>   minutes?: number,
>   seconds?: number,
>   nanos?: number
> }
> ```

> [accordion] multipleChoiceQuestion full type
>
> ```ts theme={null}
> {
>   choices?: string[]
> }
> ```

> [accordion] assignment full type
>
> ```ts theme={null}
> {
>   studentWorkFolder?: {
>     title?: string,
>     alternateLink?: string,
>     id?: string
>   }
> }
> ```

> [accordion] individualStudentsOptions full type
>
> ```ts theme={null}
> {
>   studentIds?: string[]
> }
> ```

***

### courseWork.delete

`courses.courseWork.delete`

Deletes a course work. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting developer project did not create the corresponding course work, if the requesting user is not permitted to delete the requested course or for access errors. \* `FAILED_PRECONDITION` if the requested course work has already been deleted. \* `NOT_FOUND` if no course exists with the requested ID.

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWork.delete({ pathParams: {"id":"id-123","courseId":"courseId-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   id: string,
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output:** *empty object*

***

### courseWork.get

`courses.courseWork.get`

Returns course work. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, or for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if the requested course or course work does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWork.get({ pathParams: {"id":"id-123","courseId":"courseId-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   id: string,
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `gradingPeriodId` | `string` | No | Identifier of the grading period associated with the coursework. \* At creation, if unspecified, the grading period ID will be set based on the `dueDate` (or `scheduledTime` if no `dueDate` is set). \* To indicate no association to any grading period, set this field to an empty string (""). \* If specified, it must match an existing grading period ID in the course. |
| `creationTime` | `string` | No | Timestamp when this course work was created. Read-only. |
| `state` | `COURSE_WORK_STATE_UNSPECIFIED \| PUBLISHED \| DRAFT \| DELETED \| string` | No | Status of this course work. If unspecified, the default state is `DRAFT`. |
| `dueDate` | `object` | No | Optional date, in UTC, that submissions for this course work are due. This must be specified if `due_time` is specified. |
| `topicId` | `string` | No | Identifier for the topic that this coursework is associated with. Must match an existing topic in the course. |
| `gradeCategory` | `object` | No | The category that this coursework's grade contributes to. Present only when a category has been chosen for the coursework. May be used in calculating the overall grade. Read-only. |
| `materials` | `object[]` | No | Additional materials. CourseWork must have no more than 20 material items. |
| `assigneeMode` | `ASSIGNEE_MODE_UNSPECIFIED \| ALL_STUDENTS \| INDIVIDUAL_STUDENTS \| string` | No | Assignee mode of the coursework. If unspecified, the default value is `ALL_STUDENTS`. |
| `associatedWithDeveloper` | `boolean` | No | Whether this course work item is associated with the Developer Console project making the request. See CreateCourseWork for more details. Read-only. |
| `updateTime` | `string` | No | Timestamp of the most recent change to this course work. Read-only. |
| `description` | `string` | No | Optional description of this course work. If set, the description must be a valid UTF-8 string containing no more than 30,000 characters. |
| `dueTime` | `object` | No | Optional time of day, in UTC, that submissions for this course work are due. This must be specified if `due_date` is specified. |
| `multipleChoiceQuestion` | `object` | No | Multiple choice question details. For read operations, this field is populated only when `work_type` is `MULTIPLE_CHOICE_QUESTION`. For write operations, this field must be specified when creating course work with a `work_type` of `MULTIPLE_CHOICE_QUESTION`, and it must not be set otherwise. |
| `maxPoints` | `number` | No | Maximum grade for this course work. If zero or unspecified, this assignment is considered ungraded. This must be a non-negative integer value. |
| `assignment` | `object` | No | Assignment details. This is populated only when `work_type` is `ASSIGNMENT`. Read-only. |
| `courseId` | `string` | No | Identifier of the course. Read-only. |
| `submissionModificationMode` | `SUBMISSION_MODIFICATION_MODE_UNSPECIFIED \| MODIFIABLE_UNTIL_TURNED_IN \| MODIFIABLE \| string` | No | Setting to determine when students are allowed to modify submissions. If unspecified, the default value is `MODIFIABLE_UNTIL_TURNED_IN`. |
| `id` | `string` | No | Classroom-assigned identifier of this course work, unique per course. Read-only. |
| `workType` | `COURSE_WORK_TYPE_UNSPECIFIED \| ASSIGNMENT \| SHORT_ANSWER_QUESTION \| MULTIPLE_CHOICE_QUESTION \| string` | No | Type of this course work. The type is set when the course work is created and cannot be changed. |
| `title` | `string` | No | Title of this course work. The title must be a valid UTF-8 string containing between 1 and 3000 characters. |
| `scheduledTime` | `string` | No | Optional timestamp when this course work is scheduled to be published. |
| `individualStudentsOptions` | `object` | No | Identifiers of students with access to the coursework. This field is set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students specified in this field are assigned the coursework. |
| `alternateLink` | `string` | No | Absolute link to this course work in the Classroom web UI. This is only populated if `state` is `PUBLISHED`. Read-only. |
| `creatorUserId` | `string` | No | Identifier for the user that created the coursework. Read-only. |

> [accordion] dueDate full type
>
> ```ts theme={null}
> {
>   year?: number,
>   month?: number,
>   day?: number
> }
> ```

> [accordion] gradeCategory full type
>
> ```ts theme={null}
> {
>   defaultGradeDenominator?: number,
>   id?: string,
>   weight?: number,
>   name?: string
> }
> ```

> [accordion] materials full type
>
> ```ts theme={null}
> {
>   gem?: {
>     id?: string,
>     url?: string,
>     title?: string
>   },
>   youtubeVideo?: {
>     id?: string,
>     title?: string,
>     alternateLink?: string,
>     thumbnailUrl?: string
>   },
>   form?: {
>     title?: string,
>     formUrl?: string,
>     responseUrl?: string,
>     thumbnailUrl?: string
>   },
>   driveFile?: {
>     driveFile?: {
>       thumbnailUrl?: string,
>       alternateLink?: string,
>       id?: string,
>       title?: string
>     },
>     shareMode?: UNKNOWN_SHARE_MODE | VIEW | EDIT | STUDENT_COPY | string
>   },
>   notebook?: {
>     url?: string,
>     id?: string,
>     title?: string
>   },
>   link?: {
>     url?: string,
>     thumbnailUrl?: string,
>     title?: string
>   }
> }[]
> ```

> [accordion] dueTime full type
>
> ```ts theme={null}
> {
>   hours?: number,
>   minutes?: number,
>   seconds?: number,
>   nanos?: number
> }
> ```

> [accordion] multipleChoiceQuestion full type
>
> ```ts theme={null}
> {
>   choices?: string[]
> }
> ```

> [accordion] assignment full type
>
> ```ts theme={null}
> {
>   studentWorkFolder?: {
>     title?: string,
>     alternateLink?: string,
>     id?: string
>   }
> }
> ```

> [accordion] individualStudentsOptions full type
>
> ```ts theme={null}
> {
>   studentIds?: string[]
> }
> ```

***

### courseWork.getAddOnContext

`courses.courseWork.getAddOnContext`

Gets metadata for Classroom add-ons in the context of a specific post. To maintain the integrity of its own data and permissions model, an add-on should call this to validate query parameters and the requesting user's role whenever the add-on is opened in an [iframe](https://developers.google.com/workspace/classroom/add-ons/get-started/iframes/iframes-overview). This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if one of the identified resources does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWork.getAddOnContext({ pathParams: {"itemId":"itemId-123","courseId":"courseId-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

attachmentId is optional only for the Attachment Discovery iframe. addOnToken is required when the add-on has no attachment on the post and the calling project differs from the post's creating project; Google enforces this.

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   itemId: string,
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   attachmentId?: string,
>   addOnToken?: string,
>   postId?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `supportsStudentWork` | `boolean` | No | Optional. Whether the post allows the teacher to see student work and passback grades. |
| `teacherContext` | `object` | No | Add-on context corresponding to the requesting user's role as a teacher. Its presence implies that the requesting user is a teacher in the course. |
| `studentContext` | `object` | No | Add-on context corresponding to the requesting user's role as a student. Its presence implies that the requesting user is a student in the course. |
| `courseId` | `string` | No | Immutable. Identifier of the course. |
| `postId` | `string` | No | Immutable. Deprecated, use `item_id` instead. |
| `itemId` | `string` | No | Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached. |

> [accordion] teacherContext full type
>
> ```ts theme={null}
> {
> }
> ```

> [accordion] studentContext full type
>
> ```ts theme={null}
> {
>   submissionId?: string
> }
> ```

***

### courseWork.list

`courses.courseWork.list`

Returns a list of course work that the requester is permitted to view. Course students may only view `PUBLISHED` course work. Course teachers and domain administrators may view all course work. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if the requested course does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWork.list({ pathParams: {"courseId":"courseId-123"}, query: {"pageSize":1,"courseWorkStates":["PUBLISHED"],"orderBy":"updateTime desc"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   orderBy?: string,
>   pageToken?: string,
>   pageSize?: number,
>   courseWorkStates?: (COURSE_WORK_STATE_UNSPECIFIED | PUBLISHED | DRAFT | DELETED)[],
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `nextPageToken` | `string` | No | Token identifying the next page of results to return. If empty, no further results are available. |
| `courseWork` | `object[]` | No | Course work items that match the request. |

> [accordion] courseWork full type
>
> ```ts theme={null}
> {
>   gradingPeriodId?: string,
>   creationTime?: string,
>   state?: COURSE_WORK_STATE_UNSPECIFIED | PUBLISHED | DRAFT | DELETED | string,
>   dueDate?: {
>     year?: number,
>     month?: number,
>     day?: number
>   },
>   topicId?: string,
>   gradeCategory?: {
>     defaultGradeDenominator?: number,
>     id?: string,
>     weight?: number,
>     name?: string
>   },
>   materials?: {
>     gem?: {
>       id?: string,
>       url?: string,
>       title?: string
>     },
>     youtubeVideo?: {
>       id?: string,
>       title?: string,
>       alternateLink?: string,
>       thumbnailUrl?: string
>     },
>     form?: {
>       title?: string,
>       formUrl?: string,
>       responseUrl?: string,
>       thumbnailUrl?: string
>     },
>     driveFile?: {
>       driveFile?: {
>         thumbnailUrl?: string,
>         alternateLink?: string,
>         id?: string,
>         title?: string
>       },
>       shareMode?: UNKNOWN_SHARE_MODE | VIEW | EDIT | STUDENT_COPY | string
>     },
>     notebook?: {
>       url?: string,
>       id?: string,
>       title?: string
>     },
>     link?: {
>       url?: string,
>       thumbnailUrl?: string,
>       title?: string
>     }
>   }[],
>   assigneeMode?: ASSIGNEE_MODE_UNSPECIFIED | ALL_STUDENTS | INDIVIDUAL_STUDENTS | string,
>   associatedWithDeveloper?: boolean,
>   updateTime?: string,
>   description?: string,
>   dueTime?: {
>     hours?: number,
>     minutes?: number,
>     seconds?: number,
>     nanos?: number
>   },
>   multipleChoiceQuestion?: {
>     choices?: string[]
>   },
>   maxPoints?: number,
>   assignment?: {
>     studentWorkFolder?: {
>       title?: string,
>       alternateLink?: string,
>       id?: string
>     }
>   },
>   courseId?: string,
>   submissionModificationMode?: SUBMISSION_MODIFICATION_MODE_UNSPECIFIED | MODIFIABLE_UNTIL_TURNED_IN | MODIFIABLE | string,
>   id?: string,
>   workType?: COURSE_WORK_TYPE_UNSPECIFIED | ASSIGNMENT | SHORT_ANSWER_QUESTION | MULTIPLE_CHOICE_QUESTION | string,
>   title?: string,
>   scheduledTime?: string,
>   individualStudentsOptions?: {
>     studentIds?: string[]
>   },
>   alternateLink?: string,
>   creatorUserId?: string
> }[]
> ```

***

### courseWork.modifyAssignees

`courses.courseWork.modifyAssignees`

Modifies assignee mode and options of a coursework. Only a teacher of the course that contains the coursework may call this method. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work or for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if the requested course or course work does not exist. \* `FAILED_PRECONDITION` for the following request error: \* EmptyAssignees

**Risk:** `write`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWork.modifyAssignees({ pathParams: {"courseId":"courseId-123","id":"id-123"}, query: {}, body: {"assigneeMode":"ALL_STUDENTS","modifyIndividualStudentsOptions":{}} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   id: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   modifyIndividualStudentsOptions?: {
>     removeStudentIds?: string[],
>     addStudentIds?: string[]
>   },
>   assigneeMode: ALL_STUDENTS | INDIVIDUAL_STUDENTS
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `gradingPeriodId` | `string` | No | Identifier of the grading period associated with the coursework. \* At creation, if unspecified, the grading period ID will be set based on the `dueDate` (or `scheduledTime` if no `dueDate` is set). \* To indicate no association to any grading period, set this field to an empty string (""). \* If specified, it must match an existing grading period ID in the course. |
| `creationTime` | `string` | No | Timestamp when this course work was created. Read-only. |
| `state` | `COURSE_WORK_STATE_UNSPECIFIED \| PUBLISHED \| DRAFT \| DELETED \| string` | No | Status of this course work. If unspecified, the default state is `DRAFT`. |
| `dueDate` | `object` | No | Optional date, in UTC, that submissions for this course work are due. This must be specified if `due_time` is specified. |
| `topicId` | `string` | No | Identifier for the topic that this coursework is associated with. Must match an existing topic in the course. |
| `gradeCategory` | `object` | No | The category that this coursework's grade contributes to. Present only when a category has been chosen for the coursework. May be used in calculating the overall grade. Read-only. |
| `materials` | `object[]` | No | Additional materials. CourseWork must have no more than 20 material items. |
| `assigneeMode` | `ASSIGNEE_MODE_UNSPECIFIED \| ALL_STUDENTS \| INDIVIDUAL_STUDENTS \| string` | No | Assignee mode of the coursework. If unspecified, the default value is `ALL_STUDENTS`. |
| `associatedWithDeveloper` | `boolean` | No | Whether this course work item is associated with the Developer Console project making the request. See CreateCourseWork for more details. Read-only. |
| `updateTime` | `string` | No | Timestamp of the most recent change to this course work. Read-only. |
| `description` | `string` | No | Optional description of this course work. If set, the description must be a valid UTF-8 string containing no more than 30,000 characters. |
| `dueTime` | `object` | No | Optional time of day, in UTC, that submissions for this course work are due. This must be specified if `due_date` is specified. |
| `multipleChoiceQuestion` | `object` | No | Multiple choice question details. For read operations, this field is populated only when `work_type` is `MULTIPLE_CHOICE_QUESTION`. For write operations, this field must be specified when creating course work with a `work_type` of `MULTIPLE_CHOICE_QUESTION`, and it must not be set otherwise. |
| `maxPoints` | `number` | No | Maximum grade for this course work. If zero or unspecified, this assignment is considered ungraded. This must be a non-negative integer value. |
| `assignment` | `object` | No | Assignment details. This is populated only when `work_type` is `ASSIGNMENT`. Read-only. |
| `courseId` | `string` | No | Identifier of the course. Read-only. |
| `submissionModificationMode` | `SUBMISSION_MODIFICATION_MODE_UNSPECIFIED \| MODIFIABLE_UNTIL_TURNED_IN \| MODIFIABLE \| string` | No | Setting to determine when students are allowed to modify submissions. If unspecified, the default value is `MODIFIABLE_UNTIL_TURNED_IN`. |
| `id` | `string` | No | Classroom-assigned identifier of this course work, unique per course. Read-only. |
| `workType` | `COURSE_WORK_TYPE_UNSPECIFIED \| ASSIGNMENT \| SHORT_ANSWER_QUESTION \| MULTIPLE_CHOICE_QUESTION \| string` | No | Type of this course work. The type is set when the course work is created and cannot be changed. |
| `title` | `string` | No | Title of this course work. The title must be a valid UTF-8 string containing between 1 and 3000 characters. |
| `scheduledTime` | `string` | No | Optional timestamp when this course work is scheduled to be published. |
| `individualStudentsOptions` | `object` | No | Identifiers of students with access to the coursework. This field is set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students specified in this field are assigned the coursework. |
| `alternateLink` | `string` | No | Absolute link to this course work in the Classroom web UI. This is only populated if `state` is `PUBLISHED`. Read-only. |
| `creatorUserId` | `string` | No | Identifier for the user that created the coursework. Read-only. |

> [accordion] dueDate full type
>
> ```ts theme={null}
> {
>   year?: number,
>   month?: number,
>   day?: number
> }
> ```

> [accordion] gradeCategory full type
>
> ```ts theme={null}
> {
>   defaultGradeDenominator?: number,
>   id?: string,
>   weight?: number,
>   name?: string
> }
> ```

> [accordion] materials full type
>
> ```ts theme={null}
> {
>   gem?: {
>     id?: string,
>     url?: string,
>     title?: string
>   },
>   youtubeVideo?: {
>     id?: string,
>     title?: string,
>     alternateLink?: string,
>     thumbnailUrl?: string
>   },
>   form?: {
>     title?: string,
>     formUrl?: string,
>     responseUrl?: string,
>     thumbnailUrl?: string
>   },
>   driveFile?: {
>     driveFile?: {
>       thumbnailUrl?: string,
>       alternateLink?: string,
>       id?: string,
>       title?: string
>     },
>     shareMode?: UNKNOWN_SHARE_MODE | VIEW | EDIT | STUDENT_COPY | string
>   },
>   notebook?: {
>     url?: string,
>     id?: string,
>     title?: string
>   },
>   link?: {
>     url?: string,
>     thumbnailUrl?: string,
>     title?: string
>   }
> }[]
> ```

> [accordion] dueTime full type
>
> ```ts theme={null}
> {
>   hours?: number,
>   minutes?: number,
>   seconds?: number,
>   nanos?: number
> }
> ```

> [accordion] multipleChoiceQuestion full type
>
> ```ts theme={null}
> {
>   choices?: string[]
> }
> ```

> [accordion] assignment full type
>
> ```ts theme={null}
> {
>   studentWorkFolder?: {
>     title?: string,
>     alternateLink?: string,
>     id?: string
>   }
> }
> ```

> [accordion] individualStudentsOptions full type
>
> ```ts theme={null}
> {
>   studentIds?: string[]
> }
> ```

***

### courseWork.patch

`courses.courseWork.patch`

Updates one or more fields of a course work. See google.classroom.v1.CourseWork for details of which fields may be updated and who may change them. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item or an add-on attachment on the corresponding course work item. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting developer project did not create the corresponding course work or an add-on attachment on the corresponding course work, if the user is not permitted to make the requested modification to the student submission, or for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `FAILED_PRECONDITION` if the requested course work has already been deleted. \* `NOT_FOUND` if the requested course or course work does not exist.

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWork.patch({ pathParams: {"id":"id-123","courseId":"courseId-123"}, query: {"updateMask":"title"}, body: {"title":"Assignment"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   id: string,
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   updateMask: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   gradingPeriodId?: string,
>   creationTime?: string,
>   state?: COURSE_WORK_STATE_UNSPECIFIED | PUBLISHED | DRAFT | DELETED,
>   dueDate?: {
>     year?: number,
>     month?: number,
>     day?: number
>   },
>   topicId?: string,
>   gradeCategory?: {
>     defaultGradeDenominator?: number,
>     id?: string,
>     weight?: number,
>     name?: string
>   },
>   materials?: {
>     gem?: {
>       id?: string,
>       url?: string,
>       title?: string
>     },
>     youtubeVideo?: {
>       id?: string,
>       title?: string,
>       alternateLink?: string,
>       thumbnailUrl?: string
>     },
>     form?: {
>       title?: string,
>       formUrl?: string,
>       responseUrl?: string,
>       thumbnailUrl?: string
>     },
>     driveFile?: {
>       driveFile?: {
>         thumbnailUrl?: string,
>         alternateLink?: string,
>         id?: string,
>         title?: string
>       },
>       shareMode?: UNKNOWN_SHARE_MODE | VIEW | EDIT | STUDENT_COPY
>     },
>     notebook?: {
>       url?: string,
>       id?: string,
>       title?: string
>     },
>     link?: {
>       url?: string,
>       thumbnailUrl?: string,
>       title?: string
>     }
>   }[],
>   assigneeMode?: ASSIGNEE_MODE_UNSPECIFIED | ALL_STUDENTS | INDIVIDUAL_STUDENTS,
>   associatedWithDeveloper?: boolean,
>   updateTime?: string,
>   description?: string,
>   dueTime?: {
>     hours?: number,
>     minutes?: number,
>     seconds?: number,
>     nanos?: number
>   },
>   multipleChoiceQuestion?: {
>     choices?: string[]
>   },
>   maxPoints?: number,
>   assignment?: {
>     studentWorkFolder?: {
>       title?: string,
>       alternateLink?: string,
>       id?: string
>     }
>   },
>   courseId?: string,
>   submissionModificationMode?: SUBMISSION_MODIFICATION_MODE_UNSPECIFIED | MODIFIABLE_UNTIL_TURNED_IN | MODIFIABLE,
>   id?: string,
>   workType?: COURSE_WORK_TYPE_UNSPECIFIED | ASSIGNMENT | SHORT_ANSWER_QUESTION | MULTIPLE_CHOICE_QUESTION,
>   title?: string,
>   scheduledTime?: string,
>   individualStudentsOptions?: {
>     studentIds?: string[]
>   },
>   alternateLink?: string,
>   creatorUserId?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `gradingPeriodId` | `string` | No | Identifier of the grading period associated with the coursework. \* At creation, if unspecified, the grading period ID will be set based on the `dueDate` (or `scheduledTime` if no `dueDate` is set). \* To indicate no association to any grading period, set this field to an empty string (""). \* If specified, it must match an existing grading period ID in the course. |
| `creationTime` | `string` | No | Timestamp when this course work was created. Read-only. |
| `state` | `COURSE_WORK_STATE_UNSPECIFIED \| PUBLISHED \| DRAFT \| DELETED \| string` | No | Status of this course work. If unspecified, the default state is `DRAFT`. |
| `dueDate` | `object` | No | Optional date, in UTC, that submissions for this course work are due. This must be specified if `due_time` is specified. |
| `topicId` | `string` | No | Identifier for the topic that this coursework is associated with. Must match an existing topic in the course. |
| `gradeCategory` | `object` | No | The category that this coursework's grade contributes to. Present only when a category has been chosen for the coursework. May be used in calculating the overall grade. Read-only. |
| `materials` | `object[]` | No | Additional materials. CourseWork must have no more than 20 material items. |
| `assigneeMode` | `ASSIGNEE_MODE_UNSPECIFIED \| ALL_STUDENTS \| INDIVIDUAL_STUDENTS \| string` | No | Assignee mode of the coursework. If unspecified, the default value is `ALL_STUDENTS`. |
| `associatedWithDeveloper` | `boolean` | No | Whether this course work item is associated with the Developer Console project making the request. See CreateCourseWork for more details. Read-only. |
| `updateTime` | `string` | No | Timestamp of the most recent change to this course work. Read-only. |
| `description` | `string` | No | Optional description of this course work. If set, the description must be a valid UTF-8 string containing no more than 30,000 characters. |
| `dueTime` | `object` | No | Optional time of day, in UTC, that submissions for this course work are due. This must be specified if `due_date` is specified. |
| `multipleChoiceQuestion` | `object` | No | Multiple choice question details. For read operations, this field is populated only when `work_type` is `MULTIPLE_CHOICE_QUESTION`. For write operations, this field must be specified when creating course work with a `work_type` of `MULTIPLE_CHOICE_QUESTION`, and it must not be set otherwise. |
| `maxPoints` | `number` | No | Maximum grade for this course work. If zero or unspecified, this assignment is considered ungraded. This must be a non-negative integer value. |
| `assignment` | `object` | No | Assignment details. This is populated only when `work_type` is `ASSIGNMENT`. Read-only. |
| `courseId` | `string` | No | Identifier of the course. Read-only. |
| `submissionModificationMode` | `SUBMISSION_MODIFICATION_MODE_UNSPECIFIED \| MODIFIABLE_UNTIL_TURNED_IN \| MODIFIABLE \| string` | No | Setting to determine when students are allowed to modify submissions. If unspecified, the default value is `MODIFIABLE_UNTIL_TURNED_IN`. |
| `id` | `string` | No | Classroom-assigned identifier of this course work, unique per course. Read-only. |
| `workType` | `COURSE_WORK_TYPE_UNSPECIFIED \| ASSIGNMENT \| SHORT_ANSWER_QUESTION \| MULTIPLE_CHOICE_QUESTION \| string` | No | Type of this course work. The type is set when the course work is created and cannot be changed. |
| `title` | `string` | No | Title of this course work. The title must be a valid UTF-8 string containing between 1 and 3000 characters. |
| `scheduledTime` | `string` | No | Optional timestamp when this course work is scheduled to be published. |
| `individualStudentsOptions` | `object` | No | Identifiers of students with access to the coursework. This field is set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students specified in this field are assigned the coursework. |
| `alternateLink` | `string` | No | Absolute link to this course work in the Classroom web UI. This is only populated if `state` is `PUBLISHED`. Read-only. |
| `creatorUserId` | `string` | No | Identifier for the user that created the coursework. Read-only. |

> [accordion] dueDate full type
>
> ```ts theme={null}
> {
>   year?: number,
>   month?: number,
>   day?: number
> }
> ```

> [accordion] gradeCategory full type
>
> ```ts theme={null}
> {
>   defaultGradeDenominator?: number,
>   id?: string,
>   weight?: number,
>   name?: string
> }
> ```

> [accordion] materials full type
>
> ```ts theme={null}
> {
>   gem?: {
>     id?: string,
>     url?: string,
>     title?: string
>   },
>   youtubeVideo?: {
>     id?: string,
>     title?: string,
>     alternateLink?: string,
>     thumbnailUrl?: string
>   },
>   form?: {
>     title?: string,
>     formUrl?: string,
>     responseUrl?: string,
>     thumbnailUrl?: string
>   },
>   driveFile?: {
>     driveFile?: {
>       thumbnailUrl?: string,
>       alternateLink?: string,
>       id?: string,
>       title?: string
>     },
>     shareMode?: UNKNOWN_SHARE_MODE | VIEW | EDIT | STUDENT_COPY | string
>   },
>   notebook?: {
>     url?: string,
>     id?: string,
>     title?: string
>   },
>   link?: {
>     url?: string,
>     thumbnailUrl?: string,
>     title?: string
>   }
> }[]
> ```

> [accordion] dueTime full type
>
> ```ts theme={null}
> {
>   hours?: number,
>   minutes?: number,
>   seconds?: number,
>   nanos?: number
> }
> ```

> [accordion] multipleChoiceQuestion full type
>
> ```ts theme={null}
> {
>   choices?: string[]
> }
> ```

> [accordion] assignment full type
>
> ```ts theme={null}
> {
>   studentWorkFolder?: {
>     title?: string,
>     alternateLink?: string,
>     id?: string
>   }
> }
> ```

> [accordion] individualStudentsOptions full type
>
> ```ts theme={null}
> {
>   studentIds?: string[]
> }
> ```

***

### courseWork.rubrics.create

`courses.courseWork.rubrics.create`

Creates a rubric. The requesting user and course owner must have rubrics creation capabilities. For details, see [licensing requirements](https://developers.google.com/workspace/classroom/rubrics/limitations#license-requirements). For further details, see [Rubrics structure and known limitations](https://developers.google.com/workspace/classroom/rubrics/limitations). This request must be made by the Google Cloud console of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the parent course work item. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user isn't permitted to create rubrics for course work in the requested course. \* `INTERNAL` if the request has insufficient OAuth scopes. \* `INVALID_ARGUMENT` if the request is malformed and for the following request error: \* `RubricCriteriaInvalidFormat` \* `NOT_FOUND` if the requested course or course work don't exist or the user doesn't have access to the course or course work. \* `FAILED_PRECONDITION` for the following request error: \* `AttachmentNotVisible`

**Risk:** `write`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWork.rubrics.create({ pathParams: {"courseId":"courseId-123","courseWorkId":"courseWorkId-123"}, query: {}, body: {"criteria":[{"description":"Criterion","levels":[{"title":"Proficient"}]}]} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

Importing a rubric with sourceSpreadsheetId additionally requires either the Google Sheets spreadsheets.readonly or spreadsheets OAuth scope; these scopes are available through oauthScopes but are not requested by default.

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   courseWorkId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   criteria?: {
>     description?: string,
>     id?: string,
>     title?: string,
>     levels?: {
>       points?: number,
>       description?: string,
>       title?: string,
>       id?: string
>     }[]
>   }[],
>   updateTime?: string,
>   id?: string,
>   courseWorkId?: string,
>   creationTime?: string,
>   courseId?: string,
>   sourceSpreadsheetId?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `criteria` | `object[]` | No | List of criteria. Each criterion is a dimension on which performance is rated. |
| `updateTime` | `string` | No | Output only. Timestamp of the most recent change to this rubric. Read-only. |
| `id` | `string` | No | Classroom-assigned identifier for the rubric. This is unique among rubrics for the relevant course work. Read-only. |
| `courseWorkId` | `string` | No | Identifier for the course work this corresponds to. Read-only. |
| `creationTime` | `string` | No | Output only. Timestamp when this rubric was created. Read-only. |
| `courseId` | `string` | No | Identifier of the course. Read-only. |
| `sourceSpreadsheetId` | `string` | No | Input only. Immutable. Google Sheets ID of the spreadsheet. This spreadsheet must contain formatted rubric settings. See [Create or reuse a rubric for an assignment](https://support.google.com/edu/classroom/answer/9335069). Use of this field requires the `https://www.googleapis.com/auth/spreadsheets.readonly` or `https://www.googleapis.com/auth/spreadsheets` scope. |

> [accordion] criteria full type
>
> ```ts theme={null}
> {
>   description?: string,
>   id?: string,
>   title?: string,
>   levels?: {
>     points?: number,
>     description?: string,
>     title?: string,
>     id?: string
>   }[]
> }[]
> ```

***

### courseWork.rubrics.delete

`courses.courseWork.rubrics.delete`

Deletes a rubric. The requesting user and course owner must have rubrics creation capabilities. For details, see [licensing requirements](https://developers.google.com/workspace/classroom/rubrics/limitations#license-requirements). This request must be made by the Google Cloud console of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding rubric. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting developer project didn't create the corresponding rubric, or if the requesting user isn't permitted to delete the requested rubric. \* `NOT_FOUND` if no rubric exists with the requested ID or the user does not have access to the course, course work, or rubric. \* `INVALID_ARGUMENT` if grading has already started on the rubric.

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWork.rubrics.delete({ pathParams: {"courseId":"courseId-123","id":"id-123","courseWorkId":"courseWorkId-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   courseWorkId: string,
>   id: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output:** *empty object*

***

### courseWork.rubrics.get

`courses.courseWork.rubrics.get`

Returns a rubric. This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if the requested course, course work, or rubric doesn't exist or if the user doesn't have access to the corresponding course work.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWork.rubrics.get({ pathParams: {"id":"id-123","courseId":"courseId-123","courseWorkId":"courseWorkId-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   id: string,
>   courseWorkId: string,
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `criteria` | `object[]` | No | List of criteria. Each criterion is a dimension on which performance is rated. |
| `updateTime` | `string` | No | Output only. Timestamp of the most recent change to this rubric. Read-only. |
| `id` | `string` | No | Classroom-assigned identifier for the rubric. This is unique among rubrics for the relevant course work. Read-only. |
| `courseWorkId` | `string` | No | Identifier for the course work this corresponds to. Read-only. |
| `creationTime` | `string` | No | Output only. Timestamp when this rubric was created. Read-only. |
| `courseId` | `string` | No | Identifier of the course. Read-only. |
| `sourceSpreadsheetId` | `string` | No | Input only. Immutable. Google Sheets ID of the spreadsheet. This spreadsheet must contain formatted rubric settings. See [Create or reuse a rubric for an assignment](https://support.google.com/edu/classroom/answer/9335069). Use of this field requires the `https://www.googleapis.com/auth/spreadsheets.readonly` or `https://www.googleapis.com/auth/spreadsheets` scope. |

> [accordion] criteria full type
>
> ```ts theme={null}
> {
>   description?: string,
>   id?: string,
>   title?: string,
>   levels?: {
>     points?: number,
>     description?: string,
>     title?: string,
>     id?: string
>   }[]
> }[]
> ```

***

### courseWork.rubrics.list

`courses.courseWork.rubrics.list`

Returns a list of rubrics that the requester is permitted to view. This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if the requested course or course work doesn't exist or if the user doesn't have access to the corresponding course work.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWork.rubrics.list({ pathParams: {"courseWorkId":"courseWorkId-123","courseId":"courseId-123"}, query: {"pageSize":1} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

The pageSize maximum is 1; Google coerces larger values to 1. Continue with nextPageToken when returned.

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   courseWorkId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   pageSize?: number,
>   pageToken?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `rubrics` | `object[]` | No | Rubrics that match the request. |
| `nextPageToken` | `string` | No | Token identifying the next page of results to return. If empty, no further results are available. |

> [accordion] rubrics full type
>
> ```ts theme={null}
> {
>   criteria?: {
>     description?: string,
>     id?: string,
>     title?: string,
>     levels?: {
>       points?: number,
>       description?: string,
>       title?: string,
>       id?: string
>     }[]
>   }[],
>   updateTime?: string,
>   id?: string,
>   courseWorkId?: string,
>   creationTime?: string,
>   courseId?: string,
>   sourceSpreadsheetId?: string
> }[]
> ```

***

### courseWork.rubrics.patch

`courses.courseWork.rubrics.patch`

Updates a rubric. See google.classroom.v1.Rubric for details of which fields can be updated. Rubric update capabilities are [limited](https://developers.google.com/workspace/classroom/rubrics/limitations) once grading has started. The requesting user and course owner must have rubrics creation capabilities. For details, see [licensing requirements](https://developers.google.com/workspace/classroom/rubrics/limitations#license-requirements). This request must be made by the Google Cloud console of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the parent course work item. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting developer project didn't create the corresponding course work, if the user isn't permitted to make the requested modification to the rubric, or for access errors. This error code is also returned if grading has already started on the rubric. \* `INVALID_ARGUMENT` if the request is malformed and for the following request error: \* `RubricCriteriaInvalidFormat` \* `NOT_FOUND` if the requested course, course work, or rubric doesn't exist or if the user doesn't have access to the corresponding course work. \* `INTERNAL` if grading has already started on the rubric.

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWork.rubrics.patch({ pathParams: {"courseWorkId":"courseWorkId-123","id":"id-123","courseId":"courseId-123"}, query: {"updateMask":"criteria"}, body: {"criteria":[{"description":"Criterion","levels":[{"title":"Proficient"}]}]} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

Importing a rubric with sourceSpreadsheetId additionally requires either the Google Sheets spreadsheets.readonly or spreadsheets OAuth scope; these scopes are available through oauthScopes but are not requested by default.

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   id: string,
>   courseWorkId: string,
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   updateMask: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   criteria?: {
>     description?: string,
>     id?: string,
>     title?: string,
>     levels?: {
>       points?: number,
>       description?: string,
>       title?: string,
>       id?: string
>     }[]
>   }[],
>   updateTime?: string,
>   id?: string,
>   courseWorkId?: string,
>   creationTime?: string,
>   courseId?: string,
>   sourceSpreadsheetId?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `criteria` | `object[]` | No | List of criteria. Each criterion is a dimension on which performance is rated. |
| `updateTime` | `string` | No | Output only. Timestamp of the most recent change to this rubric. Read-only. |
| `id` | `string` | No | Classroom-assigned identifier for the rubric. This is unique among rubrics for the relevant course work. Read-only. |
| `courseWorkId` | `string` | No | Identifier for the course work this corresponds to. Read-only. |
| `creationTime` | `string` | No | Output only. Timestamp when this rubric was created. Read-only. |
| `courseId` | `string` | No | Identifier of the course. Read-only. |
| `sourceSpreadsheetId` | `string` | No | Input only. Immutable. Google Sheets ID of the spreadsheet. This spreadsheet must contain formatted rubric settings. See [Create or reuse a rubric for an assignment](https://support.google.com/edu/classroom/answer/9335069). Use of this field requires the `https://www.googleapis.com/auth/spreadsheets.readonly` or `https://www.googleapis.com/auth/spreadsheets` scope. |

> [accordion] criteria full type
>
> ```ts theme={null}
> {
>   description?: string,
>   id?: string,
>   title?: string,
>   levels?: {
>     points?: number,
>     description?: string,
>     title?: string,
>     id?: string
>   }[]
> }[]
> ```

***

### courseWork.studentSubmissions.get

`courses.courseWork.studentSubmissions.get`

Returns a student submission. \* `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course, course work, or student submission or for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if the requested course, course work, or student submission does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWork.studentSubmissions.get({ pathParams: {"courseId":"courseId-123","courseWorkId":"courseWorkId-123","id":"id-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseWorkId: string,
>   id: string,
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `creationTime` | `string` | No | Creation time of this submission. This may be unset if the student has not accessed this item. Read-only. |
| `assignedGrade` | `number` | No | Optional grade. If unset, no grade was set. This value must be non-negative. Decimal (that is, non-integer) values are allowed, but are rounded to two decimal places. This may be modified only by course teachers. |
| `assignmentSubmission` | `object` | No | Submission content when course\_work\_type is ASSIGNMENT. Students can modify this content using ModifyAttachments. |
| `courseWorkType` | `COURSE_WORK_TYPE_UNSPECIFIED \| ASSIGNMENT \| SHORT_ANSWER_QUESTION \| MULTIPLE_CHOICE_QUESTION \| string` | No | Type of course work this submission is for. Read-only. |
| `submissionHistory` | `object[]` | No | The history of the submission (includes state and grade histories). Read-only. |
| `id` | `string` | No | Classroom-assigned Identifier for the student submission. This is unique among submissions for the relevant course work. Read-only. |
| `assignedRubricGrades` | `object` | No | Assigned rubric grades based on the rubric's Criteria. This map is empty if there is no rubric attached to this course work or if a rubric is attached, but no grades have been set on any Criteria. Entries are only populated for grades that have been set. Key: The rubric's criterion ID. Read-only. |
| `draftRubricGrades` | `object` | No | Pending rubric grades based on the rubric's criteria. This map is empty if there is no rubric attached to this course work or if a rubric is attached, but no grades have been set on any criteria. Entries are only populated for grades that have been set. Key: The rubric's criterion ID. Read-only. |
| `associatedWithDeveloper` | `boolean` | No | Whether this student submission is associated with the Developer Console project making the request. See CreateCourseWork for more details. Read-only. |
| `alternateLink` | `string` | No | Absolute link to the submission in the Classroom web UI. Read-only. |
| `state` | `SUBMISSION_STATE_UNSPECIFIED \| NEW \| CREATED \| TURNED_IN \| RETURNED \| RECLAIMED_BY_STUDENT \| string` | No | State of this submission. Read-only. |
| `courseId` | `string` | No | Identifier of the course. Read-only. |
| `courseWorkId` | `string` | No | Identifier for the course work this corresponds to. Read-only. |
| `late` | `boolean` | No | Whether this submission is late. Read-only. |
| `multipleChoiceSubmission` | `object` | No | Submission content when course\_work\_type is MULTIPLE\_CHOICE\_QUESTION. |
| `updateTime` | `string` | No | Last update time of this submission. This may be unset if the student has not accessed this item. Read-only. |
| `userId` | `string` | No | Identifier for the student that owns this submission. Read-only. |
| `draftGrade` | `number` | No | Optional pending grade. If unset, no grade was set. This value must be non-negative. Decimal (that is, non-integer) values are allowed, but are rounded to two decimal places. This is only visible to and modifiable by course teachers. |
| `shortAnswerSubmission` | `object` | No | Submission content when course\_work\_type is SHORT\_ANSWER\_QUESTION. |

> [accordion] assignmentSubmission full type
>
> ```ts theme={null}
> {
>   attachments?: {
>     link?: {
>       url?: string,
>       thumbnailUrl?: string,
>       title?: string
>     },
>     form?: {
>       title?: string,
>       formUrl?: string,
>       responseUrl?: string,
>       thumbnailUrl?: string
>     },
>     youTubeVideo?: {
>       id?: string,
>       title?: string,
>       alternateLink?: string,
>       thumbnailUrl?: string
>     },
>     driveFile?: {
>       thumbnailUrl?: string,
>       alternateLink?: string,
>       id?: string,
>       title?: string
>     }
>   }[]
> }
> ```

> [accordion] submissionHistory full type
>
> ```ts theme={null}
> {
>   gradeHistory?: {
>     gradeChangeType?: UNKNOWN_GRADE_CHANGE_TYPE | DRAFT_GRADE_POINTS_EARNED_CHANGE | ASSIGNED_GRADE_POINTS_EARNED_CHANGE | MAX_POINTS_CHANGE | string,
>     gradeTimestamp?: string,
>     pointsEarned?: number,
>     maxPoints?: number,
>     actorUserId?: string
>   },
>   stateHistory?: {
>     state?: STATE_UNSPECIFIED | CREATED | TURNED_IN | RETURNED | RECLAIMED_BY_STUDENT | STUDENT_EDITED_AFTER_TURN_IN | string,
>     actorUserId?: string,
>     stateTimestamp?: string
>   }
> }[]
> ```

> [accordion] assignedRubricGrades full type
>
> ```ts theme={null}
> Record<string, {
>   levelId?: string,
>   criterionId?: string,
>   points?: number
> }>
> ```

> [accordion] draftRubricGrades full type
>
> ```ts theme={null}
> Record<string, {
>   levelId?: string,
>   criterionId?: string,
>   points?: number
> }>
> ```

> [accordion] multipleChoiceSubmission full type
>
> ```ts theme={null}
> {
>   answer?: string
> }
> ```

> [accordion] shortAnswerSubmission full type
>
> ```ts theme={null}
> {
>   answer?: string
> }
> ```

***

### courseWork.studentSubmissions.list

`courses.courseWork.studentSubmissions.list`

Returns a list of student submissions that the requester is permitted to view, factoring in the OAuth scopes of the request. A hyphen (`-`) may be specified as the `course_work_id` to include student submissions for multiple course work items. Course students may only view their own work. Course teachers and domain administrators may view all student submissions. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, or for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if the requested course does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWork.studentSubmissions.list({ pathParams: {"courseId":"courseId-123","courseWorkId":"courseWorkId-123"}, query: {"userId":"student-123","pageSize":1,"states":["TURNED_IN"]} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseWorkId: string,
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   states?: (SUBMISSION_STATE_UNSPECIFIED | NEW | CREATED | TURNED_IN | RETURNED | RECLAIMED_BY_STUDENT)[],
>   late?: LATE_VALUES_UNSPECIFIED | LATE_ONLY | NOT_LATE_ONLY,
>   pageToken?: string,
>   pageSize?: number,
>   userId?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `nextPageToken` | `string` | No | Token identifying the next page of results to return. If empty, no further results are available. |
| `studentSubmissions` | `object[]` | No | Student work that matches the request. |

> [accordion] studentSubmissions full type
>
> ```ts theme={null}
> {
>   creationTime?: string,
>   assignedGrade?: number,
>   assignmentSubmission?: {
>     attachments?: {
>       link?: {
>         url?: string,
>         thumbnailUrl?: string,
>         title?: string
>       },
>       form?: {
>         title?: string,
>         formUrl?: string,
>         responseUrl?: string,
>         thumbnailUrl?: string
>       },
>       youTubeVideo?: {
>         id?: string,
>         title?: string,
>         alternateLink?: string,
>         thumbnailUrl?: string
>       },
>       driveFile?: {
>         thumbnailUrl?: string,
>         alternateLink?: string,
>         id?: string,
>         title?: string
>       }
>     }[]
>   },
>   courseWorkType?: COURSE_WORK_TYPE_UNSPECIFIED | ASSIGNMENT | SHORT_ANSWER_QUESTION | MULTIPLE_CHOICE_QUESTION | string,
>   submissionHistory?: {
>     gradeHistory?: {
>       gradeChangeType?: UNKNOWN_GRADE_CHANGE_TYPE | DRAFT_GRADE_POINTS_EARNED_CHANGE | ASSIGNED_GRADE_POINTS_EARNED_CHANGE | MAX_POINTS_CHANGE | string,
>       gradeTimestamp?: string,
>       pointsEarned?: number,
>       maxPoints?: number,
>       actorUserId?: string
>     },
>     stateHistory?: {
>       state?: STATE_UNSPECIFIED | CREATED | TURNED_IN | RETURNED | RECLAIMED_BY_STUDENT | STUDENT_EDITED_AFTER_TURN_IN | string,
>       actorUserId?: string,
>       stateTimestamp?: string
>     }
>   }[],
>   id?: string,
>   assignedRubricGrades?: Record<string, {
>     levelId?: string,
>     criterionId?: string,
>     points?: number
>   }>,
>   draftRubricGrades?: Record<string, {
>     levelId?: string,
>     criterionId?: string,
>     points?: number
>   }>,
>   associatedWithDeveloper?: boolean,
>   alternateLink?: string,
>   state?: SUBMISSION_STATE_UNSPECIFIED | NEW | CREATED | TURNED_IN | RETURNED | RECLAIMED_BY_STUDENT | string,
>   courseId?: string,
>   courseWorkId?: string,
>   late?: boolean,
>   multipleChoiceSubmission?: {
>     answer?: string
>   },
>   updateTime?: string,
>   userId?: string,
>   draftGrade?: number,
>   shortAnswerSubmission?: {
>     answer?: string
>   }
> }[]
> ```

***

### courseWork.studentSubmissions.modifyAttachments

`courses.courseWork.studentSubmissions.modifyAttachments`

Modifies attachments of student submission. Attachments may only be added to student submissions belonging to course work objects with a `workType` of `ASSIGNMENT`. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item or an add-on attachment on the corresponding course work item. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, if the user is not permitted to modify attachments on the requested student submission, or for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if the requested course, course work, or student submission does not exist.

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWork.studentSubmissions.modifyAttachments({ pathParams: {"id":"id-123","courseWorkId":"courseWorkId-123","courseId":"courseId-123"}, query: {}, body: {"addAttachments":[]} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   id: string,
>   courseWorkId: string,
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   addAttachments?: {
>     link?: {
>       url?: string,
>       thumbnailUrl?: string,
>       title?: string
>     },
>     form?: {
>       title?: string,
>       formUrl?: string,
>       responseUrl?: string,
>       thumbnailUrl?: string
>     },
>     youTubeVideo?: {
>       id?: string,
>       title?: string,
>       alternateLink?: string,
>       thumbnailUrl?: string
>     },
>     driveFile?: {
>       thumbnailUrl?: string,
>       alternateLink?: string,
>       id?: string,
>       title?: string
>     }
>   }[]
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `creationTime` | `string` | No | Creation time of this submission. This may be unset if the student has not accessed this item. Read-only. |
| `assignedGrade` | `number` | No | Optional grade. If unset, no grade was set. This value must be non-negative. Decimal (that is, non-integer) values are allowed, but are rounded to two decimal places. This may be modified only by course teachers. |
| `assignmentSubmission` | `object` | No | Submission content when course\_work\_type is ASSIGNMENT. Students can modify this content using ModifyAttachments. |
| `courseWorkType` | `COURSE_WORK_TYPE_UNSPECIFIED \| ASSIGNMENT \| SHORT_ANSWER_QUESTION \| MULTIPLE_CHOICE_QUESTION \| string` | No | Type of course work this submission is for. Read-only. |
| `submissionHistory` | `object[]` | No | The history of the submission (includes state and grade histories). Read-only. |
| `id` | `string` | No | Classroom-assigned Identifier for the student submission. This is unique among submissions for the relevant course work. Read-only. |
| `assignedRubricGrades` | `object` | No | Assigned rubric grades based on the rubric's Criteria. This map is empty if there is no rubric attached to this course work or if a rubric is attached, but no grades have been set on any Criteria. Entries are only populated for grades that have been set. Key: The rubric's criterion ID. Read-only. |
| `draftRubricGrades` | `object` | No | Pending rubric grades based on the rubric's criteria. This map is empty if there is no rubric attached to this course work or if a rubric is attached, but no grades have been set on any criteria. Entries are only populated for grades that have been set. Key: The rubric's criterion ID. Read-only. |
| `associatedWithDeveloper` | `boolean` | No | Whether this student submission is associated with the Developer Console project making the request. See CreateCourseWork for more details. Read-only. |
| `alternateLink` | `string` | No | Absolute link to the submission in the Classroom web UI. Read-only. |
| `state` | `SUBMISSION_STATE_UNSPECIFIED \| NEW \| CREATED \| TURNED_IN \| RETURNED \| RECLAIMED_BY_STUDENT \| string` | No | State of this submission. Read-only. |
| `courseId` | `string` | No | Identifier of the course. Read-only. |
| `courseWorkId` | `string` | No | Identifier for the course work this corresponds to. Read-only. |
| `late` | `boolean` | No | Whether this submission is late. Read-only. |
| `multipleChoiceSubmission` | `object` | No | Submission content when course\_work\_type is MULTIPLE\_CHOICE\_QUESTION. |
| `updateTime` | `string` | No | Last update time of this submission. This may be unset if the student has not accessed this item. Read-only. |
| `userId` | `string` | No | Identifier for the student that owns this submission. Read-only. |
| `draftGrade` | `number` | No | Optional pending grade. If unset, no grade was set. This value must be non-negative. Decimal (that is, non-integer) values are allowed, but are rounded to two decimal places. This is only visible to and modifiable by course teachers. |
| `shortAnswerSubmission` | `object` | No | Submission content when course\_work\_type is SHORT\_ANSWER\_QUESTION. |

> [accordion] assignmentSubmission full type
>
> ```ts theme={null}
> {
>   attachments?: {
>     link?: {
>       url?: string,
>       thumbnailUrl?: string,
>       title?: string
>     },
>     form?: {
>       title?: string,
>       formUrl?: string,
>       responseUrl?: string,
>       thumbnailUrl?: string
>     },
>     youTubeVideo?: {
>       id?: string,
>       title?: string,
>       alternateLink?: string,
>       thumbnailUrl?: string
>     },
>     driveFile?: {
>       thumbnailUrl?: string,
>       alternateLink?: string,
>       id?: string,
>       title?: string
>     }
>   }[]
> }
> ```

> [accordion] submissionHistory full type
>
> ```ts theme={null}
> {
>   gradeHistory?: {
>     gradeChangeType?: UNKNOWN_GRADE_CHANGE_TYPE | DRAFT_GRADE_POINTS_EARNED_CHANGE | ASSIGNED_GRADE_POINTS_EARNED_CHANGE | MAX_POINTS_CHANGE | string,
>     gradeTimestamp?: string,
>     pointsEarned?: number,
>     maxPoints?: number,
>     actorUserId?: string
>   },
>   stateHistory?: {
>     state?: STATE_UNSPECIFIED | CREATED | TURNED_IN | RETURNED | RECLAIMED_BY_STUDENT | STUDENT_EDITED_AFTER_TURN_IN | string,
>     actorUserId?: string,
>     stateTimestamp?: string
>   }
> }[]
> ```

> [accordion] assignedRubricGrades full type
>
> ```ts theme={null}
> Record<string, {
>   levelId?: string,
>   criterionId?: string,
>   points?: number
> }>
> ```

> [accordion] draftRubricGrades full type
>
> ```ts theme={null}
> Record<string, {
>   levelId?: string,
>   criterionId?: string,
>   points?: number
> }>
> ```

> [accordion] multipleChoiceSubmission full type
>
> ```ts theme={null}
> {
>   answer?: string
> }
> ```

> [accordion] shortAnswerSubmission full type
>
> ```ts theme={null}
> {
>   answer?: string
> }
> ```

***

### courseWork.studentSubmissions.patch

`courses.courseWork.studentSubmissions.patch`

Updates one or more fields of a student submission. See google.classroom.v1.StudentSubmission for details of which fields may be updated and who may change them. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item or an add-on attachment with Grade Sync enabled on the corresponding course work item. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting developer project did not create the corresponding course work or an add-on attachment on the corresponding course work with Grade Sync enabled, if the user is not permitted to make the requested modification to the student submission, or for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if the requested course, course work, or student submission does not exist.

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWork.studentSubmissions.patch({ pathParams: {"courseId":"courseId-123","id":"id-123","courseWorkId":"courseWorkId-123"}, query: {"updateMask":"draftGrade"}, body: {"draftGrade":1} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   id: string,
>   courseWorkId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   updateMask: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   draftGrade?: number,
>   assignedGrade?: number
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `creationTime` | `string` | No | Creation time of this submission. This may be unset if the student has not accessed this item. Read-only. |
| `assignedGrade` | `number` | No | Optional grade. If unset, no grade was set. This value must be non-negative. Decimal (that is, non-integer) values are allowed, but are rounded to two decimal places. This may be modified only by course teachers. |
| `assignmentSubmission` | `object` | No | Submission content when course\_work\_type is ASSIGNMENT. Students can modify this content using ModifyAttachments. |
| `courseWorkType` | `COURSE_WORK_TYPE_UNSPECIFIED \| ASSIGNMENT \| SHORT_ANSWER_QUESTION \| MULTIPLE_CHOICE_QUESTION \| string` | No | Type of course work this submission is for. Read-only. |
| `submissionHistory` | `object[]` | No | The history of the submission (includes state and grade histories). Read-only. |
| `id` | `string` | No | Classroom-assigned Identifier for the student submission. This is unique among submissions for the relevant course work. Read-only. |
| `assignedRubricGrades` | `object` | No | Assigned rubric grades based on the rubric's Criteria. This map is empty if there is no rubric attached to this course work or if a rubric is attached, but no grades have been set on any Criteria. Entries are only populated for grades that have been set. Key: The rubric's criterion ID. Read-only. |
| `draftRubricGrades` | `object` | No | Pending rubric grades based on the rubric's criteria. This map is empty if there is no rubric attached to this course work or if a rubric is attached, but no grades have been set on any criteria. Entries are only populated for grades that have been set. Key: The rubric's criterion ID. Read-only. |
| `associatedWithDeveloper` | `boolean` | No | Whether this student submission is associated with the Developer Console project making the request. See CreateCourseWork for more details. Read-only. |
| `alternateLink` | `string` | No | Absolute link to the submission in the Classroom web UI. Read-only. |
| `state` | `SUBMISSION_STATE_UNSPECIFIED \| NEW \| CREATED \| TURNED_IN \| RETURNED \| RECLAIMED_BY_STUDENT \| string` | No | State of this submission. Read-only. |
| `courseId` | `string` | No | Identifier of the course. Read-only. |
| `courseWorkId` | `string` | No | Identifier for the course work this corresponds to. Read-only. |
| `late` | `boolean` | No | Whether this submission is late. Read-only. |
| `multipleChoiceSubmission` | `object` | No | Submission content when course\_work\_type is MULTIPLE\_CHOICE\_QUESTION. |
| `updateTime` | `string` | No | Last update time of this submission. This may be unset if the student has not accessed this item. Read-only. |
| `userId` | `string` | No | Identifier for the student that owns this submission. Read-only. |
| `draftGrade` | `number` | No | Optional pending grade. If unset, no grade was set. This value must be non-negative. Decimal (that is, non-integer) values are allowed, but are rounded to two decimal places. This is only visible to and modifiable by course teachers. |
| `shortAnswerSubmission` | `object` | No | Submission content when course\_work\_type is SHORT\_ANSWER\_QUESTION. |

> [accordion] assignmentSubmission full type
>
> ```ts theme={null}
> {
>   attachments?: {
>     link?: {
>       url?: string,
>       thumbnailUrl?: string,
>       title?: string
>     },
>     form?: {
>       title?: string,
>       formUrl?: string,
>       responseUrl?: string,
>       thumbnailUrl?: string
>     },
>     youTubeVideo?: {
>       id?: string,
>       title?: string,
>       alternateLink?: string,
>       thumbnailUrl?: string
>     },
>     driveFile?: {
>       thumbnailUrl?: string,
>       alternateLink?: string,
>       id?: string,
>       title?: string
>     }
>   }[]
> }
> ```

> [accordion] submissionHistory full type
>
> ```ts theme={null}
> {
>   gradeHistory?: {
>     gradeChangeType?: UNKNOWN_GRADE_CHANGE_TYPE | DRAFT_GRADE_POINTS_EARNED_CHANGE | ASSIGNED_GRADE_POINTS_EARNED_CHANGE | MAX_POINTS_CHANGE | string,
>     gradeTimestamp?: string,
>     pointsEarned?: number,
>     maxPoints?: number,
>     actorUserId?: string
>   },
>   stateHistory?: {
>     state?: STATE_UNSPECIFIED | CREATED | TURNED_IN | RETURNED | RECLAIMED_BY_STUDENT | STUDENT_EDITED_AFTER_TURN_IN | string,
>     actorUserId?: string,
>     stateTimestamp?: string
>   }
> }[]
> ```

> [accordion] assignedRubricGrades full type
>
> ```ts theme={null}
> Record<string, {
>   levelId?: string,
>   criterionId?: string,
>   points?: number
> }>
> ```

> [accordion] draftRubricGrades full type
>
> ```ts theme={null}
> Record<string, {
>   levelId?: string,
>   criterionId?: string,
>   points?: number
> }>
> ```

> [accordion] multipleChoiceSubmission full type
>
> ```ts theme={null}
> {
>   answer?: string
> }
> ```

> [accordion] shortAnswerSubmission full type
>
> ```ts theme={null}
> {
>   answer?: string
> }
> ```

***

### courseWork.studentSubmissions.reclaim

`courses.courseWork.studentSubmissions.reclaim`

Reclaims a student submission on behalf of the student that owns it. Reclaiming a student submission transfers ownership of attached Drive files to the student and updates the submission state. Only the student that owns the requested student submission may call this method, and only for a student submission that has been turned in. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item or an add-on attachment on the corresponding course work item. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, unsubmit the requested student submission, or for access errors. \* `FAILED_PRECONDITION` if the student submission has not been turned in. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if the requested course, course work, or student submission does not exist.

**Risk:** `write`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWork.studentSubmissions.reclaim({ pathParams: {"courseId":"courseId-123","id":"id-123","courseWorkId":"courseWorkId-123"}, query: {}, body: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   id: string,
>   courseWorkId: string,
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
> }
> ```

**Output:** *empty object*

***

### courseWork.studentSubmissions.return

`courses.courseWork.studentSubmissions.return`

Returns a student submission. Returning a student submission transfers ownership of attached Drive files to the student and may also update the submission state. Unlike the Classroom application, returning a student submission does not set assignedGrade to the draftGrade value. Only a teacher of the course that contains the requested student submission may call this method. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item or an add-on attachment on the corresponding course work item. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, return the requested student submission, or for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if the requested course, course work, or student submission does not exist.

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWork.studentSubmissions.return({ pathParams: {"id":"id-123","courseId":"courseId-123","courseWorkId":"courseWorkId-123"}, query: {}, body: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseWorkId: string,
>   id: string,
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
> }
> ```

**Output:** *empty object*

***

### courseWork.studentSubmissions.turnIn

`courses.courseWork.studentSubmissions.turnIn`

Turns in a student submission. Turning in a student submission transfers ownership of attached Drive files to the teacher and may also update the submission state. This may only be called by the student that owns the specified student submission. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work item or an add-on attachment on the corresponding course work item. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work, turn in the requested student submission, or for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if the requested course, course work, or student submission does not exist.

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWork.studentSubmissions.turnIn({ pathParams: {"courseWorkId":"courseWorkId-123","courseId":"courseId-123","id":"id-123"}, query: {}, body: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseWorkId: string,
>   courseId: string,
>   id: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
> }
> ```

**Output:** *empty object*

***

### courseWorkMaterials.addOnAttachments.create

`courses.courseWorkMaterials.addOnAttachments.create`

Creates an add-on attachment under a post. Requires the add-on to have permission to create new attachments on the post. This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if one of the identified resources does not exist.

**Risk:** `write`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWorkMaterials.addOnAttachments.create({ pathParams: {"itemId":"itemId-123","courseId":"courseId-123"}, query: {}, body: {"title":"Learning activity","teacherViewUri":{"uri":"https://corsair.dev/classroom"},"studentViewUri":{"uri":"https://corsair.dev/classroom"}} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

addOnToken may be omitted for partner-first creation when the creating project matches the project that created the parent post. Google enforces the project and authorization conditions.

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   itemId: string,
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   addOnToken?: string,
>   postId?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   dueTime?: {
>     hours?: number,
>     minutes?: number,
>     seconds?: number,
>     nanos?: number
>   },
>   copyHistory?: {
>     courseId?: string,
>     postId?: string,
>     itemId?: string,
>     attachmentId?: string
>   }[],
>   gradeSyncEnabled?: boolean,
>   title: string,
>   studentViewUri: {
>     uri: string
>   },
>   itemId?: string,
>   dueDate?: {
>     year?: number,
>     month?: number,
>     day?: number
>   },
>   studentWorkReviewUri?: {
>     uri: string
>   },
>   postId?: string,
>   teacherViewUri: {
>     uri: string
>   },
>   maxPoints?: number,
>   id?: string,
>   courseId?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `dueTime` | `object` | No | Time of day, in UTC, that work on this attachment is due. This must be specified if `due_date` is specified. |
| `copyHistory` | `object[]` | No | Output only. Identifiers of attachments that were previous copies of this attachment. If the attachment was previously copied by virtue of its parent post being copied, this enumerates the identifiers of attachments that were its previous copies in ascending chronological order of copy. |
| `gradeSyncEnabled` | `boolean` | No | Output only. Whether changes to `pointsEarned` values on this attachment's student submissions will be copied to the `pointsEarned` field on the students' CourseWork submissions. This field can be `true` for at most one add-on attachment per stream item. |
| `title` | `string` | No | Required. Title of this attachment. The title must be between 1 and 1000 characters. |
| `studentViewUri` | `object` | No | Required. URI to show the student view of the attachment. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, and `attachmentId` query parameters set. |
| `itemId` | `string` | No | Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached. Unique per course. |
| `dueDate` | `object` | No | Date, in UTC, that work on this attachment is due. This must be specified if `due_time` is specified. |
| `studentWorkReviewUri` | `object` | No | URI for the teacher to see student work on the attachment, if applicable. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, `attachmentId`, and `submissionId` query parameters set. This is the same `submissionId` returned in the [`AddOnContext.studentContext`](https://developers.google.com/workspace/classroom/reference/rest/v1/AddOnContext#StudentContext) field when a student views the attachment. If the URI is omitted or removed, `max_points` will also be discarded. |
| `postId` | `string` | No | Immutable. Deprecated, use `item_id` instead. |
| `teacherViewUri` | `object` | No | Required. URI to show the teacher view of the attachment. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, and `attachmentId` query parameters set. |
| `maxPoints` | `number` | No | Maximum grade for this attachment. Can only be set if `studentWorkReviewUri` is set. Set to a non-zero value to indicate that the attachment supports grade passback. If set, this must be a non-negative integer value. When set to zero, the attachment will not support grade passback. |
| `id` | `string` | No | Immutable. Classroom-assigned identifier for this attachment, unique per post. |
| `courseId` | `string` | No | Immutable. Identifier of the course. |

> [accordion] dueTime full type
>
> ```ts theme={null}
> {
>   hours?: number,
>   minutes?: number,
>   seconds?: number,
>   nanos?: number
> }
> ```

> [accordion] copyHistory full type
>
> ```ts theme={null}
> {
>   courseId?: string,
>   postId?: string,
>   itemId?: string,
>   attachmentId?: string
> }[]
> ```

> [accordion] studentViewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

> [accordion] dueDate full type
>
> ```ts theme={null}
> {
>   year?: number,
>   month?: number,
>   day?: number
> }
> ```

> [accordion] studentWorkReviewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

> [accordion] teacherViewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

***

### courseWorkMaterials.addOnAttachments.delete

`courses.courseWorkMaterials.addOnAttachments.delete`

Deletes an add-on attachment. Requires the add-on to have been the original creator of the attachment. This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if one of the identified resources does not exist.

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWorkMaterials.addOnAttachments.delete({ pathParams: {"itemId":"itemId-123","attachmentId":"attachmentId-123","courseId":"courseId-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   attachmentId: string,
>   itemId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   postId?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output:** *empty object*

***

### courseWorkMaterials.addOnAttachments.get

`courses.courseWorkMaterials.addOnAttachments.get`

Returns an add-on attachment. Requires the add-on requesting the attachment to be the original creator of the attachment. This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if one of the identified resources does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWorkMaterials.addOnAttachments.get({ pathParams: {"itemId":"itemId-123","attachmentId":"attachmentId-123","courseId":"courseId-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   itemId: string,
>   attachmentId: string,
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   postId?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `dueTime` | `object` | No | Time of day, in UTC, that work on this attachment is due. This must be specified if `due_date` is specified. |
| `copyHistory` | `object[]` | No | Output only. Identifiers of attachments that were previous copies of this attachment. If the attachment was previously copied by virtue of its parent post being copied, this enumerates the identifiers of attachments that were its previous copies in ascending chronological order of copy. |
| `gradeSyncEnabled` | `boolean` | No | Output only. Whether changes to `pointsEarned` values on this attachment's student submissions will be copied to the `pointsEarned` field on the students' CourseWork submissions. This field can be `true` for at most one add-on attachment per stream item. |
| `title` | `string` | No | Required. Title of this attachment. The title must be between 1 and 1000 characters. |
| `studentViewUri` | `object` | No | Required. URI to show the student view of the attachment. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, and `attachmentId` query parameters set. |
| `itemId` | `string` | No | Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached. Unique per course. |
| `dueDate` | `object` | No | Date, in UTC, that work on this attachment is due. This must be specified if `due_time` is specified. |
| `studentWorkReviewUri` | `object` | No | URI for the teacher to see student work on the attachment, if applicable. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, `attachmentId`, and `submissionId` query parameters set. This is the same `submissionId` returned in the [`AddOnContext.studentContext`](https://developers.google.com/workspace/classroom/reference/rest/v1/AddOnContext#StudentContext) field when a student views the attachment. If the URI is omitted or removed, `max_points` will also be discarded. |
| `postId` | `string` | No | Immutable. Deprecated, use `item_id` instead. |
| `teacherViewUri` | `object` | No | Required. URI to show the teacher view of the attachment. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, and `attachmentId` query parameters set. |
| `maxPoints` | `number` | No | Maximum grade for this attachment. Can only be set if `studentWorkReviewUri` is set. Set to a non-zero value to indicate that the attachment supports grade passback. If set, this must be a non-negative integer value. When set to zero, the attachment will not support grade passback. |
| `id` | `string` | No | Immutable. Classroom-assigned identifier for this attachment, unique per post. |
| `courseId` | `string` | No | Immutable. Identifier of the course. |

> [accordion] dueTime full type
>
> ```ts theme={null}
> {
>   hours?: number,
>   minutes?: number,
>   seconds?: number,
>   nanos?: number
> }
> ```

> [accordion] copyHistory full type
>
> ```ts theme={null}
> {
>   courseId?: string,
>   postId?: string,
>   itemId?: string,
>   attachmentId?: string
> }[]
> ```

> [accordion] studentViewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

> [accordion] dueDate full type
>
> ```ts theme={null}
> {
>   year?: number,
>   month?: number,
>   day?: number
> }
> ```

> [accordion] studentWorkReviewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

> [accordion] teacherViewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

***

### courseWorkMaterials.addOnAttachments.list

`courses.courseWorkMaterials.addOnAttachments.list`

Returns all attachments created by an add-on under the post. Requires the add-on to have active attachments on the post or have permission to create new attachments on the post. This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if one of the identified resources does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWorkMaterials.addOnAttachments.list({ pathParams: {"itemId":"itemId-123","courseId":"courseId-123"}, query: {"pageSize":1} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   itemId: string,
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   pageToken?: string,
>   postId?: string,
>   pageSize?: number,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `addOnAttachments` | `object[]` | No | Attachments under the given post. |
| `nextPageToken` | `string` | No | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted, there are no subsequent pages. |

> [accordion] addOnAttachments full type
>
> ```ts theme={null}
> {
>   dueTime?: {
>     hours?: number,
>     minutes?: number,
>     seconds?: number,
>     nanos?: number
>   },
>   copyHistory?: {
>     courseId?: string,
>     postId?: string,
>     itemId?: string,
>     attachmentId?: string
>   }[],
>   gradeSyncEnabled?: boolean,
>   title?: string,
>   studentViewUri?: {
>     uri?: string
>   },
>   itemId?: string,
>   dueDate?: {
>     year?: number,
>     month?: number,
>     day?: number
>   },
>   studentWorkReviewUri?: {
>     uri?: string
>   },
>   postId?: string,
>   teacherViewUri?: {
>     uri?: string
>   },
>   maxPoints?: number,
>   id?: string,
>   courseId?: string
> }[]
> ```

***

### courseWorkMaterials.addOnAttachments.patch

`courses.courseWorkMaterials.addOnAttachments.patch`

Updates an add-on attachment. Requires the add-on to have been the original creator of the attachment. This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if one of the identified resources does not exist.

**Risk:** `write`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWorkMaterials.addOnAttachments.patch({ pathParams: {"courseId":"courseId-123","attachmentId":"attachmentId-123","itemId":"itemId-123"}, query: {"updateMask":"title","postId":"post-123"}, body: {"title":"Learning activity"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   attachmentId: string,
>   courseId: string,
>   itemId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   postId: string,
>   updateMask: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   dueTime?: {
>     hours?: number,
>     minutes?: number,
>     seconds?: number,
>     nanos?: number
>   },
>   copyHistory?: {
>     courseId?: string,
>     postId?: string,
>     itemId?: string,
>     attachmentId?: string
>   }[],
>   gradeSyncEnabled?: boolean,
>   title?: string,
>   studentViewUri?: {
>     uri: string
>   },
>   itemId?: string,
>   dueDate?: {
>     year?: number,
>     month?: number,
>     day?: number
>   },
>   studentWorkReviewUri?: {
>     uri: string
>   },
>   postId?: string,
>   teacherViewUri?: {
>     uri: string
>   },
>   maxPoints?: number,
>   id?: string,
>   courseId?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `dueTime` | `object` | No | Time of day, in UTC, that work on this attachment is due. This must be specified if `due_date` is specified. |
| `copyHistory` | `object[]` | No | Output only. Identifiers of attachments that were previous copies of this attachment. If the attachment was previously copied by virtue of its parent post being copied, this enumerates the identifiers of attachments that were its previous copies in ascending chronological order of copy. |
| `gradeSyncEnabled` | `boolean` | No | Output only. Whether changes to `pointsEarned` values on this attachment's student submissions will be copied to the `pointsEarned` field on the students' CourseWork submissions. This field can be `true` for at most one add-on attachment per stream item. |
| `title` | `string` | No | Required. Title of this attachment. The title must be between 1 and 1000 characters. |
| `studentViewUri` | `object` | No | Required. URI to show the student view of the attachment. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, and `attachmentId` query parameters set. |
| `itemId` | `string` | No | Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached. Unique per course. |
| `dueDate` | `object` | No | Date, in UTC, that work on this attachment is due. This must be specified if `due_time` is specified. |
| `studentWorkReviewUri` | `object` | No | URI for the teacher to see student work on the attachment, if applicable. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, `attachmentId`, and `submissionId` query parameters set. This is the same `submissionId` returned in the [`AddOnContext.studentContext`](https://developers.google.com/workspace/classroom/reference/rest/v1/AddOnContext#StudentContext) field when a student views the attachment. If the URI is omitted or removed, `max_points` will also be discarded. |
| `postId` | `string` | No | Immutable. Deprecated, use `item_id` instead. |
| `teacherViewUri` | `object` | No | Required. URI to show the teacher view of the attachment. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, and `attachmentId` query parameters set. |
| `maxPoints` | `number` | No | Maximum grade for this attachment. Can only be set if `studentWorkReviewUri` is set. Set to a non-zero value to indicate that the attachment supports grade passback. If set, this must be a non-negative integer value. When set to zero, the attachment will not support grade passback. |
| `id` | `string` | No | Immutable. Classroom-assigned identifier for this attachment, unique per post. |
| `courseId` | `string` | No | Immutable. Identifier of the course. |

> [accordion] dueTime full type
>
> ```ts theme={null}
> {
>   hours?: number,
>   minutes?: number,
>   seconds?: number,
>   nanos?: number
> }
> ```

> [accordion] copyHistory full type
>
> ```ts theme={null}
> {
>   courseId?: string,
>   postId?: string,
>   itemId?: string,
>   attachmentId?: string
> }[]
> ```

> [accordion] studentViewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

> [accordion] dueDate full type
>
> ```ts theme={null}
> {
>   year?: number,
>   month?: number,
>   day?: number
> }
> ```

> [accordion] studentWorkReviewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

> [accordion] teacherViewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

***

### courseWorkMaterials.create

`courses.courseWorkMaterials.create`

Creates a course work material. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course, create course work material in the requested course, share a Drive attachment, or for access errors. \* `INVALID_ARGUMENT` if the request is malformed or if more than 20 \* materials are provided. \* `NOT_FOUND` if the requested course does not exist. \* `FAILED_PRECONDITION` for the following request error: \* AttachmentNotVisible

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWorkMaterials.create({ pathParams: {"courseId":"courseId-123"}, query: {}, body: {"title":"Reading material"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   scheduledTime?: string,
>   state?: COURSEWORK_MATERIAL_STATE_UNSPECIFIED | PUBLISHED | DRAFT | DELETED,
>   materials?: {
>     gem?: {
>       id?: string,
>       url?: string,
>       title?: string
>     },
>     youtubeVideo?: {
>       id?: string,
>       title?: string,
>       alternateLink?: string,
>       thumbnailUrl?: string
>     },
>     form?: {
>       title?: string,
>       formUrl?: string,
>       responseUrl?: string,
>       thumbnailUrl?: string
>     },
>     driveFile?: {
>       driveFile?: {
>         thumbnailUrl?: string,
>         alternateLink?: string,
>         id?: string,
>         title?: string
>       },
>       shareMode?: UNKNOWN_SHARE_MODE | VIEW | EDIT | STUDENT_COPY
>     },
>     notebook?: {
>       url?: string,
>       id?: string,
>       title?: string
>     },
>     link?: {
>       url?: string,
>       thumbnailUrl?: string,
>       title?: string
>     }
>   }[],
>   alternateLink?: string,
>   creatorUserId?: string,
>   updateTime?: string,
>   individualStudentsOptions?: {
>     studentIds?: string[]
>   },
>   description?: string,
>   topicId?: string,
>   creationTime?: string,
>   assigneeMode?: ASSIGNEE_MODE_UNSPECIFIED | ALL_STUDENTS | INDIVIDUAL_STUDENTS,
>   title: string,
>   courseId?: string,
>   id?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `scheduledTime` | `string` | No | Optional timestamp when this course work material is scheduled to be published. |
| `state` | `COURSEWORK_MATERIAL_STATE_UNSPECIFIED \| PUBLISHED \| DRAFT \| DELETED \| string` | No | Status of this course work material. If unspecified, the default state is `DRAFT`. |
| `materials` | `object[]` | No | Additional materials. A course work material must have no more than 20 material items. |
| `alternateLink` | `string` | No | Absolute link to this course work material in the Classroom web UI. This is only populated if `state` is `PUBLISHED`. Read-only. |
| `creatorUserId` | `string` | No | Identifier for the user that created the course work material. Read-only. |
| `updateTime` | `string` | No | Timestamp of the most recent change to this course work material. Read-only. |
| `individualStudentsOptions` | `object` | No | Identifiers of students with access to the course work material. This field is set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students specified in this field can see the course work material. |
| `description` | `string` | No | Optional description of this course work material. The text must be a valid UTF-8 string containing no more than 30,000 characters. |
| `topicId` | `string` | No | Identifier for the topic that this course work material is associated with. Must match an existing topic in the course. |
| `creationTime` | `string` | No | Timestamp when this course work material was created. Read-only. |
| `assigneeMode` | `ASSIGNEE_MODE_UNSPECIFIED \| ALL_STUDENTS \| INDIVIDUAL_STUDENTS \| string` | No | Assignee mode of the course work material. If unspecified, the default value is `ALL_STUDENTS`. |
| `title` | `string` | No | Title of this course work material. The title must be a valid UTF-8 string containing between 1 and 3000 characters. |
| `courseId` | `string` | No | Identifier of the course. Read-only. |
| `id` | `string` | No | Classroom-assigned identifier of this course work material, unique per course. Read-only. |

> [accordion] materials full type
>
> ```ts theme={null}
> {
>   gem?: {
>     id?: string,
>     url?: string,
>     title?: string
>   },
>   youtubeVideo?: {
>     id?: string,
>     title?: string,
>     alternateLink?: string,
>     thumbnailUrl?: string
>   },
>   form?: {
>     title?: string,
>     formUrl?: string,
>     responseUrl?: string,
>     thumbnailUrl?: string
>   },
>   driveFile?: {
>     driveFile?: {
>       thumbnailUrl?: string,
>       alternateLink?: string,
>       id?: string,
>       title?: string
>     },
>     shareMode?: UNKNOWN_SHARE_MODE | VIEW | EDIT | STUDENT_COPY | string
>   },
>   notebook?: {
>     url?: string,
>     id?: string,
>     title?: string
>   },
>   link?: {
>     url?: string,
>     thumbnailUrl?: string,
>     title?: string
>   }
> }[]
> ```

> [accordion] individualStudentsOptions full type
>
> ```ts theme={null}
> {
>   studentIds?: string[]
> }
> ```

***

### courseWorkMaterials.delete

`courses.courseWorkMaterials.delete`

Deletes a course work material. This request must be made by the Developer Console project of the [OAuth client ID](https://support.google.com/cloud/answer/6158849) used to create the corresponding course work material item. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting developer project did not create the corresponding course work material, if the requesting user is not permitted to delete the requested course or for access errors. \* `FAILED_PRECONDITION` if the requested course work material has already been deleted. \* `NOT_FOUND` if no course exists with the requested ID.

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWorkMaterials.delete({ pathParams: {"courseId":"courseId-123","id":"id-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   id: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output:** *empty object*

***

### courseWorkMaterials.get

`courses.courseWorkMaterials.get`

Returns a course work material. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or course work material, or for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if the requested course or course work material does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWorkMaterials.get({ pathParams: {"id":"id-123","courseId":"courseId-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   id: string,
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `scheduledTime` | `string` | No | Optional timestamp when this course work material is scheduled to be published. |
| `state` | `COURSEWORK_MATERIAL_STATE_UNSPECIFIED \| PUBLISHED \| DRAFT \| DELETED \| string` | No | Status of this course work material. If unspecified, the default state is `DRAFT`. |
| `materials` | `object[]` | No | Additional materials. A course work material must have no more than 20 material items. |
| `alternateLink` | `string` | No | Absolute link to this course work material in the Classroom web UI. This is only populated if `state` is `PUBLISHED`. Read-only. |
| `creatorUserId` | `string` | No | Identifier for the user that created the course work material. Read-only. |
| `updateTime` | `string` | No | Timestamp of the most recent change to this course work material. Read-only. |
| `individualStudentsOptions` | `object` | No | Identifiers of students with access to the course work material. This field is set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students specified in this field can see the course work material. |
| `description` | `string` | No | Optional description of this course work material. The text must be a valid UTF-8 string containing no more than 30,000 characters. |
| `topicId` | `string` | No | Identifier for the topic that this course work material is associated with. Must match an existing topic in the course. |
| `creationTime` | `string` | No | Timestamp when this course work material was created. Read-only. |
| `assigneeMode` | `ASSIGNEE_MODE_UNSPECIFIED \| ALL_STUDENTS \| INDIVIDUAL_STUDENTS \| string` | No | Assignee mode of the course work material. If unspecified, the default value is `ALL_STUDENTS`. |
| `title` | `string` | No | Title of this course work material. The title must be a valid UTF-8 string containing between 1 and 3000 characters. |
| `courseId` | `string` | No | Identifier of the course. Read-only. |
| `id` | `string` | No | Classroom-assigned identifier of this course work material, unique per course. Read-only. |

> [accordion] materials full type
>
> ```ts theme={null}
> {
>   gem?: {
>     id?: string,
>     url?: string,
>     title?: string
>   },
>   youtubeVideo?: {
>     id?: string,
>     title?: string,
>     alternateLink?: string,
>     thumbnailUrl?: string
>   },
>   form?: {
>     title?: string,
>     formUrl?: string,
>     responseUrl?: string,
>     thumbnailUrl?: string
>   },
>   driveFile?: {
>     driveFile?: {
>       thumbnailUrl?: string,
>       alternateLink?: string,
>       id?: string,
>       title?: string
>     },
>     shareMode?: UNKNOWN_SHARE_MODE | VIEW | EDIT | STUDENT_COPY | string
>   },
>   notebook?: {
>     url?: string,
>     id?: string,
>     title?: string
>   },
>   link?: {
>     url?: string,
>     thumbnailUrl?: string,
>     title?: string
>   }
> }[]
> ```

> [accordion] individualStudentsOptions full type
>
> ```ts theme={null}
> {
>   studentIds?: string[]
> }
> ```

***

### courseWorkMaterials.getAddOnContext

`courses.courseWorkMaterials.getAddOnContext`

Gets metadata for Classroom add-ons in the context of a specific post. To maintain the integrity of its own data and permissions model, an add-on should call this to validate query parameters and the requesting user's role whenever the add-on is opened in an [iframe](https://developers.google.com/workspace/classroom/add-ons/get-started/iframes/iframes-overview). This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if one of the identified resources does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWorkMaterials.getAddOnContext({ pathParams: {"itemId":"itemId-123","courseId":"courseId-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

attachmentId is optional only for the Attachment Discovery iframe. addOnToken is required when the add-on has no attachment on the post and the calling project differs from the post's creating project; Google enforces this.

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   itemId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   addOnToken?: string,
>   postId?: string,
>   attachmentId?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `supportsStudentWork` | `boolean` | No | Optional. Whether the post allows the teacher to see student work and passback grades. |
| `teacherContext` | `object` | No | Add-on context corresponding to the requesting user's role as a teacher. Its presence implies that the requesting user is a teacher in the course. |
| `studentContext` | `object` | No | Add-on context corresponding to the requesting user's role as a student. Its presence implies that the requesting user is a student in the course. |
| `courseId` | `string` | No | Immutable. Identifier of the course. |
| `postId` | `string` | No | Immutable. Deprecated, use `item_id` instead. |
| `itemId` | `string` | No | Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached. |

> [accordion] teacherContext full type
>
> ```ts theme={null}
> {
> }
> ```

> [accordion] studentContext full type
>
> ```ts theme={null}
> {
>   submissionId?: string
> }
> ```

***

### courseWorkMaterials.list

`courses.courseWorkMaterials.list`

Returns a list of course work material that the requester is permitted to view. Course students may only view `PUBLISHED` course work material. Course teachers and domain administrators may view all course work material. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if the requested course does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWorkMaterials.list({ pathParams: {"courseId":"courseId-123"}, query: {"materialDriveId":"drive-file-123","pageSize":1,"orderBy":"updateTime desc","materialLink":"https://drive.google.com","courseWorkMaterialStates":["PUBLISHED"]} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   materialLink?: string,
>   orderBy?: string,
>   materialDriveId?: string,
>   pageToken?: string,
>   pageSize?: number,
>   courseWorkMaterialStates?: (COURSEWORK_MATERIAL_STATE_UNSPECIFIED | PUBLISHED | DRAFT | DELETED)[],
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `courseWorkMaterial` | `object[]` | No | Course work material items that match the request. |
| `nextPageToken` | `string` | No | Token identifying the next page of results to return. If empty, no further results are available. |

> [accordion] courseWorkMaterial full type
>
> ```ts theme={null}
> {
>   scheduledTime?: string,
>   state?: COURSEWORK_MATERIAL_STATE_UNSPECIFIED | PUBLISHED | DRAFT | DELETED | string,
>   materials?: {
>     gem?: {
>       id?: string,
>       url?: string,
>       title?: string
>     },
>     youtubeVideo?: {
>       id?: string,
>       title?: string,
>       alternateLink?: string,
>       thumbnailUrl?: string
>     },
>     form?: {
>       title?: string,
>       formUrl?: string,
>       responseUrl?: string,
>       thumbnailUrl?: string
>     },
>     driveFile?: {
>       driveFile?: {
>         thumbnailUrl?: string,
>         alternateLink?: string,
>         id?: string,
>         title?: string
>       },
>       shareMode?: UNKNOWN_SHARE_MODE | VIEW | EDIT | STUDENT_COPY | string
>     },
>     notebook?: {
>       url?: string,
>       id?: string,
>       title?: string
>     },
>     link?: {
>       url?: string,
>       thumbnailUrl?: string,
>       title?: string
>     }
>   }[],
>   alternateLink?: string,
>   creatorUserId?: string,
>   updateTime?: string,
>   individualStudentsOptions?: {
>     studentIds?: string[]
>   },
>   description?: string,
>   topicId?: string,
>   creationTime?: string,
>   assigneeMode?: ASSIGNEE_MODE_UNSPECIFIED | ALL_STUDENTS | INDIVIDUAL_STUDENTS | string,
>   title?: string,
>   courseId?: string,
>   id?: string
> }[]
> ```

***

### courseWorkMaterials.patch

`courses.courseWorkMaterials.patch`

Updates one or more fields of a course work material. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting developer project for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `FAILED_PRECONDITION` if the requested course work material has already been deleted. \* `NOT_FOUND` if the requested course or course work material does not exist

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.courses.courseWorkMaterials.patch({ pathParams: {"id":"id-123","courseId":"courseId-123"}, query: {"updateMask":"title"}, body: {"title":"Reading material"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   id: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   updateMask: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   scheduledTime?: string,
>   state?: COURSEWORK_MATERIAL_STATE_UNSPECIFIED | PUBLISHED | DRAFT | DELETED,
>   materials?: {
>     gem?: {
>       id?: string,
>       url?: string,
>       title?: string
>     },
>     youtubeVideo?: {
>       id?: string,
>       title?: string,
>       alternateLink?: string,
>       thumbnailUrl?: string
>     },
>     form?: {
>       title?: string,
>       formUrl?: string,
>       responseUrl?: string,
>       thumbnailUrl?: string
>     },
>     driveFile?: {
>       driveFile?: {
>         thumbnailUrl?: string,
>         alternateLink?: string,
>         id?: string,
>         title?: string
>       },
>       shareMode?: UNKNOWN_SHARE_MODE | VIEW | EDIT | STUDENT_COPY
>     },
>     notebook?: {
>       url?: string,
>       id?: string,
>       title?: string
>     },
>     link?: {
>       url?: string,
>       thumbnailUrl?: string,
>       title?: string
>     }
>   }[],
>   alternateLink?: string,
>   creatorUserId?: string,
>   updateTime?: string,
>   individualStudentsOptions?: {
>     studentIds?: string[]
>   },
>   description?: string,
>   topicId?: string,
>   creationTime?: string,
>   assigneeMode?: ASSIGNEE_MODE_UNSPECIFIED | ALL_STUDENTS | INDIVIDUAL_STUDENTS,
>   title?: string,
>   courseId?: string,
>   id?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `scheduledTime` | `string` | No | Optional timestamp when this course work material is scheduled to be published. |
| `state` | `COURSEWORK_MATERIAL_STATE_UNSPECIFIED \| PUBLISHED \| DRAFT \| DELETED \| string` | No | Status of this course work material. If unspecified, the default state is `DRAFT`. |
| `materials` | `object[]` | No | Additional materials. A course work material must have no more than 20 material items. |
| `alternateLink` | `string` | No | Absolute link to this course work material in the Classroom web UI. This is only populated if `state` is `PUBLISHED`. Read-only. |
| `creatorUserId` | `string` | No | Identifier for the user that created the course work material. Read-only. |
| `updateTime` | `string` | No | Timestamp of the most recent change to this course work material. Read-only. |
| `individualStudentsOptions` | `object` | No | Identifiers of students with access to the course work material. This field is set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students specified in this field can see the course work material. |
| `description` | `string` | No | Optional description of this course work material. The text must be a valid UTF-8 string containing no more than 30,000 characters. |
| `topicId` | `string` | No | Identifier for the topic that this course work material is associated with. Must match an existing topic in the course. |
| `creationTime` | `string` | No | Timestamp when this course work material was created. Read-only. |
| `assigneeMode` | `ASSIGNEE_MODE_UNSPECIFIED \| ALL_STUDENTS \| INDIVIDUAL_STUDENTS \| string` | No | Assignee mode of the course work material. If unspecified, the default value is `ALL_STUDENTS`. |
| `title` | `string` | No | Title of this course work material. The title must be a valid UTF-8 string containing between 1 and 3000 characters. |
| `courseId` | `string` | No | Identifier of the course. Read-only. |
| `id` | `string` | No | Classroom-assigned identifier of this course work material, unique per course. Read-only. |

> [accordion] materials full type
>
> ```ts theme={null}
> {
>   gem?: {
>     id?: string,
>     url?: string,
>     title?: string
>   },
>   youtubeVideo?: {
>     id?: string,
>     title?: string,
>     alternateLink?: string,
>     thumbnailUrl?: string
>   },
>   form?: {
>     title?: string,
>     formUrl?: string,
>     responseUrl?: string,
>     thumbnailUrl?: string
>   },
>   driveFile?: {
>     driveFile?: {
>       thumbnailUrl?: string,
>       alternateLink?: string,
>       id?: string,
>       title?: string
>     },
>     shareMode?: UNKNOWN_SHARE_MODE | VIEW | EDIT | STUDENT_COPY | string
>   },
>   notebook?: {
>     url?: string,
>     id?: string,
>     title?: string
>   },
>   link?: {
>     url?: string,
>     thumbnailUrl?: string,
>     title?: string
>   }
> }[]
> ```

> [accordion] individualStudentsOptions full type
>
> ```ts theme={null}
> {
>   studentIds?: string[]
> }
> ```

***

### create

`courses.create`

Creates a course. The user specified in `ownerId` is the owner of the created course and added as a teacher. A non-admin requesting user can only create a course with themselves as the owner. Domain admins can create courses owned by any user within their domain. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to create courses or for access errors. \* `NOT_FOUND` if the primary teacher is not a valid user. \* `FAILED_PRECONDITION` if the course owner's account is disabled or for the following request errors: \* UserCannotOwnCourse \* UserGroupsMembershipLimitReached \* CourseTitleCannotContainUrl \* `ALREADY_EXISTS` if an alias was specified in the `id` and already exists.

**Risk:** `write`

```ts theme={null}
await corsair.googleclassroom.api.courses.create({ pathParams: {}, query: {}, body: {"name":"Biology","ownerId":"me"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   courseState?: COURSE_STATE_UNSPECIFIED | ACTIVE | ARCHIVED | PROVISIONED | DECLINED | SUSPENDED,
>   descriptionHeading?: string,
>   guardiansEnabled?: boolean,
>   alternateLink?: string,
>   room?: string,
>   ownerId: string,
>   id?: string,
>   teacherGroupEmail?: string,
>   enrollmentCode?: string,
>   teacherFolder?: {
>     title?: string,
>     alternateLink?: string,
>     id?: string
>   },
>   name: string,
>   updateTime?: string,
>   levels?: string,
>   section?: string,
>   gradebookSettings?: {
>     gradeCategories?: {
>       defaultGradeDenominator?: number,
>       id?: string,
>       weight?: number,
>       name?: string
>     }[],
>     calculationType?: CALCULATION_TYPE_UNSPECIFIED | TOTAL_POINTS | WEIGHTED_CATEGORIES,
>     displaySetting?: DISPLAY_SETTING_UNSPECIFIED | SHOW_OVERALL_GRADE | HIDE_OVERALL_GRADE | SHOW_TEACHERS_ONLY
>   },
>   calendarId?: string,
>   subject?: string,
>   description?: string,
>   courseGroupEmail?: string,
>   creationTime?: string,
>   courseMaterialSets?: {
>     title?: string,
>     materials?: {
>       driveFile?: {
>         thumbnailUrl?: string,
>         alternateLink?: string,
>         id?: string,
>         title?: string
>       },
>       youTubeVideo?: {
>         id?: string,
>         title?: string,
>         alternateLink?: string,
>         thumbnailUrl?: string
>       },
>       link?: {
>         url?: string,
>         thumbnailUrl?: string,
>         title?: string
>       },
>       form?: {
>         title?: string,
>         formUrl?: string,
>         responseUrl?: string,
>         thumbnailUrl?: string
>       }
>     }[]
>   }[]
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `courseState` | `COURSE_STATE_UNSPECIFIED \| ACTIVE \| ARCHIVED \| PROVISIONED \| DECLINED \| SUSPENDED \| string` | No | State of the course. If unspecified, the default state is `PROVISIONED`. |
| `descriptionHeading` | `string` | No | Optional heading for the description. For example, "Welcome to 10th Grade Biology." If set, this field must be a valid UTF-8 string and no longer than 3600 characters. |
| `guardiansEnabled` | `boolean` | No | Whether or not guardian notifications are enabled for this course. Read-only. |
| `alternateLink` | `string` | No | Absolute link to this course in the Classroom web UI. Read-only. |
| `room` | `string` | No | Optional room location. For example, "301". If set, this field must be a valid UTF-8 string and no longer than 650 characters. |
| `ownerId` | `string` | No | The identifier of the owner of a course. When specified as a parameter of a create course request, this field is required. The identifier can be one of the following: \* the numeric identifier for the user \* the email address of the user \* the string literal `"me"`, indicating the requesting user This must be set in a create request. Admins can also specify this field in a patch course request to transfer ownership. In other contexts, it is read-only. |
| `id` | `string` | No | Identifier for this course assigned by Classroom. When creating a course, you may optionally set this identifier to an alias string in the request to create a corresponding alias. The `id` is still assigned by Classroom and cannot be updated after the course is created. Specifying this field in a course update mask results in an error. |
| `teacherGroupEmail` | `string` | No | The email address of a Google group containing all teachers of the course. This group does not accept email and can only be used for permissions. Read-only. |
| `enrollmentCode` | `string` | No | Enrollment code to use when joining this course. Specifying this field in a course update mask results in an error. Read-only. |
| `teacherFolder` | `object` | No | Information about a Drive Folder that is shared with all teachers of the course. This field will only be set for teachers of the course and domain administrators. Read-only. |
| `name` | `string` | No | Name of the course. For example, "10th Grade Biology". The name is required. It must be between 1 and 750 characters and a valid UTF-8 string. |
| `updateTime` | `string` | No | Time of the most recent update to this course. Specifying this field in a course update mask results in an error. Read-only. |
| `levels` | `string` | No | Optional. Levels for the course. Examples: "9th grade", "Middle school", "4th - 5th", "K-2", "3000". If set, this field must be a valid UTF-8 string and fewer than 1000 characters. This field can only be cleared using the `PatchCourse` method. |
| `section` | `string` | No | Section of the course. For example, "Period 2". If set, this field must be a valid UTF-8 string and no longer than 2800 characters. |
| `gradebookSettings` | `object` | No | The gradebook settings that specify how a student's overall grade for the course will be calculated and who it will be displayed to. Read-only. |
| `calendarId` | `string` | No | The Calendar ID for a calendar that all course members can see, to which Classroom adds events for course work and announcements in the course. The Calendar for a course is created asynchronously when the course is set to `CourseState.ACTIVE` for the first time (at creation time or when it is updated to `ACTIVE` through the UI or the API). The Calendar ID will not be populated until the creation process is completed. Read-only. |
| `subject` | `string` | No | Optional. The subject of the course. |
| `description` | `string` | No | Optional description. For example, "We'll be learning about the structure of living creatures from a combination of textbooks, guest lectures, and lab work. Expect to be excited!" If set, this field must be a valid UTF-8 string and no longer than 30,000 characters. |
| `courseGroupEmail` | `string` | No | The email address of a Google group containing all members of the course. This group does not accept email and can only be used for permissions. Read-only. |
| `creationTime` | `string` | No | Creation time of the course. Specifying this field in a course update mask results in an error. Read-only. |
| `courseMaterialSets` | `object[]` | No | Sets of materials that appear on the "about" page of this course. Read-only. |

> [accordion] teacherFolder full type
>
> ```ts theme={null}
> {
>   title?: string,
>   alternateLink?: string,
>   id?: string
> }
> ```

> [accordion] gradebookSettings full type
>
> ```ts theme={null}
> {
>   gradeCategories?: {
>     defaultGradeDenominator?: number,
>     id?: string,
>     weight?: number,
>     name?: string
>   }[],
>   calculationType?: CALCULATION_TYPE_UNSPECIFIED | TOTAL_POINTS | WEIGHTED_CATEGORIES | string,
>   displaySetting?: DISPLAY_SETTING_UNSPECIFIED | SHOW_OVERALL_GRADE | HIDE_OVERALL_GRADE | SHOW_TEACHERS_ONLY | string
> }
> ```

> [accordion] courseMaterialSets full type
>
> ```ts theme={null}
> {
>   title?: string,
>   materials?: {
>     driveFile?: {
>       thumbnailUrl?: string,
>       alternateLink?: string,
>       id?: string,
>       title?: string
>     },
>     youTubeVideo?: {
>       id?: string,
>       title?: string,
>       alternateLink?: string,
>       thumbnailUrl?: string
>     },
>     link?: {
>       url?: string,
>       thumbnailUrl?: string,
>       title?: string
>     },
>     form?: {
>       title?: string,
>       formUrl?: string,
>       responseUrl?: string,
>       thumbnailUrl?: string
>     }
>   }[]
> }[]
> ```

***

### delete

`courses.delete`

Deletes a course. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to delete the requested course or for access errors. \* `NOT_FOUND` if no course exists with the requested ID.

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.courses.delete({ pathParams: {"id":"id-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   id: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output:** *empty object*

***

### get

`courses.get`

Returns a course. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors. \* `NOT_FOUND` if no course exists with the requested ID.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.get({ pathParams: {"id":"id-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   id: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `courseState` | `COURSE_STATE_UNSPECIFIED \| ACTIVE \| ARCHIVED \| PROVISIONED \| DECLINED \| SUSPENDED \| string` | No | State of the course. If unspecified, the default state is `PROVISIONED`. |
| `descriptionHeading` | `string` | No | Optional heading for the description. For example, "Welcome to 10th Grade Biology." If set, this field must be a valid UTF-8 string and no longer than 3600 characters. |
| `guardiansEnabled` | `boolean` | No | Whether or not guardian notifications are enabled for this course. Read-only. |
| `alternateLink` | `string` | No | Absolute link to this course in the Classroom web UI. Read-only. |
| `room` | `string` | No | Optional room location. For example, "301". If set, this field must be a valid UTF-8 string and no longer than 650 characters. |
| `ownerId` | `string` | No | The identifier of the owner of a course. When specified as a parameter of a create course request, this field is required. The identifier can be one of the following: \* the numeric identifier for the user \* the email address of the user \* the string literal `"me"`, indicating the requesting user This must be set in a create request. Admins can also specify this field in a patch course request to transfer ownership. In other contexts, it is read-only. |
| `id` | `string` | No | Identifier for this course assigned by Classroom. When creating a course, you may optionally set this identifier to an alias string in the request to create a corresponding alias. The `id` is still assigned by Classroom and cannot be updated after the course is created. Specifying this field in a course update mask results in an error. |
| `teacherGroupEmail` | `string` | No | The email address of a Google group containing all teachers of the course. This group does not accept email and can only be used for permissions. Read-only. |
| `enrollmentCode` | `string` | No | Enrollment code to use when joining this course. Specifying this field in a course update mask results in an error. Read-only. |
| `teacherFolder` | `object` | No | Information about a Drive Folder that is shared with all teachers of the course. This field will only be set for teachers of the course and domain administrators. Read-only. |
| `name` | `string` | No | Name of the course. For example, "10th Grade Biology". The name is required. It must be between 1 and 750 characters and a valid UTF-8 string. |
| `updateTime` | `string` | No | Time of the most recent update to this course. Specifying this field in a course update mask results in an error. Read-only. |
| `levels` | `string` | No | Optional. Levels for the course. Examples: "9th grade", "Middle school", "4th - 5th", "K-2", "3000". If set, this field must be a valid UTF-8 string and fewer than 1000 characters. This field can only be cleared using the `PatchCourse` method. |
| `section` | `string` | No | Section of the course. For example, "Period 2". If set, this field must be a valid UTF-8 string and no longer than 2800 characters. |
| `gradebookSettings` | `object` | No | The gradebook settings that specify how a student's overall grade for the course will be calculated and who it will be displayed to. Read-only. |
| `calendarId` | `string` | No | The Calendar ID for a calendar that all course members can see, to which Classroom adds events for course work and announcements in the course. The Calendar for a course is created asynchronously when the course is set to `CourseState.ACTIVE` for the first time (at creation time or when it is updated to `ACTIVE` through the UI or the API). The Calendar ID will not be populated until the creation process is completed. Read-only. |
| `subject` | `string` | No | Optional. The subject of the course. |
| `description` | `string` | No | Optional description. For example, "We'll be learning about the structure of living creatures from a combination of textbooks, guest lectures, and lab work. Expect to be excited!" If set, this field must be a valid UTF-8 string and no longer than 30,000 characters. |
| `courseGroupEmail` | `string` | No | The email address of a Google group containing all members of the course. This group does not accept email and can only be used for permissions. Read-only. |
| `creationTime` | `string` | No | Creation time of the course. Specifying this field in a course update mask results in an error. Read-only. |
| `courseMaterialSets` | `object[]` | No | Sets of materials that appear on the "about" page of this course. Read-only. |

> [accordion] teacherFolder full type
>
> ```ts theme={null}
> {
>   title?: string,
>   alternateLink?: string,
>   id?: string
> }
> ```

> [accordion] gradebookSettings full type
>
> ```ts theme={null}
> {
>   gradeCategories?: {
>     defaultGradeDenominator?: number,
>     id?: string,
>     weight?: number,
>     name?: string
>   }[],
>   calculationType?: CALCULATION_TYPE_UNSPECIFIED | TOTAL_POINTS | WEIGHTED_CATEGORIES | string,
>   displaySetting?: DISPLAY_SETTING_UNSPECIFIED | SHOW_OVERALL_GRADE | HIDE_OVERALL_GRADE | SHOW_TEACHERS_ONLY | string
> }
> ```

> [accordion] courseMaterialSets full type
>
> ```ts theme={null}
> {
>   title?: string,
>   materials?: {
>     driveFile?: {
>       thumbnailUrl?: string,
>       alternateLink?: string,
>       id?: string,
>       title?: string
>     },
>     youTubeVideo?: {
>       id?: string,
>       title?: string,
>       alternateLink?: string,
>       thumbnailUrl?: string
>     },
>     link?: {
>       url?: string,
>       thumbnailUrl?: string,
>       title?: string
>     },
>     form?: {
>       title?: string,
>       formUrl?: string,
>       responseUrl?: string,
>       thumbnailUrl?: string
>     }
>   }[]
> }[]
> ```

***

### getGradingPeriodSettings

`courses.getGradingPeriodSettings`

Returns the grading period settings in a course. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user isn't permitted to access the grading period settings in the requested course or for access errors. \* `NOT_FOUND` if the requested course does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.getGradingPeriodSettings({ pathParams: {"courseId":"courseId-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `gradingPeriods` | `object[]` | No | The list of grading periods in a specific course. Grading periods must not have overlapping date ranges and must be listed in chronological order. Each grading period must have a unique title within a course. |
| `applyToExistingCoursework` | `boolean` | No | Supports toggling the application of grading periods on existing stream items. Once set, this value is persisted meaning that it does not need to be set in every request to update `GradingPeriodSettings`. If not previously set, the default is False. |

> [accordion] gradingPeriods full type
>
> ```ts theme={null}
> {
>   endDate?: {
>     year?: number,
>     month?: number,
>     day?: number
>   },
>   title?: string,
>   startDate?: {
>     year?: number,
>     month?: number,
>     day?: number
>   },
>   id?: string
> }[]
> ```

***

### list

`courses.list`

Returns a list of courses that the requesting user is permitted to view, restricted to those that match the request. Returned courses are ordered by creation time, with the most recently created coming first. This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the query argument is malformed. \* `NOT_FOUND` if any users specified in the query arguments do not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.list({ pathParams: {}, query: {"courseStates":["ACTIVE"],"pageSize":1,"teacherId":"me"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   teacherId?: string,
>   pageToken?: string,
>   courseStates?: (COURSE_STATE_UNSPECIFIED | ACTIVE | ARCHIVED | PROVISIONED | DECLINED | SUSPENDED)[],
>   pageSize?: number,
>   studentId?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `nextPageToken` | `string` | No | Token identifying the next page of results to return. If empty, no further results are available. |
| `courses` | `object[]` | No | Courses that match the list request. |

> [accordion] courses full type
>
> ```ts theme={null}
> {
>   courseState?: COURSE_STATE_UNSPECIFIED | ACTIVE | ARCHIVED | PROVISIONED | DECLINED | SUSPENDED | string,
>   descriptionHeading?: string,
>   guardiansEnabled?: boolean,
>   alternateLink?: string,
>   room?: string,
>   ownerId?: string,
>   id?: string,
>   teacherGroupEmail?: string,
>   enrollmentCode?: string,
>   teacherFolder?: {
>     title?: string,
>     alternateLink?: string,
>     id?: string
>   },
>   name?: string,
>   updateTime?: string,
>   levels?: string,
>   section?: string,
>   gradebookSettings?: {
>     gradeCategories?: {
>       defaultGradeDenominator?: number,
>       id?: string,
>       weight?: number,
>       name?: string
>     }[],
>     calculationType?: CALCULATION_TYPE_UNSPECIFIED | TOTAL_POINTS | WEIGHTED_CATEGORIES | string,
>     displaySetting?: DISPLAY_SETTING_UNSPECIFIED | SHOW_OVERALL_GRADE | HIDE_OVERALL_GRADE | SHOW_TEACHERS_ONLY | string
>   },
>   calendarId?: string,
>   subject?: string,
>   description?: string,
>   courseGroupEmail?: string,
>   creationTime?: string,
>   courseMaterialSets?: {
>     title?: string,
>     materials?: {
>       driveFile?: {
>         thumbnailUrl?: string,
>         alternateLink?: string,
>         id?: string,
>         title?: string
>       },
>       youTubeVideo?: {
>         id?: string,
>         title?: string,
>         alternateLink?: string,
>         thumbnailUrl?: string
>       },
>       link?: {
>         url?: string,
>         thumbnailUrl?: string,
>         title?: string
>       },
>       form?: {
>         title?: string,
>         formUrl?: string,
>         responseUrl?: string,
>         thumbnailUrl?: string
>       }
>     }[]
>   }[]
> }[]
> ```

***

### patch

`courses.patch`

Updates one or more fields in a course. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to modify the requested course or for access errors. \* `NOT_FOUND` if no course exists with the requested ID. \* `INVALID_ARGUMENT` if invalid fields are specified in the update mask or if no update mask is supplied. \* `FAILED_PRECONDITION` for the following request errors: \* CourseNotModifiable \* InactiveCourseOwner \* IneligibleOwner \* CourseTitleCannotContainUrl

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.courses.patch({ pathParams: {"id":"id-123"}, query: {"updateMask":"name"}, body: {"name":"Biology"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   id: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   updateMask: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   courseState?: COURSE_STATE_UNSPECIFIED | ACTIVE | ARCHIVED | PROVISIONED | DECLINED | SUSPENDED,
>   descriptionHeading?: string,
>   guardiansEnabled?: boolean,
>   alternateLink?: string,
>   room?: string,
>   ownerId?: string,
>   id?: string,
>   teacherGroupEmail?: string,
>   enrollmentCode?: string,
>   teacherFolder?: {
>     title?: string,
>     alternateLink?: string,
>     id?: string
>   },
>   name?: string,
>   updateTime?: string,
>   levels?: string,
>   section?: string,
>   gradebookSettings?: {
>     gradeCategories?: {
>       defaultGradeDenominator?: number,
>       id?: string,
>       weight?: number,
>       name?: string
>     }[],
>     calculationType?: CALCULATION_TYPE_UNSPECIFIED | TOTAL_POINTS | WEIGHTED_CATEGORIES,
>     displaySetting?: DISPLAY_SETTING_UNSPECIFIED | SHOW_OVERALL_GRADE | HIDE_OVERALL_GRADE | SHOW_TEACHERS_ONLY
>   },
>   calendarId?: string,
>   subject?: string,
>   description?: string,
>   courseGroupEmail?: string,
>   creationTime?: string,
>   courseMaterialSets?: {
>     title?: string,
>     materials?: {
>       driveFile?: {
>         thumbnailUrl?: string,
>         alternateLink?: string,
>         id?: string,
>         title?: string
>       },
>       youTubeVideo?: {
>         id?: string,
>         title?: string,
>         alternateLink?: string,
>         thumbnailUrl?: string
>       },
>       link?: {
>         url?: string,
>         thumbnailUrl?: string,
>         title?: string
>       },
>       form?: {
>         title?: string,
>         formUrl?: string,
>         responseUrl?: string,
>         thumbnailUrl?: string
>       }
>     }[]
>   }[]
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `courseState` | `COURSE_STATE_UNSPECIFIED \| ACTIVE \| ARCHIVED \| PROVISIONED \| DECLINED \| SUSPENDED \| string` | No | State of the course. If unspecified, the default state is `PROVISIONED`. |
| `descriptionHeading` | `string` | No | Optional heading for the description. For example, "Welcome to 10th Grade Biology." If set, this field must be a valid UTF-8 string and no longer than 3600 characters. |
| `guardiansEnabled` | `boolean` | No | Whether or not guardian notifications are enabled for this course. Read-only. |
| `alternateLink` | `string` | No | Absolute link to this course in the Classroom web UI. Read-only. |
| `room` | `string` | No | Optional room location. For example, "301". If set, this field must be a valid UTF-8 string and no longer than 650 characters. |
| `ownerId` | `string` | No | The identifier of the owner of a course. When specified as a parameter of a create course request, this field is required. The identifier can be one of the following: \* the numeric identifier for the user \* the email address of the user \* the string literal `"me"`, indicating the requesting user This must be set in a create request. Admins can also specify this field in a patch course request to transfer ownership. In other contexts, it is read-only. |
| `id` | `string` | No | Identifier for this course assigned by Classroom. When creating a course, you may optionally set this identifier to an alias string in the request to create a corresponding alias. The `id` is still assigned by Classroom and cannot be updated after the course is created. Specifying this field in a course update mask results in an error. |
| `teacherGroupEmail` | `string` | No | The email address of a Google group containing all teachers of the course. This group does not accept email and can only be used for permissions. Read-only. |
| `enrollmentCode` | `string` | No | Enrollment code to use when joining this course. Specifying this field in a course update mask results in an error. Read-only. |
| `teacherFolder` | `object` | No | Information about a Drive Folder that is shared with all teachers of the course. This field will only be set for teachers of the course and domain administrators. Read-only. |
| `name` | `string` | No | Name of the course. For example, "10th Grade Biology". The name is required. It must be between 1 and 750 characters and a valid UTF-8 string. |
| `updateTime` | `string` | No | Time of the most recent update to this course. Specifying this field in a course update mask results in an error. Read-only. |
| `levels` | `string` | No | Optional. Levels for the course. Examples: "9th grade", "Middle school", "4th - 5th", "K-2", "3000". If set, this field must be a valid UTF-8 string and fewer than 1000 characters. This field can only be cleared using the `PatchCourse` method. |
| `section` | `string` | No | Section of the course. For example, "Period 2". If set, this field must be a valid UTF-8 string and no longer than 2800 characters. |
| `gradebookSettings` | `object` | No | The gradebook settings that specify how a student's overall grade for the course will be calculated and who it will be displayed to. Read-only. |
| `calendarId` | `string` | No | The Calendar ID for a calendar that all course members can see, to which Classroom adds events for course work and announcements in the course. The Calendar for a course is created asynchronously when the course is set to `CourseState.ACTIVE` for the first time (at creation time or when it is updated to `ACTIVE` through the UI or the API). The Calendar ID will not be populated until the creation process is completed. Read-only. |
| `subject` | `string` | No | Optional. The subject of the course. |
| `description` | `string` | No | Optional description. For example, "We'll be learning about the structure of living creatures from a combination of textbooks, guest lectures, and lab work. Expect to be excited!" If set, this field must be a valid UTF-8 string and no longer than 30,000 characters. |
| `courseGroupEmail` | `string` | No | The email address of a Google group containing all members of the course. This group does not accept email and can only be used for permissions. Read-only. |
| `creationTime` | `string` | No | Creation time of the course. Specifying this field in a course update mask results in an error. Read-only. |
| `courseMaterialSets` | `object[]` | No | Sets of materials that appear on the "about" page of this course. Read-only. |

> [accordion] teacherFolder full type
>
> ```ts theme={null}
> {
>   title?: string,
>   alternateLink?: string,
>   id?: string
> }
> ```

> [accordion] gradebookSettings full type
>
> ```ts theme={null}
> {
>   gradeCategories?: {
>     defaultGradeDenominator?: number,
>     id?: string,
>     weight?: number,
>     name?: string
>   }[],
>   calculationType?: CALCULATION_TYPE_UNSPECIFIED | TOTAL_POINTS | WEIGHTED_CATEGORIES | string,
>   displaySetting?: DISPLAY_SETTING_UNSPECIFIED | SHOW_OVERALL_GRADE | HIDE_OVERALL_GRADE | SHOW_TEACHERS_ONLY | string
> }
> ```

> [accordion] courseMaterialSets full type
>
> ```ts theme={null}
> {
>   title?: string,
>   materials?: {
>     driveFile?: {
>       thumbnailUrl?: string,
>       alternateLink?: string,
>       id?: string,
>       title?: string
>     },
>     youTubeVideo?: {
>       id?: string,
>       title?: string,
>       alternateLink?: string,
>       thumbnailUrl?: string
>     },
>     link?: {
>       url?: string,
>       thumbnailUrl?: string,
>       title?: string
>     },
>     form?: {
>       title?: string,
>       formUrl?: string,
>       responseUrl?: string,
>       thumbnailUrl?: string
>     }
>   }[]
> }[]
> ```

***

### posts.addOnAttachments.create

`courses.posts.addOnAttachments.create`

Creates an add-on attachment under a post. Requires the add-on to have permission to create new attachments on the post. This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if one of the identified resources does not exist.

**Risk:** `write`

```ts theme={null}
await corsair.googleclassroom.api.courses.posts.addOnAttachments.create({ pathParams: {"postId":"postId-123","courseId":"courseId-123"}, query: {"itemId":"item-123"}, body: {"title":"Learning activity","teacherViewUri":{"uri":"https://corsair.dev/classroom"},"studentViewUri":{"uri":"https://corsair.dev/classroom"}} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

Deprecated posts-based route retained for compatibility; use the matching resource-specific add-on method. addOnToken may be omitted for partner-first creation when the creating project matches the project that created the parent post. Google enforces the project and authorization conditions.

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   postId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   addOnToken?: string,
>   itemId: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   dueTime?: {
>     hours?: number,
>     minutes?: number,
>     seconds?: number,
>     nanos?: number
>   },
>   copyHistory?: {
>     courseId?: string,
>     postId?: string,
>     itemId?: string,
>     attachmentId?: string
>   }[],
>   gradeSyncEnabled?: boolean,
>   title: string,
>   studentViewUri: {
>     uri: string
>   },
>   itemId?: string,
>   dueDate?: {
>     year?: number,
>     month?: number,
>     day?: number
>   },
>   studentWorkReviewUri?: {
>     uri: string
>   },
>   postId?: string,
>   teacherViewUri: {
>     uri: string
>   },
>   maxPoints?: number,
>   id?: string,
>   courseId?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `dueTime` | `object` | No | Time of day, in UTC, that work on this attachment is due. This must be specified if `due_date` is specified. |
| `copyHistory` | `object[]` | No | Output only. Identifiers of attachments that were previous copies of this attachment. If the attachment was previously copied by virtue of its parent post being copied, this enumerates the identifiers of attachments that were its previous copies in ascending chronological order of copy. |
| `gradeSyncEnabled` | `boolean` | No | Output only. Whether changes to `pointsEarned` values on this attachment's student submissions will be copied to the `pointsEarned` field on the students' CourseWork submissions. This field can be `true` for at most one add-on attachment per stream item. |
| `title` | `string` | No | Required. Title of this attachment. The title must be between 1 and 1000 characters. |
| `studentViewUri` | `object` | No | Required. URI to show the student view of the attachment. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, and `attachmentId` query parameters set. |
| `itemId` | `string` | No | Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached. Unique per course. |
| `dueDate` | `object` | No | Date, in UTC, that work on this attachment is due. This must be specified if `due_time` is specified. |
| `studentWorkReviewUri` | `object` | No | URI for the teacher to see student work on the attachment, if applicable. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, `attachmentId`, and `submissionId` query parameters set. This is the same `submissionId` returned in the [`AddOnContext.studentContext`](https://developers.google.com/workspace/classroom/reference/rest/v1/AddOnContext#StudentContext) field when a student views the attachment. If the URI is omitted or removed, `max_points` will also be discarded. |
| `postId` | `string` | No | Immutable. Deprecated, use `item_id` instead. |
| `teacherViewUri` | `object` | No | Required. URI to show the teacher view of the attachment. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, and `attachmentId` query parameters set. |
| `maxPoints` | `number` | No | Maximum grade for this attachment. Can only be set if `studentWorkReviewUri` is set. Set to a non-zero value to indicate that the attachment supports grade passback. If set, this must be a non-negative integer value. When set to zero, the attachment will not support grade passback. |
| `id` | `string` | No | Immutable. Classroom-assigned identifier for this attachment, unique per post. |
| `courseId` | `string` | No | Immutable. Identifier of the course. |

> [accordion] dueTime full type
>
> ```ts theme={null}
> {
>   hours?: number,
>   minutes?: number,
>   seconds?: number,
>   nanos?: number
> }
> ```

> [accordion] copyHistory full type
>
> ```ts theme={null}
> {
>   courseId?: string,
>   postId?: string,
>   itemId?: string,
>   attachmentId?: string
> }[]
> ```

> [accordion] studentViewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

> [accordion] dueDate full type
>
> ```ts theme={null}
> {
>   year?: number,
>   month?: number,
>   day?: number
> }
> ```

> [accordion] studentWorkReviewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

> [accordion] teacherViewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

***

### posts.addOnAttachments.delete

`courses.posts.addOnAttachments.delete`

Deletes an add-on attachment. Requires the add-on to have been the original creator of the attachment. This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if one of the identified resources does not exist.

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.courses.posts.addOnAttachments.delete({ pathParams: {"courseId":"courseId-123","postId":"postId-123","attachmentId":"attachmentId-123"}, query: {"itemId":"item-123"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

Deprecated posts-based route retained for compatibility. Use the matching announcement, courseWork, or courseWorkMaterial add-on resource method instead.

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   attachmentId: string,
>   postId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   itemId: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output:** *empty object*

***

### posts.addOnAttachments.get

`courses.posts.addOnAttachments.get`

Returns an add-on attachment. Requires the add-on requesting the attachment to be the original creator of the attachment. This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if one of the identified resources does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.posts.addOnAttachments.get({ pathParams: {"courseId":"courseId-123","postId":"postId-123","attachmentId":"attachmentId-123"}, query: {"itemId":"item-123"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

Deprecated posts-based route retained for compatibility. Use the matching announcement, courseWork, or courseWorkMaterial add-on resource method instead.

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   postId: string,
>   attachmentId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   itemId: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `dueTime` | `object` | No | Time of day, in UTC, that work on this attachment is due. This must be specified if `due_date` is specified. |
| `copyHistory` | `object[]` | No | Output only. Identifiers of attachments that were previous copies of this attachment. If the attachment was previously copied by virtue of its parent post being copied, this enumerates the identifiers of attachments that were its previous copies in ascending chronological order of copy. |
| `gradeSyncEnabled` | `boolean` | No | Output only. Whether changes to `pointsEarned` values on this attachment's student submissions will be copied to the `pointsEarned` field on the students' CourseWork submissions. This field can be `true` for at most one add-on attachment per stream item. |
| `title` | `string` | No | Required. Title of this attachment. The title must be between 1 and 1000 characters. |
| `studentViewUri` | `object` | No | Required. URI to show the student view of the attachment. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, and `attachmentId` query parameters set. |
| `itemId` | `string` | No | Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached. Unique per course. |
| `dueDate` | `object` | No | Date, in UTC, that work on this attachment is due. This must be specified if `due_time` is specified. |
| `studentWorkReviewUri` | `object` | No | URI for the teacher to see student work on the attachment, if applicable. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, `attachmentId`, and `submissionId` query parameters set. This is the same `submissionId` returned in the [`AddOnContext.studentContext`](https://developers.google.com/workspace/classroom/reference/rest/v1/AddOnContext#StudentContext) field when a student views the attachment. If the URI is omitted or removed, `max_points` will also be discarded. |
| `postId` | `string` | No | Immutable. Deprecated, use `item_id` instead. |
| `teacherViewUri` | `object` | No | Required. URI to show the teacher view of the attachment. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, and `attachmentId` query parameters set. |
| `maxPoints` | `number` | No | Maximum grade for this attachment. Can only be set if `studentWorkReviewUri` is set. Set to a non-zero value to indicate that the attachment supports grade passback. If set, this must be a non-negative integer value. When set to zero, the attachment will not support grade passback. |
| `id` | `string` | No | Immutable. Classroom-assigned identifier for this attachment, unique per post. |
| `courseId` | `string` | No | Immutable. Identifier of the course. |

> [accordion] dueTime full type
>
> ```ts theme={null}
> {
>   hours?: number,
>   minutes?: number,
>   seconds?: number,
>   nanos?: number
> }
> ```

> [accordion] copyHistory full type
>
> ```ts theme={null}
> {
>   courseId?: string,
>   postId?: string,
>   itemId?: string,
>   attachmentId?: string
> }[]
> ```

> [accordion] studentViewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

> [accordion] dueDate full type
>
> ```ts theme={null}
> {
>   year?: number,
>   month?: number,
>   day?: number
> }
> ```

> [accordion] studentWorkReviewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

> [accordion] teacherViewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

***

### posts.addOnAttachments.list

`courses.posts.addOnAttachments.list`

Returns all attachments created by an add-on under the post. Requires the add-on to have active attachments on the post or have permission to create new attachments on the post. This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if one of the identified resources does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.posts.addOnAttachments.list({ pathParams: {"postId":"postId-123","courseId":"courseId-123"}, query: {"pageSize":1,"itemId":"item-123"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

Deprecated posts-based route retained for compatibility. Use the matching announcement, courseWork, or courseWorkMaterial add-on resource method instead.

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   postId: string,
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   pageSize?: number,
>   itemId: string,
>   pageToken?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `addOnAttachments` | `object[]` | No | Attachments under the given post. |
| `nextPageToken` | `string` | No | A token, which can be sent as `pageToken` to retrieve the next page. If this field is omitted, there are no subsequent pages. |

> [accordion] addOnAttachments full type
>
> ```ts theme={null}
> {
>   dueTime?: {
>     hours?: number,
>     minutes?: number,
>     seconds?: number,
>     nanos?: number
>   },
>   copyHistory?: {
>     courseId?: string,
>     postId?: string,
>     itemId?: string,
>     attachmentId?: string
>   }[],
>   gradeSyncEnabled?: boolean,
>   title?: string,
>   studentViewUri?: {
>     uri?: string
>   },
>   itemId?: string,
>   dueDate?: {
>     year?: number,
>     month?: number,
>     day?: number
>   },
>   studentWorkReviewUri?: {
>     uri?: string
>   },
>   postId?: string,
>   teacherViewUri?: {
>     uri?: string
>   },
>   maxPoints?: number,
>   id?: string,
>   courseId?: string
> }[]
> ```

***

### posts.addOnAttachments.patch

`courses.posts.addOnAttachments.patch`

Updates an add-on attachment. Requires the add-on to have been the original creator of the attachment. This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if one of the identified resources does not exist.

**Risk:** `write`

```ts theme={null}
await corsair.googleclassroom.api.courses.posts.addOnAttachments.patch({ pathParams: {"postId":"postId-123","courseId":"courseId-123","attachmentId":"attachmentId-123"}, query: {"updateMask":"title"}, body: {"title":"Learning activity"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

Deprecated posts-based route retained for compatibility. Use the matching announcement, courseWork, or courseWorkMaterial add-on resource method instead.

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   postId: string,
>   attachmentId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   itemId?: string,
>   updateMask: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   dueTime?: {
>     hours?: number,
>     minutes?: number,
>     seconds?: number,
>     nanos?: number
>   },
>   copyHistory?: {
>     courseId?: string,
>     postId?: string,
>     itemId?: string,
>     attachmentId?: string
>   }[],
>   gradeSyncEnabled?: boolean,
>   title?: string,
>   studentViewUri?: {
>     uri: string
>   },
>   itemId?: string,
>   dueDate?: {
>     year?: number,
>     month?: number,
>     day?: number
>   },
>   studentWorkReviewUri?: {
>     uri: string
>   },
>   postId?: string,
>   teacherViewUri?: {
>     uri: string
>   },
>   maxPoints?: number,
>   id?: string,
>   courseId?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `dueTime` | `object` | No | Time of day, in UTC, that work on this attachment is due. This must be specified if `due_date` is specified. |
| `copyHistory` | `object[]` | No | Output only. Identifiers of attachments that were previous copies of this attachment. If the attachment was previously copied by virtue of its parent post being copied, this enumerates the identifiers of attachments that were its previous copies in ascending chronological order of copy. |
| `gradeSyncEnabled` | `boolean` | No | Output only. Whether changes to `pointsEarned` values on this attachment's student submissions will be copied to the `pointsEarned` field on the students' CourseWork submissions. This field can be `true` for at most one add-on attachment per stream item. |
| `title` | `string` | No | Required. Title of this attachment. The title must be between 1 and 1000 characters. |
| `studentViewUri` | `object` | No | Required. URI to show the student view of the attachment. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, and `attachmentId` query parameters set. |
| `itemId` | `string` | No | Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached. Unique per course. |
| `dueDate` | `object` | No | Date, in UTC, that work on this attachment is due. This must be specified if `due_time` is specified. |
| `studentWorkReviewUri` | `object` | No | URI for the teacher to see student work on the attachment, if applicable. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, `attachmentId`, and `submissionId` query parameters set. This is the same `submissionId` returned in the [`AddOnContext.studentContext`](https://developers.google.com/workspace/classroom/reference/rest/v1/AddOnContext#StudentContext) field when a student views the attachment. If the URI is omitted or removed, `max_points` will also be discarded. |
| `postId` | `string` | No | Immutable. Deprecated, use `item_id` instead. |
| `teacherViewUri` | `object` | No | Required. URI to show the teacher view of the attachment. The URI will be opened in an iframe with the `courseId`, `itemId`, `itemType`, and `attachmentId` query parameters set. |
| `maxPoints` | `number` | No | Maximum grade for this attachment. Can only be set if `studentWorkReviewUri` is set. Set to a non-zero value to indicate that the attachment supports grade passback. If set, this must be a non-negative integer value. When set to zero, the attachment will not support grade passback. |
| `id` | `string` | No | Immutable. Classroom-assigned identifier for this attachment, unique per post. |
| `courseId` | `string` | No | Immutable. Identifier of the course. |

> [accordion] dueTime full type
>
> ```ts theme={null}
> {
>   hours?: number,
>   minutes?: number,
>   seconds?: number,
>   nanos?: number
> }
> ```

> [accordion] copyHistory full type
>
> ```ts theme={null}
> {
>   courseId?: string,
>   postId?: string,
>   itemId?: string,
>   attachmentId?: string
> }[]
> ```

> [accordion] studentViewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

> [accordion] dueDate full type
>
> ```ts theme={null}
> {
>   year?: number,
>   month?: number,
>   day?: number
> }
> ```

> [accordion] studentWorkReviewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

> [accordion] teacherViewUri full type
>
> ```ts theme={null}
> {
>   uri?: string
> }
> ```

***

### posts.addOnAttachments.studentSubmissions.get

`courses.posts.addOnAttachments.studentSubmissions.get`

Returns a student submission for an add-on attachment. This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if one of the identified resources does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.posts.addOnAttachments.studentSubmissions.get({ pathParams: {"courseId":"courseId-123","submissionId":"submissionId-123","postId":"postId-123","attachmentId":"attachmentId-123"}, query: {"itemId":"item-123"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

Deprecated posts-based route retained for compatibility. Use the matching resource-specific add-on studentSubmissions method instead.

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   attachmentId: string,
>   submissionId: string,
>   postId: string,
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   itemId: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `postSubmissionState` | `SUBMISSION_STATE_UNSPECIFIED \| NEW \| CREATED \| TURNED_IN \| RETURNED \| RECLAIMED_BY_STUDENT \| string` | No | Submission state of add-on attachment's parent post (i.e. assignment). |
| `pointsEarned` | `number` | No | Student grade on this attachment. If unset, no grade was set. |
| `courseWorkSubmissionId` | `string` | No | Output only. Identifier of the course work submission under which this attachment submission was made. |
| `userId` | `string` | No | Identifier for the student that owns this submission. Requires the user to be a teacher in the course and have permission to read student submissions. See [`courseWork.studentSubmissions.get`](https://developers.google.com/workspace/classroom/reference/rest/v1/courses.courseWork.studentSubmissions/get#authorization-scopes) for the list of acceptable OAuth scopes for this field. Read-only. |
| `id` | `string` | No | Output only. Classroom-assigned identifier for this student submission. This is unique among submissions for the relevant course work and add-on attachment combination. |

***

### posts.addOnAttachments.studentSubmissions.patch

`courses.posts.addOnAttachments.studentSubmissions.patch`

Updates data associated with an add-on attachment submission. Requires the add-on to have been the original creator of the attachment and the attachment to have a positive `max_points` value set. This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if one of the identified resources does not exist.

**Risk:** `write`

```ts theme={null}
await corsair.googleclassroom.api.courses.posts.addOnAttachments.studentSubmissions.patch({ pathParams: {"submissionId":"submissionId-123","courseId":"courseId-123","attachmentId":"attachmentId-123","postId":"postId-123"}, query: {"updateMask":"pointsEarned","itemId":"itemId-123"}, body: {"pointsEarned":1} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

Deprecated posts-based route retained for compatibility. Use the matching resource-specific add-on studentSubmissions method instead. To clear a passback grade, include pointsEarned in updateMask and omit pointsEarned from the request body.

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   submissionId: string,
>   postId: string,
>   attachmentId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   updateMask: string,
>   itemId: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   pointsEarned?: number
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `postSubmissionState` | `SUBMISSION_STATE_UNSPECIFIED \| NEW \| CREATED \| TURNED_IN \| RETURNED \| RECLAIMED_BY_STUDENT \| string` | No | Submission state of add-on attachment's parent post (i.e. assignment). |
| `pointsEarned` | `number` | No | Student grade on this attachment. If unset, no grade was set. |
| `courseWorkSubmissionId` | `string` | No | Output only. Identifier of the course work submission under which this attachment submission was made. |
| `userId` | `string` | No | Identifier for the student that owns this submission. Requires the user to be a teacher in the course and have permission to read student submissions. See [`courseWork.studentSubmissions.get`](https://developers.google.com/workspace/classroom/reference/rest/v1/courses.courseWork.studentSubmissions/get#authorization-scopes) for the list of acceptable OAuth scopes for this field. Read-only. |
| `id` | `string` | No | Output only. Classroom-assigned identifier for this student submission. This is unique among submissions for the relevant course work and add-on attachment combination. |

***

### posts.getAddOnContext

`courses.posts.getAddOnContext`

Gets metadata for Classroom add-ons in the context of a specific post. To maintain the integrity of its own data and permissions model, an add-on should call this to validate query parameters and the requesting user's role whenever the add-on is opened in an [iframe](https://developers.google.com/workspace/classroom/add-ons/get-started/iframes/iframes-overview). This method returns the following error codes: \* `PERMISSION_DENIED` for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if one of the identified resources does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.posts.getAddOnContext({ pathParams: {"postId":"postId-123","courseId":"courseId-123"}, query: {"itemId":"item-123"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

Deprecated posts-based route retained for compatibility; prefer the matching resource-specific route. attachmentId is optional only for the Attachment Discovery iframe. addOnToken is required when the add-on has no attachment on the post and the calling project differs from the post's creating project; Google enforces this.

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   postId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   addOnToken?: string,
>   itemId: string,
>   attachmentId?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `supportsStudentWork` | `boolean` | No | Optional. Whether the post allows the teacher to see student work and passback grades. |
| `teacherContext` | `object` | No | Add-on context corresponding to the requesting user's role as a teacher. Its presence implies that the requesting user is a teacher in the course. |
| `studentContext` | `object` | No | Add-on context corresponding to the requesting user's role as a student. Its presence implies that the requesting user is a student in the course. |
| `courseId` | `string` | No | Immutable. Identifier of the course. |
| `postId` | `string` | No | Immutable. Deprecated, use `item_id` instead. |
| `itemId` | `string` | No | Immutable. Identifier of the `Announcement`, `CourseWork`, or `CourseWorkMaterial` under which the attachment is attached. |

> [accordion] teacherContext full type
>
> ```ts theme={null}
> {
> }
> ```

> [accordion] studentContext full type
>
> ```ts theme={null}
> {
>   submissionId?: string
> }
> ```

***

### studentGroups.create

`courses.studentGroups.create`

Creates a student group for a course. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to create the student group or for access errors. \* `NOT_FOUND` if the course does not exist or the requesting user doesn't have access to the course. \* `FAILED_PRECONDITION` if creating the student group would exceed the maximum number of student groups per course.

**Risk:** `write`

```ts theme={null}
await corsair.googleclassroom.api.courses.studentGroups.create({ pathParams: {"courseId":"courseId-123"}, query: {}, body: {"title":"Study group"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   title: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `title` | `string` | No | The title of the student group. |
| `id` | `string` | No | The identifier of the student group. |
| `courseId` | `string` | No | The identifier of the course. |

***

### studentGroups.delete

`courses.studentGroups.delete`

Deletes a student group. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to delete the requested student group or for access errors. \* `NOT_FOUND` if the student group does not exist or the user does not have access to the student group.

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.courses.studentGroups.delete({ pathParams: {"courseId":"courseId-123","id":"id-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   id: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output:** *empty object*

***

### studentGroups.list

`courses.studentGroups.list`

Returns a list of groups in a course. This method returns the following error codes: \* `NOT_FOUND` if the course does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.studentGroups.list({ pathParams: {"courseId":"courseId-123"}, query: {"pageSize":1} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   pageToken?: string,
>   pageSize?: number,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `studentGroups` | `object[]` | No | The student groups. |
| `nextPageToken` | `string` | No | Token identifying the next page of results to return. If empty, no further results are available. |

> [accordion] studentGroups full type
>
> ```ts theme={null}
> {
>   title?: string,
>   id?: string,
>   courseId?: string
> }[]
> ```

***

### studentGroups.patch

`courses.studentGroups.patch`

Updates one or more fields in a student group. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to modify the requested student group or for access errors. \* `NOT_FOUND` if the student group does not exist or the user does not have access to the student group. \* `INVALID_ARGUMENT` if invalid fields are specified in the update mask or if no update mask is supplied.

**Risk:** `write`

```ts theme={null}
await corsair.googleclassroom.api.courses.studentGroups.patch({ pathParams: {"id":"id-123","courseId":"courseId-123"}, query: {"updateMask":"title"}, body: {"title":"Study group"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   id: string,
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   updateMask: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   title?: string,
>   id?: string,
>   courseId?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `title` | `string` | No | The title of the student group. |
| `id` | `string` | No | The identifier of the student group. |
| `courseId` | `string` | No | The identifier of the course. |

***

### studentGroups.studentGroupMembers.create

`courses.studentGroups.studentGroupMembers.create`

Creates a student group member for a student group. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to create the student group or member for access errors. \* `NOT_FOUND` if the student group does not exist or the user does not have access to the student group. \* `ALREADY_EXISTS` if the student group member already exists. \* `FAILED_PRECONDITION` if attempting to add a member to a student group that has reached its member limit.

**Risk:** `write`

```ts theme={null}
await corsair.googleclassroom.api.courses.studentGroups.studentGroupMembers.create({ pathParams: {"courseId":"courseId-123","studentGroupId":"studentGroupId-123"}, query: {}, body: {"userId":"student-123"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   studentGroupId: string,
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   userId: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `courseId` | `string` | No | The identifier of the course. |
| `userId` | `string` | No | Identifier of the student. |
| `studentGroupId` | `string` | No | The identifier of the student group. |

***

### studentGroups.studentGroupMembers.delete

`courses.studentGroups.studentGroupMembers.delete`

Deletes a student group member. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to delete the requested student group member or for access errors. \* `NOT_FOUND` if the student group member does not exist or the user does not have access to the student group.

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.courses.studentGroups.studentGroupMembers.delete({ pathParams: {"studentGroupId":"studentGroupId-123","courseId":"courseId-123","userId":"userId-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   studentGroupId: string,
>   userId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output:** *empty object*

***

### studentGroups.studentGroupMembers.list

`courses.studentGroups.studentGroupMembers.list`

Returns a list of students in a group. This method returns the following error codes: \* `NOT_FOUND` if the course or student group does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.studentGroups.studentGroupMembers.list({ pathParams: {"studentGroupId":"studentGroupId-123","courseId":"courseId-123"}, query: {"pageSize":1} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   studentGroupId: string,
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   pageSize?: number,
>   pageToken?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `nextPageToken` | `string` | No | Token identifying the next page of results to return. If empty, no further results are available. |
| `studentGroupMembers` | `object[]` | No | The student group members. |

> [accordion] studentGroupMembers full type
>
> ```ts theme={null}
> {
>   courseId?: string,
>   userId?: string,
>   studentGroupId?: string
> }[]
> ```

***

### students.create

`courses.students.create`

Adds a user as a student of a course. Domain administrators are permitted to [directly add](https://developers.google.com/workspace/classroom/guides/manage-users) users within their domain as students to courses within their domain. Students are permitted to add themselves to a course using an enrollment code. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to create students in this course or for access errors. \* `NOT_FOUND` if the requested course ID does not exist. \* `FAILED_PRECONDITION` if the requested user's account is disabled, for the following request errors: \* CourseMemberLimitReached \* CourseNotModifiable \* UserGroupsMembershipLimitReached \* InactiveCourseOwner \* `ALREADY_EXISTS` if the user is already a student or teacher in the course.

**Risk:** `write`

```ts theme={null}
await corsair.googleclassroom.api.courses.students.create({ pathParams: {"courseId":"courseId-123"}, query: {}, body: {"userId":"student-123"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   enrollmentCode?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   userId: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `studentWorkFolder` | `object` | No | Information about a Drive Folder for this student's work in this course. Only visible to the student and domain administrators. Read-only. |
| `userId` | `string` | No | Identifier of the user. When specified as a parameter of a request, this identifier can be one of the following: \* the numeric identifier for the user \* the email address of the user \* the string literal `"me"`, indicating the requesting user |
| `profile` | `object` | No | Global user information for the student. Read-only. |
| `courseId` | `string` | No | Identifier of the course. Read-only. |

> [accordion] studentWorkFolder full type
>
> ```ts theme={null}
> {
>   title?: string,
>   alternateLink?: string,
>   id?: string
> }
> ```

> [accordion] profile full type
>
> ```ts theme={null}
> {
>   name?: {
>     fullName?: string,
>     familyName?: string,
>     givenName?: string
>   },
>   id?: string,
>   photoUrl?: string,
>   permissions?: {
>     permission?: PERMISSION_UNSPECIFIED | CREATE_COURSE | string
>   }[],
>   emailAddress?: string,
>   verifiedTeacher?: boolean
> }
> ```

***

### students.delete

`courses.students.delete`

Deletes a student of a course. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to delete students of this course or for access errors. \* `NOT_FOUND` if no student of this course has the requested ID or if the course does not exist.

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.courses.students.delete({ pathParams: {"userId":"userId-123","courseId":"courseId-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   userId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output:** *empty object*

***

### students.get

`courses.students.get`

Returns a student of a course. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to view students of this course or for access errors. \* `NOT_FOUND` if no student of this course has the requested ID or if the course does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.students.get({ pathParams: {"courseId":"courseId-123","userId":"userId-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   userId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `studentWorkFolder` | `object` | No | Information about a Drive Folder for this student's work in this course. Only visible to the student and domain administrators. Read-only. |
| `userId` | `string` | No | Identifier of the user. When specified as a parameter of a request, this identifier can be one of the following: \* the numeric identifier for the user \* the email address of the user \* the string literal `"me"`, indicating the requesting user |
| `profile` | `object` | No | Global user information for the student. Read-only. |
| `courseId` | `string` | No | Identifier of the course. Read-only. |

> [accordion] studentWorkFolder full type
>
> ```ts theme={null}
> {
>   title?: string,
>   alternateLink?: string,
>   id?: string
> }
> ```

> [accordion] profile full type
>
> ```ts theme={null}
> {
>   name?: {
>     fullName?: string,
>     familyName?: string,
>     givenName?: string
>   },
>   id?: string,
>   photoUrl?: string,
>   permissions?: {
>     permission?: PERMISSION_UNSPECIFIED | CREATE_COURSE | string
>   }[],
>   emailAddress?: string,
>   verifiedTeacher?: boolean
> }
> ```

***

### students.list

`courses.students.list`

Returns a list of students of this course that the requester is permitted to view. This method returns the following error codes: \* `NOT_FOUND` if the course does not exist. \* `PERMISSION_DENIED` for access errors.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.students.list({ pathParams: {"courseId":"courseId-123"}, query: {"pageSize":1} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   pageSize?: number,
>   pageToken?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `students` | `object[]` | No | Students who match the list request. |
| `nextPageToken` | `string` | No | Token identifying the next page of results to return. If empty, no further results are available. |

> [accordion] students full type
>
> ```ts theme={null}
> {
>   studentWorkFolder?: {
>     title?: string,
>     alternateLink?: string,
>     id?: string
>   },
>   userId?: string,
>   profile?: {
>     name?: {
>       fullName?: string,
>       familyName?: string,
>       givenName?: string
>     },
>     id?: string,
>     photoUrl?: string,
>     permissions?: {
>       permission?: PERMISSION_UNSPECIFIED | CREATE_COURSE | string
>     }[],
>     emailAddress?: string,
>     verifiedTeacher?: boolean
>   },
>   courseId?: string
> }[]
> ```

***

### teachers.create

`courses.teachers.create`

Creates a teacher of a course. Domain administrators are permitted to [directly add](https://developers.google.com/workspace/classroom/guides/manage-users) users within their domain as teachers to courses within their domain. Non-admin users should send an Invitation instead. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to create teachers in this course or for access errors. \* `NOT_FOUND` if the requested course ID does not exist. \* `FAILED_PRECONDITION` if the requested user's account is disabled, for the following request errors: \* CourseMemberLimitReached \* CourseNotModifiable \* CourseTeacherLimitReached \* UserGroupsMembershipLimitReached \* InactiveCourseOwner \* `ALREADY_EXISTS` if the user is already a teacher or student in the course.

**Risk:** `write`

```ts theme={null}
await corsair.googleclassroom.api.courses.teachers.create({ pathParams: {"courseId":"courseId-123"}, query: {}, body: {"userId":"teacher-123"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   userId: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `profile` | `object` | No | Global user information for the teacher. Read-only. |
| `userId` | `string` | No | Identifier of the user. When specified as a parameter of a request, this identifier can be one of the following: \* the numeric identifier for the user \* the email address of the user \* the string literal `"me"`, indicating the requesting user |
| `courseId` | `string` | No | Identifier of the course. Read-only. |

> [accordion] profile full type
>
> ```ts theme={null}
> {
>   name?: {
>     fullName?: string,
>     familyName?: string,
>     givenName?: string
>   },
>   id?: string,
>   photoUrl?: string,
>   permissions?: {
>     permission?: PERMISSION_UNSPECIFIED | CREATE_COURSE | string
>   }[],
>   emailAddress?: string,
>   verifiedTeacher?: boolean
> }
> ```

***

### teachers.delete

`courses.teachers.delete`

Removes the specified teacher from the specified course. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to delete teachers of this course or for access errors. \* `NOT_FOUND` if no teacher of this course has the requested ID or if the course does not exist. \* `FAILED_PRECONDITION` if the requested ID belongs to the primary teacher of this course. \* `FAILED_PRECONDITION` if the requested ID belongs to the owner of the course Drive folder. \* `FAILED_PRECONDITION` if the course no longer has an active owner.

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.courses.teachers.delete({ pathParams: {"userId":"userId-123","courseId":"courseId-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   userId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output:** *empty object*

***

### teachers.get

`courses.teachers.get`

Returns a teacher of a course. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to view teachers of this course or for access errors. \* `NOT_FOUND` if no teacher of this course has the requested ID or if the course does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.teachers.get({ pathParams: {"userId":"userId-123","courseId":"courseId-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   userId: string,
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `profile` | `object` | No | Global user information for the teacher. Read-only. |
| `userId` | `string` | No | Identifier of the user. When specified as a parameter of a request, this identifier can be one of the following: \* the numeric identifier for the user \* the email address of the user \* the string literal `"me"`, indicating the requesting user |
| `courseId` | `string` | No | Identifier of the course. Read-only. |

> [accordion] profile full type
>
> ```ts theme={null}
> {
>   name?: {
>     fullName?: string,
>     familyName?: string,
>     givenName?: string
>   },
>   id?: string,
>   photoUrl?: string,
>   permissions?: {
>     permission?: PERMISSION_UNSPECIFIED | CREATE_COURSE | string
>   }[],
>   emailAddress?: string,
>   verifiedTeacher?: boolean
> }
> ```

***

### teachers.list

`courses.teachers.list`

Returns a list of teachers of this course that the requester is permitted to view. This method returns the following error codes: \* `NOT_FOUND` if the course does not exist. \* `PERMISSION_DENIED` for access errors.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.teachers.list({ pathParams: {"courseId":"courseId-123"}, query: {"pageSize":1} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   pageSize?: number,
>   pageToken?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `teachers` | `object[]` | No | Teachers who match the list request. |
| `nextPageToken` | `string` | No | Token identifying the next page of results to return. If empty, no further results are available. |

> [accordion] teachers full type
>
> ```ts theme={null}
> {
>   profile?: {
>     name?: {
>       fullName?: string,
>       familyName?: string,
>       givenName?: string
>     },
>     id?: string,
>     photoUrl?: string,
>     permissions?: {
>       permission?: PERMISSION_UNSPECIFIED | CREATE_COURSE | string
>     }[],
>     emailAddress?: string,
>     verifiedTeacher?: boolean
>   },
>   userId?: string,
>   courseId?: string
> }[]
> ```

***

### topics.create

`courses.topics.create`

Creates a topic. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course, create a topic in the requested course, or for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `ALREADY_EXISTS` if there exists a topic in the course with the same name. \* `FAILED_PRECONDITION` for the following request error: \* CourseTopicLimitReached \* `NOT_FOUND` if the requested course does not exist.

**Risk:** `write`

```ts theme={null}
await corsair.googleclassroom.api.courses.topics.create({ pathParams: {"courseId":"courseId-123"}, query: {}, body: {"name":"Unit 1"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   name: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `topicId` | `string` | No | Unique identifier for the topic. Read-only. |
| `updateTime` | `string` | No | The time the topic was last updated by the system. Read-only. |
| `name` | `string` | No | The name of the topic, generated by the user. Leading and trailing whitespaces, if any, are trimmed. Also, multiple consecutive whitespaces are collapsed into one inside the name. The result must be a non-empty string. Topic names are case sensitive, and must be no longer than 100 characters. |
| `courseId` | `string` | No | Identifier of the course. Read-only. |

***

### topics.delete

`courses.topics.delete`

Deletes a topic. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not allowed to delete the requested topic or for access errors. \* `FAILED_PRECONDITION` if the requested topic has already been deleted. \* `NOT_FOUND` if no course or topic exists with the requested ID.

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.courses.topics.delete({ pathParams: {"courseId":"courseId-123","id":"id-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   id: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output:** *empty object*

***

### topics.get

`courses.topics.get`

Returns a topic. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or topic, or for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if the requested course or topic does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.topics.get({ pathParams: {"id":"id-123","courseId":"courseId-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   id: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `topicId` | `string` | No | Unique identifier for the topic. Read-only. |
| `updateTime` | `string` | No | The time the topic was last updated by the system. Read-only. |
| `name` | `string` | No | The name of the topic, generated by the user. Leading and trailing whitespaces, if any, are trimmed. Also, multiple consecutive whitespaces are collapsed into one inside the name. The result must be a non-empty string. Topic names are case sensitive, and must be no longer than 100 characters. |
| `courseId` | `string` | No | Identifier of the course. Read-only. |

***

### topics.list

`courses.topics.list`

Returns the list of topics that the requester is permitted to view. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to access the requested course or for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if the requested course does not exist.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.courses.topics.list({ pathParams: {"courseId":"courseId-123"}, query: {"pageSize":1} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   pageToken?: string,
>   pageSize?: number,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `nextPageToken` | `string` | No | Token identifying the next page of results to return. If empty, no further results are available. |
| `topic` | `object[]` | No | Topic items that match the request. |

> [accordion] topic full type
>
> ```ts theme={null}
> {
>   topicId?: string,
>   updateTime?: string,
>   name?: string,
>   courseId?: string
> }[]
> ```

***

### topics.patch

`courses.topics.patch`

Updates one or more fields of a topic. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting developer project did not create the corresponding topic or for access errors. \* `INVALID_ARGUMENT` if the request is malformed. \* `FAILED_PRECONDITION` if there exists a topic in the course with the same name. \* `NOT_FOUND` if the requested course or topic does not exist

**Risk:** `write`

```ts theme={null}
await corsair.googleclassroom.api.courses.topics.patch({ pathParams: {"courseId":"courseId-123","id":"id-123"}, query: {"updateMask":"name"}, body: {"name":"Unit 1"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string,
>   id: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   updateMask: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   topicId?: string,
>   updateTime?: string,
>   name?: string,
>   courseId?: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `topicId` | `string` | No | Unique identifier for the topic. Read-only. |
| `updateTime` | `string` | No | The time the topic was last updated by the system. Read-only. |
| `name` | `string` | No | The name of the topic, generated by the user. Leading and trailing whitespaces, if any, are trimmed. Also, multiple consecutive whitespaces are collapsed into one inside the name. The result must be a non-empty string. Topic names are case sensitive, and must be no longer than 100 characters. |
| `courseId` | `string` | No | Identifier of the course. Read-only. |

***

### update

`courses.update`

Updates a course. Note: Unlike other fields, `levels` is not cleared if omitted from the request. The `UpdateCourse` method only modifies `levels` if it is explicitly provided; otherwise, the existing value is preserved. Use the `PatchCourse` method to clear the `levels` field. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to modify the requested course or for access errors. \* `NOT_FOUND` if no course exists with the requested ID. \* `FAILED_PRECONDITION` for the following request errors: \* CourseNotModifiable \* CourseTitleCannotContainUrl

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.courses.update({ pathParams: {"id":"id-123"}, query: {}, body: {"name":"Biology","ownerId":"me"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   id: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   courseState?: COURSE_STATE_UNSPECIFIED | ACTIVE | ARCHIVED | PROVISIONED | DECLINED | SUSPENDED,
>   descriptionHeading?: string,
>   guardiansEnabled?: boolean,
>   alternateLink?: string,
>   room?: string,
>   ownerId: string,
>   id?: string,
>   teacherGroupEmail?: string,
>   enrollmentCode?: string,
>   teacherFolder?: {
>     title?: string,
>     alternateLink?: string,
>     id?: string
>   },
>   name: string,
>   updateTime?: string,
>   levels?: string,
>   section?: string,
>   gradebookSettings?: {
>     gradeCategories?: {
>       defaultGradeDenominator?: number,
>       id?: string,
>       weight?: number,
>       name?: string
>     }[],
>     calculationType?: CALCULATION_TYPE_UNSPECIFIED | TOTAL_POINTS | WEIGHTED_CATEGORIES,
>     displaySetting?: DISPLAY_SETTING_UNSPECIFIED | SHOW_OVERALL_GRADE | HIDE_OVERALL_GRADE | SHOW_TEACHERS_ONLY
>   },
>   calendarId?: string,
>   subject?: string,
>   description?: string,
>   courseGroupEmail?: string,
>   creationTime?: string,
>   courseMaterialSets?: {
>     title?: string,
>     materials?: {
>       driveFile?: {
>         thumbnailUrl?: string,
>         alternateLink?: string,
>         id?: string,
>         title?: string
>       },
>       youTubeVideo?: {
>         id?: string,
>         title?: string,
>         alternateLink?: string,
>         thumbnailUrl?: string
>       },
>       link?: {
>         url?: string,
>         thumbnailUrl?: string,
>         title?: string
>       },
>       form?: {
>         title?: string,
>         formUrl?: string,
>         responseUrl?: string,
>         thumbnailUrl?: string
>       }
>     }[]
>   }[]
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `courseState` | `COURSE_STATE_UNSPECIFIED \| ACTIVE \| ARCHIVED \| PROVISIONED \| DECLINED \| SUSPENDED \| string` | No | State of the course. If unspecified, the default state is `PROVISIONED`. |
| `descriptionHeading` | `string` | No | Optional heading for the description. For example, "Welcome to 10th Grade Biology." If set, this field must be a valid UTF-8 string and no longer than 3600 characters. |
| `guardiansEnabled` | `boolean` | No | Whether or not guardian notifications are enabled for this course. Read-only. |
| `alternateLink` | `string` | No | Absolute link to this course in the Classroom web UI. Read-only. |
| `room` | `string` | No | Optional room location. For example, "301". If set, this field must be a valid UTF-8 string and no longer than 650 characters. |
| `ownerId` | `string` | No | The identifier of the owner of a course. When specified as a parameter of a create course request, this field is required. The identifier can be one of the following: \* the numeric identifier for the user \* the email address of the user \* the string literal `"me"`, indicating the requesting user This must be set in a create request. Admins can also specify this field in a patch course request to transfer ownership. In other contexts, it is read-only. |
| `id` | `string` | No | Identifier for this course assigned by Classroom. When creating a course, you may optionally set this identifier to an alias string in the request to create a corresponding alias. The `id` is still assigned by Classroom and cannot be updated after the course is created. Specifying this field in a course update mask results in an error. |
| `teacherGroupEmail` | `string` | No | The email address of a Google group containing all teachers of the course. This group does not accept email and can only be used for permissions. Read-only. |
| `enrollmentCode` | `string` | No | Enrollment code to use when joining this course. Specifying this field in a course update mask results in an error. Read-only. |
| `teacherFolder` | `object` | No | Information about a Drive Folder that is shared with all teachers of the course. This field will only be set for teachers of the course and domain administrators. Read-only. |
| `name` | `string` | No | Name of the course. For example, "10th Grade Biology". The name is required. It must be between 1 and 750 characters and a valid UTF-8 string. |
| `updateTime` | `string` | No | Time of the most recent update to this course. Specifying this field in a course update mask results in an error. Read-only. |
| `levels` | `string` | No | Optional. Levels for the course. Examples: "9th grade", "Middle school", "4th - 5th", "K-2", "3000". If set, this field must be a valid UTF-8 string and fewer than 1000 characters. This field can only be cleared using the `PatchCourse` method. |
| `section` | `string` | No | Section of the course. For example, "Period 2". If set, this field must be a valid UTF-8 string and no longer than 2800 characters. |
| `gradebookSettings` | `object` | No | The gradebook settings that specify how a student's overall grade for the course will be calculated and who it will be displayed to. Read-only. |
| `calendarId` | `string` | No | The Calendar ID for a calendar that all course members can see, to which Classroom adds events for course work and announcements in the course. The Calendar for a course is created asynchronously when the course is set to `CourseState.ACTIVE` for the first time (at creation time or when it is updated to `ACTIVE` through the UI or the API). The Calendar ID will not be populated until the creation process is completed. Read-only. |
| `subject` | `string` | No | Optional. The subject of the course. |
| `description` | `string` | No | Optional description. For example, "We'll be learning about the structure of living creatures from a combination of textbooks, guest lectures, and lab work. Expect to be excited!" If set, this field must be a valid UTF-8 string and no longer than 30,000 characters. |
| `courseGroupEmail` | `string` | No | The email address of a Google group containing all members of the course. This group does not accept email and can only be used for permissions. Read-only. |
| `creationTime` | `string` | No | Creation time of the course. Specifying this field in a course update mask results in an error. Read-only. |
| `courseMaterialSets` | `object[]` | No | Sets of materials that appear on the "about" page of this course. Read-only. |

> [accordion] teacherFolder full type
>
> ```ts theme={null}
> {
>   title?: string,
>   alternateLink?: string,
>   id?: string
> }
> ```

> [accordion] gradebookSettings full type
>
> ```ts theme={null}
> {
>   gradeCategories?: {
>     defaultGradeDenominator?: number,
>     id?: string,
>     weight?: number,
>     name?: string
>   }[],
>   calculationType?: CALCULATION_TYPE_UNSPECIFIED | TOTAL_POINTS | WEIGHTED_CATEGORIES | string,
>   displaySetting?: DISPLAY_SETTING_UNSPECIFIED | SHOW_OVERALL_GRADE | HIDE_OVERALL_GRADE | SHOW_TEACHERS_ONLY | string
> }
> ```

> [accordion] courseMaterialSets full type
>
> ```ts theme={null}
> {
>   title?: string,
>   materials?: {
>     driveFile?: {
>       thumbnailUrl?: string,
>       alternateLink?: string,
>       id?: string,
>       title?: string
>     },
>     youTubeVideo?: {
>       id?: string,
>       title?: string,
>       alternateLink?: string,
>       thumbnailUrl?: string
>     },
>     link?: {
>       url?: string,
>       thumbnailUrl?: string,
>       title?: string
>     },
>     form?: {
>       title?: string,
>       formUrl?: string,
>       responseUrl?: string,
>       thumbnailUrl?: string
>     }
>   }[]
> }[]
> ```

***

### updateGradingPeriodSettings

`courses.updateGradingPeriodSettings`

Updates grading period settings of a course. Individual grading periods can be added, removed, or modified using this method. The requesting user and course owner must be eligible to modify Grading Periods. For details, see [licensing requirements](https://developers.google.com/workspace/classroom/grading-periods/manage-grading-periods#licensing_requirements). This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to modify the grading period settings in a course or for access errors: \* UserIneligibleToUpdateGradingPeriodSettings \* `INVALID_ARGUMENT` if the request is malformed. \* `NOT_FOUND` if the requested course does not exist.

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.courses.updateGradingPeriodSettings({ pathParams: {"courseId":"courseId-123"}, query: {"updateMask":"gradingPeriods"}, body: {"gradingPeriods":[]} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   courseId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   updateMask?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   gradingPeriods?: {
>     endDate: {
>       year?: number,
>       month?: number,
>       day?: number
>     },
>     title: string,
>     startDate: {
>       year?: number,
>       month?: number,
>       day?: number
>     },
>     id?: string
>   }[],
>   applyToExistingCoursework?: boolean
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `gradingPeriods` | `object[]` | No | The list of grading periods in a specific course. Grading periods must not have overlapping date ranges and must be listed in chronological order. Each grading period must have a unique title within a course. |
| `applyToExistingCoursework` | `boolean` | No | Supports toggling the application of grading periods on existing stream items. Once set, this value is persisted meaning that it does not need to be set in every request to update `GradingPeriodSettings`. If not previously set, the default is False. |

> [accordion] gradingPeriods full type
>
> ```ts theme={null}
> {
>   endDate?: {
>     year?: number,
>     month?: number,
>     day?: number
>   },
>   title?: string,
>   startDate?: {
>     year?: number,
>     month?: number,
>     day?: number
>   },
>   id?: string
> }[]
> ```

***

## Invitations

### accept

`invitations.accept`

Accepts an invitation, removing it and adding the invited user to the teachers or students (as appropriate) of the specified course. Only the invited user may accept an invitation. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to accept the requested invitation or for access errors. \* `FAILED_PRECONDITION` for the following request errors: \* CourseMemberLimitReached \* CourseNotModifiable \* CourseTeacherLimitReached \* UserGroupsMembershipLimitReached \* `NOT_FOUND` if no invitation exists with the requested ID.

**Risk:** `write`

```ts theme={null}
await corsair.googleclassroom.api.invitations.accept({ pathParams: {"id":"id-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   id: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output:** *empty object*

***

### create

`invitations.create`

Creates an invitation. Only one invitation for a user and course may exist at a time. Delete and re-create an invitation to make changes. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to create invitations for this course or for access errors. \* `NOT_FOUND` if the course or the user does not exist. \* `FAILED_PRECONDITION`: \* if the requested user's account is disabled. \* if the user already has this role or a role with greater permissions. \* for the following request errors: \* IneligibleOwner \* `ALREADY_EXISTS` if an invitation for the specified user and course already exists.

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.invitations.create({ pathParams: {}, query: {}, body: {"userId":"student-123","courseId":"course-123","role":"STUDENT"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   userId: string,
>   courseId: string,
>   role: STUDENT | TEACHER | OWNER
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | No | Identifier assigned by Classroom. Read-only. |
| `role` | `COURSE_ROLE_UNSPECIFIED \| STUDENT \| TEACHER \| OWNER \| string` | No | Role to invite the user to have. Must not be `COURSE_ROLE_UNSPECIFIED`. |
| `userId` | `string` | No | Identifier of the invited user. When specified as a parameter of a request, this identifier can be set to one of the following: \* the numeric identifier for the user \* the email address of the user \* the string literal `"me"`, indicating the requesting user |
| `courseId` | `string` | No | Identifier of the course to invite the user to. |

***

### delete

`invitations.delete`

Deletes an invitation. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to delete the requested invitation or for access errors. \* `NOT_FOUND` if no invitation exists with the requested ID.

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.invitations.delete({ pathParams: {"id":"id-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   id: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output:** *empty object*

***

### get

`invitations.get`

Returns an invitation. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to view the requested invitation or for access errors. \* `NOT_FOUND` if no invitation exists with the requested ID.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.invitations.get({ pathParams: {"id":"id-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   id: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `id` | `string` | No | Identifier assigned by Classroom. Read-only. |
| `role` | `COURSE_ROLE_UNSPECIFIED \| STUDENT \| TEACHER \| OWNER \| string` | No | Role to invite the user to have. Must not be `COURSE_ROLE_UNSPECIFIED`. |
| `userId` | `string` | No | Identifier of the invited user. When specified as a parameter of a request, this identifier can be set to one of the following: \* the numeric identifier for the user \* the email address of the user \* the string literal `"me"`, indicating the requesting user |
| `courseId` | `string` | No | Identifier of the course to invite the user to. |

***

### list

`invitations.list`

Returns a list of invitations that the requesting user is permitted to view, restricted to those that match the list request. *Note:* At least one of `user_id` or `course_id` must be supplied. Both fields can be supplied. This method returns the following error codes: \* `PERMISSION_DENIED` for access errors.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.invitations.list({ pathParams: {}, query: {"userId":"student-123","courseId":"course-123","pageSize":1} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   pageSize?: number,
>   pageToken?: string,
>   userId?: string,
>   courseId?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `invitations` | `object[]` | No | Invitations that match the list request. |
| `nextPageToken` | `string` | No | Token identifying the next page of results to return. If empty, no further results are available. |

> [accordion] invitations full type
>
> ```ts theme={null}
> {
>   id?: string,
>   role?: COURSE_ROLE_UNSPECIFIED | STUDENT | TEACHER | OWNER | string,
>   userId?: string,
>   courseId?: string
> }[]
> ```

***

## Registrations

### create

`registrations.create`

Creates a `Registration`, causing Classroom to start sending notifications from the provided `feed` to the destination provided in `cloudPubSubTopic`. Returns the created `Registration`. Currently, this will be the same as the argument, but with server-assigned fields such as `expiry_time` and `id` filled in. Note that any value specified for the `expiry_time` or `id` fields will be ignored. While Classroom may validate the `cloudPubSubTopic` and return errors on a best effort basis, it is the caller's responsibility to ensure that it exists and that Classroom has permission to publish to it. This method may return the following error codes: \* `PERMISSION_DENIED` if: \* the authenticated user does not have permission to receive notifications from the requested field; or \* the current user has not granted access to the current Cloud project with the appropriate scope for the requested feed. Note that domain-wide delegation of authority is not currently supported for this purpose. If the request has the appropriate scope, but no grant exists, a Request Errors is returned. \* another access error is encountered. \* `INVALID_ARGUMENT` if: \* no `cloudPubsubTopic` is specified, or the specified `cloudPubsubTopic` is not valid; or \* no `feed` is specified, or the specified `feed` is not valid. \* `NOT_FOUND` if: \* the specified `feed` cannot be located, or the requesting user does not have permission to determine whether or not it exists; or \* the specified `cloudPubsubTopic` cannot be located, or Classroom has not been granted permission to publish to it.

**Risk:** `write`

```ts theme={null}
await corsair.googleclassroom.api.registrations.create({ pathParams: {}, query: {}, body: {"cloudPubsubTopic":{"topicName":"projects/classroom-demo/topics/updates"},"feed":{"feedType":"COURSE_ROSTER_CHANGES","courseRosterChangesInfo":{"courseId":"course-123"}}} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

A valid Google Cloud Pub/Sub topic must exist and grant Classroom permission to publish. The plugin manages the registration but does not receive messages.

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   cloudPubsubTopic: {
>     topicName?: string
>   },
>   feed: {
>     feedType?: FEED_TYPE_UNSPECIFIED | DOMAIN_ROSTER_CHANGES | COURSE_ROSTER_CHANGES | COURSE_WORK_CHANGES,
>     courseWorkChangesInfo?: {
>       courseId?: string
>     },
>     courseRosterChangesInfo?: {
>       courseId?: string
>     }
>   }
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `expiryTime` | `string` | No | The time until which the `Registration` is effective. This is a read-only field assigned by the server. |
| `registrationId` | `string` | No | A server-generated unique identifier for this `Registration`. Read-only. |
| `cloudPubsubTopic` | `object` | No | The Cloud Pub/Sub topic that notifications are to be sent to. |
| `feed` | `object` | No | Specification for the class of notifications that Classroom should deliver to the destination. |

> [accordion] cloudPubsubTopic full type
>
> ```ts theme={null}
> {
>   topicName?: string
> }
> ```

> [accordion] feed full type
>
> ```ts theme={null}
> {
>   feedType?: FEED_TYPE_UNSPECIFIED | DOMAIN_ROSTER_CHANGES | COURSE_ROSTER_CHANGES | COURSE_WORK_CHANGES | string,
>   courseWorkChangesInfo?: {
>     courseId?: string
>   },
>   courseRosterChangesInfo?: {
>     courseId?: string
>   }
> }
> ```

***

### delete

`registrations.delete`

Deletes a `Registration`, causing Classroom to stop sending notifications for that `Registration`.

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.registrations.delete({ pathParams: {"registrationId":"registrationId-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   registrationId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output:** *empty object*

***

## User Profiles

### get

`userProfiles.get`

Returns a user profile. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to access this user profile, if no profile exists with the requested ID, or for access errors.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.userProfiles.get({ pathParams: {"userId":"userId-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

Profile email and photo fields require their corresponding Google OAuth scopes and may be absent when those scopes are not granted.

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   userId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `name` | `object` | No | Name of the user. Read-only. |
| `id` | `string` | No | Identifier of the user. Read-only. |
| `photoUrl` | `string` | No | URL of user's profile photo. Must request `https://www.googleapis.com/auth/classroom.profile.photos` scope for this field to be populated in a response body. Read-only. |
| `permissions` | `object[]` | No | Global permissions of the user. Read-only. |
| `emailAddress` | `string` | No | Email address of the user. Must request `https://www.googleapis.com/auth/classroom.profile.emails` scope for this field to be populated in a response body. Read-only. |
| `verifiedTeacher` | `boolean` | No | Represents whether a Google Workspace for Education user's domain administrator has explicitly verified them as being a teacher. This field is always false if the user is not a member of a Google Workspace for Education domain. Read-only |

> [accordion] name full type
>
> ```ts theme={null}
> {
>   fullName?: string,
>   familyName?: string,
>   givenName?: string
> }
> ```

> [accordion] permissions full type
>
> ```ts theme={null}
> {
>   permission?: PERMISSION_UNSPECIFIED | CREATE_COURSE | string
> }[]
> ```

***

### guardianInvitations.create

`userProfiles.guardianInvitations.create`

Creates a guardian invitation, and sends an email to the guardian asking them to confirm that they are the student's guardian. Once the guardian accepts the invitation, their `state` will change to `COMPLETED` and they will start receiving guardian notifications. A `Guardian` resource will also be created to represent the active guardian. The request object must have the `student_id` and `invited_email_address` fields set. Failing to set these fields, or setting any other fields in the request, will result in an error. This method returns the following error codes: \* `PERMISSION_DENIED` if the current user does not have permission to manage guardians, if the guardian in question has already rejected too many requests for that student, if guardians are not enabled for the domain in question, or for other access errors. \* `RESOURCE_EXHAUSTED` if the student or guardian has exceeded the guardian link limit. \* `INVALID_ARGUMENT` if the guardian email address is not valid (for example, if it is too long), or if the format of the student ID provided cannot be recognized (it is not an email address, nor a `user_id` from this API). This error will also be returned if read-only fields are set, or if the `state` field is set to to a value other than `PENDING`. \* `NOT_FOUND` if the student ID provided is a valid student ID, but Classroom has no record of that student. \* `ALREADY_EXISTS` if there is already a pending guardian invitation for the student and `invited_email_address` provided, or if the provided `invited_email_address` matches the Google account of an existing `Guardian` for this user.

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.userProfiles.guardianInvitations.create({ pathParams: {"studentId":"studentId-123"}, query: {}, body: {"studentId":"student-123","invitedEmailAddress":"guardian@school.test"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   studentId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   studentId: string,
>   invitedEmailAddress: string
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `invitationId` | `string` | No | Unique identifier for this invitation. Read-only. |
| `creationTime` | `string` | No | The time that this invitation was created. Read-only. |
| `studentId` | `string` | No | ID of the student (in standard format) |
| `state` | `GUARDIAN_INVITATION_STATE_UNSPECIFIED \| PENDING \| COMPLETE \| string` | No | The state that this invitation is in. |
| `invitedEmailAddress` | `string` | No | Email address that the invitation was sent to. This field is only visible to domain administrators. |

***

### guardianInvitations.get

`userProfiles.guardianInvitations.get`

Returns a specific guardian invitation. This method returns the following error codes: \* `PERMISSION_DENIED` if the requesting user is not permitted to view guardian invitations for the student identified by the `student_id`, if guardians are not enabled for the domain in question, or for other access errors. \* `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot be recognized (it is not an email address, nor a `student_id` from the API, nor the literal string `me`). \* `NOT_FOUND` if Classroom cannot find any record of the given student or `invitation_id`. May also be returned if the student exists, but the requesting user does not have access to see that student.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.userProfiles.guardianInvitations.get({ pathParams: {"invitationId":"invitationId-123","studentId":"studentId-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   studentId: string,
>   invitationId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `invitationId` | `string` | No | Unique identifier for this invitation. Read-only. |
| `creationTime` | `string` | No | The time that this invitation was created. Read-only. |
| `studentId` | `string` | No | ID of the student (in standard format) |
| `state` | `GUARDIAN_INVITATION_STATE_UNSPECIFIED \| PENDING \| COMPLETE \| string` | No | The state that this invitation is in. |
| `invitedEmailAddress` | `string` | No | Email address that the invitation was sent to. This field is only visible to domain administrators. |

***

### guardianInvitations.list

`userProfiles.guardianInvitations.list`

Returns a list of guardian invitations that the requesting user is permitted to view, filtered by the parameters provided. This method returns the following error codes: \* `PERMISSION_DENIED` if a `student_id` is specified, and the requesting user is not permitted to view guardian invitations for that student, if `"-"` is specified as the `student_id` and the user is not a domain administrator, if guardians are not enabled for the domain in question, or for other access errors. \* `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot be recognized (it is not an email address, nor a `student_id` from the API, nor the literal string `me`). May also be returned if an invalid `page_token` or `state` is provided. \* `NOT_FOUND` if a `student_id` is specified, and its format can be recognized, but Classroom has no record of that student.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.userProfiles.guardianInvitations.list({ pathParams: {"studentId":"studentId-123"}, query: {"invitedEmailAddress":"guardian@school.test","pageSize":1,"states":["PENDING"]} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   studentId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   pageSize?: number,
>   states?: (GUARDIAN_INVITATION_STATE_UNSPECIFIED | PENDING | COMPLETE)[],
>   invitedEmailAddress?: string,
>   pageToken?: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `nextPageToken` | `string` | No | Token identifying the next page of results to return. If empty, no further results are available. |
| `guardianInvitations` | `object[]` | No | Guardian invitations that matched the list request. |

> [accordion] guardianInvitations full type
>
> ```ts theme={null}
> {
>   invitationId?: string,
>   creationTime?: string,
>   studentId?: string,
>   state?: GUARDIAN_INVITATION_STATE_UNSPECIFIED | PENDING | COMPLETE | string,
>   invitedEmailAddress?: string
> }[]
> ```

***

### guardianInvitations.patch

`userProfiles.guardianInvitations.patch`

Modifies a guardian invitation. Currently, the only valid modification is to change the `state` from `PENDING` to `COMPLETE`. This has the effect of withdrawing the invitation. This method returns the following error codes: \* `PERMISSION_DENIED` if the current user does not have permission to manage guardians, if guardians are not enabled for the domain in question or for other access errors. \* `FAILED_PRECONDITION` if the guardian link is not in the `PENDING` state. \* `INVALID_ARGUMENT` if the format of the student ID provided cannot be recognized (it is not an email address, nor a `user_id` from this API), or if the passed `GuardianInvitation` has a `state` other than `COMPLETE`, or if it modifies fields other than `state`. \* `NOT_FOUND` if the student ID provided is a valid student ID, but Classroom has no record of that student, or if the `id` field does not refer to a guardian invitation known to Classroom.

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.userProfiles.guardianInvitations.patch({ pathParams: {"invitationId":"invitationId-123","studentId":"studentId-123"}, query: {"updateMask":"state"}, body: {"state":"COMPLETE"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `object` | Yes | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   studentId: string,
>   invitationId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   updateMask: string,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

> [accordion] body full type
>
> ```ts theme={null}
> {
>   state: COMPLETE
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `invitationId` | `string` | No | Unique identifier for this invitation. Read-only. |
| `creationTime` | `string` | No | The time that this invitation was created. Read-only. |
| `studentId` | `string` | No | ID of the student (in standard format) |
| `state` | `GUARDIAN_INVITATION_STATE_UNSPECIFIED \| PENDING \| COMPLETE \| string` | No | The state that this invitation is in. |
| `invitedEmailAddress` | `string` | No | Email address that the invitation was sent to. This field is only visible to domain administrators. |

***

### guardians.delete

`userProfiles.guardians.delete`

Deletes a guardian. The guardian will no longer receive guardian notifications and the guardian will no longer be accessible via the API. This method returns the following error codes: \* `PERMISSION_DENIED` if no user that matches the provided `student_id` is visible to the requesting user, if the requesting user is not permitted to manage guardians for the student identified by the `student_id`, if guardians are not enabled for the domain in question, or for other access errors. \* `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot be recognized (it is not an email address, nor a `student_id` from the API). \* `NOT_FOUND` if the requesting user is permitted to modify guardians for the requested `student_id`, but no `Guardian` record exists for that student with the provided `guardian_id`.

**Risk:** `destructive`

```ts theme={null}
await corsair.googleclassroom.api.userProfiles.guardians.delete({ pathParams: {"guardianId":"guardianId-123","studentId":"studentId-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   studentId: string,
>   guardianId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output:** *empty object*

***

### guardians.get

`userProfiles.guardians.get`

Returns a specific guardian. This method returns the following error codes: \* `PERMISSION_DENIED` if no user that matches the provided `student_id` is visible to the requesting user, if the requesting user is not permitted to view guardian information for the student identified by the `student_id`, if guardians are not enabled for the domain in question, or for other access errors. \* `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot be recognized (it is not an email address, nor a `student_id` from the API, nor the literal string `me`). \* `NOT_FOUND` if the requesting user is permitted to view guardians for the requested `student_id`, but no `Guardian` record exists for that student that matches the provided `guardian_id`.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.userProfiles.guardians.get({ pathParams: {"guardianId":"guardianId-123","studentId":"studentId-123"}, query: {} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   guardianId: string,
>   studentId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `guardianProfile` | `object` | No | User profile for the guardian. |
| `studentId` | `string` | No | Identifier for the student to whom the guardian relationship applies. |
| `guardianId` | `string` | No | Identifier for the guardian. |
| `invitedEmailAddress` | `string` | No | The email address to which the initial guardian invitation was sent. This field is only visible to domain administrators. |

> [accordion] guardianProfile full type
>
> ```ts theme={null}
> {
>   name?: {
>     fullName?: string,
>     familyName?: string,
>     givenName?: string
>   },
>   id?: string,
>   photoUrl?: string,
>   permissions?: {
>     permission?: PERMISSION_UNSPECIFIED | CREATE_COURSE | string
>   }[],
>   emailAddress?: string,
>   verifiedTeacher?: boolean
> }
> ```

***

### guardians.list

`userProfiles.guardians.list`

Returns a list of guardians that the requesting user is permitted to view, restricted to those that match the request. To list guardians for any student that the requesting user may view guardians for, use the literal character `-` for the student ID. This method returns the following error codes: \* `PERMISSION_DENIED` if a `student_id` is specified, and the requesting user is not permitted to view guardian information for that student, if `"-"` is specified as the `student_id` and the user is not a domain administrator, if guardians are not enabled for the domain in question, if the `invited_email_address` filter is set by a user who is not a domain administrator, or for other access errors. \* `INVALID_ARGUMENT` if a `student_id` is specified, but its format cannot be recognized (it is not an email address, nor a `student_id` from the API, nor the literal string `me`). May also be returned if an invalid `page_token` is provided. \* `NOT_FOUND` if a `student_id` is specified, and its format can be recognized, but Classroom has no record of that student.

**Risk:** `read`

```ts theme={null}
await corsair.googleclassroom.api.userProfiles.guardians.list({ pathParams: {"studentId":"studentId-123"}, query: {"pageSize":1,"invitedEmailAddress":"guardian@school.test"} });
```

**Input**

| Name | Type | Required | Description |
| - | - | - | - |
| `pathParams` | `object` | Yes | — |
| `query` | `object` | Yes | — |
| `body` | `never` | No | — |

> [accordion] pathParams full type
>
> ```ts theme={null}
> {
>   studentId: string
> }
> ```

> [accordion] query full type
>
> ```ts theme={null}
> {
>   invitedEmailAddress?: string,
>   pageToken?: string,
>   pageSize?: number,
>   fields?: string,
>   prettyPrint?: boolean,
>   quotaUser?: string,
>   alt?: json
> }
> ```

**Output**

| Name | Type | Required | Description |
| - | - | - | - |
| `nextPageToken` | `string` | No | Token identifying the next page of results to return. If empty, no further results are available. |
| `guardians` | `object[]` | No | Guardians on this page of results that met the criteria specified in the request. |

> [accordion] guardians full type
>
> ```ts theme={null}
> {
>   guardianProfile?: {
>     name?: {
>       fullName?: string,
>       familyName?: string,
>       givenName?: string
>     },
>     id?: string,
>     photoUrl?: string,
>     permissions?: {
>       permission?: PERMISSION_UNSPECIFIED | CREATE_COURSE | string
>     }[],
>     emailAddress?: string,
>     verifiedTeacher?: boolean
>   },
>   studentId?: string,
>   guardianId?: string,
>   invitedEmailAddress?: string
> }[]
> ```

***


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.