1<html><body> 2<style> 3 4body, h1, h2, h3, div, span, p, pre, a { 5 margin: 0; 6 padding: 0; 7 border: 0; 8 font-weight: inherit; 9 font-style: inherit; 10 font-size: 100%; 11 font-family: inherit; 12 vertical-align: baseline; 13} 14 15body { 16 font-size: 13px; 17 padding: 1em; 18} 19 20h1 { 21 font-size: 26px; 22 margin-bottom: 1em; 23} 24 25h2 { 26 font-size: 24px; 27 margin-bottom: 1em; 28} 29 30h3 { 31 font-size: 20px; 32 margin-bottom: 1em; 33 margin-top: 1em; 34} 35 36pre, code { 37 line-height: 1.5; 38 font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace; 39} 40 41pre { 42 margin-top: 0.5em; 43} 44 45h1, h2, h3, p { 46 font-family: Arial, sans serif; 47} 48 49h1, h2, h3 { 50 border-bottom: solid #CCC 1px; 51} 52 53.toc_element { 54 margin-top: 0.5em; 55} 56 57.firstline { 58 margin-left: 2 em; 59} 60 61.method { 62 margin-top: 1em; 63 border: solid 1px #CCC; 64 padding: 1em; 65 background: #EEE; 66} 67 68.details { 69 font-weight: bold; 70 font-size: 14px; 71} 72 73</style> 74 75<h1><a href="classroom_v1.html">Google Classroom API</a> . <a href="classroom_v1.courses.html">courses</a> . <a href="classroom_v1.courses.announcements.html">announcements</a></h1> 76<h2>Instance Methods</h2> 77<p class="toc_element"> 78 <code><a href="#close">close()</a></code></p> 79<p class="firstline">Close httplib2 connections.</p> 80<p class="toc_element"> 81 <code><a href="#create">create(courseId, body=None, x__xgafv=None)</a></code></p> 82<p class="firstline">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</p> 83<p class="toc_element"> 84 <code><a href="#delete">delete(courseId, id, x__xgafv=None)</a></code></p> 85<p class="firstline">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.</p> 86<p class="toc_element"> 87 <code><a href="#get">get(courseId, id, x__xgafv=None)</a></code></p> 88<p class="firstline">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.</p> 89<p class="toc_element"> 90 <code><a href="#list">list(courseId, announcementStates=None, orderBy=None, pageSize=None, pageToken=None, x__xgafv=None)</a></code></p> 91<p class="firstline">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.</p> 92<p class="toc_element"> 93 <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p> 94<p class="firstline">Retrieves the next page of results.</p> 95<p class="toc_element"> 96 <code><a href="#modifyAssignees">modifyAssignees(courseId, id, body=None, x__xgafv=None)</a></code></p> 97<p class="firstline">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.</p> 98<p class="toc_element"> 99 <code><a href="#patch">patch(courseId, id, body=None, updateMask=None, x__xgafv=None)</a></code></p> 100<p class="firstline">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</p> 101<h3>Method Details</h3> 102<div class="method"> 103 <code class="details" id="close">close()</code> 104 <pre>Close httplib2 connections.</pre> 105</div> 106 107<div class="method"> 108 <code class="details" id="create">create(courseId, body=None, x__xgafv=None)</code> 109 <pre>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 110 111Args: 112 courseId: string, Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. (required) 113 body: object, The request body. 114 The object takes the form of: 115 116{ # Announcement created by a teacher for students of the course 117 "alternateLink": "A String", # Absolute link to this announcement in the Classroom web UI. This is only populated if `state` is `PUBLISHED`. Read-only. 118 "assigneeMode": "A String", # Assignee mode of the announcement. If unspecified, the default value is `ALL_STUDENTS`. 119 "courseId": "A String", # Identifier of the course. Read-only. 120 "creationTime": "A String", # Timestamp when this announcement was created. Read-only. 121 "creatorUserId": "A String", # Identifier for the user that created the announcement. Read-only. 122 "id": "A String", # Classroom-assigned identifier of this announcement, unique per course. Read-only. 123 "individualStudentsOptions": { # Assignee details about a coursework/announcement. This field is set if and only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. # 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. 124 "studentIds": [ # Identifiers for the students that have access to the coursework/announcement. 125 "A String", 126 ], 127 }, 128 "materials": [ # Additional materials. Announcements must have no more than 20 material items. 129 { # Material attached to course work. When creating attachments, setting the `form` field is not supported. 130 "driveFile": { # Drive file that is used as material for course work. # Google Drive file material. 131 "driveFile": { # Representation of a Google Drive file. # Drive file details. 132 "alternateLink": "A String", # URL that can be used to access the Drive item. Read-only. 133 "id": "A String", # Drive API resource ID. 134 "thumbnailUrl": "A String", # URL of a thumbnail image of the Drive item. Read-only. 135 "title": "A String", # Title of the Drive item. Read-only. 136 }, 137 "shareMode": "A String", # Mechanism by which students access the Drive item. 138 }, 139 "form": { # Google Forms item. # Google Forms material. 140 "formUrl": "A String", # URL of the form. 141 "responseUrl": "A String", # URL of the form responses document. Only set if respsonses have been recorded and only when the requesting user is an editor of the form. Read-only. 142 "thumbnailUrl": "A String", # URL of a thumbnail image of the Form. Read-only. 143 "title": "A String", # Title of the Form. Read-only. 144 }, 145 "link": { # URL item. # Link material. On creation, this is upgraded to a more appropriate type if possible, and this is reflected in the response. 146 "thumbnailUrl": "A String", # URL of a thumbnail image of the target URL. Read-only. 147 "title": "A String", # Title of the target of the URL. Read-only. 148 "url": "A String", # URL to link to. This must be a valid UTF-8 string containing between 1 and 2024 characters. 149 }, 150 "youtubeVideo": { # YouTube video item. # YouTube video material. 151 "alternateLink": "A String", # URL that can be used to view the YouTube video. Read-only. 152 "id": "A String", # YouTube API resource ID. 153 "thumbnailUrl": "A String", # URL of a thumbnail image of the YouTube video. Read-only. 154 "title": "A String", # Title of the YouTube video. Read-only. 155 }, 156 }, 157 ], 158 "scheduledTime": "A String", # Optional timestamp when this announcement is scheduled to be published. 159 "state": "A String", # Status of this announcement. If unspecified, the default state is `DRAFT`. 160 "text": "A String", # Description of this announcement. The text must be a valid UTF-8 string containing no more than 30,000 characters. 161 "updateTime": "A String", # Timestamp of the most recent change to this announcement. Read-only. 162} 163 164 x__xgafv: string, V1 error format. 165 Allowed values 166 1 - v1 error format 167 2 - v2 error format 168 169Returns: 170 An object of the form: 171 172 { # Announcement created by a teacher for students of the course 173 "alternateLink": "A String", # Absolute link to this announcement in the Classroom web UI. This is only populated if `state` is `PUBLISHED`. Read-only. 174 "assigneeMode": "A String", # Assignee mode of the announcement. If unspecified, the default value is `ALL_STUDENTS`. 175 "courseId": "A String", # Identifier of the course. Read-only. 176 "creationTime": "A String", # Timestamp when this announcement was created. Read-only. 177 "creatorUserId": "A String", # Identifier for the user that created the announcement. Read-only. 178 "id": "A String", # Classroom-assigned identifier of this announcement, unique per course. Read-only. 179 "individualStudentsOptions": { # Assignee details about a coursework/announcement. This field is set if and only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. # 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. 180 "studentIds": [ # Identifiers for the students that have access to the coursework/announcement. 181 "A String", 182 ], 183 }, 184 "materials": [ # Additional materials. Announcements must have no more than 20 material items. 185 { # Material attached to course work. When creating attachments, setting the `form` field is not supported. 186 "driveFile": { # Drive file that is used as material for course work. # Google Drive file material. 187 "driveFile": { # Representation of a Google Drive file. # Drive file details. 188 "alternateLink": "A String", # URL that can be used to access the Drive item. Read-only. 189 "id": "A String", # Drive API resource ID. 190 "thumbnailUrl": "A String", # URL of a thumbnail image of the Drive item. Read-only. 191 "title": "A String", # Title of the Drive item. Read-only. 192 }, 193 "shareMode": "A String", # Mechanism by which students access the Drive item. 194 }, 195 "form": { # Google Forms item. # Google Forms material. 196 "formUrl": "A String", # URL of the form. 197 "responseUrl": "A String", # URL of the form responses document. Only set if respsonses have been recorded and only when the requesting user is an editor of the form. Read-only. 198 "thumbnailUrl": "A String", # URL of a thumbnail image of the Form. Read-only. 199 "title": "A String", # Title of the Form. Read-only. 200 }, 201 "link": { # URL item. # Link material. On creation, this is upgraded to a more appropriate type if possible, and this is reflected in the response. 202 "thumbnailUrl": "A String", # URL of a thumbnail image of the target URL. Read-only. 203 "title": "A String", # Title of the target of the URL. Read-only. 204 "url": "A String", # URL to link to. This must be a valid UTF-8 string containing between 1 and 2024 characters. 205 }, 206 "youtubeVideo": { # YouTube video item. # YouTube video material. 207 "alternateLink": "A String", # URL that can be used to view the YouTube video. Read-only. 208 "id": "A String", # YouTube API resource ID. 209 "thumbnailUrl": "A String", # URL of a thumbnail image of the YouTube video. Read-only. 210 "title": "A String", # Title of the YouTube video. Read-only. 211 }, 212 }, 213 ], 214 "scheduledTime": "A String", # Optional timestamp when this announcement is scheduled to be published. 215 "state": "A String", # Status of this announcement. If unspecified, the default state is `DRAFT`. 216 "text": "A String", # Description of this announcement. The text must be a valid UTF-8 string containing no more than 30,000 characters. 217 "updateTime": "A String", # Timestamp of the most recent change to this announcement. Read-only. 218}</pre> 219</div> 220 221<div class="method"> 222 <code class="details" id="delete">delete(courseId, id, x__xgafv=None)</code> 223 <pre>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. 224 225Args: 226 courseId: string, Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. (required) 227 id: string, Identifier of the announcement to delete. This identifier is a Classroom-assigned identifier. (required) 228 x__xgafv: string, V1 error format. 229 Allowed values 230 1 - v1 error format 231 2 - v2 error format 232 233Returns: 234 An object of the form: 235 236 { # A generic empty message that you can re-use to avoid defining duplicated empty messages in your APIs. A typical example is to use it as the request or the response type of an API method. For instance: service Foo { rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty); } The JSON representation for `Empty` is empty JSON object `{}`. 237}</pre> 238</div> 239 240<div class="method"> 241 <code class="details" id="get">get(courseId, id, x__xgafv=None)</code> 242 <pre>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. 243 244Args: 245 courseId: string, Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. (required) 246 id: string, Identifier of the announcement. (required) 247 x__xgafv: string, V1 error format. 248 Allowed values 249 1 - v1 error format 250 2 - v2 error format 251 252Returns: 253 An object of the form: 254 255 { # Announcement created by a teacher for students of the course 256 "alternateLink": "A String", # Absolute link to this announcement in the Classroom web UI. This is only populated if `state` is `PUBLISHED`. Read-only. 257 "assigneeMode": "A String", # Assignee mode of the announcement. If unspecified, the default value is `ALL_STUDENTS`. 258 "courseId": "A String", # Identifier of the course. Read-only. 259 "creationTime": "A String", # Timestamp when this announcement was created. Read-only. 260 "creatorUserId": "A String", # Identifier for the user that created the announcement. Read-only. 261 "id": "A String", # Classroom-assigned identifier of this announcement, unique per course. Read-only. 262 "individualStudentsOptions": { # Assignee details about a coursework/announcement. This field is set if and only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. # 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. 263 "studentIds": [ # Identifiers for the students that have access to the coursework/announcement. 264 "A String", 265 ], 266 }, 267 "materials": [ # Additional materials. Announcements must have no more than 20 material items. 268 { # Material attached to course work. When creating attachments, setting the `form` field is not supported. 269 "driveFile": { # Drive file that is used as material for course work. # Google Drive file material. 270 "driveFile": { # Representation of a Google Drive file. # Drive file details. 271 "alternateLink": "A String", # URL that can be used to access the Drive item. Read-only. 272 "id": "A String", # Drive API resource ID. 273 "thumbnailUrl": "A String", # URL of a thumbnail image of the Drive item. Read-only. 274 "title": "A String", # Title of the Drive item. Read-only. 275 }, 276 "shareMode": "A String", # Mechanism by which students access the Drive item. 277 }, 278 "form": { # Google Forms item. # Google Forms material. 279 "formUrl": "A String", # URL of the form. 280 "responseUrl": "A String", # URL of the form responses document. Only set if respsonses have been recorded and only when the requesting user is an editor of the form. Read-only. 281 "thumbnailUrl": "A String", # URL of a thumbnail image of the Form. Read-only. 282 "title": "A String", # Title of the Form. Read-only. 283 }, 284 "link": { # URL item. # Link material. On creation, this is upgraded to a more appropriate type if possible, and this is reflected in the response. 285 "thumbnailUrl": "A String", # URL of a thumbnail image of the target URL. Read-only. 286 "title": "A String", # Title of the target of the URL. Read-only. 287 "url": "A String", # URL to link to. This must be a valid UTF-8 string containing between 1 and 2024 characters. 288 }, 289 "youtubeVideo": { # YouTube video item. # YouTube video material. 290 "alternateLink": "A String", # URL that can be used to view the YouTube video. Read-only. 291 "id": "A String", # YouTube API resource ID. 292 "thumbnailUrl": "A String", # URL of a thumbnail image of the YouTube video. Read-only. 293 "title": "A String", # Title of the YouTube video. Read-only. 294 }, 295 }, 296 ], 297 "scheduledTime": "A String", # Optional timestamp when this announcement is scheduled to be published. 298 "state": "A String", # Status of this announcement. If unspecified, the default state is `DRAFT`. 299 "text": "A String", # Description of this announcement. The text must be a valid UTF-8 string containing no more than 30,000 characters. 300 "updateTime": "A String", # Timestamp of the most recent change to this announcement. Read-only. 301}</pre> 302</div> 303 304<div class="method"> 305 <code class="details" id="list">list(courseId, announcementStates=None, orderBy=None, pageSize=None, pageToken=None, x__xgafv=None)</code> 306 <pre>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. 307 308Args: 309 courseId: string, Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. (required) 310 announcementStates: string, Restriction on the `state` of announcements returned. If this argument is left unspecified, the default value is `PUBLISHED`. (repeated) 311 Allowed values 312 ANNOUNCEMENT_STATE_UNSPECIFIED - No state specified. This is never returned. 313 PUBLISHED - Status for announcement that has been published. This is the default state. 314 DRAFT - Status for an announcement that is not yet published. Announcement in this state is visible only to course teachers and domain administrators. 315 DELETED - Status for announcement that was published but is now deleted. Announcement in this state is visible only to course teachers and domain administrators. Announcement in this state is deleted after some time. 316 orderBy: string, Optional sort ordering for results. A comma-separated list of fields with an optional sort direction keyword. Supported field is `updateTime`. Supported direction keywords are `asc` and `desc`. If not specified, `updateTime desc` is the default behavior. Examples: `updateTime asc`, `updateTime` 317 pageSize: integer, Maximum number of items to return. Zero or unspecified indicates that the server may assign a maximum. The server may return fewer than the specified number of results. 318 pageToken: string, nextPageToken value returned from a previous list call, indicating that the subsequent page of results should be returned. The list request must be otherwise identical to the one that resulted in this token. 319 x__xgafv: string, V1 error format. 320 Allowed values 321 1 - v1 error format 322 2 - v2 error format 323 324Returns: 325 An object of the form: 326 327 { # Response when listing course work. 328 "announcements": [ # Announcement items that match the request. 329 { # Announcement created by a teacher for students of the course 330 "alternateLink": "A String", # Absolute link to this announcement in the Classroom web UI. This is only populated if `state` is `PUBLISHED`. Read-only. 331 "assigneeMode": "A String", # Assignee mode of the announcement. If unspecified, the default value is `ALL_STUDENTS`. 332 "courseId": "A String", # Identifier of the course. Read-only. 333 "creationTime": "A String", # Timestamp when this announcement was created. Read-only. 334 "creatorUserId": "A String", # Identifier for the user that created the announcement. Read-only. 335 "id": "A String", # Classroom-assigned identifier of this announcement, unique per course. Read-only. 336 "individualStudentsOptions": { # Assignee details about a coursework/announcement. This field is set if and only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. # 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. 337 "studentIds": [ # Identifiers for the students that have access to the coursework/announcement. 338 "A String", 339 ], 340 }, 341 "materials": [ # Additional materials. Announcements must have no more than 20 material items. 342 { # Material attached to course work. When creating attachments, setting the `form` field is not supported. 343 "driveFile": { # Drive file that is used as material for course work. # Google Drive file material. 344 "driveFile": { # Representation of a Google Drive file. # Drive file details. 345 "alternateLink": "A String", # URL that can be used to access the Drive item. Read-only. 346 "id": "A String", # Drive API resource ID. 347 "thumbnailUrl": "A String", # URL of a thumbnail image of the Drive item. Read-only. 348 "title": "A String", # Title of the Drive item. Read-only. 349 }, 350 "shareMode": "A String", # Mechanism by which students access the Drive item. 351 }, 352 "form": { # Google Forms item. # Google Forms material. 353 "formUrl": "A String", # URL of the form. 354 "responseUrl": "A String", # URL of the form responses document. Only set if respsonses have been recorded and only when the requesting user is an editor of the form. Read-only. 355 "thumbnailUrl": "A String", # URL of a thumbnail image of the Form. Read-only. 356 "title": "A String", # Title of the Form. Read-only. 357 }, 358 "link": { # URL item. # Link material. On creation, this is upgraded to a more appropriate type if possible, and this is reflected in the response. 359 "thumbnailUrl": "A String", # URL of a thumbnail image of the target URL. Read-only. 360 "title": "A String", # Title of the target of the URL. Read-only. 361 "url": "A String", # URL to link to. This must be a valid UTF-8 string containing between 1 and 2024 characters. 362 }, 363 "youtubeVideo": { # YouTube video item. # YouTube video material. 364 "alternateLink": "A String", # URL that can be used to view the YouTube video. Read-only. 365 "id": "A String", # YouTube API resource ID. 366 "thumbnailUrl": "A String", # URL of a thumbnail image of the YouTube video. Read-only. 367 "title": "A String", # Title of the YouTube video. Read-only. 368 }, 369 }, 370 ], 371 "scheduledTime": "A String", # Optional timestamp when this announcement is scheduled to be published. 372 "state": "A String", # Status of this announcement. If unspecified, the default state is `DRAFT`. 373 "text": "A String", # Description of this announcement. The text must be a valid UTF-8 string containing no more than 30,000 characters. 374 "updateTime": "A String", # Timestamp of the most recent change to this announcement. Read-only. 375 }, 376 ], 377 "nextPageToken": "A String", # Token identifying the next page of results to return. If empty, no further results are available. 378}</pre> 379</div> 380 381<div class="method"> 382 <code class="details" id="list_next">list_next(previous_request, previous_response)</code> 383 <pre>Retrieves the next page of results. 384 385Args: 386 previous_request: The request for the previous page. (required) 387 previous_response: The response from the request for the previous page. (required) 388 389Returns: 390 A request object that you can call 'execute()' on to request the next 391 page. Returns None if there are no more items in the collection. 392 </pre> 393</div> 394 395<div class="method"> 396 <code class="details" id="modifyAssignees">modifyAssignees(courseId, id, body=None, x__xgafv=None)</code> 397 <pre>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. 398 399Args: 400 courseId: string, Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. (required) 401 id: string, Identifier of the announcement. (required) 402 body: object, The request body. 403 The object takes the form of: 404 405{ # Request to modify assignee mode and options of an announcement. 406 "assigneeMode": "A String", # Mode of the announcement describing whether it is accessible by all students or specified individual students. 407 "modifyIndividualStudentsOptions": { # Contains fields to add or remove students from a course work or announcement where the `assigneeMode` is set to `INDIVIDUAL_STUDENTS`. # Set which students can view or cannot view the announcement. Must be specified only when `assigneeMode` is `INDIVIDUAL_STUDENTS`. 408 "addStudentIds": [ # IDs of students to be added as having access to this coursework/announcement. 409 "A String", 410 ], 411 "removeStudentIds": [ # IDs of students to be removed from having access to this coursework/announcement. 412 "A String", 413 ], 414 }, 415} 416 417 x__xgafv: string, V1 error format. 418 Allowed values 419 1 - v1 error format 420 2 - v2 error format 421 422Returns: 423 An object of the form: 424 425 { # Announcement created by a teacher for students of the course 426 "alternateLink": "A String", # Absolute link to this announcement in the Classroom web UI. This is only populated if `state` is `PUBLISHED`. Read-only. 427 "assigneeMode": "A String", # Assignee mode of the announcement. If unspecified, the default value is `ALL_STUDENTS`. 428 "courseId": "A String", # Identifier of the course. Read-only. 429 "creationTime": "A String", # Timestamp when this announcement was created. Read-only. 430 "creatorUserId": "A String", # Identifier for the user that created the announcement. Read-only. 431 "id": "A String", # Classroom-assigned identifier of this announcement, unique per course. Read-only. 432 "individualStudentsOptions": { # Assignee details about a coursework/announcement. This field is set if and only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. # 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. 433 "studentIds": [ # Identifiers for the students that have access to the coursework/announcement. 434 "A String", 435 ], 436 }, 437 "materials": [ # Additional materials. Announcements must have no more than 20 material items. 438 { # Material attached to course work. When creating attachments, setting the `form` field is not supported. 439 "driveFile": { # Drive file that is used as material for course work. # Google Drive file material. 440 "driveFile": { # Representation of a Google Drive file. # Drive file details. 441 "alternateLink": "A String", # URL that can be used to access the Drive item. Read-only. 442 "id": "A String", # Drive API resource ID. 443 "thumbnailUrl": "A String", # URL of a thumbnail image of the Drive item. Read-only. 444 "title": "A String", # Title of the Drive item. Read-only. 445 }, 446 "shareMode": "A String", # Mechanism by which students access the Drive item. 447 }, 448 "form": { # Google Forms item. # Google Forms material. 449 "formUrl": "A String", # URL of the form. 450 "responseUrl": "A String", # URL of the form responses document. Only set if respsonses have been recorded and only when the requesting user is an editor of the form. Read-only. 451 "thumbnailUrl": "A String", # URL of a thumbnail image of the Form. Read-only. 452 "title": "A String", # Title of the Form. Read-only. 453 }, 454 "link": { # URL item. # Link material. On creation, this is upgraded to a more appropriate type if possible, and this is reflected in the response. 455 "thumbnailUrl": "A String", # URL of a thumbnail image of the target URL. Read-only. 456 "title": "A String", # Title of the target of the URL. Read-only. 457 "url": "A String", # URL to link to. This must be a valid UTF-8 string containing between 1 and 2024 characters. 458 }, 459 "youtubeVideo": { # YouTube video item. # YouTube video material. 460 "alternateLink": "A String", # URL that can be used to view the YouTube video. Read-only. 461 "id": "A String", # YouTube API resource ID. 462 "thumbnailUrl": "A String", # URL of a thumbnail image of the YouTube video. Read-only. 463 "title": "A String", # Title of the YouTube video. Read-only. 464 }, 465 }, 466 ], 467 "scheduledTime": "A String", # Optional timestamp when this announcement is scheduled to be published. 468 "state": "A String", # Status of this announcement. If unspecified, the default state is `DRAFT`. 469 "text": "A String", # Description of this announcement. The text must be a valid UTF-8 string containing no more than 30,000 characters. 470 "updateTime": "A String", # Timestamp of the most recent change to this announcement. Read-only. 471}</pre> 472</div> 473 474<div class="method"> 475 <code class="details" id="patch">patch(courseId, id, body=None, updateMask=None, x__xgafv=None)</code> 476 <pre>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 477 478Args: 479 courseId: string, Identifier of the course. This identifier can be either the Classroom-assigned identifier or an alias. (required) 480 id: string, Identifier of the announcement. (required) 481 body: object, The request body. 482 The object takes the form of: 483 484{ # Announcement created by a teacher for students of the course 485 "alternateLink": "A String", # Absolute link to this announcement in the Classroom web UI. This is only populated if `state` is `PUBLISHED`. Read-only. 486 "assigneeMode": "A String", # Assignee mode of the announcement. If unspecified, the default value is `ALL_STUDENTS`. 487 "courseId": "A String", # Identifier of the course. Read-only. 488 "creationTime": "A String", # Timestamp when this announcement was created. Read-only. 489 "creatorUserId": "A String", # Identifier for the user that created the announcement. Read-only. 490 "id": "A String", # Classroom-assigned identifier of this announcement, unique per course. Read-only. 491 "individualStudentsOptions": { # Assignee details about a coursework/announcement. This field is set if and only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. # 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. 492 "studentIds": [ # Identifiers for the students that have access to the coursework/announcement. 493 "A String", 494 ], 495 }, 496 "materials": [ # Additional materials. Announcements must have no more than 20 material items. 497 { # Material attached to course work. When creating attachments, setting the `form` field is not supported. 498 "driveFile": { # Drive file that is used as material for course work. # Google Drive file material. 499 "driveFile": { # Representation of a Google Drive file. # Drive file details. 500 "alternateLink": "A String", # URL that can be used to access the Drive item. Read-only. 501 "id": "A String", # Drive API resource ID. 502 "thumbnailUrl": "A String", # URL of a thumbnail image of the Drive item. Read-only. 503 "title": "A String", # Title of the Drive item. Read-only. 504 }, 505 "shareMode": "A String", # Mechanism by which students access the Drive item. 506 }, 507 "form": { # Google Forms item. # Google Forms material. 508 "formUrl": "A String", # URL of the form. 509 "responseUrl": "A String", # URL of the form responses document. Only set if respsonses have been recorded and only when the requesting user is an editor of the form. Read-only. 510 "thumbnailUrl": "A String", # URL of a thumbnail image of the Form. Read-only. 511 "title": "A String", # Title of the Form. Read-only. 512 }, 513 "link": { # URL item. # Link material. On creation, this is upgraded to a more appropriate type if possible, and this is reflected in the response. 514 "thumbnailUrl": "A String", # URL of a thumbnail image of the target URL. Read-only. 515 "title": "A String", # Title of the target of the URL. Read-only. 516 "url": "A String", # URL to link to. This must be a valid UTF-8 string containing between 1 and 2024 characters. 517 }, 518 "youtubeVideo": { # YouTube video item. # YouTube video material. 519 "alternateLink": "A String", # URL that can be used to view the YouTube video. Read-only. 520 "id": "A String", # YouTube API resource ID. 521 "thumbnailUrl": "A String", # URL of a thumbnail image of the YouTube video. Read-only. 522 "title": "A String", # Title of the YouTube video. Read-only. 523 }, 524 }, 525 ], 526 "scheduledTime": "A String", # Optional timestamp when this announcement is scheduled to be published. 527 "state": "A String", # Status of this announcement. If unspecified, the default state is `DRAFT`. 528 "text": "A String", # Description of this announcement. The text must be a valid UTF-8 string containing no more than 30,000 characters. 529 "updateTime": "A String", # Timestamp of the most recent change to this announcement. Read-only. 530} 531 532 updateMask: string, Mask that identifies which fields on the announcement to update. This field is required to do an update. The update fails if invalid fields are specified. If a field supports empty values, it can be cleared by specifying it in the update mask and not in the Announcement object. If a field that does not support empty values is included in the update mask and not set in the Announcement object, an `INVALID_ARGUMENT` error is returned. The following fields may be specified by teachers: * `text` * `state` * `scheduled_time` 533 x__xgafv: string, V1 error format. 534 Allowed values 535 1 - v1 error format 536 2 - v2 error format 537 538Returns: 539 An object of the form: 540 541 { # Announcement created by a teacher for students of the course 542 "alternateLink": "A String", # Absolute link to this announcement in the Classroom web UI. This is only populated if `state` is `PUBLISHED`. Read-only. 543 "assigneeMode": "A String", # Assignee mode of the announcement. If unspecified, the default value is `ALL_STUDENTS`. 544 "courseId": "A String", # Identifier of the course. Read-only. 545 "creationTime": "A String", # Timestamp when this announcement was created. Read-only. 546 "creatorUserId": "A String", # Identifier for the user that created the announcement. Read-only. 547 "id": "A String", # Classroom-assigned identifier of this announcement, unique per course. Read-only. 548 "individualStudentsOptions": { # Assignee details about a coursework/announcement. This field is set if and only if `assigneeMode` is `INDIVIDUAL_STUDENTS`. # 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. 549 "studentIds": [ # Identifiers for the students that have access to the coursework/announcement. 550 "A String", 551 ], 552 }, 553 "materials": [ # Additional materials. Announcements must have no more than 20 material items. 554 { # Material attached to course work. When creating attachments, setting the `form` field is not supported. 555 "driveFile": { # Drive file that is used as material for course work. # Google Drive file material. 556 "driveFile": { # Representation of a Google Drive file. # Drive file details. 557 "alternateLink": "A String", # URL that can be used to access the Drive item. Read-only. 558 "id": "A String", # Drive API resource ID. 559 "thumbnailUrl": "A String", # URL of a thumbnail image of the Drive item. Read-only. 560 "title": "A String", # Title of the Drive item. Read-only. 561 }, 562 "shareMode": "A String", # Mechanism by which students access the Drive item. 563 }, 564 "form": { # Google Forms item. # Google Forms material. 565 "formUrl": "A String", # URL of the form. 566 "responseUrl": "A String", # URL of the form responses document. Only set if respsonses have been recorded and only when the requesting user is an editor of the form. Read-only. 567 "thumbnailUrl": "A String", # URL of a thumbnail image of the Form. Read-only. 568 "title": "A String", # Title of the Form. Read-only. 569 }, 570 "link": { # URL item. # Link material. On creation, this is upgraded to a more appropriate type if possible, and this is reflected in the response. 571 "thumbnailUrl": "A String", # URL of a thumbnail image of the target URL. Read-only. 572 "title": "A String", # Title of the target of the URL. Read-only. 573 "url": "A String", # URL to link to. This must be a valid UTF-8 string containing between 1 and 2024 characters. 574 }, 575 "youtubeVideo": { # YouTube video item. # YouTube video material. 576 "alternateLink": "A String", # URL that can be used to view the YouTube video. Read-only. 577 "id": "A String", # YouTube API resource ID. 578 "thumbnailUrl": "A String", # URL of a thumbnail image of the YouTube video. Read-only. 579 "title": "A String", # Title of the YouTube video. Read-only. 580 }, 581 }, 582 ], 583 "scheduledTime": "A String", # Optional timestamp when this announcement is scheduled to be published. 584 "state": "A String", # Status of this announcement. If unspecified, the default state is `DRAFT`. 585 "text": "A String", # Description of this announcement. The text must be a valid UTF-8 string containing no more than 30,000 characters. 586 "updateTime": "A String", # Timestamp of the most recent change to this announcement. Read-only. 587}</pre> 588</div> 589 590</body></html>