• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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="#create">create(courseId, body, x__xgafv=None)</a></code></p>
79<p class="firstline">Creates an announcement.</p>
80<p class="toc_element">
81  <code><a href="#delete">delete(courseId, id, x__xgafv=None)</a></code></p>
82<p class="firstline">Deletes an announcement.</p>
83<p class="toc_element">
84  <code><a href="#get">get(courseId, id, x__xgafv=None)</a></code></p>
85<p class="firstline">Returns an announcement.</p>
86<p class="toc_element">
87  <code><a href="#list">list(courseId, orderBy=None, pageSize=None, announcementStates=None, pageToken=None, x__xgafv=None)</a></code></p>
88<p class="firstline">Returns a list of announcements that the requester is permitted to view.</p>
89<p class="toc_element">
90  <code><a href="#list_next">list_next(previous_request, previous_response)</a></code></p>
91<p class="firstline">Retrieves the next page of results.</p>
92<p class="toc_element">
93  <code><a href="#modifyAssignees">modifyAssignees(courseId, id, body, x__xgafv=None)</a></code></p>
94<p class="firstline">Modifies assignee mode and options of an announcement.</p>
95<p class="toc_element">
96  <code><a href="#patch">patch(courseId, id, body, updateMask=None, x__xgafv=None)</a></code></p>
97<p class="firstline">Updates one or more fields of an announcement.</p>
98<h3>Method Details</h3>
99<div class="method">
100    <code class="details" id="create">create(courseId, body, x__xgafv=None)</code>
101  <pre>Creates an announcement.
102
103This method returns the following error codes:
104
105* `PERMISSION_DENIED` if the requesting user is not permitted to access the
106requested course, create announcements in the requested course, share a
107Drive attachment, or for access errors.
108* `INVALID_ARGUMENT` if the request is malformed.
109* `NOT_FOUND` if the requested course does not exist.
110* `FAILED_PRECONDITION` for the following request error:
111    * AttachmentNotVisible
112
113Args:
114  courseId: string, Identifier of the course.
115This identifier can be either the Classroom-assigned identifier or an
116alias. (required)
117  body: object, The request body. (required)
118    The object takes the form of:
119
120{ # Announcement created by a teacher for students of the course
121  "updateTime": "A String", # Timestamp of the most recent change to this announcement.
122      #
123      # Read-only.
124  "scheduledTime": "A String", # Optional timestamp when this announcement is scheduled to be published.
125  "creatorUserId": "A String", # Identifier for the user that created the announcement.
126      #
127      # Read-only.
128  "courseId": "A String", # Identifier of the course.
129      #
130      # Read-only.
131  "text": "A String", # Description of this announcement.
132      # The text must be a valid UTF-8 string containing no more
133      # than 30,000 characters.
134  "alternateLink": "A String", # Absolute link to this announcement in the Classroom web UI.
135      # This is only populated if `state` is `PUBLISHED`.
136      #
137      # Read-only.
138  "creationTime": "A String", # Timestamp when this announcement was created.
139      #
140      # Read-only.
141  "assigneeMode": "A String", # Assignee mode of the announcement.
142      # If unspecified, the default value is `ALL_STUDENTS`.
143  "state": "A String", # Status of this announcement.
144      # If unspecified, the default state is `DRAFT`.
145  "materials": [ # Additional materials.
146      #
147      # Announcements must have no more than 20 material items.
148    { # Material attached to course work.
149        #
150        # When creating attachments, setting the `form` field is not supported.
151      "youtubeVideo": { # YouTube video item. # YouTube video material.
152        "alternateLink": "A String", # URL that can be used to view the YouTube video.
153            #
154            # Read-only.
155        "thumbnailUrl": "A String", # URL of a thumbnail image of the YouTube video.
156            #
157            # Read-only.
158        "id": "A String", # YouTube API resource ID.
159        "title": "A String", # Title of the YouTube video.
160            #
161            # Read-only.
162      },
163      "driveFile": { # Drive file that is used as material for course work. # Google Drive file material.
164        "driveFile": { # Representation of a Google Drive file. # Drive file details.
165          "thumbnailUrl": "A String", # URL of a thumbnail image of the Drive item.
166              #
167              # Read-only.
168          "alternateLink": "A String", # URL that can be used to access the Drive item.
169              #
170              # Read-only.
171          "id": "A String", # Drive API resource ID.
172          "title": "A String", # Title of the Drive item.
173              #
174              # Read-only.
175        },
176        "shareMode": "A String", # Mechanism by which students access the Drive item.
177      },
178      "link": { # URL item. # Link material. On creation, will be upgraded to a more appropriate type
179          # if possible, and this will be reflected in the response.
180        "url": "A String", # URL to link to.
181            # This must be a valid UTF-8 string containing between 1 and 2024 characters.
182        "thumbnailUrl": "A String", # URL of a thumbnail image of the target URL.
183            #
184            # Read-only.
185        "title": "A String", # Title of the target of the URL.
186            #
187            # Read-only.
188      },
189      "form": { # Google Forms item. # Google Forms material.
190        "formUrl": "A String", # URL of the form.
191        "thumbnailUrl": "A String", # URL of a thumbnail image of the Form.
192            #
193            # Read-only.
194        "responseUrl": "A String", # URL of the form responses document.
195            # Only set if respsonses have been recorded and only when the
196            # requesting user is an editor of the form.
197            #
198            # Read-only.
199        "title": "A String", # Title of the Form.
200            #
201            # Read-only.
202      },
203    },
204  ],
205  "individualStudentsOptions": { # Assignee details about a coursework/announcement. # Identifiers of students with access to the announcement.
206      # This field is set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`.
207      # If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students
208      # specified in this field will be able to see the announcement.
209      # This field is set if and only if `assigneeMode` is `INDIVIDUAL_STUDENTS`.
210    "studentIds": [ # Identifiers for the students that have access to the
211        # coursework/announcement.
212      "A String",
213    ],
214  },
215  "id": "A String", # Classroom-assigned identifier of this announcement, unique per course.
216      #
217      # Read-only.
218}
219
220  x__xgafv: string, V1 error format.
221    Allowed values
222      1 - v1 error format
223      2 - v2 error format
224
225Returns:
226  An object of the form:
227
228    { # Announcement created by a teacher for students of the course
229    "updateTime": "A String", # Timestamp of the most recent change to this announcement.
230        #
231        # Read-only.
232    "scheduledTime": "A String", # Optional timestamp when this announcement is scheduled to be published.
233    "creatorUserId": "A String", # Identifier for the user that created the announcement.
234        #
235        # Read-only.
236    "courseId": "A String", # Identifier of the course.
237        #
238        # Read-only.
239    "text": "A String", # Description of this announcement.
240        # The text must be a valid UTF-8 string containing no more
241        # than 30,000 characters.
242    "alternateLink": "A String", # Absolute link to this announcement in the Classroom web UI.
243        # This is only populated if `state` is `PUBLISHED`.
244        #
245        # Read-only.
246    "creationTime": "A String", # Timestamp when this announcement was created.
247        #
248        # Read-only.
249    "assigneeMode": "A String", # Assignee mode of the announcement.
250        # If unspecified, the default value is `ALL_STUDENTS`.
251    "state": "A String", # Status of this announcement.
252        # If unspecified, the default state is `DRAFT`.
253    "materials": [ # Additional materials.
254        #
255        # Announcements must have no more than 20 material items.
256      { # Material attached to course work.
257          #
258          # When creating attachments, setting the `form` field is not supported.
259        "youtubeVideo": { # YouTube video item. # YouTube video material.
260          "alternateLink": "A String", # URL that can be used to view the YouTube video.
261              #
262              # Read-only.
263          "thumbnailUrl": "A String", # URL of a thumbnail image of the YouTube video.
264              #
265              # Read-only.
266          "id": "A String", # YouTube API resource ID.
267          "title": "A String", # Title of the YouTube video.
268              #
269              # Read-only.
270        },
271        "driveFile": { # Drive file that is used as material for course work. # Google Drive file material.
272          "driveFile": { # Representation of a Google Drive file. # Drive file details.
273            "thumbnailUrl": "A String", # URL of a thumbnail image of the Drive item.
274                #
275                # Read-only.
276            "alternateLink": "A String", # URL that can be used to access the Drive item.
277                #
278                # Read-only.
279            "id": "A String", # Drive API resource ID.
280            "title": "A String", # Title of the Drive item.
281                #
282                # Read-only.
283          },
284          "shareMode": "A String", # Mechanism by which students access the Drive item.
285        },
286        "link": { # URL item. # Link material. On creation, will be upgraded to a more appropriate type
287            # if possible, and this will be reflected in the response.
288          "url": "A String", # URL to link to.
289              # This must be a valid UTF-8 string containing between 1 and 2024 characters.
290          "thumbnailUrl": "A String", # URL of a thumbnail image of the target URL.
291              #
292              # Read-only.
293          "title": "A String", # Title of the target of the URL.
294              #
295              # Read-only.
296        },
297        "form": { # Google Forms item. # Google Forms material.
298          "formUrl": "A String", # URL of the form.
299          "thumbnailUrl": "A String", # URL of a thumbnail image of the Form.
300              #
301              # Read-only.
302          "responseUrl": "A String", # URL of the form responses document.
303              # Only set if respsonses have been recorded and only when the
304              # requesting user is an editor of the form.
305              #
306              # Read-only.
307          "title": "A String", # Title of the Form.
308              #
309              # Read-only.
310        },
311      },
312    ],
313    "individualStudentsOptions": { # Assignee details about a coursework/announcement. # Identifiers of students with access to the announcement.
314        # This field is set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`.
315        # If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students
316        # specified in this field will be able to see the announcement.
317        # This field is set if and only if `assigneeMode` is `INDIVIDUAL_STUDENTS`.
318      "studentIds": [ # Identifiers for the students that have access to the
319          # coursework/announcement.
320        "A String",
321      ],
322    },
323    "id": "A String", # Classroom-assigned identifier of this announcement, unique per course.
324        #
325        # Read-only.
326  }</pre>
327</div>
328
329<div class="method">
330    <code class="details" id="delete">delete(courseId, id, x__xgafv=None)</code>
331  <pre>Deletes an announcement.
332
333This request must be made by the Developer Console project of the
334[OAuth client ID](https://support.google.com/cloud/answer/6158849) used to
335create the corresponding announcement item.
336
337This method returns the following error codes:
338
339* `PERMISSION_DENIED` if the requesting developer project did not create
340the corresponding announcement, if the requesting user is not permitted
341to delete the requested course or for access errors.
342* `FAILED_PRECONDITION` if the requested announcement has already been
343deleted.
344* `NOT_FOUND` if no course exists with the requested ID.
345
346Args:
347  courseId: string, Identifier of the course.
348This identifier can be either the Classroom-assigned identifier or an
349alias. (required)
350  id: string, Identifier of the announcement to delete.
351This identifier is a Classroom-assigned identifier. (required)
352  x__xgafv: string, V1 error format.
353    Allowed values
354      1 - v1 error format
355      2 - v2 error format
356
357Returns:
358  An object of the form:
359
360    { # A generic empty message that you can re-use to avoid defining duplicated
361      # empty messages in your APIs. A typical example is to use it as the request
362      # or the response type of an API method. For instance:
363      #
364      #     service Foo {
365      #       rpc Bar(google.protobuf.Empty) returns (google.protobuf.Empty);
366      #     }
367      #
368      # The JSON representation for `Empty` is empty JSON object `{}`.
369  }</pre>
370</div>
371
372<div class="method">
373    <code class="details" id="get">get(courseId, id, x__xgafv=None)</code>
374  <pre>Returns an announcement.
375
376This method returns the following error codes:
377
378* `PERMISSION_DENIED` if the requesting user is not permitted to access the
379requested course or announcement, or for access errors.
380* `INVALID_ARGUMENT` if the request is malformed.
381* `NOT_FOUND` if the requested course or announcement does not exist.
382
383Args:
384  courseId: string, Identifier of the course.
385This identifier can be either the Classroom-assigned identifier or an
386alias. (required)
387  id: string, Identifier of the announcement. (required)
388  x__xgafv: string, V1 error format.
389    Allowed values
390      1 - v1 error format
391      2 - v2 error format
392
393Returns:
394  An object of the form:
395
396    { # Announcement created by a teacher for students of the course
397    "updateTime": "A String", # Timestamp of the most recent change to this announcement.
398        #
399        # Read-only.
400    "scheduledTime": "A String", # Optional timestamp when this announcement is scheduled to be published.
401    "creatorUserId": "A String", # Identifier for the user that created the announcement.
402        #
403        # Read-only.
404    "courseId": "A String", # Identifier of the course.
405        #
406        # Read-only.
407    "text": "A String", # Description of this announcement.
408        # The text must be a valid UTF-8 string containing no more
409        # than 30,000 characters.
410    "alternateLink": "A String", # Absolute link to this announcement in the Classroom web UI.
411        # This is only populated if `state` is `PUBLISHED`.
412        #
413        # Read-only.
414    "creationTime": "A String", # Timestamp when this announcement was created.
415        #
416        # Read-only.
417    "assigneeMode": "A String", # Assignee mode of the announcement.
418        # If unspecified, the default value is `ALL_STUDENTS`.
419    "state": "A String", # Status of this announcement.
420        # If unspecified, the default state is `DRAFT`.
421    "materials": [ # Additional materials.
422        #
423        # Announcements must have no more than 20 material items.
424      { # Material attached to course work.
425          #
426          # When creating attachments, setting the `form` field is not supported.
427        "youtubeVideo": { # YouTube video item. # YouTube video material.
428          "alternateLink": "A String", # URL that can be used to view the YouTube video.
429              #
430              # Read-only.
431          "thumbnailUrl": "A String", # URL of a thumbnail image of the YouTube video.
432              #
433              # Read-only.
434          "id": "A String", # YouTube API resource ID.
435          "title": "A String", # Title of the YouTube video.
436              #
437              # Read-only.
438        },
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            "thumbnailUrl": "A String", # URL of a thumbnail image of the Drive item.
442                #
443                # Read-only.
444            "alternateLink": "A String", # URL that can be used to access the Drive item.
445                #
446                # Read-only.
447            "id": "A String", # Drive API resource ID.
448            "title": "A String", # Title of the Drive item.
449                #
450                # Read-only.
451          },
452          "shareMode": "A String", # Mechanism by which students access the Drive item.
453        },
454        "link": { # URL item. # Link material. On creation, will be upgraded to a more appropriate type
455            # if possible, and this will be reflected in the response.
456          "url": "A String", # URL to link to.
457              # This must be a valid UTF-8 string containing between 1 and 2024 characters.
458          "thumbnailUrl": "A String", # URL of a thumbnail image of the target URL.
459              #
460              # Read-only.
461          "title": "A String", # Title of the target of the URL.
462              #
463              # Read-only.
464        },
465        "form": { # Google Forms item. # Google Forms material.
466          "formUrl": "A String", # URL of the form.
467          "thumbnailUrl": "A String", # URL of a thumbnail image of the Form.
468              #
469              # Read-only.
470          "responseUrl": "A String", # URL of the form responses document.
471              # Only set if respsonses have been recorded and only when the
472              # requesting user is an editor of the form.
473              #
474              # Read-only.
475          "title": "A String", # Title of the Form.
476              #
477              # Read-only.
478        },
479      },
480    ],
481    "individualStudentsOptions": { # Assignee details about a coursework/announcement. # Identifiers of students with access to the announcement.
482        # This field is set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`.
483        # If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students
484        # specified in this field will be able to see the announcement.
485        # This field is set if and only if `assigneeMode` is `INDIVIDUAL_STUDENTS`.
486      "studentIds": [ # Identifiers for the students that have access to the
487          # coursework/announcement.
488        "A String",
489      ],
490    },
491    "id": "A String", # Classroom-assigned identifier of this announcement, unique per course.
492        #
493        # Read-only.
494  }</pre>
495</div>
496
497<div class="method">
498    <code class="details" id="list">list(courseId, orderBy=None, pageSize=None, announcementStates=None, pageToken=None, x__xgafv=None)</code>
499  <pre>Returns a list of announcements that the requester is permitted to view.
500
501Course students may only view `PUBLISHED` announcements. Course teachers
502and domain administrators may view all announcements.
503
504This method returns the following error codes:
505
506* `PERMISSION_DENIED` if the requesting user is not permitted to access
507the requested course or for access errors.
508* `INVALID_ARGUMENT` if the request is malformed.
509* `NOT_FOUND` if the requested course does not exist.
510
511Args:
512  courseId: string, Identifier of the course.
513This identifier can be either the Classroom-assigned identifier or an
514alias. (required)
515  orderBy: string, Optional sort ordering for results. A comma-separated list of fields with
516an optional sort direction keyword. Supported field is `updateTime`.
517Supported direction keywords are `asc` and `desc`.
518If not specified, `updateTime desc` is the default behavior.
519Examples: `updateTime asc`, `updateTime`
520  pageSize: integer, Maximum number of items to return. Zero or unspecified indicates that the
521server may assign a maximum.
522
523The server may return fewer than the specified number of results.
524  announcementStates: string, Restriction on the `state` of announcements returned.
525If this argument is left unspecified, the default value is `PUBLISHED`. (repeated)
526  pageToken: string, nextPageToken
527value returned from a previous
528list call,
529indicating that the subsequent page of results should be returned.
530
531The list request
532must be otherwise identical to the one that resulted in this token.
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    { # Response when listing course work.
542    "nextPageToken": "A String", # Token identifying the next page of results to return. If empty, no further
543        # results are available.
544    "announcements": [ # Announcement items that match the request.
545      { # Announcement created by a teacher for students of the course
546        "updateTime": "A String", # Timestamp of the most recent change to this announcement.
547            #
548            # Read-only.
549        "scheduledTime": "A String", # Optional timestamp when this announcement is scheduled to be published.
550        "creatorUserId": "A String", # Identifier for the user that created the announcement.
551            #
552            # Read-only.
553        "courseId": "A String", # Identifier of the course.
554            #
555            # Read-only.
556        "text": "A String", # Description of this announcement.
557            # The text must be a valid UTF-8 string containing no more
558            # than 30,000 characters.
559        "alternateLink": "A String", # Absolute link to this announcement in the Classroom web UI.
560            # This is only populated if `state` is `PUBLISHED`.
561            #
562            # Read-only.
563        "creationTime": "A String", # Timestamp when this announcement was created.
564            #
565            # Read-only.
566        "assigneeMode": "A String", # Assignee mode of the announcement.
567            # If unspecified, the default value is `ALL_STUDENTS`.
568        "state": "A String", # Status of this announcement.
569            # If unspecified, the default state is `DRAFT`.
570        "materials": [ # Additional materials.
571            #
572            # Announcements must have no more than 20 material items.
573          { # Material attached to course work.
574              #
575              # When creating attachments, setting the `form` field is not supported.
576            "youtubeVideo": { # YouTube video item. # YouTube video material.
577              "alternateLink": "A String", # URL that can be used to view the YouTube video.
578                  #
579                  # Read-only.
580              "thumbnailUrl": "A String", # URL of a thumbnail image of the YouTube video.
581                  #
582                  # Read-only.
583              "id": "A String", # YouTube API resource ID.
584              "title": "A String", # Title of the YouTube video.
585                  #
586                  # Read-only.
587            },
588            "driveFile": { # Drive file that is used as material for course work. # Google Drive file material.
589              "driveFile": { # Representation of a Google Drive file. # Drive file details.
590                "thumbnailUrl": "A String", # URL of a thumbnail image of the Drive item.
591                    #
592                    # Read-only.
593                "alternateLink": "A String", # URL that can be used to access the Drive item.
594                    #
595                    # Read-only.
596                "id": "A String", # Drive API resource ID.
597                "title": "A String", # Title of the Drive item.
598                    #
599                    # Read-only.
600              },
601              "shareMode": "A String", # Mechanism by which students access the Drive item.
602            },
603            "link": { # URL item. # Link material. On creation, will be upgraded to a more appropriate type
604                # if possible, and this will be reflected in the response.
605              "url": "A String", # URL to link to.
606                  # This must be a valid UTF-8 string containing between 1 and 2024 characters.
607              "thumbnailUrl": "A String", # URL of a thumbnail image of the target URL.
608                  #
609                  # Read-only.
610              "title": "A String", # Title of the target of the URL.
611                  #
612                  # Read-only.
613            },
614            "form": { # Google Forms item. # Google Forms material.
615              "formUrl": "A String", # URL of the form.
616              "thumbnailUrl": "A String", # URL of a thumbnail image of the Form.
617                  #
618                  # Read-only.
619              "responseUrl": "A String", # URL of the form responses document.
620                  # Only set if respsonses have been recorded and only when the
621                  # requesting user is an editor of the form.
622                  #
623                  # Read-only.
624              "title": "A String", # Title of the Form.
625                  #
626                  # Read-only.
627            },
628          },
629        ],
630        "individualStudentsOptions": { # Assignee details about a coursework/announcement. # Identifiers of students with access to the announcement.
631            # This field is set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`.
632            # If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students
633            # specified in this field will be able to see the announcement.
634            # This field is set if and only if `assigneeMode` is `INDIVIDUAL_STUDENTS`.
635          "studentIds": [ # Identifiers for the students that have access to the
636              # coursework/announcement.
637            "A String",
638          ],
639        },
640        "id": "A String", # Classroom-assigned identifier of this announcement, unique per course.
641            #
642            # Read-only.
643      },
644    ],
645  }</pre>
646</div>
647
648<div class="method">
649    <code class="details" id="list_next">list_next(previous_request, previous_response)</code>
650  <pre>Retrieves the next page of results.
651
652Args:
653  previous_request: The request for the previous page. (required)
654  previous_response: The response from the request for the previous page. (required)
655
656Returns:
657  A request object that you can call 'execute()' on to request the next
658  page. Returns None if there are no more items in the collection.
659    </pre>
660</div>
661
662<div class="method">
663    <code class="details" id="modifyAssignees">modifyAssignees(courseId, id, body, x__xgafv=None)</code>
664  <pre>Modifies assignee mode and options of an announcement.
665
666Only a teacher of the course that contains the announcement may
667call this method.
668
669This method returns the following error codes:
670
671* `PERMISSION_DENIED` if the requesting user is not permitted to access the
672requested course or course work or for access errors.
673* `INVALID_ARGUMENT` if the request is malformed.
674* `NOT_FOUND` if the requested course or course work does not exist.
675
676Args:
677  courseId: string, Identifier of the course.
678This identifier can be either the Classroom-assigned identifier or an
679alias. (required)
680  id: string, Identifier of the announcement. (required)
681  body: object, The request body. (required)
682    The object takes the form of:
683
684{ # Request to modify assignee mode and options of an announcement.
685    "assigneeMode": "A String", # Mode of the announcement describing whether it will be accessible by all
686        # students or specified individual students.
687    "modifyIndividualStudentsOptions": { # Contains fields to add or remove students from a course work or announcement # Set which students can view or cannot view the announcement.
688        # Must be specified only when `assigneeMode` is `INDIVIDUAL_STUDENTS`.
689        # where the `assigneeMode` is set to `INDIVIDUAL_STUDENTS`.
690      "addStudentIds": [ # Ids of students to be added as having access to this
691          # coursework/announcement.
692        "A String",
693      ],
694      "removeStudentIds": [ # Ids of students to be removed from having access to this
695          # coursework/announcement.
696        "A String",
697      ],
698    },
699  }
700
701  x__xgafv: string, V1 error format.
702    Allowed values
703      1 - v1 error format
704      2 - v2 error format
705
706Returns:
707  An object of the form:
708
709    { # Announcement created by a teacher for students of the course
710    "updateTime": "A String", # Timestamp of the most recent change to this announcement.
711        #
712        # Read-only.
713    "scheduledTime": "A String", # Optional timestamp when this announcement is scheduled to be published.
714    "creatorUserId": "A String", # Identifier for the user that created the announcement.
715        #
716        # Read-only.
717    "courseId": "A String", # Identifier of the course.
718        #
719        # Read-only.
720    "text": "A String", # Description of this announcement.
721        # The text must be a valid UTF-8 string containing no more
722        # than 30,000 characters.
723    "alternateLink": "A String", # Absolute link to this announcement in the Classroom web UI.
724        # This is only populated if `state` is `PUBLISHED`.
725        #
726        # Read-only.
727    "creationTime": "A String", # Timestamp when this announcement was created.
728        #
729        # Read-only.
730    "assigneeMode": "A String", # Assignee mode of the announcement.
731        # If unspecified, the default value is `ALL_STUDENTS`.
732    "state": "A String", # Status of this announcement.
733        # If unspecified, the default state is `DRAFT`.
734    "materials": [ # Additional materials.
735        #
736        # Announcements must have no more than 20 material items.
737      { # Material attached to course work.
738          #
739          # When creating attachments, setting the `form` field is not supported.
740        "youtubeVideo": { # YouTube video item. # YouTube video material.
741          "alternateLink": "A String", # URL that can be used to view the YouTube video.
742              #
743              # Read-only.
744          "thumbnailUrl": "A String", # URL of a thumbnail image of the YouTube video.
745              #
746              # Read-only.
747          "id": "A String", # YouTube API resource ID.
748          "title": "A String", # Title of the YouTube video.
749              #
750              # Read-only.
751        },
752        "driveFile": { # Drive file that is used as material for course work. # Google Drive file material.
753          "driveFile": { # Representation of a Google Drive file. # Drive file details.
754            "thumbnailUrl": "A String", # URL of a thumbnail image of the Drive item.
755                #
756                # Read-only.
757            "alternateLink": "A String", # URL that can be used to access the Drive item.
758                #
759                # Read-only.
760            "id": "A String", # Drive API resource ID.
761            "title": "A String", # Title of the Drive item.
762                #
763                # Read-only.
764          },
765          "shareMode": "A String", # Mechanism by which students access the Drive item.
766        },
767        "link": { # URL item. # Link material. On creation, will be upgraded to a more appropriate type
768            # if possible, and this will be reflected in the response.
769          "url": "A String", # URL to link to.
770              # This must be a valid UTF-8 string containing between 1 and 2024 characters.
771          "thumbnailUrl": "A String", # URL of a thumbnail image of the target URL.
772              #
773              # Read-only.
774          "title": "A String", # Title of the target of the URL.
775              #
776              # Read-only.
777        },
778        "form": { # Google Forms item. # Google Forms material.
779          "formUrl": "A String", # URL of the form.
780          "thumbnailUrl": "A String", # URL of a thumbnail image of the Form.
781              #
782              # Read-only.
783          "responseUrl": "A String", # URL of the form responses document.
784              # Only set if respsonses have been recorded and only when the
785              # requesting user is an editor of the form.
786              #
787              # Read-only.
788          "title": "A String", # Title of the Form.
789              #
790              # Read-only.
791        },
792      },
793    ],
794    "individualStudentsOptions": { # Assignee details about a coursework/announcement. # Identifiers of students with access to the announcement.
795        # This field is set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`.
796        # If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students
797        # specified in this field will be able to see the announcement.
798        # This field is set if and only if `assigneeMode` is `INDIVIDUAL_STUDENTS`.
799      "studentIds": [ # Identifiers for the students that have access to the
800          # coursework/announcement.
801        "A String",
802      ],
803    },
804    "id": "A String", # Classroom-assigned identifier of this announcement, unique per course.
805        #
806        # Read-only.
807  }</pre>
808</div>
809
810<div class="method">
811    <code class="details" id="patch">patch(courseId, id, body, updateMask=None, x__xgafv=None)</code>
812  <pre>Updates one or more fields of an announcement.
813
814This method returns the following error codes:
815
816* `PERMISSION_DENIED` if the requesting developer project did not create
817the corresponding announcement or for access errors.
818* `INVALID_ARGUMENT` if the request is malformed.
819* `FAILED_PRECONDITION` if the requested announcement has already been
820deleted.
821* `NOT_FOUND` if the requested course or announcement does not exist
822
823Args:
824  courseId: string, Identifier of the course.
825This identifier can be either the Classroom-assigned identifier or an
826alias. (required)
827  id: string, Identifier of the announcement. (required)
828  body: object, The request body. (required)
829    The object takes the form of:
830
831{ # Announcement created by a teacher for students of the course
832  "updateTime": "A String", # Timestamp of the most recent change to this announcement.
833      #
834      # Read-only.
835  "scheduledTime": "A String", # Optional timestamp when this announcement is scheduled to be published.
836  "creatorUserId": "A String", # Identifier for the user that created the announcement.
837      #
838      # Read-only.
839  "courseId": "A String", # Identifier of the course.
840      #
841      # Read-only.
842  "text": "A String", # Description of this announcement.
843      # The text must be a valid UTF-8 string containing no more
844      # than 30,000 characters.
845  "alternateLink": "A String", # Absolute link to this announcement in the Classroom web UI.
846      # This is only populated if `state` is `PUBLISHED`.
847      #
848      # Read-only.
849  "creationTime": "A String", # Timestamp when this announcement was created.
850      #
851      # Read-only.
852  "assigneeMode": "A String", # Assignee mode of the announcement.
853      # If unspecified, the default value is `ALL_STUDENTS`.
854  "state": "A String", # Status of this announcement.
855      # If unspecified, the default state is `DRAFT`.
856  "materials": [ # Additional materials.
857      #
858      # Announcements must have no more than 20 material items.
859    { # Material attached to course work.
860        #
861        # When creating attachments, setting the `form` field is not supported.
862      "youtubeVideo": { # YouTube video item. # YouTube video material.
863        "alternateLink": "A String", # URL that can be used to view the YouTube video.
864            #
865            # Read-only.
866        "thumbnailUrl": "A String", # URL of a thumbnail image of the YouTube video.
867            #
868            # Read-only.
869        "id": "A String", # YouTube API resource ID.
870        "title": "A String", # Title of the YouTube video.
871            #
872            # Read-only.
873      },
874      "driveFile": { # Drive file that is used as material for course work. # Google Drive file material.
875        "driveFile": { # Representation of a Google Drive file. # Drive file details.
876          "thumbnailUrl": "A String", # URL of a thumbnail image of the Drive item.
877              #
878              # Read-only.
879          "alternateLink": "A String", # URL that can be used to access the Drive item.
880              #
881              # Read-only.
882          "id": "A String", # Drive API resource ID.
883          "title": "A String", # Title of the Drive item.
884              #
885              # Read-only.
886        },
887        "shareMode": "A String", # Mechanism by which students access the Drive item.
888      },
889      "link": { # URL item. # Link material. On creation, will be upgraded to a more appropriate type
890          # if possible, and this will be reflected in the response.
891        "url": "A String", # URL to link to.
892            # This must be a valid UTF-8 string containing between 1 and 2024 characters.
893        "thumbnailUrl": "A String", # URL of a thumbnail image of the target URL.
894            #
895            # Read-only.
896        "title": "A String", # Title of the target of the URL.
897            #
898            # Read-only.
899      },
900      "form": { # Google Forms item. # Google Forms material.
901        "formUrl": "A String", # URL of the form.
902        "thumbnailUrl": "A String", # URL of a thumbnail image of the Form.
903            #
904            # Read-only.
905        "responseUrl": "A String", # URL of the form responses document.
906            # Only set if respsonses have been recorded and only when the
907            # requesting user is an editor of the form.
908            #
909            # Read-only.
910        "title": "A String", # Title of the Form.
911            #
912            # Read-only.
913      },
914    },
915  ],
916  "individualStudentsOptions": { # Assignee details about a coursework/announcement. # Identifiers of students with access to the announcement.
917      # This field is set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`.
918      # If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students
919      # specified in this field will be able to see the announcement.
920      # This field is set if and only if `assigneeMode` is `INDIVIDUAL_STUDENTS`.
921    "studentIds": [ # Identifiers for the students that have access to the
922        # coursework/announcement.
923      "A String",
924    ],
925  },
926  "id": "A String", # Classroom-assigned identifier of this announcement, unique per course.
927      #
928      # Read-only.
929}
930
931  updateMask: string, Mask that identifies which fields on the announcement to update.
932This field is required to do an update. The update fails if invalid
933fields are specified. If a field supports empty values, it can be cleared
934by specifying it in the update mask and not in the Announcement object. If
935a field that does not support empty values is included in the update mask
936and not set in the Announcement object, an `INVALID_ARGUMENT` error will be
937returned.
938
939The following fields may be specified by teachers:
940
941* `text`
942* `state`
943* `scheduled_time`
944  x__xgafv: string, V1 error format.
945    Allowed values
946      1 - v1 error format
947      2 - v2 error format
948
949Returns:
950  An object of the form:
951
952    { # Announcement created by a teacher for students of the course
953    "updateTime": "A String", # Timestamp of the most recent change to this announcement.
954        #
955        # Read-only.
956    "scheduledTime": "A String", # Optional timestamp when this announcement is scheduled to be published.
957    "creatorUserId": "A String", # Identifier for the user that created the announcement.
958        #
959        # Read-only.
960    "courseId": "A String", # Identifier of the course.
961        #
962        # Read-only.
963    "text": "A String", # Description of this announcement.
964        # The text must be a valid UTF-8 string containing no more
965        # than 30,000 characters.
966    "alternateLink": "A String", # Absolute link to this announcement in the Classroom web UI.
967        # This is only populated if `state` is `PUBLISHED`.
968        #
969        # Read-only.
970    "creationTime": "A String", # Timestamp when this announcement was created.
971        #
972        # Read-only.
973    "assigneeMode": "A String", # Assignee mode of the announcement.
974        # If unspecified, the default value is `ALL_STUDENTS`.
975    "state": "A String", # Status of this announcement.
976        # If unspecified, the default state is `DRAFT`.
977    "materials": [ # Additional materials.
978        #
979        # Announcements must have no more than 20 material items.
980      { # Material attached to course work.
981          #
982          # When creating attachments, setting the `form` field is not supported.
983        "youtubeVideo": { # YouTube video item. # YouTube video material.
984          "alternateLink": "A String", # URL that can be used to view the YouTube video.
985              #
986              # Read-only.
987          "thumbnailUrl": "A String", # URL of a thumbnail image of the YouTube video.
988              #
989              # Read-only.
990          "id": "A String", # YouTube API resource ID.
991          "title": "A String", # Title of the YouTube video.
992              #
993              # Read-only.
994        },
995        "driveFile": { # Drive file that is used as material for course work. # Google Drive file material.
996          "driveFile": { # Representation of a Google Drive file. # Drive file details.
997            "thumbnailUrl": "A String", # URL of a thumbnail image of the Drive item.
998                #
999                # Read-only.
1000            "alternateLink": "A String", # URL that can be used to access the Drive item.
1001                #
1002                # Read-only.
1003            "id": "A String", # Drive API resource ID.
1004            "title": "A String", # Title of the Drive item.
1005                #
1006                # Read-only.
1007          },
1008          "shareMode": "A String", # Mechanism by which students access the Drive item.
1009        },
1010        "link": { # URL item. # Link material. On creation, will be upgraded to a more appropriate type
1011            # if possible, and this will be reflected in the response.
1012          "url": "A String", # URL to link to.
1013              # This must be a valid UTF-8 string containing between 1 and 2024 characters.
1014          "thumbnailUrl": "A String", # URL of a thumbnail image of the target URL.
1015              #
1016              # Read-only.
1017          "title": "A String", # Title of the target of the URL.
1018              #
1019              # Read-only.
1020        },
1021        "form": { # Google Forms item. # Google Forms material.
1022          "formUrl": "A String", # URL of the form.
1023          "thumbnailUrl": "A String", # URL of a thumbnail image of the Form.
1024              #
1025              # Read-only.
1026          "responseUrl": "A String", # URL of the form responses document.
1027              # Only set if respsonses have been recorded and only when the
1028              # requesting user is an editor of the form.
1029              #
1030              # Read-only.
1031          "title": "A String", # Title of the Form.
1032              #
1033              # Read-only.
1034        },
1035      },
1036    ],
1037    "individualStudentsOptions": { # Assignee details about a coursework/announcement. # Identifiers of students with access to the announcement.
1038        # This field is set only if `assigneeMode` is `INDIVIDUAL_STUDENTS`.
1039        # If the `assigneeMode` is `INDIVIDUAL_STUDENTS`, then only students
1040        # specified in this field will be able to see the announcement.
1041        # This field is set if and only if `assigneeMode` is `INDIVIDUAL_STUDENTS`.
1042      "studentIds": [ # Identifiers for the students that have access to the
1043          # coursework/announcement.
1044        "A String",
1045      ],
1046    },
1047    "id": "A String", # Classroom-assigned identifier of this announcement, unique per course.
1048        #
1049        # Read-only.
1050  }</pre>
1051</div>
1052
1053</body></html>